From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752584AbdHGIyi (ORCPT ); Mon, 7 Aug 2017 04:54:38 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2555 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752299AbdHGIyg (ORCPT ); Mon, 7 Aug 2017 04:54:36 -0400 Message-ID: <59882ABD.6000501@huawei.com> Date: Mon, 7 Aug 2017 16:54:21 +0800 From: "Longpeng (Mike)" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: David Hildenbrand CC: , , , , , , , , , , , , , Subject: Re: [PATCH 3/3] KVM: implement spinlock optimization logic for arm/s390 References: <1502095466-21312-1-git-send-email-longpeng2@huawei.com> <1502095466-21312-4-git-send-email-longpeng2@huawei.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.246.209] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.59882ACA.00F4,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 28c01b78789ed0e89d884217e2ed897f Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017/8/7 16:52, David Hildenbrand wrote: > On 07.08.2017 10:44, Longpeng(Mike) wrote: >> Implements the kvm_arch_vcpu_spin/preempt_in_kernel() for arm/s390, >> they needn't cache the result. >> >> Signed-off-by: Longpeng(Mike) >> --- >> arch/s390/kvm/kvm-s390.c | 4 ++-- >> virt/kvm/arm/arm.c | 4 ++-- >> 2 files changed, 4 insertions(+), 4 deletions(-) >> >> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c >> index f78cdc2..49b9178 100644 >> --- a/arch/s390/kvm/kvm-s390.c >> +++ b/arch/s390/kvm/kvm-s390.c >> @@ -2449,12 +2449,12 @@ int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu) >> >> bool kvm_arch_vcpu_spin_in_kernel(struct kvm_vcpu *vcpu) >> { >> - return false; >> + return !(vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE); >> } >> >> bool kvm_arch_vcpu_preempt_in_kernel(struct kvm_vcpu *vcpu) >> { >> - return false; >> + return !(vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE); >> } >> >> void kvm_s390_vcpu_block(struct kvm_vcpu *vcpu) >> diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c >> index e45f780..956f025 100644 >> --- a/virt/kvm/arm/arm.c >> +++ b/virt/kvm/arm/arm.c >> @@ -418,12 +418,12 @@ int kvm_arch_vcpu_runnable(struct kvm_vcpu *v) >> >> bool kvm_arch_vcpu_spin_in_kernel(struct kvm_vcpu *vcpu) >> { >> - return false; >> + return vcpu_mode_priv(vcpu); >> } >> >> bool kvm_arch_vcpu_preempt_in_kernel(struct kvm_vcpu *vcpu) >> { >> - return false; >> + return vcpu_mode_priv(vcpu); >> } >> >> /* Just ensure a guest exit from a particular CPU */ >> > > Can you split that into two parts? (arm and s390x?) OK, I'll split in V2. :) > -- Regards, Longpeng(Mike)