Skip to contentSkip to conversation

Clear the pending interrupt on shared page when PIC initialized

PATCH Jiang, Yunhong 2 participants 3 messages Sep 12, 2005

lore
Share & tools
lore
#0 lore raw
Quoted 5 lines · Keir Fraser
Quoted 2 lines · Yunhong

When PIC is initialized and the irq base changed, the pending interrupt on shared page should be cleared.

Quoted 8 lines

For the i8259 device-model change -- ought we to be hooking off the cpu_interrupt/cpu_reset_interrupt functions rather than adding new hooks?

Also, are the patches to the PIT code directly related to the PIC patch or should they be split out with a separate explanation?

-- Keir

This patch works for following scenerio:
1) The BIOS set the irq base to 0x20, and then interrupt is injected through shared page.
2) The OS disable interurpt , and reset the PIC with ICW1~ICW4. In this process, it changes the irq base for PIC from 0x20 to 0x30 through ICW2.

On original code, when OS enable interrupt again after step 2, the interrupts that was kept on shared page and has no chance to be injected will be injected into guest. However, at this time, the guest has change the irq base. So maybe 0x20 will be injected into guest, which cause wrong vectoring on guest.

The patch on PIC and PIT works together for this purpose, since the PIT interrupt is injected on HV directly.

Thanks
Yunhong Jiang

#1 lore raw
Quoted 5 lines · Yunhong

This patch works for following scenerio:
1) The BIOS set the irq base to 0x20, and then interrupt is injected through shared page.
2) The OS disable interurpt , and reset the PIC with ICW1~ICW4. In this process, it changes the irq base for PIC from 0x20 to 0x30 through ICW2.

Okay, thanks for the clarification and I see why the PIT bart is needed now. But, in the PIC code, wouldn't hanging the reset off of cpu_reset_interrupt() make more sense?

-- Keir

#2 lore raw
Quoted 7 lines · Keir Fraser
Quoted 5 lines

This patch works for following scenerio:
1) The BIOS set the irq base to 0x20, and then interrupt is injected through shared page.
2) The OS disable interurpt , and reset the PIC with ICW1~ICW4. In this process, it changes the irq base for PIC from 0x20 to 0x30 through ICW2.

Okay, thanks for the clarification and I see why the PIT bart is needed now. But, in the PIC code, wouldn't hanging the reset off of cpu_reset_interrupt() make more sense?

I should add that I think in the end the PIC emulation belongs in Xen, or the PIT should be moved out to the qemu device model (but only after all that code is moved out of domain0 user space). The current architectural split across Xen/dom0 is pretty gross.

-- Keir