mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Christoffer Dall <cdall@linaro.org>,
	"Longpeng(Mike)" <longpeng2@huawei.com>
Cc: pbonzini@redhat.com, rkrcmar@redhat.com, agraf@suse.com,
	borntraeger@de.ibm.com, cohuck@redhat.com,
	christoffer.dall@linaro.org, marc.zyngier@arm.com,
	james.hogan@imgtec.com, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org, weidong.huang@huawei.com,
	arei.gonglei@huawei.com, wangxinxin.wang@huawei.com,
	longpeng.mike@gmail.com
Subject: Re: [RFC] KVM: optimize the kvm_vcpu_on_spin
Date: Mon, 31 Jul 2017 19:32:26 +0200	[thread overview]
Message-ID: <8d64ea0f-4cd6-6b7d-8804-d29beeaef6e3@redhat.com> (raw)
In-Reply-To: <20170731132255.GZ5176@cbox>

On 31.07.2017 15:22, Christoffer Dall wrote:
> On Sat, Jul 29, 2017 at 02:22:57PM +0800, Longpeng(Mike) wrote:
>> We had disscuss the idea here:
>> https://www.spinics.net/lists/kvm/msg140593.html
> 
> This is not a very nice way to start a commit description.
> 
> Please provide the necessary background to understand your change
> directly in the commit message.
> 
>>
>> I think it's also suitable for other architectures.
>>
> 
> I think this sentence can go in the end of the commit message together
> with your explanation of only doing this for x86.
> 
> By the way, the ARM solution should be pretty simple:
> 
> diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c
> index a39a1e1..b9f68e4 100644
> --- a/virt/kvm/arm/arm.c
> +++ b/virt/kvm/arm/arm.c
> @@ -416,6 +416,11 @@ int kvm_arch_vcpu_runnable(struct kvm_vcpu *v)
>  		&& !v->arch.power_off && !v->arch.pause);
>  }
>  
> +bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu)
> +{
> +	return vcpu_mode_priv(vcpu);
> +}
> +
>  /* Just ensure a guest exit from a particular CPU */
>  static void exit_vm_noop(void *info)
>  {
> 
> 


This one should work for s390x, no caching (or special access patterns
like on x86) needed:

+++ b/arch/s390/kvm/kvm-s390.c
@@ -2447,6 +2447,11 @@ int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
        return kvm_s390_vcpu_has_irq(vcpu, 0);
 }

+bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu)
+{
+       return !(vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE);
+}
+
 void kvm_s390_vcpu_block(struct kvm_vcpu *vcpu)
 {
        atomic_or(PROG_BLOCK_SIE, &vcpu->arch.sie_block->prog20);



-- 

Thanks,

David

  reply	other threads:[~2017-07-31 17:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-29  6:22 Longpeng(Mike)
2017-07-31 11:31 ` David Hildenbrand
2017-07-31 12:08   ` Longpeng (Mike)
2017-07-31 12:27     ` David Hildenbrand
2017-07-31 13:20       ` Paolo Bonzini
2017-08-01  3:26         ` Longpeng (Mike)
2017-08-01  8:32           ` Paolo Bonzini
2017-07-31 12:31     ` Cornelia Huck
2017-07-31 13:01       ` Longpeng (Mike)
2017-07-31 13:22 ` Christoffer Dall
2017-07-31 17:32   ` David Hildenbrand [this message]
2017-08-01  6:51     ` Cornelia Huck
2017-08-01  2:24   ` Longpeng (Mike)
2017-07-31 13:42 ` Marc Zyngier
2017-07-31 14:23   ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8d64ea0f-4cd6-6b7d-8804-d29beeaef6e3@redhat.com \
    --to=david@redhat.com \
    --cc=agraf@suse.com \
    --cc=arei.gonglei@huawei.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cdall@linaro.org \
    --cc=christoffer.dall@linaro.org \
    --cc=cohuck@redhat.com \
    --cc=james.hogan@imgtec.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longpeng.mike@gmail.com \
    --cc=longpeng2@huawei.com \
    --cc=marc.zyngier@arm.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=wangxinxin.wang@huawei.com \
    --cc=weidong.huang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome