From nobody Sat Feb 7 18:21:04 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linux.dev ARC-Seal: i=1; a=rsa-sha256; t=1753807225; cv=none; d=zohomail.com; s=zohoarc; b=M85rUtpt88ZDNvgHJh+ZxmTFQA7W33CdAkj9LrcIpYhaPnKyaYYESgZs+ie3K5Bg2leAMbgvJXXA2bELeUNcBX6FCP1bq50z2WCJyZbaxdVtLaL8aRQNPGXiB45ItakHK8nvnKLVihr47BFet6uKn9c6DNBgQC7pPjNdnFnTqX4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1753807225; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=M2ZO+yRcPzN1e4ri+7Jvh6MuhG7j6tOGfAAa9Axt08Q=; b=MFGrBrf/TE+ZToFmlZS4+tZjIhEJMf/vZ88gn2LSUPz0nG4GUbo5Qaszw+DMwXWUeKniL6qP1QF6xGurV8lJWwGNSteYJPFud4HR31vYiBcEZOPwdMZY7P3pB0K9dg10mRmi3HTf2JgoCZ/TV0tuwF0F1kaGb5r8NyFhxVWIl8E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1753807225537922.4374661820335; Tue, 29 Jul 2025 09:40:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ugnMg-0002UY-4G; Tue, 29 Jul 2025 12:39:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ugn1K-0003I2-7Z for qemu-devel@nongnu.org; Tue, 29 Jul 2025 12:17:53 -0400 Received: from out-181.mta1.migadu.com ([95.215.58.181]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ugn17-0001HB-Eu for qemu-devel@nongnu.org; Tue, 29 Jul 2025 12:17:41 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1753805841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M2ZO+yRcPzN1e4ri+7Jvh6MuhG7j6tOGfAAa9Axt08Q=; b=AxYF/EJZj1Y+KX0IXgVhyjWAQ5ltobnEzoo77lxKg+aZPMgED4IR/WF+8D2lSi0RIdzbQx Z7Ptm1p5783RlKplUIPs8s0BksSsb6WvUIO0KBkuIA1vgcN/cuYLXMD8+AeBCyAaH1FsYn Uei0pIFdFtsyklBPhCoJuINqAp8+nvk= From: Zenghui Yu To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Zenghui Yu Subject: [PATCH 1/2] hw/intc/arm_gicv3_kvm: Remove writes to ICPENDR registers Date: Wed, 30 Jul 2025 00:16:49 +0800 Message-Id: <20250729161650.43758-2-zenghui.yu@linux.dev> In-Reply-To: <20250729161650.43758-1-zenghui.yu@linux.dev> References: <20250729161650.43758-1-zenghui.yu@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=95.215.58.181; envelope-from=zenghui.yu@linux.dev; helo=out-181.mta1.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linux.dev) X-ZM-MESSAGEID: 1753807226966116600 Content-Type: text/plain; charset="utf-8" As per the arm-vgic-v3 kernel doc [1]: Accesses to GICD_ICPENDR register region and GICR_ICPENDR0 registers have RAZ/WI semantics, meaning that reads always return 0 and writes are always ignored. Remove the useless writes to ICPENDR registers in kvm_arm_gicv3_put(). [1] https://docs.kernel.org/virt/kvm/devices/arm-vgic-v3.html Signed-off-by: Zenghui Yu Reviewed-by: Peter Maydell --- hw/intc/arm_gicv3_kvm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c index 8ed88e7429..f798a6e28c 100644 --- a/hw/intc/arm_gicv3_kvm.c +++ b/hw/intc/arm_gicv3_kvm.c @@ -387,8 +387,6 @@ static void kvm_arm_gicv3_put(GICv3State *s) reg =3D c->level; kvm_gic_line_level_access(s, 0, ncpu, ®, true); =20 - reg =3D ~0; - kvm_gicr_access(s, GICR_ICPENDR0, ncpu, ®, true); reg =3D c->gicr_ipendr0; kvm_gicr_access(s, GICR_ISPENDR0, ncpu, ®, true); =20 @@ -445,7 +443,7 @@ static void kvm_arm_gicv3_put(GICv3State *s) kvm_gic_put_line_level_bmp(s, s->level); =20 /* s->pending bitmap -> GICD_ISPENDRn */ - kvm_dist_putbmp(s, GICD_ISPENDR, GICD_ICPENDR, s->pending); + kvm_dist_putbmp(s, GICD_ISPENDR, 0, s->pending); =20 /* s->active bitmap -> GICD_ISACTIVERn */ kvm_dist_putbmp(s, GICD_ISACTIVER, GICD_ICACTIVER, s->active); --=20 2.34.1 From nobody Sat Feb 7 18:21:04 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linux.dev ARC-Seal: i=1; a=rsa-sha256; t=1753807282; cv=none; d=zohomail.com; s=zohoarc; b=LAe0BONj8XeS5S1HClS72B8vreuUvTbgN8+/m4vcklnObEaGJ/REzOqg1RtiKECG4zkUt5A9+sMXfD9lFpznF1o4Rjc52PmMPYYDlmGUexojEjcp2Dzzmrje1ZVqxuMl1JJo9+V4Da9NjqLbnDsBR6mMV1Wuov62c/Beb8ro9Yg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1753807282; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DOAFvXjrHEu0P9+9MA6Q6NIwE4ue9YOFl/xjbvqzEoc=; b=VsXHhSuLzDDF1aDZpCUGhGVGcggCRBvmYqn+cPpr9cnb11WhGvSSzFyp6ia5PubhrkbJqq9eOdQB3ZuyCg2rt96Ebm013mE9NgsuDE1KiPnRKKbofJRovlWDiQKOADpyMCiY2XTN+QAkia9GXgb9POr+tf4uPw+Z8il55+hFPzs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1753807282203923.1711367339536; Tue, 29 Jul 2025 09:41:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ugnNj-0003lm-K9; Tue, 29 Jul 2025 12:40:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ugn1K-0003Hv-2j for qemu-devel@nongnu.org; Tue, 29 Jul 2025 12:17:57 -0400 Received: from out-170.mta1.migadu.com ([2001:41d0:203:375::aa]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ugn1G-0001Hr-PA for qemu-devel@nongnu.org; Tue, 29 Jul 2025 12:17:41 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1753805846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DOAFvXjrHEu0P9+9MA6Q6NIwE4ue9YOFl/xjbvqzEoc=; b=h0HOO4mJ0WE/HSkvK2U9EmqUnUA3bJhQEu0i9LiARUd0ikJEdePHCBFzlSHLSmVpdHgkQ+ 2+UIdm5fBjY+wcUAz+Ntkg87A9SO2EwLA34YyPTHINp1rVV13x6Rw4fAVfmxbSyMJ6+CBG yfmCRw9okw81XBVcco38D+6LmyudxDM= From: Zenghui Yu To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Zenghui Yu 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 Message-Id: <20250729161650.43758-3-zenghui.yu@linux.dev> In-Reply-To: <20250729161650.43758-1-zenghui.yu@linux.dev> References: <20250729161650.43758-1-zenghui.yu@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41d0:203:375::aa; envelope-from=zenghui.yu@linux.dev; helo=out-170.mta1.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linux.dev) X-ZM-MESSAGEID: 1753807283867116600 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Peter Maydell --- 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 off= set, * the 1 bits. */ if (clroffset !=3D 0) { - reg =3D 0; + reg =3D ~0; kvm_gicd_access(s, clroffset, ®, true); clroffset +=3D 4; } --=20 2.34.1