- Subject: Re: [PATCH RFC V6 1/5] kvm hypervisor : Add a hypercall to KVM hypervisor to support pv-ticketlocks
- From: Gleb Natapov <gleb@xxxxxxxxxx>
- Date: Mon, 30 Apr 2012 11:38:25 +0300
- Cc: Raghavendra K T <raghavendra.kt@xxxxxxxxxxxxxxxxxx>, Jeremy Fitzhardinge <jeremy@xxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxx>, Alexander Graf <agraf@xxxxxxx>, Randy Dunlap <rdunlap@xxxxxxxxxxxx>, linux-doc@xxxxxxxxxxxxxxx, "H. Peter Anvin" <hpa@xxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, KVM <kvm@xxxxxxxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>, Virtualization <virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx>, X86 <x86@xxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Marcelo Tosatti <mtosatti@xxxxxxxxxx>, LKML <linux-kernel@xxxxxxxxxxxxxxx>, Xen <xen-devel@xxxxxxxxxxxxxxxxxxx>, Sasha Levin <levinsasha928@xxxxxxxxx>, Srivatsa Vaddagiri <vatsa@xxxxxxxxxxxxxxxxxx>
- In-reply-to: <4F9E4BCA.5030604@redhat.com>
- References: <20120423095937.30893.14776.sendpatchset@codeblue.in.ibm.com> <20120423095947.30893.84029.sendpatchset@codeblue.in.ibm.com> <20120424095923.GS15413@redhat.com> <4F9D3F8B.9010805@redhat.com> <20120429132030.GB15413@redhat.com> <4F9D417D.1050105@redhat.com> <20120429135227.GC15413@redhat.com> <4F9E4BCA.5030604@redhat.com>
On Mon, Apr 30, 2012 at 11:22:34AM +0300, Avi Kivity wrote:
> On 04/29/2012 04:52 PM, Gleb Natapov wrote:
> > On Sun, Apr 29, 2012 at 04:26:21PM +0300, Avi Kivity wrote:
> > > On 04/29/2012 04:20 PM, Gleb Natapov wrote:
> > > > > > This is too similar to kvm_irq_delivery_to_apic(). Why not reuse it. We
> > > > > > can use one of reserved delivery modes as PV delivery mode. We will
> > > > > > disallow guest to trigger it through apic interface, so this will not be
> > > > > > part of ABI and can be changed at will.
> > > > > >
> > > > >
> > > > > I'm not thrilled about this. Those delivery modes will eventually
> > > > > become unreserved. We can have a kvm_lookup_apic_id() that is shared
> > > > > among implementations.
> > > > >
> > > > This is only internal implementation. If they become unreserved we will
> > > > use something else.
> > > >
> > >
> > > Yeah, I'm thinking of that time. Why do something temporary and fragile?
> > >
> > Why is it fragile? Just by unreserving the value Intel will not break
> > KVM. Only when KVM will implement apic feature that unreserves the value
> > we will have to change internal implementation and use another value,
> > but this will be done by the same patch that does unreserving. The
> > unreserving may even never happen.
>
> Some remains of that may leak somewhere.
I do not see where. APIC code should #GP if a guest attempts to set
reserved values through APIC interface, or at least ignore them.
> Why not add an extra
> parameter?
Yes, we can add extra parameter to "struct kvm_lapic_irq" and propagate it to
__apic_accept_irq(). We can do that now, or when Intel unreserve all
reserved values. I prefer the later since I do not believe it will
happen in observable feature.
> Or do something like
>
> kvm_for_each_apic_dest(vcpu, apic_destination) {
> ...
> }
>
> That can be reused in both the apic code and pv kick.
>
That's exactly what kvm_irq_delivery_to_apic() is.
> > Meanwhile kvm_irq_delivery_to_apic()
> > will likely be optimized to use hash for unicast delivery and unhalt
> > hypercall will benefit from it immediately.
>
> Overloading delivery mode is not the only way to achieve sharing.
>
It is simplest and most straightforward with no demonstratable drawbacks :)
Adding parameter to "struct kvm_lapic_irq" is next best thing.
--
Gleb.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[KVM ARM]
[KVM ia64]
[KVM ppc]
[Spice Development]
[Libvirt]
[Libvirt Users]
[Linux USB Devel]
[Video for Linux]
[Linux Audio Users]
[Photo]
[Yosemite News]
[Yosemite Photos]
[Linux Kernel]
[Linux SCSI]
[XFree86]