ia64/xen-unstable

changeset 13842:311b27546cf6

[IA64] Follow to allow PV-on-HVM callback irq to be identified by PCI device.

Also delete IA64 specific spec concerned with IA64_CALLBACK_IRQ_RID.

Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
author awilliam@xenbuild2.aw
date Tue Feb 06 09:26:25 2007 -0700 (2007-02-06)
parents d7f7021902a2
children b3ae332e6dbd
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	Mon Feb 05 15:41:58 2007 -0700
     1.2 +++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c	Tue Feb 06 09:26:25 2007 -0700
     1.3 @@ -181,23 +181,18 @@ static int get_hypercall_stubs(void)
     1.4  
     1.5  static uint64_t get_callback_via(struct pci_dev *pdev)
     1.6  {
     1.7 +	u8 pin;
     1.8  #ifdef __ia64__
     1.9  	int irq, rid;
    1.10  	for (irq = 0; irq < 16; irq++) {
    1.11  		if (isa_irq_to_vector(irq) == pdev->irq)
    1.12 -			return irq;
    1.13 +			return irq; /* ISA IRQ */
    1.14  	}
    1.15 -	/* use Requester-ID as callback_irq */
    1.16 -	/* RID: '<#bus(8)><#dev(5)><#func(3)>' (cf. PCI-Express spec) */
    1.17 -	rid = ((pdev->bus->number & 0xff) << 8) | pdev->devfn;
    1.18 -	printk(KERN_INFO DRV_NAME ":use Requester-ID(%04x) as callback irq\n",
    1.19 -	       rid);
    1.20 -	return rid | IA64_CALLBACK_IRQ_RID;
    1.21  #else /* !__ia64__ */
    1.22 -	u8 pin;
    1.23  
    1.24  	if (pdev->irq < 16)
    1.25  		return pdev->irq; /* ISA IRQ */
    1.26 +#endif
    1.27  
    1.28  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
    1.29  	pin = pdev->pin;
    1.30 @@ -211,7 +206,6 @@ static uint64_t get_callback_via(struct 
    1.31  		((uint64_t)pdev->bus->number << 16) |
    1.32  		((uint64_t)(pdev->devfn & 0xff) << 8) |
    1.33  		((uint64_t)(pin - 1) & 3));
    1.34 -#endif
    1.35  }
    1.36  
    1.37  /* Invalidate foreign mappings (e.g., in qemu-based device model). */
     2.1 --- a/xen/arch/ia64/vmx/vmx_process.c	Mon Feb 05 15:41:58 2007 -0700
     2.2 +++ b/xen/arch/ia64/vmx/vmx_process.c	Tue Feb 06 09:26:25 2007 -0700
     2.3 @@ -227,17 +227,23 @@ void leave_hypervisor_tail(void)
     2.4          local_irq_disable();
     2.5  
     2.6          if (v->vcpu_id == 0) {
     2.7 -            int callback_irq =
     2.8 +            unsigned long callback_irq =
     2.9                  d->arch.hvm_domain.params[HVM_PARAM_CALLBACK_IRQ];
    2.10 +            /*
    2.11 +             * val[63:56] == 1: val[55:0] is a delivery PCI INTx line:
    2.12 +             *                  Domain = val[47:32], Bus  = val[31:16],
    2.13 +             *                  DevFn  = val[15: 8], IntX = val[ 1: 0]
    2.14 +             * val[63:56] == 0: val[55:0] is a delivery as GSI
    2.15 +             */
    2.16              if (callback_irq != 0 && local_events_need_delivery()) {
    2.17                  /* change level for para-device callback irq */
    2.18                  /* use level irq to send discrete event */
    2.19 -                if (callback_irq & IA64_CALLBACK_IRQ_RID) {
    2.20 -                    /* case of using Requester-ID as callback irq */
    2.21 -                    /* RID: '<#bus(8)><#dev(5)><#func(3)>' */
    2.22 -                    int dev = (callback_irq >> 3) & 0x1f;
    2.23 -                    viosapic_set_pci_irq(d, dev, 0, 1);
    2.24 -                    viosapic_set_pci_irq(d, dev, 0, 0);
    2.25 +                if ((uint8_t)(callback_irq >> 56) == 1) {
    2.26 +                    /* case of using PCI INTx line as callback irq */
    2.27 +                    int pdev = (callback_irq >> 11) & 0x1f;
    2.28 +                    int pintx = callback_irq & 3;
    2.29 +                    viosapic_set_pci_irq(d, pdev, pintx, 1);
    2.30 +                    viosapic_set_pci_irq(d, pdev, pintx, 0);
    2.31                  } else {
    2.32                      /* case of using GSI as callback irq */
    2.33                      viosapic_set_irq(d, callback_irq, 1);
     3.1 --- a/xen/include/public/arch-ia64.h	Mon Feb 05 15:41:58 2007 -0700
     3.2 +++ b/xen/include/public/arch-ia64.h	Tue Feb 06 09:26:25 2007 -0700
     3.3 @@ -64,10 +64,6 @@ 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 IA64_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