Re: KVM guest interrupts, traps, and, exceptions

Previous thread: Re: [Qemu-devel] [PATCH] qemu: jaso-parser: Output the content of invalid keyword by Aurelien Jarno on Saturday, March 27, 2010 - 5:52 am. (1 message)

Next thread: Clocksource tsc unstable (delta = -4398046474878 ns) by Sebastian Hetze on Sunday, March 28, 2010 - 4:46 am. (7 messages)
From: Pekka Enberg
Date: Saturday, March 27, 2010 - 8:43 am

Hi Avi,

I'm continuing my journey through the KVM API documentation and I'm now 
scratching my head on how interrupts, traps, and exceptions are 
supported by the API. I see KVM_CREATE_IRQCHIP and KVM_IRQ_LINE but I'm 
unable to work out how the host is notified of such events. For example, 
if the guest does

   int $0x10

is there some KVM_EXIT "exit reason" like we have for IO? Is there some 
other mechanism for that? As I haven't yet set up anything related to 
IRQs I can see the host just deadlock on user interrupts.

			Pekka
--

From: Alexander Graf
Date: Saturday, March 27, 2010 - 9:15 am

IRQs here mean hardware interrupts. They usually are pushed from host -> guest. So all you need is a way to tell the guest "you got an interrupt". Your userspace is the one giving interrupts, so there's no need to an exit.


I don't think I quite understand? If there's anything running inside guest context the host shouldn't be affected at all. Host interrupts always intercept guest execution.


Alex

--

From: Pekka Enberg
Date: Saturday, March 27, 2010 - 9:42 am

Hi Alexander,


OK, so Avi asked me not to look at KVM code or qemu code if I don't 
understand something in Documentation/kvm/api.txt and instead, complain 
about it. That might also partly explain why I am so confused.

I'm not talking in host -> guest interrupts but interrupts happening in 
the _guest_. Now if I understand your explanation correctly, host is not 
involved in interrupt processing but instead I just need to set up IDTs 
properly in the guest? That makes sense and explains why guest 
interrupts are not mentioned in the KVM API documentation at all. ;-)

			Pekka
--

From: Alexander Graf
Date: Saturday, March 27, 2010 - 9:45 am

Heh, yep. SW interrupts run 100% in guest context. Interrupt handling (IDT interpretation etc.) also happens in guest context.


Alex--

Previous thread: Re: [Qemu-devel] [PATCH] qemu: jaso-parser: Output the content of invalid keyword by Aurelien Jarno on Saturday, March 27, 2010 - 5:52 am. (1 message)

Next thread: Clocksource tsc unstable (delta = -4398046474878 ns) by Sebastian Hetze on Sunday, March 28, 2010 - 4:46 am. (7 messages)