qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target-ppc: disable unsupported modes for SPR_CTRL/SPR_UCTRL
@ 2013-12-23  2:42 Alexey Kardashevskiy
  2014-01-10  8:41 ` Alexey Kardashevskiy
  2014-01-20 15:08 ` Alexander Graf
  0 siblings, 2 replies; 3+ messages in thread
From: Alexey Kardashevskiy @ 2013-12-23  2:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexey Kardashevskiy, qemu-ppc, Alexander Graf

The Figure 17 "SPR encodings" of the PowerISA 2.07 describes CTRL SPR as:

                       priviledged
#   spr5-9 spr0-4 name mtspr mfspr len cat
136 00100  01000  CTRL   -    no    32  S
152 00100  11000  CTRL  yes    -    32  S

According to this chart, the hypervisor's CTRL (#152) does not support
reading, the user-space's CTRL (UCTRL, #136) does not support writing.

This replaces unsupported operations with the default SPR_NOACCESS hook.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---

While we are on this topic, I thought it makes sense to fix this too.
This does not seem to affect anything in the current QEMU but it is more
correct/clean.


---
 target-ppc/translate_init.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index 93ad762..860e241 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -6737,11 +6737,11 @@ static void init_proc_970FX (CPUPPCState *env)
                  0x00000000);
     spr_register(env, SPR_CTRL, "SPR_CTRL",
                  SPR_NOACCESS, SPR_NOACCESS,
-                 &spr_read_generic, &spr_write_generic,
+                 SPR_NOACCESS, &spr_write_generic,
                  0x00000000);
     spr_register(env, SPR_UCTRL, "SPR_UCTRL",
                  SPR_NOACCESS, SPR_NOACCESS,
-                 &spr_read_generic, &spr_write_generic,
+                 &spr_read_generic, SPR_NOACCESS,
                  0x00000000);
     spr_register(env, SPR_VRSAVE, "SPR_VRSAVE",
                  &spr_read_generic, &spr_write_generic,
@@ -6902,11 +6902,11 @@ static void init_proc_power5plus(CPUPPCState *env)
                  0x00000000);
     spr_register(env, SPR_CTRL, "SPR_CTRL",
                  SPR_NOACCESS, SPR_NOACCESS,
-                 &spr_read_generic, &spr_write_generic,
+                 SPR_NOACCESS, &spr_write_generic,
                  0x00000000);
     spr_register(env, SPR_UCTRL, "SPR_UCTRL",
                  SPR_NOACCESS, SPR_NOACCESS,
-                 &spr_read_generic, &spr_write_generic,
+                 &spr_read_generic, SPR_NOACCESS,
                  0x00000000);
     spr_register(env, SPR_VRSAVE, "SPR_VRSAVE",
                  &spr_read_generic, &spr_write_generic,
@@ -7002,11 +7002,11 @@ static void init_proc_POWER7 (CPUPPCState *env)
     /* XXX : not implemented */
     spr_register(env, SPR_CTRL, "SPR_CTRLT",
                  SPR_NOACCESS, SPR_NOACCESS,
-                 &spr_read_generic, &spr_write_generic,
+                 SPR_NOACCESS, &spr_write_generic,
                  0x80800000);
     spr_register(env, SPR_UCTRL, "SPR_CTRLF",
                  SPR_NOACCESS, SPR_NOACCESS,
-                 &spr_read_generic, &spr_write_generic,
+                 &spr_read_generic, SPR_NOACCESS,
                  0x80800000);
     spr_register(env, SPR_VRSAVE, "SPR_VRSAVE",
                  &spr_read_generic, &spr_write_generic,
-- 
1.8.4.rc4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] target-ppc: disable unsupported modes for SPR_CTRL/SPR_UCTRL
  2013-12-23  2:42 [Qemu-devel] [PATCH] target-ppc: disable unsupported modes for SPR_CTRL/SPR_UCTRL Alexey Kardashevskiy
@ 2014-01-10  8:41 ` Alexey Kardashevskiy
  2014-01-20 15:08 ` Alexander Graf
  1 sibling, 0 replies; 3+ messages in thread
From: Alexey Kardashevskiy @ 2014-01-10  8:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexey Kardashevskiy, qemu-ppc, Alexander Graf

On 12/23/2013 01:42 PM, Alexey Kardashevskiy wrote:
> The Figure 17 "SPR encodings" of the PowerISA 2.07 describes CTRL SPR as:
> 
>                        priviledged
> #   spr5-9 spr0-4 name mtspr mfspr len cat
> 136 00100  01000  CTRL   -    no    32  S
> 152 00100  11000  CTRL  yes    -    32  S
> 
> According to this chart, the hypervisor's CTRL (#152) does not support
> reading, the user-space's CTRL (UCTRL, #136) does not support writing.
> 
> This replaces unsupported operations with the default SPR_NOACCESS hook.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
> 
> While we are on this topic, I thought it makes sense to fix this too.
> This does not seem to affect anything in the current QEMU but it is more
> correct/clean.


Alex, ping.

Is it complicated or controversial patch? :)


