summaryrefslogtreecommitdiff
path: root/target/ppc/translate.c
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2018-03-14 18:33:36 +0100
committerDavid Gibson <david@gibson.dropbear.id.au>2018-03-18 21:03:20 +1100
commit91c60f124e682a78c9a2ef951e8e58ebab6441d0 (patch)
treec0b02db1652bda1e758bf54a05d255651a15655c /target/ppc/translate.c
parent21a5a442aef89d617fc8e41d4d35f6aee535b8b2 (diff)
downloadqemu-91c60f124e682a78c9a2ef951e8e58ebab6441d0.tar.gz
target/ppc: fix tlbsync to check privilege level depending on GTSE
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édric Le Goater <clg@kaod.org> Reviewed-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'target/ppc/translate.c')
-rw-r--r--target/ppc/translate.c9
1 files 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;
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 */
+ }
/* BookS does both ptesync and tlbsync make tlbsync a nop for server */
if (ctx->insns_flags & PPC_BOOKE) {