kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Alexander Graf <agraf@suse.de>
Cc: kvm@vger.kernel.org, joerg.roedel@amd.com
Subject: Re: [PATCH 4/4] Nested SVM: Improve interrupt injection v2
Date: Mon, 15 Jun 2009 14:56:10 +0300	[thread overview]
Message-ID: <20090615115610.GP19508@redhat.com> (raw)
In-Reply-To: <16F5B8F5-5F7D-4D3C-B33D-6C0369A6FD14@suse.de>

On Mon, Jun 15, 2009 at 01:47:08PM +0200, Alexander Graf wrote:
>
> On 19.05.2009, at 15:22, Gleb Natapov wrote:
>
>> On Tue, May 19, 2009 at 12:54:03PM +0200, Alexander Graf wrote:
>>> While trying to get Hyper-V running, I realized that the interrupt  
>>> injection
>>> mechanisms that are in place right now are not 100% correct.
>>>
>>> This patch makes nested SVM's interrupt injection behave more like  
>>> on a
>>> real machine.
>>>
>>> v2 calls BUG_ON when svm_set_irq is called with GIF=0
>>>
>>> Signed-off-by: Alexander Graf <agraf@suse.de>
>>> ---
>>> arch/x86/kvm/svm.c |   39 ++++++++++++++++++++++++---------------
>>> 1 files changed, 24 insertions(+), 15 deletions(-)
>>>
>>> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
>>> index fa2a710..5b14c9d 100644
>>> --- a/arch/x86/kvm/svm.c
>>> +++ b/arch/x86/kvm/svm.c
>>> @@ -1517,7 +1517,8 @@ static int nested_svm_vmexit_real(struct  
>>> vcpu_svm *svm, void *arg1,
>>> 	/* Kill any pending exceptions */
>>> 	if (svm->vcpu.arch.exception.pending == true)
>>> 		nsvm_printk("WARNING: Pending Exception\n");
>>> -	svm->vcpu.arch.exception.pending = false;
>>> +	kvm_clear_exception_queue(&svm->vcpu);
>>> +	kvm_clear_interrupt_queue(&svm->vcpu);
>>>
>> What about pending NMI here?
>
> NMI injected to the guest? That should have triggered by now and caused 
> an #NMI exit, no?
>
I don't really understand what this code is doing, but there are three
types of events exception/interrupt/nmi you clear only two of them. If
you are sure this is correct then OK.

--
			Gleb.

  reply	other threads:[~2009-06-15 11:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-19 10:53 [PATCH 0/4] Add rudimentary Hyper-V guest support v2 Alexander Graf
2009-05-19 10:54 ` [PATCH 1/4] Add definition for IGNNE MSR Alexander Graf
2009-05-19 10:54   ` [PATCH 2/4] Implement Hyper-V MSRs v2 Alexander Graf
2009-05-19 10:54     ` [PATCH 3/4] Nested SVM: Implement INVLPGA v2 Alexander Graf
2009-05-19 10:54       ` [PATCH 4/4] Nested SVM: Improve interrupt injection v2 Alexander Graf
2009-05-19 13:22         ` Gleb Natapov
2009-06-15 11:47           ` Alexander Graf
2009-06-15 11:56             ` Gleb Natapov [this message]
2009-05-19 12:58       ` [PATCH 3/4] Nested SVM: Implement INVLPGA v2 Avi Kivity
2009-05-19 13:10         ` Alexander Graf
2009-05-19 13:19           ` Avi Kivity
2009-05-19 13:54         ` Marcelo Tosatti
2009-05-19 13:56           ` Avi Kivity
2009-05-19 13:58             ` Marcelo Tosatti
2009-05-19 15:18               ` Alexander Graf
2009-05-19 16:33                 ` Marcelo Tosatti
2009-05-19 16:35                 ` Avi Kivity
2009-05-19 12:52     ` [PATCH 2/4] Implement Hyper-V MSRs v2 Avi Kivity
2009-06-15 11:45       ` Alexander Graf

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=20090615115610.GP19508@redhat.com \
    --to=gleb@redhat.com \
    --cc=agraf@suse.de \
    --cc=joerg.roedel@amd.com \
    --cc=kvm@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).