From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:25832 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729597AbgBYHxM (ORCPT ); Tue, 25 Feb 2020 02:53:12 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01P7osdB038243 for ; Tue, 25 Feb 2020 02:53:11 -0500 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ycxcxhvn3-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 25 Feb 2020 02:53:11 -0500 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 25 Feb 2020 07:53:09 -0000 Subject: Re: [PATCH v4 29/36] KVM: s390: protvirt: Support cmd 5 operation state References: <20200224114107.4646-1-borntraeger@de.ibm.com> <20200224114107.4646-30-borntraeger@de.ibm.com> <99363e0d-494b-59ab-93dd-ccda4f25ef6d@redhat.com> From: Christian Borntraeger Date: Tue, 25 Feb 2020 08:53:01 +0100 MIME-Version: 1.0 In-Reply-To: <99363e0d-494b-59ab-93dd-ccda4f25ef6d@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Message-Id: <60d428de-4fd2-ae13-ddad-5a7399290063@de.ibm.com> Sender: linux-s390-owner@vger.kernel.org List-ID: To: David Hildenbrand , Janosch Frank Cc: KVM , Cornelia Huck , Thomas Huth , Ulrich Weigand , Claudio Imbrenda , linux-s390 , Michael Mueller , Vasily Gorbik , Janosch Frank On 24.02.20 20:08, David Hildenbrand wrote: > On 24.02.20 12:41, Christian Borntraeger wrote: >> From: Janosch Frank >> >> Code 5 for the set cpu state UV call tells the UV to load a PSW from >> the SE header (first IPL) or from guest location 0x0 (diag 308 subcode >> 0/1). Also it sets the cpu into operating state afterwards, so we can >> start it. >> >> Signed-off-by: Janosch Frank >> Reviewed-by: Thomas Huth >> Reviewed-by: Cornelia Huck >> [borntraeger@de.ibm.com: patch merging, splitting, fixing] >> Signed-off-by: Christian Borntraeger >> --- >> arch/s390/include/asm/uv.h | 1 + >> arch/s390/kvm/kvm-s390.c | 6 ++++++ >> 2 files changed, 7 insertions(+) >> >> diff --git a/arch/s390/include/asm/uv.h b/arch/s390/include/asm/uv.h >> index 99e1a14ef909..4945e44e1528 100644 >> --- a/arch/s390/include/asm/uv.h >> +++ b/arch/s390/include/asm/uv.h >> @@ -169,6 +169,7 @@ struct uv_cb_unp { >> #define PV_CPU_STATE_OPR 1 >> #define PV_CPU_STATE_STP 2 >> #define PV_CPU_STATE_CHKSTP 3 >> +#define PV_CPU_STATE_OPR_LOAD 5 >> >> struct uv_cb_cpu_set_state { >> struct uv_cb_header header; >> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c >> index f10cce6fc5e0..9c0ab66128fd 100644 >> --- a/arch/s390/kvm/kvm-s390.c >> +++ b/arch/s390/kvm/kvm-s390.c >> @@ -3728,6 +3728,12 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu, >> rc = kvm_s390_vcpu_start(vcpu); >> break; >> case KVM_MP_STATE_LOAD: >> + if (!kvm_s390_pv_cpu_is_protected(vcpu)) { >> + rc = -ENXIO; >> + break; >> + } >> + rc = kvm_s390_pv_set_cpu_state(vcpu, PV_CPU_STATE_OPR_LOAD); >> + break; >> case KVM_MP_STATE_CHECK_STOP: >> /* fall through - CHECK_STOP and LOAD are not supported yet */ >> default: >> > > Fits in nicely :) > > Reviewed-by: David Hildenbrand Thanks. FWIW, I will drop Thomas and Conny RB as this was for the older version. >