From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Gregory Haskins <ghaskins-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH 2/5] KVM: Add irqdevice object
Date: Thu, 26 Apr 2007 19:26:46 +0300 [thread overview]
Message-ID: <4630D2C6.7040809@qumranet.com> (raw)
In-Reply-To: <463080C8.BA47.005A.0-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>
Gregory Haskins wrote:
> Hi Avi, Sorry for the delay. I have been traveling this week. See inline...
>
>>>> [do we actually need a virtual destructor?]
>>>>
>>>>
>>> I believe it is the right thing to do, yes. The implementation of the
>>>
>> irqdevice destructor may be as simple as a kfree(), or could be arbitrarily
>> complex (don't forget that we will have multiple models..we already have
>> three: userint, kernint, and lapic. There may also be i8259 and
>> i8259_cascaded in the future).
>>
>>>
>>>
>> Yes, but does it need to be a function pointer? IOW, is the point it is
>> called generic code or already irqdevice- specific?
>>
>
> The code can-be/is irqdevice specific, thus the virtual. In some cases, it will be as simple as a kfree(). In others, (kernint, for instance), it might need to drop references to the apic/ext devices and do other cleanup (which reminds me that I should look at this to make sure its done right today) ;)
>
>
I mean, "called from generic code". e.g. in C++ a destructor need not
be virtual unless you're destroying the object via a pointer to the base
class.
>> I meant, __kvm_vcpu_irq_pending is just reading stuff.
>>
>
> Ah, I see. I am not 100% sure about this, but I think you can make the same argument here as you can with that "double check locks are broken" article that you sent out. If I got anything out of that article (it was very interesting, BTW), its that the locks do more than protect critical sections: They are an implicit memory barrier also. I am under the impression that we want that behavior here. I can be convinced otherwise....
>
>
There's a whole bunch of memory barriers available (smp__rmb() seems to
be indicated here, which is a noop on x86 IIRC)
>
>> I guess it works because no OS is insane enough to page out
>> the IDT or GDT, so the only faults we can get are handled by kvm, not
>> the guest.
>>
>
> This is my thinking as well. The conditions that cause an injection failure are probably relatively light-weight w.r.t. the guests execution context. Like for instance, maybe an NMI comes in during the VMENTRY and causes an immediate VMEXIT (e.g. the guest never made any forward progress, and therefore nothing else (e.g. TPR) has changed)
>
>
That, or a shadow pagefault.
>> So it seems the correct description is not 'un- ack the interrupt', as we
>> have effectively acked it, but actually queue it pending host- only kvm
>> processing.
>>
>
> This is exactly what I have done (if I understood what you were saying). When the injection fails we push the vector to the irq.deferred entry which takes a higher priority in the queue than the backing irqdevice (since it believes the vector is already dispatched).
>
>
Okay. Windows can demand page drivers, but probably not the IDT :) We
shall have to live with the knowledge that emulation is incorrect wrt
taking exceptions while delivering external interrupts to the guest.
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
next prev parent reply other threads:[~2007-04-26 16:26 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-20 3:09 KVM: Patch series for in-kernel APIC support Gregory Haskins
[not found] ` <20070420030905.12408.40403.stgit-5CR4LY5GPkvLDviKLk5550HKjMygAv58XqFh9Ls21Oc@public.gmane.org>
2007-04-20 3:09 ` [PATCH 1/5] Adds support for in-kernel mmio handlers Gregory Haskins
2007-04-20 3:09 ` [PATCH 2/5] KVM: Add irqdevice object Gregory Haskins
[not found] ` <20070420030916.12408.80159.stgit-5CR4LY5GPkvLDviKLk5550HKjMygAv58XqFh9Ls21Oc@public.gmane.org>
2007-04-22 8:42 ` Avi Kivity
[not found] ` <462B1FD8.4080004-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-04-23 13:58 ` Gregory Haskins
[not found] ` <462C8333.BA47.005A.0-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>
2007-04-24 9:09 ` Avi Kivity
[not found] ` <462DC954.1020400-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-04-26 14:37 ` Gregory Haskins
[not found] ` <463080C8.BA47.005A.0-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>
2007-04-26 16:26 ` Avi Kivity [this message]
2007-04-20 3:09 ` [PATCH 3/5] KVM: Adds ability to preepmt an executing VCPU Gregory Haskins
[not found] ` <20070420030921.12408.97321.stgit-5CR4LY5GPkvLDviKLk5550HKjMygAv58XqFh9Ls21Oc@public.gmane.org>
2007-04-22 8:50 ` Avi Kivity
[not found] ` <462B21C7.2060007-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-04-23 15:42 ` Gregory Haskins
[not found] ` <462C9B94.BA47.005A.0-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>
2007-04-24 9:17 ` Avi Kivity
[not found] ` <462DCB3E.6070802-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-04-26 14:40 ` Gregory Haskins
2007-04-20 3:09 ` [PATCH 4/5] KVM: Local-APIC interface cleanup Gregory Haskins
[not found] ` <20070420030926.12408.27637.stgit-5CR4LY5GPkvLDviKLk5550HKjMygAv58XqFh9Ls21Oc@public.gmane.org>
2007-04-22 8:54 ` Avi Kivity
[not found] ` <462B22AE.4090108-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-04-23 15:55 ` Gregory Haskins
[not found] ` <462C9EAE.BA47.005A.0-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>
2007-04-24 9:26 ` Avi Kivity
[not found] ` <462DCD31.4030108-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-04-26 14:43 ` Gregory Haskins
2007-04-20 3:09 ` [PATCH 5/5] KVM: Add support for in-kernel LAPIC model Gregory Haskins
[not found] ` <20070420030931.12408.88158.stgit-5CR4LY5GPkvLDviKLk5550HKjMygAv58XqFh9Ls21Oc@public.gmane.org>
2007-04-22 9:04 ` Avi Kivity
[not found] ` <462B250E.6050603-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-04-23 15:57 ` Gregory Haskins
2007-04-22 9:06 ` KVM: Patch series for in-kernel APIC support Avi Kivity
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=4630D2C6.7040809@qumranet.com \
--to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
--cc=ghaskins-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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