From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIcog-0000hf-Pc for qemu-devel@nongnu.org; Wed, 26 Feb 2014 06:38:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WIcoX-0001uD-Gp for qemu-devel@nongnu.org; Wed, 26 Feb 2014 06:38:22 -0500 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:54697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIcoX-0001tN-6X for qemu-devel@nongnu.org; Wed, 26 Feb 2014 06:38:13 -0500 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 26 Feb 2014 11:38:11 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 1456E17D805F for ; Wed, 26 Feb 2014 11:38:43 +0000 (GMT) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s1QBbvQe63897748 for ; Wed, 26 Feb 2014 11:37:57 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s1QBc776032682 for ; Wed, 26 Feb 2014 04:38:09 -0700 From: Christian Borntraeger Date: Wed, 26 Feb 2014 12:38:24 +0100 Message-Id: <1393414708-37739-2-git-send-email-borntraeger@de.ibm.com> In-Reply-To: <1393414708-37739-1-git-send-email-borntraeger@de.ibm.com> References: <1393414708-37739-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [PATCH 1/5] s390x/cpu: Use ioctl to reset state in the kernel List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Cc: Peter Maydell , Thomas Huth , Alexander Graf , Christian Borntraeger , Jens Freimann , Anthony Liguori , Cornelia Huck , Richard Henderson From: Thomas Huth Some of the state in the kernel can not be reset from QEMU yet. For this we've got to use the KVM_S390_INITIAL_RESET ioctl to make sure that the state in the kernel is set to the right values during initial CPU reset, too. Signed-off-by: Thomas Huth Acked-by: Cornelia Huck Signed-off-by: Christian Borntraeger --- target-s390x/cpu.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c index f1319e5..1a8c1cc 100644 --- a/target-s390x/cpu.c +++ b/target-s390x/cpu.c @@ -108,6 +108,15 @@ static void s390_cpu_initial_reset(CPUState *s) env->cregs[14] = CR14_RESET; env->pfault_token = -1UL; + +#if defined(CONFIG_KVM) + /* Reset state inside the kernel that we cannot access yet from QEMU. */ + if (kvm_enabled()) { + if (kvm_vcpu_ioctl(s, KVM_S390_INITIAL_RESET, NULL)) { + perror("Initial CPU reset failed"); + } + } +#endif } /* CPUClass:reset() */ -- 1.8.4.2