From nobody Sat Oct 25 02:31:12 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; 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 1521049253012589.6284259523117; Wed, 14 Mar 2018 10:40:53 -0700 (PDT) Received: from localhost ([::1]:47554 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewAON-0001I0-6h for importer@patchew.org; Wed, 14 Mar 2018 13:40:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewAHn-0004Im-MQ for qemu-devel@nongnu.org; Wed, 14 Mar 2018 13:34:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ewAHk-0004zM-JH for qemu-devel@nongnu.org; Wed, 14 Mar 2018 13:33:59 -0400 Received: from 19.mo7.mail-out.ovh.net ([178.33.251.118]:40084) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ewAHk-0004sE-7n for qemu-devel@nongnu.org; Wed, 14 Mar 2018 13:33:56 -0400 Received: from player159.ha.ovh.net (unknown [10.109.122.225]) by mo7.mail-out.ovh.net (Postfix) with ESMTP id 32FF892701 for ; Wed, 14 Mar 2018 18:33:45 +0100 (CET) Received: from zorba.kaod.org.com (LFbn-TOU-1-358-204.w86-206.abo.wanadoo.fr [86.206.19.204]) (Authenticated sender: clg@kaod.org) by player159.ha.ovh.net (Postfix) with ESMTPSA id BB7354800B4; Wed, 14 Mar 2018 18:33:40 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson Date: Wed, 14 Mar 2018 18:33:36 +0100 Message-Id: <20180314173336.20055-1-clg@kaod.org> X-Mailer: git-send-email 2.13.6 MIME-Version: 1.0 X-Ovh-Tracer-Id: 6699104447776197459 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtgedrtddvgddutddtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm 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: 178.33.251.118 Subject: [Qemu-devel] [PATCH] 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: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 --- This will have its importance when we activate the HV bit on the POWER9 CPU for the PowerNV machine. 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 0a0c090c9978..218665b4080b 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.13.6