From nobody Sun Feb 8 12:37:58 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1532379218651122.84607512770378; Mon, 23 Jul 2018 13:53:38 -0700 (PDT) Received: from localhost ([::1]:36538 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhhpo-0005iy-M9 for importer@patchew.org; Mon, 23 Jul 2018 16:53:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhhJa-0002nP-I9 for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:20:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fhhJX-0004a5-V4 for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:20:18 -0400 Received: from mail-oi0-x236.google.com ([2607:f8b0:4003:c06::236]:38211) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fhhJX-0004YK-Hr; Mon, 23 Jul 2018 16:20:15 -0400 Received: by mail-oi0-x236.google.com with SMTP id v8-v6so3479099oie.5; Mon, 23 Jul 2018 13:20:15 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id i3-v6sm8783514oiy.12.2018.07.23.13.20.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jul 2018 13:20:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=ruUlhOHSjmk6vIvU6TnBO/dR9LR2hmjWRxSNwnk8CnE=; b=jj3FGeng1oudZDTaqMB+2A+EzRPaTcVIDmsSAdXyJ7T/ZRWYS6Zb+CTDxh4ybHzIlx SHKCu9TF8nOD3FtxxkE9QmrSdUyJswb4Ff34JbgmGmIzWoFx6v5tQU0KSwGQYfz8EF6P Bi6JtBgt6H4YztrdJSvlPVxeEbjwdx4uO6MosMusceTHS9QDGwjIkuWjAEbDmn6IS/1e /D2CbptpXDjlsdHI4ugENI8UPEfk3x5TtuTRLvWx7s9qXIVgwqSwPPb/mrbgfn/jaHNP z/zk7ahXtjrP+ynAIt/dgKH0LC9ecBifRCLnRktR8WIumYCboO3mREJYfWhEY4CiDr0z DVMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=ruUlhOHSjmk6vIvU6TnBO/dR9LR2hmjWRxSNwnk8CnE=; b=HH/IsdZYd1AZRrpkNzOUb9Gcskyri2/HgrmQWtld73YXxdOEfNOtZqF/ZQB7t9fsqy JDzYdRLZb26+WwjFbvNiP3lQe80laxlmDk1s0evQCk3r/fEpNp1HqlmgQuNrwBUkRMC1 Z6jxSx+adAxxuwNl87VAaIVD/xDcv+S4LnbSGIR0Zhwrxov7MBfYh0sdYobxS8NJ179l 2N8GrPZEeyPqmVKyuuRFtZCqaScD4g79o7NoWqJSw7BoaPv2FuB2g5xif5FkY4kpUf6T z5QQfZY00eLZTWQ/+hNLRXoST4reYwJl/mjm5cps7TAMw08n0dccg8HFGiufrtcXyCB4 Q73Q== X-Gm-Message-State: AOUpUlEFvQ9iHyjDYNfHYaQPw/5z3oLKp1t7AGL+Axqz7ovgo9a9cPy+ G+JZALOsnjAYdIUxK1hMe3laDbE88Uw= X-Google-Smtp-Source: AAOMgpeYpPIjtYKloULauCXUADK2X50p2iKd+tjHNJujzK0QgYeHQU5NaRauSIaQ5D0aZDUbe9jc6A== X-Received: by 2002:aca:a12:: with SMTP id 18-v6mr289552oik.292.1532377214388; Mon, 23 Jul 2018 13:20:14 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 23 Jul 2018 15:16:58 -0500 Message-Id: <20180723201748.25573-50-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> References: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::236 Subject: [Qemu-devel] [PATCH 49/99] arm_gicv3_kvm: kvm_dist_get/put_priority: skip the registers banked by GICR_IPRIORITYR X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-stable@nongnu.org, Shannon Zhao Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Shannon Zhao While for_each_dist_irq_reg loop starts from GIC_INTERNAL, it forgot to offset the date array and index. This will overlap the GICR registers value and leave the last GIC_INTERNAL irq's registers out of update. Fixes: 367b9f527becdd20ddf116e17a3c0c2bbc486920 Cc: qemu-stable@nongnu.org Reviewed-by: Peter Maydell Reviewed-by: Eric Auger Signed-off-by: Shannon Zhao Signed-off-by: Peter Maydell (cherry picked from commit 1dcf3675196a1cec616ce71b067d9498590a60a6) Signed-off-by: Michael Roth --- hw/intc/arm_gicv3_kvm.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c index 81cbd16817..bc6fa415b2 100644 --- a/hw/intc/arm_gicv3_kvm.c +++ b/hw/intc/arm_gicv3_kvm.c @@ -135,7 +135,14 @@ static void kvm_dist_get_priority(GICv3State *s, uint3= 2_t offset, uint8_t *bmp) uint32_t reg, *field; int irq; =20 - field =3D (uint32_t *)bmp; + /* For the KVM GICv3, affinity routing is always enabled, and the firs= t 8 + * GICD_IPRIORITYR registers are always RAZ/WI. The corresponding + * functionality is replaced by GICR_IPRIORITYR. It doesn't need to + * sync them. So it needs to skip the field of GIC_INTERNAL irqs in bm= p and + * offset. + */ + field =3D (uint32_t *)(bmp + GIC_INTERNAL); + offset +=3D (GIC_INTERNAL * 8) / 8; for_each_dist_irq_reg(irq, s->num_irq, 8) { kvm_gicd_access(s, offset, ®, false); *field =3D reg; @@ -149,7 +156,14 @@ static void kvm_dist_put_priority(GICv3State *s, uint3= 2_t offset, uint8_t *bmp) uint32_t reg, *field; int irq; =20 - field =3D (uint32_t *)bmp; + /* For the KVM GICv3, affinity routing is always enabled, and the firs= t 8 + * GICD_IPRIORITYR registers are always RAZ/WI. The corresponding + * functionality is replaced by GICR_IPRIORITYR. It doesn't need to + * sync them. So it needs to skip the field of GIC_INTERNAL irqs in bm= p and + * offset. + */ + field =3D (uint32_t *)(bmp + GIC_INTERNAL); + offset +=3D (GIC_INTERNAL * 8) / 8; for_each_dist_irq_reg(irq, s->num_irq, 8) { reg =3D *field; kvm_gicd_access(s, offset, ®, true); --=20 2.17.1