Skip to contentSkip to conversation

In kernel PIC support: kernel patch

DISCUSSION Gregory Haskins 3 participants 6 messages Jun 22, 2007 – Jun 25, 2007 5 messages not in the archive KVM

lore
Share & tools
lore
#0 lore raw
Quoted 16 lines · Avi Kivity
Quoted 8 lines · Gregory Haskins

Unless I misunderstood Avi, I think he was suggesting that use use KVM_EXTINT/ISA_INTERRUPT as a way to distinguish between the dual modes of ISA_INTERRUPT as I have today (e.g. ISA_INTERRUPT(level-1)/ISA_INTERRUPT(level-2)). This doesn't really have anything to do with LINT0/1 (directly, anyway). Hope this helps to clarify.

Well, we don't need to think in terms of modes. Each ioctl controls interrupts at a different point in the architecture.

KVM_INTERRUPT is at the interface between the processor core and the lapic/system bus.

Quoted 6 lines

KVM_APIC_MESSAGE is at the apic bus.

KVM_EXTINT is at the interface between the lapic and the system bus. If the guest disabled the local apic, it's equivalent to the KVM_INTERRUPT (injecting a vector directly); otherwise it is handled by the lapic (LINT0/1 handling).

Ok, now I understand what Eddie was saying about LINT0/1 and we were both describing the same thing in different ways. I think we are all on the same page.

Quoted 5 lines

KVM_ISA_INTERRUPT (maybe KVM_IRQ_LINE, to signify it doesn't carry a vector) is at the boundary between the interrupt controller chips and the rest of the system.

Ack on s/ISA/IRQ or something similar

-------------------------------------------------------------------------
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/

A message that is not in the archive (sent off-list or not yet received): 467B830B0200005A000263FB-Igcdv/6uVdMHoYOw/[email protected]

#2 lore raw

Woo, we have gone through so many threads within single day and get almost
everything in hand now :-) Should we make a short notes on the decision to be referenced in future (Any place to KVM I/F)?

Basically we have solved the I/Fs issue and part IRQ delivery issue.

Several other minor points in my mind:

1: Cross architecture consideration
If we want to consider other platform too such as IA64 and PPC like that in Xen, then use GSI is better for KVM_IOAPIC_INTERRUPT. BTW, IA64 platform doesn;t have PIC usually.(The work for IA64 is under going.)

2: MSI.
Not sure if there will have requirement to support a virtual
device
with MSI support, if yes, then we may add new APIs in future. So let us reserve some I/F for future irq injection.

3: IOAPIC position
Though it looks like neutral to have this one in user or kernel
space,
but I'd like to suggest we only support one model. Considering future VT-d
case, hypervisor need to inject an IRQ directly in KVM (still thru IOAPIC)
without going to user level, so probably moving IOAPIC to kernel is good

in this point.
Any suggestion?

thanks, eddie

-------------------------------------------------------------------------
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/

A message that is not in the archive (sent off-list or not yet received): 10EA09EFD8728347A513008B6B0DA77A014E8AC7-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org

#4 lore raw
Quoted 7 lines · Eddie

Woo, we have gone through so many threads within single day and get almost
everything in hand now :-) Should we make a short notes on the decision to be referenced in future (Any place to KVM I/F)?

Basically we have solved the I/Fs issue and part IRQ delivery issue.

Quoted 9 lines

Several other minor points in my mind:

1: Cross architecture consideration
If we want to consider other platform too such as IA64 and PPC like that in Xen, then use GSI is better for KVM_IOAPIC_INTERRUPT. BTW, IA64 platform doesn;t have PIC usually.(The work for IA64 is under going.)

What is GSI?

Quoted 6 lines

2: MSI.
Not sure if there will have requirement to support a virtual
device
with MSI support, if yes, then we may add new APIs in future. So let us reserve some I/F for future irq injection.

We'll add it as soon as it becomes necessary. But isn't it just a memory write?

Quoted 11 lines

3: IOAPIC position
Though it looks like neutral to have this one in user or kernel
space,
but I'd like to suggest we only support one model. Considering future VT-d
case, hypervisor need to inject an IRQ directly in KVM (still thru IOAPIC)
without going to user level, so probably moving IOAPIC to kernel is good

in this point.

Even paravirt device drivers will want to inject IRQs via the ioapic (when the guest is not paravirt_ops enabled, like older Linux and Windows). It's probably okay to implement the device side of a block device in qemu, but more difficult for networking. If we have device implementations in the kernel then we'll need an ioapic in the kernel.

Also, if we end up sharing interrupts between the kernel and userspace, we'll need the kernel to perform the OR between the level specified by the kernel devices and the level specified by userspace.

-------------------------------------------------------------------------
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/

A message that is not in the archive (sent off-list or not yet received): 467D5B5B.9090702-atKUWr5tajBWk0Htik3J/[email protected]

#6 lore raw
Quoted 17 lines · Avi Kivity
Quoted 6 lines · Eddie

Woo, we have gone through so many threads within single day and get almost everything in hand now :-) Should we make a short notes on the decision to be referenced in future (Any place to KVM I/F)?

Basically we have solved the I/Fs issue and part IRQ delivery issue.

Quoted 9 lines

Several other minor points in my mind:

1: Cross architecture consideration
If we want to consider other platform too such as IA64 and PPC like that in Xen, then use GSI is better for KVM_IOAPIC_INTERRUPT. BTW, IA64 platform doesn;t have PIC usually.(The work for IA64 is under going.)

