From nobody Sat Oct 25 13:17:42 2025 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 1521087863773505.38721038282927; Wed, 14 Mar 2018 21:24:23 -0700 (PDT) Received: from localhost ([::1]:49659 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewKRC-00033g-Vj for importer@patchew.org; Thu, 15 Mar 2018 00:24:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewKMJ-00074Q-I2 for qemu-devel@nongnu.org; Thu, 15 Mar 2018 00:19:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ewKMH-00043d-Vo for qemu-devel@nongnu.org; Thu, 15 Mar 2018 00:19:19 -0400 Received: from ozlabs.org ([103.22.144.67]:41915) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ewKMH-000426-K5; Thu, 15 Mar 2018 00:19:17 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 401wMd0nvlz9sVd; Thu, 15 Mar 2018 15:19:08 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1521087549; bh=Y5oAYO1Y4pyCBuBeA/32+fcJrJZu9Kifi3/lgr4XYmo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RqQPJ04cF3P8Ed3svTTq0/CMG+GSiVo9hwv+TY9NFjaeOs7ifTPHXE4UvxUpxc8s4 R0j+cfF1mCLsC0oOQnG3CV2RqAs8Fl8ZF7El5+Nec5vhNwPJxZ1+rmttgp97AS0v+Y BYZO4w1mWRzFMbVVtAtclDlo/XBUZtdM3NqeR6aw= From: David Gibson To: peter.maydell@linaro.org Date: Thu, 15 Mar 2018 15:19:03 +1100 Message-Id: <20180315041903.10046-10-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180315041903.10046-1-david@gibson.dropbear.id.au> References: <20180315041903.10046-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 9/9] target/ppc: fix tlbsync to check privilege level depending on GTSE 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: lvivier@redhat.com, surajjs@au1.ibm.com, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , 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-Type: text/plain; charset="utf-8" From: C=C3=A9dric Le Goater tlbsync also needs to check the Guest Translation Shootdown Enable (GTSE) bit in the Logical Partition Control Register (LPCR) to determine at which privilege level it is running. See commit c6fd28fd573d ("target/ppc: Update tlbie to check privilege level based on GTSE") Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Suraj Jitindar Singh Signed-off-by: David Gibson --- target/ppc/translate.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 0a0c090c99..218665b408 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -4526,7 +4526,7 @@ static void gen_tlbie(DisasContext *ctx) TCGv_i32 t1; =20 if (ctx->gtse) { - CHK_SV; /* If gtse is set then tblie is supervisor privileged */ + CHK_SV; /* If gtse is set then tlbie is supervisor privileged */ } else { CHK_HV; /* Else hypervisor privileged */ } @@ -4553,7 +4553,12 @@ static void gen_tlbsync(DisasContext *ctx) #if defined(CONFIG_USER_ONLY) GEN_PRIV; #else - CHK_HV; + + if (ctx->gtse) { + CHK_SV; /* If gtse is set then tlbsync is supervisor privileged */ + } else { + CHK_HV; /* Else hypervisor privileged */ + } =20 /* BookS does both ptesync and tlbsync make tlbsync a nop for server */ if (ctx->insns_flags & PPC_BOOKE) { --=20 2.14.3