All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: KVM <kvm@vger.kernel.org>,
	kvm-ppc@vger.kernel.org, kvmarm@lists.cs.columbia.edu,
	linux-mips@linux-mips.org,
	Cornelia Huck <cornelia.huck@de.ibm.com>,
	Alexander Graf <agraf@suse.de>
Subject: Re: [PATCH 1/2] KVM: provide irq_unsafe kvm_guest_{enter|exit}
Date: Thu, 30 Apr 2015 11:50:04 +0000	[thread overview]
Message-ID: <554216EC.6070406@redhat.com> (raw)
In-Reply-To: <1430394211-25209-2-git-send-email-borntraeger@de.ibm.com>



On 30/04/2015 13:43, Christian Borntraeger wrote:
> +/* must be called with irqs disabled */
> +static inline void __kvm_guest_enter(void)
>  {
> -	unsigned long flags;
> -
> -	BUG_ON(preemptible());

Please keep the BUG_ON() in kvm_guest_enter.  Otherwise looks good, thanks!

Paolo

> -	local_irq_save(flags);
>  	guest_enter();
> -	local_irq_restore(flags);
> -
>  	/* KVM does not hold any references to rcu protected data when it
>  	 * switches CPU into a guest mode. In fact switching to a guest mode
>  	 * is very similar to exiting to userspace from rcu point of view. In
> @@ -769,12 +763,27 @@ static inline void kvm_guest_enter(void)
>  	rcu_virt_note_context_switch(smp_processor_id());
>  }
>  
> +/* must be called with irqs disabled */
> +static inline void __kvm_guest_exit(void)
> +{
> +	guest_exit();
> +}
> +
> +static inline void kvm_guest_enter(void)
> +{
> +	unsigned long flags;
> +
> +	local_irq_save(flags);
> +	__kvm_guest_enter();
> +	local_irq_restore(flags);
> +}
> +

WARNING: multiple messages have this Message-ID (diff)
From: Paolo Bonzini <pbonzini@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: KVM <kvm@vger.kernel.org>,
	kvm-ppc@vger.kernel.org, kvmarm@lists.cs.columbia.edu,
	linux-mips@linux-mips.org,
	Cornelia Huck <cornelia.huck@de.ibm.com>,
	Alexander Graf <agraf@suse.de>
Subject: Re: [PATCH 1/2] KVM: provide irq_unsafe kvm_guest_{enter|exit}
Date: Thu, 30 Apr 2015 13:50:04 +0200	[thread overview]
Message-ID: <554216EC.6070406@redhat.com> (raw)
In-Reply-To: <1430394211-25209-2-git-send-email-borntraeger@de.ibm.com>



On 30/04/2015 13:43, Christian Borntraeger wrote:
> +/* must be called with irqs disabled */
> +static inline void __kvm_guest_enter(void)
>  {
> -	unsigned long flags;
> -
> -	BUG_ON(preemptible());

Please keep the BUG_ON() in kvm_guest_enter.  Otherwise looks good, thanks!

Paolo

> -	local_irq_save(flags);
>  	guest_enter();
> -	local_irq_restore(flags);
> -
>  	/* KVM does not hold any references to rcu protected data when it
>  	 * switches CPU into a guest mode. In fact switching to a guest mode
>  	 * is very similar to exiting to userspace from rcu point of view. In
> @@ -769,12 +763,27 @@ static inline void kvm_guest_enter(void)
>  	rcu_virt_note_context_switch(smp_processor_id());
>  }
>  
> +/* must be called with irqs disabled */
> +static inline void __kvm_guest_exit(void)
> +{
> +	guest_exit();
> +}
> +
> +static inline void kvm_guest_enter(void)
> +{
> +	unsigned long flags;
> +
> +	local_irq_save(flags);
> +	__kvm_guest_enter();
> +	local_irq_restore(flags);
> +}
> +

  reply	other threads:[~2015-04-30 11:50 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-30 11:43 [PATCHv2 0/2] KVM: micro-optimization and interrupt disabling Christian Borntraeger
2015-04-30 11:43 ` Christian Borntraeger
2015-04-30 11:43 ` Christian Borntraeger
2015-04-30 11:43 ` [PATCH 1/2] KVM: provide irq_unsafe kvm_guest_{enter|exit} Christian Borntraeger
2015-04-30 11:43   ` Christian Borntraeger
2015-04-30 11:50   ` Paolo Bonzini [this message]
2015-04-30 11:50     ` Paolo Bonzini
2015-04-30 12:01     ` Christian Borntraeger
2015-04-30 12:01       ` Christian Borntraeger
2015-04-30 12:02       ` Christian Borntraeger
2015-04-30 12:02         ` Christian Borntraeger
2015-04-30 12:07         ` Christian Borntraeger
2015-04-30 12:07           ` Christian Borntraeger
2015-04-30 12:07           ` Christian Borntraeger
2015-04-30 12:28           ` Paolo Bonzini
2015-04-30 12:28             ` Paolo Bonzini
2015-04-30 12:28             ` Paolo Bonzini
2015-04-30 11:43 ` [PATCH 2/2] KVM: arm/mips/x86/power use __kvm_guest_{enter|exit} Christian Borntraeger
2015-04-30 11:43   ` Christian Borntraeger
2015-05-05 12:08   ` Christoffer Dall
2015-05-05 12:08     ` Christoffer Dall

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=554216EC.6070406@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-mips@linux-mips.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.