qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 04/22] s390x/kvm: Fixed bad SIGP SET-ARCHITECTURE han


From: Christian Borntraeger
Subject: [Qemu-devel] [PULL 04/22] s390x/kvm: Fixed bad SIGP SET-ARCHITECTURE handler
Date: Fri, 28 Feb 2014 10:30:48 +0100

From: Thomas Huth <address@hidden>

The SET-ARCHITECTURE handler in QEMU caused a program interruption.
This is wrong according to the "Principles of Operations" specification
(since SIGP should never cause a program interrupt) and was likely only
introduced for debugging purposes. Since we handle SET-ARCHITECTURE in
the kernel already and only dropped to user space in case of bad mode
parameters, we should just report INVALID PARAMETER in QEMU instead.

Signed-off-by: Thomas Huth <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Signed-off-by: Christian Borntraeger <address@hidden>
---
 target-s390x/kvm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index 9430a35..b93fe84 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -676,8 +676,10 @@ static int handle_sigp(S390CPU *cpu, struct kvm_run *run, 
uint8_t ipa1)
         cc = kvm_s390_cpu_restart(target_cpu);
         break;
     case SIGP_SET_ARCH:
-        /* make the caller panic */
-        return -1;
+        *statusreg &= 0xffffffff00000000UL;
+        *statusreg |= SIGP_STAT_INVALID_PARAMETER;
+        cc = 1;   /* status stored */
+        break;
     case SIGP_INITIAL_CPU_RESET:
         cc = s390_cpu_initial_reset(target_cpu);
         break;
-- 
1.8.4.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]