]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/intc: cannot clear GICv3 ITS CTLR[Enabled] bit
authorShashi Mallela <shashi.mallela@linaro.org>
Wed, 24 Nov 2021 18:22:46 +0000 (13:22 -0500)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 26 Nov 2021 16:54:09 +0000 (16:54 +0000)
When Enabled bit is cleared in GITS_CTLR,ITS feature continues
to be enabled.This patch fixes the issue.

Signed-off-by: Shashi Mallela <shashi.mallela@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20211124182246.67691-1-shashi.mallela@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/intc/arm_gicv3_its.c

index 84bcbb5f56a28e30b37aaaae67a6383b47ede153..c929a9cb5c3b64a3b11d56e970f142961ad476df 100644 (file)
@@ -896,13 +896,14 @@ static bool its_writel(GICv3ITSState *s, hwaddr offset,
 
     switch (offset) {
     case GITS_CTLR:
-        s->ctlr |= (value & ~(s->ctlr));
-
-        if (s->ctlr & ITS_CTLR_ENABLED) {
+        if (value & R_GITS_CTLR_ENABLED_MASK) {
+            s->ctlr |= ITS_CTLR_ENABLED;
             extract_table_params(s);
             extract_cmdq_params(s);
             s->creadr = 0;
             process_cmdq(s);
+        } else {
+            s->ctlr &= ~ITS_CTLR_ENABLED;
         }
         break;
     case GITS_CBASER: