qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Zenghui Yu <zenghui.yu@linux.dev>
To: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, Zenghui Yu <zenghui.yu@linux.dev>
Subject: [PATCH 2/2] hw/intc/arm_gicv3_kvm: Write all 1's to clear enable/active
Date: Wed, 30 Jul 2025 00:16:50 +0800	[thread overview]
Message-ID: <20250729161650.43758-3-zenghui.yu@linux.dev> (raw)
In-Reply-To: <20250729161650.43758-1-zenghui.yu@linux.dev>

Writing 0 to GICD_IC{ENABLE,ACTIVE}R architecturally has no effect on
interrupt status (all writes are simply ignored by KVM) and doesn't comply
with the intention of "first write to the clear-reg to clear all bits".

Write all 1's to actually clear the enable/active status.

Signed-off-by: Zenghui Yu <zenghui.yu@linux.dev>
---
 hw/intc/arm_gicv3_kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c
index f798a6e28c..6166283cd1 100644
--- a/hw/intc/arm_gicv3_kvm.c
+++ b/hw/intc/arm_gicv3_kvm.c
@@ -295,7 +295,7 @@ static void kvm_dist_putbmp(GICv3State *s, uint32_t offset,
          * the 1 bits.
          */
         if (clroffset != 0) {
-            reg = 0;
+            reg = ~0;
             kvm_gicd_access(s, clroffset, &reg, true);
             clroffset += 4;
         }
-- 
2.34.1



  parent reply	other threads:[~2025-07-29 16:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-29 16:16 [PATCH 0/2] hw/intc/arm_gicv3_kvm: two small fixes about register accesses Zenghui Yu
2025-07-29 16:16 ` [PATCH 1/2] hw/intc/arm_gicv3_kvm: Remove writes to ICPENDR registers Zenghui Yu
2025-07-31 16:42   ` Peter Maydell
2025-07-31 17:01     ` Peter Maydell
2025-07-29 16:16 ` Zenghui Yu [this message]
2025-07-31 16:59   ` [PATCH 2/2] hw/intc/arm_gicv3_kvm: Write all 1's to clear enable/active Peter Maydell
2025-08-06 15:01     ` Zenghui Yu
2025-07-31 17:11 ` [PATCH 0/2] hw/intc/arm_gicv3_kvm: two small fixes about register accesses Peter Maydell
2025-08-06 14:55   ` Zenghui Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250729161650.43758-3-zenghui.yu@linux.dev \
    --to=zenghui.yu@linux.dev \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).