Skip to contentSkip to conversation

kvm-s390: Fix problem state handling in guest sigp handler

PATCH In review Christian Borntraeger 2 participants 2 messages Nov 17, 2008 – Nov 18, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm-s390: Fix problem state handling in guest sigp handler

Hello Avi,

this patch should go into 2.6.28-rcx. It fixes an important guest bug.

-
From: Christian Borntraeger <[email protected]>

We can get an exit for instructions starting with 0xae, even if the guest is in userspace. Lets make sure, that the signal processor handler is only called in guest supervisor mode. Otherwise, send a program check.

---
 arch/s390/kvm/sigp.c |    5 +++++
 1 file changed, 5 insertions(+)
arch/s390/kvm/sigp.c +5 -0
Index: kvm/arch/s390/kvm/sigp.c
===================================================================
@@ -237,6 +237,11 @@ int kvm_s390_handle_sigp(struct kvm_vcpu
 	u8 order_code;
 	int rc;
 
+	/* sigp in userspace can exit */
+	if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE)
+		return kvm_s390_inject_program_int(vcpu,
+						   PGM_PRIVILEGED_OPERATION);
+
 	order_code = disp2;
 	if (base2)
 		order_code += vcpu->arch.guest_gprs[base2];
#1 lore raw
Quoted 10 lines · Christian Borntraeger

Hello Avi,

this patch should go into 2.6.28-rcx. It fixes an important guest bug.

-
From: Christian Borntraeger <[email protected]>

We can get an exit for instructions starting with 0xae, even if the guest is in userspace. Lets make sure, that the signal processor handler is only called in guest supervisor mode. Otherwise, send a program check

Applied and queued, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function