From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGlVR-0002dp-O0 for qemu-devel@nongnu.org; Tue, 03 Sep 2013 03:58:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGlVF-0007st-Jq for qemu-devel@nongnu.org; Tue, 03 Sep 2013 03:58:33 -0400 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:52223) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGlVF-0007pX-9b for qemu-devel@nongnu.org; Tue, 03 Sep 2013 03:58:21 -0400 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 3 Sep 2013 08:51:20 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 1B7121B08066 for ; Tue, 3 Sep 2013 08:58:17 +0100 (BST) Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r837w4rX62914730 for ; Tue, 3 Sep 2013 07:58:04 GMT Received: from d06av12.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r837wFFm021531 for ; Tue, 3 Sep 2013 01:58:16 -0600 From: Christian Borntraeger Date: Tue, 3 Sep 2013 09:58:32 +0200 Message-Id: <1378195117-60980-2-git-send-email-borntraeger@de.ibm.com> In-Reply-To: <1378195117-60980-1-git-send-email-borntraeger@de.ibm.com> References: <1378195117-60980-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [PULL 1/6] s390/kvm: Add check for priviledged SCLP handler List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Thomas Huth , qemu-devel , Christian Borntraeger , Jens Freimann , Cornelia Huck , =?UTF-8?q?Andreas=20F=C3=A4rber?= From: Thomas Huth The SCLP instruction is priviledged, so we should make sure that we generate an exception when it is called from the problem state. Signed-off-by: Thomas Huth Signed-off-by: Christian Borntraeger --- target-s390x/kvm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 185c8f5..dc1ed56 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -448,6 +448,10 @@ static int kvm_sclp_service_call(S390CPU *cpu, struct kvm_run *run, int r = 0; cpu_synchronize_state(CPU(cpu)); + if (env->psw.mask & PSW_MASK_PSTATE) { + enter_pgmcheck(cpu, PGM_PRIVILEGED); + return 0; + } sccb = env->regs[ipbh0 & 0xf]; code = env->regs[(ipbh0 & 0xf0) >> 4]; -- 1.8.3.1