From nobody Sun Feb 8 14:35:31 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 1532378073001723.2069992658762; Mon, 23 Jul 2018 13:34:33 -0700 (PDT) Received: from localhost ([::1]:36414 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhhXL-0006aR-WC for importer@patchew.org; Mon, 23 Jul 2018 16:34:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhhIf-0001nD-NR for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:19:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fhhIb-00031k-Es for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:19:21 -0400 Received: from mail-oi0-x230.google.com ([2607:f8b0:4003:c06::230]:39344) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fhhIb-000313-8O; Mon, 23 Jul 2018 16:19:17 -0400 Received: by mail-oi0-x230.google.com with SMTP id d189-v6so3476521oib.6; Mon, 23 Jul 2018 13:19:17 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id q18-v6sm1078952oic.18.2018.07.23.13.19.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jul 2018 13:19:14 -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=xa11ownfegEdDdt6qm/4wsMAV8olYURvYcP/Es2RQ48=; b=TFuZwV6Hfyi6/G9tFXRfNZ+oVlwlKC4dwyQeID8ulBHevYVA9qkHnm2YZANQG6XG/G Y773X4Yolb0HRaRpZhftH6vQCo6t9Yfe3A04kIS2ave2e0AWF5nvOSSAMEOB7W+4H7Bt UEdXixLfDl9d+0VNTRCLGCDe6piJx6+i0fJEmqk7k1GWkHMqo56Zx+o8wlvdmXONy4BZ pMhcoPlpgg8nmE6Q2KCbSi+iLv8i6aO7Deso2sL4pAsgeMvSR1OGVEyg8ohZQobf8p86 9IriE2JCAhkqz3TxtwaiaXfqhEFpDjaxNxqeMXJ0TOgRysGFjPZPGl3gT+F92F/os0MC WprA== 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=xa11ownfegEdDdt6qm/4wsMAV8olYURvYcP/Es2RQ48=; b=fGf1mh7jS9YshmWKvGPg2/POFuTJ1A0BIS8z6omcgeNoqvdzXs6Ts04fxgbnl2FZ+y Ly00PMPml7d4Vb9fMLC4H4kBOePZwcgNMLyMWgP1J4b35ixggKc+8703yT0lYzJ8urm5 omJHCZIRl+MAi1yZFDX2MQPq/MBnCvI7p5sD0FVHwCjThn+vx8Ro3jlTJLuHf58f9r5i QqJ4NNPI+CXXDzn5URsAf1lzDqR1oFigPUAeLS5whnVqTgK+MOFwC7Uu16KA1p39By9v M3LFcZjOmgGgNJTBvnsxpBpUUTB+FIe23AkJAMZKX8ZiiyKwY577QvmjtuYpOlvO/iur eiiA== X-Gm-Message-State: AOUpUlFzC5Dj3X1xP9Au6PEqE52QhwAsUM2joy7KMqS+iVSH8bcK124u q3gP4rdCXf4VK3TwAMQLLqsNXB8xDig= X-Google-Smtp-Source: AAOMgpc12o6nvwyRU3uTCjcTiPG3tGZqDCeB8un2Z7ek7kwpJrAT5xkG0NOED8kg4RcYfNoxj3VkhQ== X-Received: by 2002:aca:5282:: with SMTP id g124-v6mr279059oib.241.1532377156017; Mon, 23 Jul 2018 13:19:16 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 23 Jul 2018 15:16:33 -0500 Message-Id: <20180723201748.25573-25-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::230 Subject: [Qemu-devel] [PATCH 24/99] hw/intc/arm_gicv3: Fix APxR register dispatching 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: Jan Kiszka , qemu-stable@nongnu.org, Peter Maydell 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: Jan Kiszka There was a nasty flip in identifying which register group an access is targeting. The issue caused spuriously raised priorities of the guest when handing CPUs over in the Jailhouse hypervisor. Cc: qemu-stable@nongnu.org Signed-off-by: Jan Kiszka Message-id: 28b927d3-da58-bce4-cc13-bfec7f9b1cb9@siemens.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell (cherry picked from commit 887aae10f6150dfdc71c45d7588e8efe6c144019) Signed-off-by: Michael Roth --- hw/intc/arm_gicv3_cpuif.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c index 26f5eeda94..554be25cb7 100644 --- a/hw/intc/arm_gicv3_cpuif.c +++ b/hw/intc/arm_gicv3_cpuif.c @@ -431,7 +431,7 @@ static uint64_t icv_ap_read(CPUARMState *env, const ARM= CPRegInfo *ri) { GICv3CPUState *cs =3D icc_cs_from_env(env); int regno =3D ri->opc2 & 3; - int grp =3D ri->crm & 1 ? GICV3_G0 : GICV3_G1NS; + int grp =3D (ri->crm & 1) ? GICV3_G1NS : GICV3_G0; uint64_t value =3D cs->ich_apr[grp][regno]; =20 trace_gicv3_icv_ap_read(ri->crm & 1, regno, gicv3_redist_affid(cs), va= lue); @@ -443,7 +443,7 @@ static void icv_ap_write(CPUARMState *env, const ARMCPR= egInfo *ri, { GICv3CPUState *cs =3D icc_cs_from_env(env); int regno =3D ri->opc2 & 3; - int grp =3D ri->crm & 1 ? GICV3_G0 : GICV3_G1NS; + int grp =3D (ri->crm & 1) ? GICV3_G1NS : GICV3_G0; =20 trace_gicv3_icv_ap_write(ri->crm & 1, regno, gicv3_redist_affid(cs), v= alue); =20 @@ -1465,7 +1465,7 @@ static uint64_t icc_ap_read(CPUARMState *env, const A= RMCPRegInfo *ri) uint64_t value; =20 int regno =3D ri->opc2 & 3; - int grp =3D ri->crm & 1 ? GICV3_G0 : GICV3_G1; + int grp =3D (ri->crm & 1) ? GICV3_G1 : GICV3_G0; =20 if (icv_access(env, grp =3D=3D GICV3_G0 ? HCR_FMO : HCR_IMO)) { return icv_ap_read(env, ri); @@ -1487,7 +1487,7 @@ static void icc_ap_write(CPUARMState *env, const ARMC= PRegInfo *ri, GICv3CPUState *cs =3D icc_cs_from_env(env); =20 int regno =3D ri->opc2 & 3; - int grp =3D ri->crm & 1 ? GICV3_G0 : GICV3_G1; + int grp =3D (ri->crm & 1) ? GICV3_G1 : GICV3_G0; =20 if (icv_access(env, grp =3D=3D GICV3_G0 ? HCR_FMO : HCR_IMO)) { icv_ap_write(env, ri, value); @@ -2296,7 +2296,7 @@ static uint64_t ich_ap_read(CPUARMState *env, const A= RMCPRegInfo *ri) { GICv3CPUState *cs =3D icc_cs_from_env(env); int regno =3D ri->opc2 & 3; - int grp =3D ri->crm & 1 ? GICV3_G0 : GICV3_G1NS; + int grp =3D (ri->crm & 1) ? GICV3_G1NS : GICV3_G0; uint64_t value; =20 value =3D cs->ich_apr[grp][regno]; @@ -2309,7 +2309,7 @@ static void ich_ap_write(CPUARMState *env, const ARMC= PRegInfo *ri, { GICv3CPUState *cs =3D icc_cs_from_env(env); int regno =3D ri->opc2 & 3; - int grp =3D ri->crm & 1 ? GICV3_G0 : GICV3_G1NS; + int grp =3D (ri->crm & 1) ? GICV3_G1NS : GICV3_G0; =20 trace_gicv3_ich_ap_write(ri->crm & 1, regno, gicv3_redist_affid(cs), v= alue); =20 --=20 2.17.1