* Undocumented KVM_SET_LAPIC ioctl()
@ 2011-04-27 7:23 Pekka Enberg
2011-04-27 7:37 ` Avi Kivity
0 siblings, 1 reply; 6+ messages in thread
From: Pekka Enberg @ 2011-04-27 7:23 UTC (permalink / raw)
To: KVM General; +Cc: Avi Kivity, Ingo Molnar, Cyrill Gorcunov
Hi!
We're currently having issues while trying to make the KVM in-kernel
lapic to work. There seems to be a KVM_SET_LAPIC ioctl() for this but
it's not documented in Documentation/kvm/api.txt. Are there other
ioctls we should know about? We're using KVM_CREATE_IRQCHIP obviously.
Pekka
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Undocumented KVM_SET_LAPIC ioctl()
2011-04-27 7:23 Undocumented KVM_SET_LAPIC ioctl() Pekka Enberg
@ 2011-04-27 7:37 ` Avi Kivity
2011-04-27 7:53 ` Pekka Enberg
0 siblings, 1 reply; 6+ messages in thread
From: Avi Kivity @ 2011-04-27 7:37 UTC (permalink / raw)
To: Pekka Enberg; +Cc: KVM General, Ingo Molnar, Cyrill Gorcunov
On 04/27/2011 10:23 AM, Pekka Enberg wrote:
> Hi!
>
> We're currently having issues while trying to make the KVM in-kernel
> lapic to work. There seems to be a KVM_SET_LAPIC ioctl() for this but
> it's not documented in Documentation/kvm/api.txt. Are there other
> ioctls we should know about? We're using KVM_CREATE_IRQCHIP obviously.
Plenty, yes.
KVM_IRQ_LINE - raise or lower an irq line.
KVM_GET_IRQCHIP/KVM_SET_IRQCHIP - save/restore PIC/IOAPIC states.
KVM_CREATE_PIT2/KVM_GET_PIT2/KVM_SET_PIT2 - PIT support (optional)
KVM_IRQ_LINE_STATUS - like KVM_IRQ_LINE, but provide information about
whether the interrupt was coalesced or not. Useful for compensating for
time drift.
KVM_SET_GSI_ROUTING - manipulate the routes between irq lines and the
IOAPIC and PIC; also maintain virtual routes for message signalled
interrupts (MSI)
KVM_IRQFD - raise an edge-triggered interrupt via an eventfd; useful for
talking to a guest from outside its host process
KVM_GET_LAPIC/KVM_SET_LAPIC - save/restore local APIC register state
I'll post documentation patches. To get started, KVM_SET_LAPIC is
simple - it simply accepts a 1K buffer that maps 1:1 to local APIC
registers as documented in the Intel SDM, volume 3.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Undocumented KVM_SET_LAPIC ioctl()
2011-04-27 7:37 ` Avi Kivity
@ 2011-04-27 7:53 ` Pekka Enberg
2011-04-27 8:20 ` Avi Kivity
0 siblings, 1 reply; 6+ messages in thread
From: Pekka Enberg @ 2011-04-27 7:53 UTC (permalink / raw)
To: Avi Kivity; +Cc: KVM General, Ingo Molnar, Cyrill Gorcunov
On Wed, Apr 27, 2011 at 10:37 AM, Avi Kivity <avi@redhat.com> wrote:
> KVM_SET_GSI_ROUTING - manipulate the routes between irq lines and the IOAPIC
> and PIC; also maintain virtual routes for message signalled interrupts (MSI)
Is this mandatory to set up manually for lapic to work or does KVM set
these up automatically (like it does for most ioctls) to something
sane?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Undocumented KVM_SET_LAPIC ioctl()
2011-04-27 7:53 ` Pekka Enberg
@ 2011-04-27 8:20 ` Avi Kivity
2011-04-27 8:26 ` Gleb Natapov
0 siblings, 1 reply; 6+ messages in thread
From: Avi Kivity @ 2011-04-27 8:20 UTC (permalink / raw)
To: Pekka Enberg; +Cc: KVM General, Ingo Molnar, Cyrill Gorcunov
On 04/27/2011 10:53 AM, Pekka Enberg wrote:
> On Wed, Apr 27, 2011 at 10:37 AM, Avi Kivity<avi@redhat.com> wrote:
> > KVM_SET_GSI_ROUTING - manipulate the routes between irq lines and the IOAPIC
> > and PIC; also maintain virtual routes for message signalled interrupts (MSI)
>
> Is this mandatory to set up manually for lapic to work or does KVM set
> these up automatically (like it does for most ioctls) to something
> sane?
The defaults are all sane (including the APIC ID).
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Undocumented KVM_SET_LAPIC ioctl()
2011-04-27 8:20 ` Avi Kivity
@ 2011-04-27 8:26 ` Gleb Natapov
2011-04-27 8:50 ` Avi Kivity
0 siblings, 1 reply; 6+ messages in thread
From: Gleb Natapov @ 2011-04-27 8:26 UTC (permalink / raw)
To: Avi Kivity; +Cc: Pekka Enberg, KVM General, Ingo Molnar, Cyrill Gorcunov
On Wed, Apr 27, 2011 at 11:20:29AM +0300, Avi Kivity wrote:
> On 04/27/2011 10:53 AM, Pekka Enberg wrote:
> >On Wed, Apr 27, 2011 at 10:37 AM, Avi Kivity<avi@redhat.com> wrote:
> >> KVM_SET_GSI_ROUTING - manipulate the routes between irq lines and the IOAPIC
> >> and PIC; also maintain virtual routes for message signalled interrupts (MSI)
> >
> >Is this mandatory to set up manually for lapic to work or does KVM set
> >these up automatically (like it does for most ioctls) to something
> >sane?
>
> The defaults are all sane (including the APIC ID).
>
But IIRC the only way to reset BSP lapic to its initial state is to call
KVM_SET_LAPIC with buffer filled with initial values. The same is true
for non-BSP lapics too if they are reset by machine reset (as opposite
to by INIT message).
--
Gleb.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Undocumented KVM_SET_LAPIC ioctl()
2011-04-27 8:26 ` Gleb Natapov
@ 2011-04-27 8:50 ` Avi Kivity
0 siblings, 0 replies; 6+ messages in thread
From: Avi Kivity @ 2011-04-27 8:50 UTC (permalink / raw)
To: Gleb Natapov; +Cc: Pekka Enberg, KVM General, Ingo Molnar, Cyrill Gorcunov
On 04/27/2011 11:26 AM, Gleb Natapov wrote:
> On Wed, Apr 27, 2011 at 11:20:29AM +0300, Avi Kivity wrote:
> > On 04/27/2011 10:53 AM, Pekka Enberg wrote:
> > >On Wed, Apr 27, 2011 at 10:37 AM, Avi Kivity<avi@redhat.com> wrote:
> > >> KVM_SET_GSI_ROUTING - manipulate the routes between irq lines and the IOAPIC
> > >> and PIC; also maintain virtual routes for message signalled interrupts (MSI)
> > >
> > >Is this mandatory to set up manually for lapic to work or does KVM set
> > >these up automatically (like it does for most ioctls) to something
> > >sane?
> >
> > The defaults are all sane (including the APIC ID).
> >
> But IIRC the only way to reset BSP lapic to its initial state is to call
> KVM_SET_LAPIC with buffer filled with initial values. The same is true
> for non-BSP lapics too if they are reset by machine reset (as opposite
> to by INIT message).
Right, we do need a reset system in kvm.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-04-27 8:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-27 7:23 Undocumented KVM_SET_LAPIC ioctl() Pekka Enberg
2011-04-27 7:37 ` Avi Kivity
2011-04-27 7:53 ` Pekka Enberg
2011-04-27 8:20 ` Avi Kivity
2011-04-27 8:26 ` Gleb Natapov
2011-04-27 8:50 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox