* [Qemu-devel] [PATCH] target/ppc: fix tlbsync to check privilege level depending on GTSE
@ 2018-03-14 17:33 Cédric Le Goater
2018-03-14 23:58 ` [Qemu-devel] [Qemu-ppc] " Suraj Jitindar Singh
2018-03-15 0:19 ` [Qemu-devel] " David Gibson
0 siblings, 2 replies; 4+ messages in thread
From: Cédric Le Goater @ 2018-03-14 17:33 UTC (permalink / raw)
To: qemu-ppc, qemu-devel, David Gibson; +Cc: Cédric 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édric Le Goater <clg@kaod.org>
---
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;
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) {
--
2.13.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH] target/ppc: fix tlbsync to check privilege level depending on GTSE
2018-03-14 17:33 [Qemu-devel] [PATCH] target/ppc: fix tlbsync to check privilege level depending on GTSE Cédric Le Goater
@ 2018-03-14 23:58 ` Suraj Jitindar Singh
2018-03-15 7:20 ` Cédric Le Goater
2018-03-15 0:19 ` [Qemu-devel] " David Gibson
1 sibling, 1 reply; 4+ messages in thread
From: Suraj Jitindar Singh @ 2018-03-14 23:58 UTC (permalink / raw)
To: Cédric Le Goater, qemu-ppc, qemu-devel, David Gibson
On Wed, 2018-03-14 at 18:33 +0100, Cédric Le Goater wrote:
> 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>
> ---
>
> 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;
>
> 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 */
^^^ Did that line actually change? :)
> } 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) {
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] target/ppc: fix tlbsync to check privilege level depending on GTSE
2018-03-14 17:33 [Qemu-devel] [PATCH] target/ppc: fix tlbsync to check privilege level depending on GTSE Cédric Le Goater
2018-03-14 23:58 ` [Qemu-devel] [Qemu-ppc] " Suraj Jitindar Singh
@ 2018-03-15 0:19 ` David Gibson
1 sibling, 0 replies; 4+ messages in thread
From: David Gibson @ 2018-03-15 0:19 UTC (permalink / raw)
To: Cédric Le Goater; +Cc: qemu-ppc, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1854 bytes --]
On Wed, Mar 14, 2018 at 06:33:36PM +0100, Cédric Le Goater wrote:
> 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>
> ---
>
> 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(-)
Applied to ppc-for-2.12, thanks.
>
> 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;
>
> 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) {
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH] target/ppc: fix tlbsync to check privilege level depending on GTSE
2018-03-14 23:58 ` [Qemu-devel] [Qemu-ppc] " Suraj Jitindar Singh
@ 2018-03-15 7:20 ` Cédric Le Goater
0 siblings, 0 replies; 4+ messages in thread
From: Cédric Le Goater @ 2018-03-15 7:20 UTC (permalink / raw)
To: Suraj Jitindar Singh, qemu-ppc, qemu-devel, David Gibson
>> --- 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 */
>
> ^^^ Did that line actually change? :)
It did. Look closer :)
C.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-03-15 7:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-14 17:33 [Qemu-devel] [PATCH] target/ppc: fix tlbsync to check privilege level depending on GTSE Cédric Le Goater
2018-03-14 23:58 ` [Qemu-devel] [Qemu-ppc] " Suraj Jitindar Singh
2018-03-15 7:20 ` Cédric Le Goater
2018-03-15 0:19 ` [Qemu-devel] " David Gibson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).