Hi all,
I modified to follow new interrupt deliver mechanism for PV-on-HVM/IPF.
New interrupt deliver mechanism changed GSI of pseudo hardware for
PV-on-HVM. So, old get_callback_irq function can't get GSI of it.
In this case, I modified that PV-driver notices Requester-ID(RID) to
hypervisor as callback irq with RID marker(MSB).
RID contains a bus number, a device number and a function number.
(cf. PCI-Express spec)
* pvdrv.patch
- Modify to change the spec of callback IRQ in PV-driver side.
* hyper.patch
- Modify to change the spec of callback IRQ in hypervisor side.
I tested with our simple test of PV-on-HVM on RHEL4 U4.
Thanks,
- Tsunehisa Doi
# HG changeset patch
# User Doi.Tsunehisa@xxxxxxxxxxxxxx
# Node ID 656f00fcd551061c268b73bfe9d7b92a2f53bdcc
# Parent 6e68e8a8cc99717b372c482efa0e153e868ae6f4
Follow new interrupt deliver mechanism for PV-on-HVM/IPF (driver side)
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@xxxxxxxxxxxxxx>
diff -r 6e68e8a8cc99 -r 656f00fcd551
unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c Mon Dec 18
10:56:34 2006 -0700
+++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c Tue Dec 19
18:22:05 2006 +0900
@@ -182,12 +182,16 @@ static int get_callback_irq(struct pci_d
static int get_callback_irq(struct pci_dev *pdev)
{
#ifdef __ia64__
- int irq;
+ int irq, rid;
for (irq = 0; irq < 16; irq++) {
if (isa_irq_to_vector(irq) == pdev->irq)
return irq;
}
- return 0;
+ /* use Requester-ID as callback_irq */
+ /* RID: '<#bus(8)><#dev(5)><#func(3)>' (cf. PCI-Express spec) */
+ rid = ((pdev->bus->number & 0xff) << 8) | pdev->devfn;
+ printk(KERN_INFO DRV_NAME ":use Requester-ID(%04x) as callback irq\n",
rid);
+ return rid | (1 << 31); /* with RID marker(MSB) */
#else /* !__ia64__ */
return pdev->irq;
#endif
# HG changeset patch
# User Doi.Tsunehisa@xxxxxxxxxxxxxx
# Node ID 8217a7ba6d9adbadeda939756346bcedb080a0f8
# Parent 656f00fcd551061c268b73bfe9d7b92a2f53bdcc
Follow new interrupt deliver mechanism for PV-on-HVM/IPF (hypervisor side)
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@xxxxxxxxxxxxxx>
diff -r 656f00fcd551 -r 8217a7ba6d9a xen/arch/ia64/vmx/vmx_process.c
--- a/xen/arch/ia64/vmx/vmx_process.c Tue Dec 19 18:22:05 2006 +0900
+++ b/xen/arch/ia64/vmx/vmx_process.c Tue Dec 19 18:23:33 2006 +0900
@@ -212,8 +212,18 @@ void leave_hypervisor_tail(struct pt_reg
if (callback_irq != 0 && local_events_need_delivery()) {
/* change level for para-device callback irq */
/* use level irq to send discrete event */
- viosapic_set_irq(d, callback_irq, 1);
- viosapic_set_irq(d, callback_irq, 0);
+ if (callback_irq & (1 << 31) /* RID marker(MSB) */) {
+ /* case of using Requester-ID as callback irq */
+ /* RID: '<#bus(8)><#dev(5)><#func(3)>' */
+ int rid = (callback_irq & ~(1 << 31));
+ viosapic_set_pci_irq(d, ((rid >> 3) & 0x1f), 0, 1);
+ viosapic_set_pci_irq(d, ((rid >> 3) & 0x1f), 0, 0);
+ }
+ else {
+ /* case of using GSI as callback irq */
+ viosapic_set_irq(d, callback_irq, 1);
+ viosapic_set_irq(d, callback_irq, 0);
+ }
}
}
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
|