From 1d0d5e40206c693e24b0a4de7dbcfc4b79f3138e Mon Sep 17 00:00:00 2001 From: Boyan Karatotev Date: Thu, 23 Mar 2023 12:46:53 +0000 Subject: [PATCH] fix(gicv3): restore scr_el3 after changing it EL3's context is poorly defined as it is and polluting it further is not a good idea. Put it back as it was before the function call. Signed-off-by: Boyan Karatotev Change-Id: I9d13c9517962b501246989fd2126d08410191784 --- drivers/arm/gic/v3/gicv3_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/arm/gic/v3/gicv3_main.c b/drivers/arm/gic/v3/gicv3_main.c index 168d0ebc9..2c7480001 100644 --- a/drivers/arm/gic/v3/gicv3_main.c +++ b/drivers/arm/gic/v3/gicv3_main.c @@ -330,6 +330,8 @@ void gicv3_cpuif_enable(unsigned int proc_num) /* Enable Group1 Secure interrupts */ write_icc_igrpen1_el3(read_icc_igrpen1_el3() | IGRPEN1_EL3_ENABLE_G1S_BIT); + /* and restore the original */ + write_scr_el3(scr_el3); isb(); /* Add DSB to ensure visibility of System register writes */ dsb(); -- 2.39.5