From: Avi Kivity <avi@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: kvm@vger.kernel.org, mtosatti@redhat.com
Subject: Re: [PATCH] KVM: prevent spurious exit to userspace during task switch emulation.
Date: Thu, 15 Apr 2010 12:36:22 +0300 [thread overview]
Message-ID: <4BC6DE16.8040706@redhat.com> (raw)
In-Reply-To: <20100415092810.GH18132@redhat.com>
On 04/15/2010 12:28 PM, Gleb Natapov wrote:
>
> kvm_task_switch() never requires userspace exit, so no matter what the
> function returns we should not exit to userspace.
>
> Signed-off-by: Gleb Natapov<gleb@redhat.com>
> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> index c773a46..1bd434b 100644
> --- a/arch/x86/kvm/svm.c
> +++ b/arch/x86/kvm/svm.c
> @@ -2254,7 +2254,8 @@ static int task_switch_interception(struct vcpu_svm *svm)
> (int_vec == OF_VECTOR || int_vec == BP_VECTOR)))
> skip_emulated_instruction(&svm->vcpu);
>
> - return kvm_task_switch(&svm->vcpu, tss_selector, reason);
> + kvm_task_switch(&svm->vcpu, tss_selector, reason);
> + return 1;
> }
>
> static int cpuid_interception(struct vcpu_svm *svm)
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 453f080..3e1607d 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -3306,8 +3306,7 @@ static int handle_task_switch(struct kvm_vcpu *vcpu)
> type != INTR_TYPE_NMI_INTR))
> skip_emulated_instruction(vcpu);
>
> - if (!kvm_task_switch(vcpu, tss_selector, reason))
> - return 0;
> + kvm_task_switch(vcpu, tss_selector, reason);
>
>
Ignoring the return seems wrong. At the very least log errors in dmesg
(rate-limited).
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
prev parent reply other threads:[~2010-04-15 9:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-15 9:28 [PATCH] KVM: prevent spurious exit to userspace during task switch emulation Gleb Natapov
2010-04-15 9:36 ` Avi Kivity [this message]
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=4BC6DE16.8040706@redhat.com \
--to=avi@redhat.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.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 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.