diff mbox series

[RFCv2,2/6] s390x/diag: no need to check for PGM_PRIVILEGED in diag308

Message ID 20200710151239.39370-3-david@redhat.com
State New
Headers show
Series [RFCv2,1/6] s390x: move setting of maximum ram size to machine init | expand

Commit Message

David Hildenbrand July 10, 2020, 3:12 p.m. UTC
Whenever we reach this point via KVM or TCG, we already verified that we
are running in the supervisor state.

TCG checks this via IF_PRIV, KVM checks this directly in the diag
instruction handler, before exiting to userspace.

Signed-off-by: David Hildenbrand <david@redhat.com>
---
 target/s390x/diag.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Janosch Frank July 15, 2020, 9:27 a.m. UTC | #1
On 7/10/20 5:12 PM, David Hildenbrand wrote:
> Whenever we reach this point via KVM or TCG, we already verified that we
> are running in the supervisor state.
> 
> TCG checks this via IF_PRIV, KVM checks this directly in the diag
> instruction handler, before exiting to userspace.
> 
> Signed-off-by: David Hildenbrand <david@redhat.com>

I'm trusting you on the tcg part.

Acked-by: Janosch Frank <frankja@linux.ibm.com>

> ---
>  target/s390x/diag.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/target/s390x/diag.c b/target/s390x/diag.c
> index 1a48429564..be70aecd72 100644
> --- a/target/s390x/diag.c
> +++ b/target/s390x/diag.c
> @@ -80,11 +80,6 @@ void handle_diag_308(CPUS390XState *env, uint64_t r1, uint64_t r3, uintptr_t ra)
>      uint64_t subcode = env->regs[r3];
>      IplParameterBlock *iplb;
>  
> -    if (env->psw.mask & PSW_MASK_PSTATE) {
> -        s390_program_interrupt(env, PGM_PRIVILEGED, ra);
> -        return;
> -    }
> -
>      if (subcode & ~0x0ffffULL) {
>          s390_program_interrupt(env, PGM_SPECIFICATION, ra);
>          return;
>
diff mbox series

Patch

diff --git a/target/s390x/diag.c b/target/s390x/diag.c
index 1a48429564..be70aecd72 100644
--- a/target/s390x/diag.c
+++ b/target/s390x/diag.c
@@ -80,11 +80,6 @@  void handle_diag_308(CPUS390XState *env, uint64_t r1, uint64_t r3, uintptr_t ra)
     uint64_t subcode = env->regs[r3];
     IplParameterBlock *iplb;
 
-    if (env->psw.mask & PSW_MASK_PSTATE) {
-        s390_program_interrupt(env, PGM_PRIVILEGED, ra);
-        return;
-    }
-
     if (subcode & ~0x0ffffULL) {
         s390_program_interrupt(env, PGM_SPECIFICATION, ra);
         return;