Quoted 1 line

What is GSI?

GSI is ACPI notion of "Global System Interrupt". (Just parameter passing difference: GSI use GSI #, our previous discussion use: PIC/IOAPIC # + line #)

Quoted 11 lines
Quoted 7 lines

2: MSI.
Not sure if there will have requirement to support a virtual
device
with MSI support, if yes, then we may add new APIs in future. So let us reserve some I/F for future irq injection.

We'll add it as soon as it becomes necessary. But isn't it just a memory
write?

Yes. So you mean we just add a memory Write I/F? It could be another good alternative.
(I suppose MSI emulation is in kernel too if other irqchip is in kernel.)

Quoted 17 lines
Quoted 10 lines

3: IOAPIC position
Though it looks like neutral to have this one in user or kernel
space, but I'd like to suggest we only support one model. Considering future VT-d case, hypervisor need to inject an IRQ directly in KVM (still thru IOAPIC) without going to user level, so probably moving IOAPIC to kernel is good

in this point.

Even paravirt device drivers will want to inject IRQs via the ioapic (when the guest is not paravirt_ops enabled, like older Linux and Windows). It's probably okay to implement the device side of a block device in qemu, but more difficult for networking. If we have device implementations in the kernel then we'll need an ioapic in the kernel.

Quoted 3 lines

Also, if we end up sharing interrupts between the kernel and userspace, we'll need the kernel to perform the OR between the level specified by the kernel devices and the level specified by userspace.

Yes, so basically in kernel IOAPIC has stronger reason :-) Any strong reason
to support user level IOAPIC + kernel level APIC/PIC/MSI ? thx,eddie

-------------------------------------------------------------------------
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/

A message that is not in the archive (sent off-list or not yet received): 10EA09EFD8728347A513008B6B0DA77A01AA46F5-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org

#8 lore raw
Quoted 20 lines · Eddie
Quoted 18 lines · Avi Kivity
Quoted 16 lines · Eddie

Woo, we have gone through so many threads within single day and get almost everything in hand now :-) Should we make a short notes on the decision to be referenced in future (Any place to KVM I/F)?

Basically we have solved the I/Fs issue and part IRQ delivery issue.

Several other minor points in my mind:

1: Cross architecture consideration
If we want to consider other platform too such as IA64 and PPC like that in Xen, then use GSI is better for KVM_IOAPIC_INTERRUPT. BTW, IA64 platform doesn;t have PIC usually.(The work for IA64 is under going.)

Quoted 9 lines
Quoted 2 lines

What is GSI?

GSI is ACPI notion of "Global System Interrupt". (Just parameter passing difference: GSI use GSI #, our previous discussion use: PIC/IOAPIC # + line #)

Can you refer me to any documentation about it?

Quoted 12 lines
Quoted 11 lines
Quoted 7 lines

2: MSI.
Not sure if there will have requirement to support a virtual
device
with MSI support, if yes, then we may add new APIs in future. So let us reserve some I/F for future irq injection.

We'll add it as soon as it becomes necessary. But isn't it just a memory
write?

Quoted 5 lines

Yes. So you mean we just add a memory Write I/F? It could be another good alternative.
(I suppose MSI emulation is in kernel too if other irqchip is in kernel.)

We already have kernel->user write (normal mmio)
If both the interrupt originator and the irqchip are in the kernel there is no need for an api.
So all that is left is an mmio api from user to kernel. Which makes
sense: if we have memory resources in the kernel, we need to be able to access them from userspace (one example already exists, RAM, which is accessed in userspace through mmap()).

Quoted 18 lines
Quoted 18 lines
Quoted 12 lines

3: IOAPIC position
Though it looks like neutral to have this one in user or kernel
space, but I'd like to suggest we only support one model. Considering future VT-d case, hypervisor need to inject an IRQ directly in KVM (still thru IOAPIC) without going to user level, so probably moving IOAPIC to kernel is good

in this point.

Even paravirt device drivers will want to inject IRQs via the ioapic (when the guest is not paravirt_ops enabled, like older Linux and Windows). It's probably okay to implement the device side of a block device in qemu, but more difficult for networking. If we have device implementations in the kernel then we'll need an ioapic in the kernel.

Quoted 9 lines
Quoted 4 lines

Also, if we end up sharing interrupts between the kernel and userspace, we'll need the kernel to perform the OR between the level specified by the kernel devices and the level specified by userspace.

Yes, so basically in kernel IOAPIC has stronger reason :-) Any strong reason
to support user level IOAPIC + kernel level APIC/PIC/MSI ?

No strong reason. It may be desirable for debuggability, but not much else.

-------------------------------------------------------------------------
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/

A message that is not in the archive (sent off-list or not yet received): 467F38F7.9090101-atKUWr5tajBWk0Htik3J/[email protected]

#10 lore raw
Quoted 9 lines · Avi Kivity
Quoted 7 lines

GSI is ACPI notion of "Global System Interrupt". (Just parameter passing difference: GSI use GSI #, our previous discussion use: PIC/IOAPIC # + line #)

Can you refer me to any documentation about it?

ACPI spec 3.0a, section 5.2.12.
http://www.acpi.info/spec.htm has a copy. I don't where is formal release org.

-------------------------------------------------------------------------
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/