kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Joerg Roedel <joro@8bytes.org>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH 3/5] Don't #VMEXIT(INTR) if we still have event_inj waiting
Date: Wed, 23 Sep 2009 01:09:13 -0700	[thread overview]
Message-ID: <EEA84B7C-CC07-4DEC-A1FA-49023F680FBF@suse.de> (raw)
In-Reply-To: <20090923013923.GD4654@8bytes.org>


Am 22.09.2009 um 18:39 schrieb Joerg Roedel <joro@8bytes.org>:

> On Fri, Sep 18, 2009 at 03:00:30PM +0200, Alexander Graf wrote:
>> Real hardware would first process the event_inj field and then  
>> notify the
>> host that an interrupt is waiting.
>
> Does it really? I couldn't find this in the SVM spec.

I didn't see it in the spec either, but that's what I saw real  
hardware do which is supported by the exit_info validity check in svm.c

>
>> Let's do the same and just not EXIT_INTR if we have an event  
>> pending for the
>> L2 guest.
>
> Anyway. I think this case is handled good enough with patch 5/5. This
> patch, to be complete must also enable single-steping to exit again
> after the first instruction of the exception handler has ran to inject
> the interrupt. But that would make the whole thing rather compĺicate 
> d.

The NMI injection path has logic for that, but for now it shouldn't  
hurt - we'll get an interrupt sooner or later.

>
>> Signed-off-by: Alexander Graf <agraf@suse.de>
>> ---
>> arch/x86/kvm/svm.c |    4 ++++
>> 1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
>> index 61efd13..28fcbd0 100644
>> --- a/arch/x86/kvm/svm.c
>> +++ b/arch/x86/kvm/svm.c
>> @@ -1401,6 +1401,10 @@ static inline int nested_svm_intr(struct  
>> vcpu_svm *svm)
>>    if (!(svm->vcpu.arch.hflags & HF_HIF_MASK))
>>        return 0;
>>
>> +    /* We can't EXIT_INTR when we still have an event to inject */
>> +    if (svm->vmcb->control.event_inj)
>> +        return 1;
>> +
>>    svm->vmcb->control.exit_code = SVM_EXIT_INTR;
>>
>>    if (nested_svm_exit_handled(svm)) {
>> -- 
>> 1.6.0.2
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe kvm" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-09-23  8:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-18 13:00 [PATCH 0/5] Nested SVM Interrupt Fixes Alexander Graf
2009-09-18 13:00 ` [PATCH 1/5] Implement #NMI exiting for nested SVM Alexander Graf
2009-09-18 13:00   ` [PATCH 2/5] Don't call svm_complete_interrupts for nested guests Alexander Graf
2009-09-18 13:00     ` [PATCH 3/5] Don't #VMEXIT(INTR) if we still have event_inj waiting Alexander Graf
2009-09-18 13:00       ` [PATCH 4/5] Don't bail when injecting an event in nested SVM Alexander Graf
2009-09-18 13:00         ` [PATCH 5/5] Notify nested hypervisor of lost event injections Alexander Graf
2009-09-23  1:22           ` Joerg Roedel
2009-09-27 14:18           ` Joerg Roedel
2009-09-23  1:39       ` [PATCH 3/5] Don't #VMEXIT(INTR) if we still have event_inj waiting Joerg Roedel
2009-09-23  8:09         ` Alexander Graf [this message]
2009-09-18 13:39     ` [PATCH 2/5] Don't call svm_complete_interrupts for nested guests Jan Kiszka
2009-09-23  1:26     ` Joerg Roedel
2009-09-23  8:04       ` Alexander Graf
2009-09-23  8:05       ` Alexander Graf
2009-09-23  8:28         ` Gleb Natapov
2009-09-18 13:33   ` [PATCH 1/5] Implement #NMI exiting for nested SVM Jan Kiszka
2009-09-18 15:44     ` Alexander Graf
2009-09-18 16:01       ` Jan Kiszka
2009-09-23  1:06   ` Joerg Roedel

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=EEA84B7C-CC07-4DEC-A1FA-49023F680FBF@suse.de \
    --to=agraf@suse.de \
    --cc=joro@8bytes.org \
    --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).