ia64/xen-unstable

changeset 13092:46c44b5e6a1b

[IA64] Follow new interrupt deliver mechanism for PV-on-HVM/IPF

This fixes PV-on-HVM drivers for ia64

Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
author awilliam@xenbuild2.aw
date Wed Dec 20 08:53:42 2006 -0700 (2006-12-20)
parents c3b455c4676c
children 80c5b5914b79
files unmodified_drivers/linux-2.6/platform-pci/platform-pci.c xen/arch/ia64/vmx/vmx_process.c xen/include/public/arch-ia64.h
line diff
     1.1 --- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c	Tue Dec 19 13:31:48 2006 -0700
     1.2 +++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c	Wed Dec 20 08:53:42 2006 -0700
     1.3 @@ -182,12 +182,17 @@ static int get_hypercall_stubs(void)
     1.4  static int get_callback_irq(struct pci_dev *pdev)
     1.5  {
     1.6  #ifdef __ia64__
     1.7 -	int irq;
     1.8 +	int irq, rid;
     1.9  	for (irq = 0; irq < 16; irq++) {
    1.10  		if (isa_irq_to_vector(irq) == pdev->irq)
    1.11  			return irq;
    1.12  	}
    1.13 -	return 0;
    1.14 +	/* use Requester-ID as callback_irq */
    1.15 +	/* RID: '<#bus(8)><#dev(5)><#func(3)>' (cf. PCI-Express spec) */
    1.16 +	rid = ((pdev->bus->number & 0xff) << 8) | pdev->devfn;
    1.17 +	printk(KERN_INFO DRV_NAME ":use Requester-ID(%04x) as callback irq\n",
    1.18 +	       rid);
    1.19 +	return rid | HVM_PARAM_CALLBACK_IRQ_RID;
    1.20  #else /* !__ia64__ */
    1.21  	return pdev->irq;
    1.22  #endif
     2.1 --- a/xen/arch/ia64/vmx/vmx_process.c	Tue Dec 19 13:31:48 2006 -0700
     2.2 +++ b/xen/arch/ia64/vmx/vmx_process.c	Wed Dec 20 08:53:42 2006 -0700
     2.3 @@ -212,8 +212,17 @@ void leave_hypervisor_tail(struct pt_reg
     2.4              if (callback_irq != 0 && local_events_need_delivery()) {
     2.5                  /* change level for para-device callback irq */
     2.6                  /* use level irq to send discrete event */
     2.7 -                viosapic_set_irq(d, callback_irq, 1);
     2.8 -                viosapic_set_irq(d, callback_irq, 0);
     2.9 +                if (callback_irq & HVM_PARAM_CALLBACK_IRQ_RID) {
    2.10 +                    /* case of using Requester-ID as callback irq */
    2.11 +                    /* RID: '<#bus(8)><#dev(5)><#func(3)>' */
    2.12 +                    int dev = (callback_irq >> 3) & 0x1f;
    2.13 +                    viosapic_set_pci_irq(d, dev, 0, 1);
    2.14 +                    viosapic_set_pci_irq(d, dev, 0, 0);
    2.15 +                } else {
    2.16 +                    /* case of using GSI as callback irq */
    2.17 +                    viosapic_set_irq(d, callback_irq, 1);
    2.18 +                    viosapic_set_irq(d, callback_irq, 0);
    2.19 +                }
    2.20              }
    2.21          }
    2.22  
     3.1 --- a/xen/include/public/arch-ia64.h	Tue Dec 19 13:31:48 2006 -0700
     3.2 +++ b/xen/include/public/arch-ia64.h	Wed Dec 20 08:53:42 2006 -0700
     3.3 @@ -62,6 +62,10 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
     3.4  #define VIRQ_MCA_CMC    VIRQ_ARCH_1 /* MCA cmc interrupt */
     3.5  #define VIRQ_MCA_CPE    VIRQ_ARCH_2 /* MCA cpe interrupt */
     3.6  
     3.7 +/* Arch specific callback irq definition */
     3.8 +/* using Requester-ID(RID) as callback irq */
     3.9 +#define HVM_PARAM_CALLBACK_IRQ_RID        (1 << 31)
    3.10 +
    3.11  /* Maximum number of virtual CPUs in multi-processor guests. */
    3.12  /* WARNING: before changing this, check that shared_info fits on a page */
    3.13  #define MAX_VIRT_CPUS 64