> 
> 
> ---
>  target-ppc/translate_init.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
> index 93ad762..860e241 100644
> --- a/target-ppc/translate_init.c
> +++ b/target-ppc/translate_init.c
> @@ -6737,11 +6737,11 @@ static void init_proc_970FX (CPUPPCState *env)
>                   0x00000000);
>      spr_register(env, SPR_CTRL, "SPR_CTRL",
>                   SPR_NOACCESS, SPR_NOACCESS,
> -                 &spr_read_generic, &spr_write_generic,
> +                 SPR_NOACCESS, &spr_write_generic,
>                   0x00000000);
>      spr_register(env, SPR_UCTRL, "SPR_UCTRL",
>                   SPR_NOACCESS, SPR_NOACCESS,
> -                 &spr_read_generic, &spr_write_generic,
> +                 &spr_read_generic, SPR_NOACCESS,
>                   0x00000000);
>      spr_register(env, SPR_VRSAVE, "SPR_VRSAVE",
>                   &spr_read_generic, &spr_write_generic,
> @@ -6902,11 +6902,11 @@ static void init_proc_power5plus(CPUPPCState *env)
>                   0x00000000);
>      spr_register(env, SPR_CTRL, "SPR_CTRL",
>                   SPR_NOACCESS, SPR_NOACCESS,
> -                 &spr_read_generic, &spr_write_generic,
> +                 SPR_NOACCESS, &spr_write_generic,
>                   0x00000000);
>      spr_register(env, SPR_UCTRL, "SPR_UCTRL",
>                   SPR_NOACCESS, SPR_NOACCESS,
> -                 &spr_read_generic, &spr_write_generic,
> +                 &spr_read_generic, SPR_NOACCESS,
>                   0x00000000);
>      spr_register(env, SPR_VRSAVE, "SPR_VRSAVE",
>                   &spr_read_generic, &spr_write_generic,
> @@ -7002,11 +7002,11 @@ static void init_proc_POWER7 (CPUPPCState *env)
>      /* XXX : not implemented */
>      spr_register(env, SPR_CTRL, "SPR_CTRLT",
>                   SPR_NOACCESS, SPR_NOACCESS,
> -                 &spr_read_generic, &spr_write_generic,
> +                 SPR_NOACCESS, &spr_write_generic,
>                   0x80800000);
>      spr_register(env, SPR_UCTRL, "SPR_CTRLF",
>                   SPR_NOACCESS, SPR_NOACCESS,
> -                 &spr_read_generic, &spr_write_generic,
> +                 &spr_read_generic, SPR_NOACCESS,
>                   0x80800000);
>      spr_register(env, SPR_VRSAVE, "SPR_VRSAVE",
>                   &spr_read_generic, &spr_write_generic,
> 


-- 
Alexey

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] target-ppc: disable unsupported modes for SPR_CTRL/SPR_UCTRL
  2013-12-23  2:42 [Qemu-devel] [PATCH] target-ppc: disable unsupported modes for SPR_CTRL/SPR_UCTRL Alexey Kardashevskiy
  2014-01-10  8:41 ` Alexey Kardashevskiy
@ 2014-01-20 15:08 ` Alexander Graf
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander Graf @ 2014-01-20 15:08 UTC (permalink / raw)
  To: Alexey Kardashevskiy; +Cc: qemu-ppc, QEMU Developers


On 23.12.2013, at 03:42, Alexey Kardashevskiy <aik@ozlabs.ru> wrote:

> The Figure 17 "SPR encodings" of the PowerISA 2.07 describes CTRL SPR as:
> 
>                       priviledged
> #   spr5-9 spr0-4 name mtspr mfspr len cat
> 136 00100  01000  CTRL   -    no    32  S
> 152 00100  11000  CTRL  yes    -    32  S
> 
> According to this chart, the hypervisor's CTRL (#152) does not support
> reading, the user-space's CTRL (UCTRL, #136) does not support writing.
> 
> This replaces unsupported operations with the default SPR_NOACCESS hook.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>

Thanks, applied to ppc-next.


Alex

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-20 15:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-23  2:42 [Qemu-devel] [PATCH] target-ppc: disable unsupported modes for SPR_CTRL/SPR_UCTRL Alexey Kardashevskiy
2014-01-10  8:41 ` Alexey Kardashevskiy
2014-01-20 15:08 ` Alexander Graf

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).