From nobody Mon Feb 9 16:34:07 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.zoho.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 1496718062749960.4589053011; Mon, 5 Jun 2017 20:01:02 -0700 (PDT) Received: from localhost ([::1]:35990 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dI4jt-00042f-Ai for importer@patchew.org; Mon, 05 Jun 2017 23:01:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dI4ay-0003VG-8s for qemu-devel@nongnu.org; Mon, 05 Jun 2017 22:51:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dI4aw-0002yX-Cx for qemu-devel@nongnu.org; Mon, 05 Jun 2017 22:51:48 -0400 Received: from ozlabs.org ([103.22.144.67]:42411) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dI4aw-0002xa-1Q; Mon, 05 Jun 2017 22:51:46 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3whbmq1NFRz9s7p; Tue, 6 Jun 2017 12:51:39 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1496717499; bh=mPncNnMfrO3NlSDKDo4dYyJlup0U0S94LDH9OoH6ZV0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WpMcqUCJazPKiJmXI565GiQqLzBDsIubtyqpDhcTbNKjgh08BNL68YCIj9Gppzc2X VZTulgsHw8Vsh8v9fDvtqzh64uXSI0Iox9xl7mAk/JSZtYW1bLu4BfnywW+wOW1aZr 7OqsQv7MwGjIhwy0NO7tpS96Arudj7XMmCo2HQX8= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 6 Jun 2017 12:51:26 +1000 Message-Id: <20170606025135.2685-9-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170606025135.2685-1-david@gibson.dropbear.id.au> References: <20170606025135.2685-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 103.22.144.67 Subject: [Qemu-devel] [PULL 08/17] target/ppc: Fixup set_spr error in h_register_process_table 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: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, agraf@suse.de, qemu-ppc@nongnu.org, Suraj Jitindar Singh , David Gibson 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: Suraj Jitindar Singh set_spr is used in the function h_register_process_table() to update the LPCR_GTSE and LPCR_UPRT values based on the flags passed by the guest. The set_spr function takes the last two arguments mask and value used to mask and set the value of the spr respectively. The current call site passes these arguments in the wrong order and thus bot GTSE and UPRT will be set irrespective, which is obviously incorrect. Rearrange the function call so that these arguments are passed in the correct order and the correct behaviour is exhibited. It is worth noting that this wasn't detected earlier since these were always both set in all cases where this H_CALL was made. Fixes: 6de833070ca2 ("target/ppc: Set UPRT and GTSE on all cpus in H_REGIST= ER_PROCESS_TABLE") Signed-off-by: Suraj Jitindar Singh Signed-off-by: David Gibson --- hw/ppc/spapr_hcall.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index aae5a62..aa1ffea 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -992,9 +992,10 @@ static target_ulong h_register_process_table(PowerPCCP= U *cpu, =20 /* Update the UPRT and GTSE bits in the LPCR for all cpus */ CPU_FOREACH(cs) { - set_spr(cs, SPR_LPCR, LPCR_UPRT | LPCR_GTSE, + set_spr(cs, SPR_LPCR, ((flags & (FLAG_RADIX | FLAG_HASH_PROC_TBL)) ? LPCR_UPRT := 0) | - ((flags & FLAG_GTSE) ? LPCR_GTSE : 0)); + ((flags & FLAG_GTSE) ? LPCR_GTSE : 0), + LPCR_UPRT | LPCR_GTSE); } =20 if (kvm_enabled()) { --=20 2.9.4