WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

Re: [Xen-ia64-devel] [Patch] Modify for compiling PV-on-HVM and followin

To: Alex Williamson <alex.williamson@xxxxxx>
Subject: Re: [Xen-ia64-devel] [Patch] Modify for compiling PV-on-HVM and following callback_via
From: DOI Tsunehisa <Doi.Tsunehisa@xxxxxxxxxxxxxx>
Date: Tue, 06 Feb 2007 16:11:25 +0900
Cc: xen-ia64-devel <xen-ia64-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 05 Feb 2007 23:09:46 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1170742449.30297.4.camel@bling>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
References: <45C6BF26.2060107@xxxxxxxxxxxxxx> <1170715895.20903.29.camel@xxxxxxxxxxxxx> <200702060325.l163PmX09791@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <1170742449.30297.4.camel@bling>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.9 (Windows/20061207)
Hi Alex,

Alex Williamson wrote:
>    IMHO, if it's #if 0'd out, it's not really adding to backwards
> compatibility anyway.  This wasn't in 3.0.4, so I think we should
> probably drop it.  Thanks,

  I agree. I've modified the patch.

Thanks,
- Tsunehisa Doi
# HG changeset patch
# User Doi.Tsunehisa@xxxxxxxxxxxxxx
# Date 1170745418 -32400
# Node ID 32d787da5ff555fb8991ccbb97c75897a9595bbd
# Parent  d7f7021902a2c6b5beee0abfdbdc89fce7892450
Follow to allow PV-on-HVM callback irq to be identified by PCI device.
and delete IA64 specific spec concerned with IA64_CALLBACK_IRQ_RID.

Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@xxxxxxxxxxxxxx>

diff -r d7f7021902a2 -r 32d787da5ff5 
unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c  Mon Feb 05 
15:41:58 2007 -0700
+++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c  Tue Feb 06 
16:03:38 2007 +0900
@@ -181,23 +181,18 @@ static int get_hypercall_stubs(void)
 
 static uint64_t get_callback_via(struct pci_dev *pdev)
 {
+       u8 pin;
 #ifdef __ia64__
        int irq, rid;
        for (irq = 0; irq < 16; irq++) {
                if (isa_irq_to_vector(irq) == pdev->irq)
-                       return irq;
-       }
-       /* 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 | IA64_CALLBACK_IRQ_RID;
+                       return irq; /* ISA IRQ */
+       }
 #else /* !__ia64__ */
-       u8 pin;
 
        if (pdev->irq < 16)
                return pdev->irq; /* ISA IRQ */
+#endif
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
        pin = pdev->pin;
@@ -211,7 +206,6 @@ static uint64_t get_callback_via(struct 
                ((uint64_t)pdev->bus->number << 16) |
                ((uint64_t)(pdev->devfn & 0xff) << 8) |
                ((uint64_t)(pin - 1) & 3));
-#endif
 }
 
 /* Invalidate foreign mappings (e.g., in qemu-based device model). */
diff -r d7f7021902a2 -r 32d787da5ff5 xen/arch/ia64/vmx/vmx_process.c
--- a/xen/arch/ia64/vmx/vmx_process.c   Mon Feb 05 15:41:58 2007 -0700
+++ b/xen/arch/ia64/vmx/vmx_process.c   Tue Feb 06 16:03:38 2007 +0900
@@ -227,17 +227,23 @@ void leave_hypervisor_tail(void)
         local_irq_disable();
 
         if (v->vcpu_id == 0) {
-            int callback_irq =
+            unsigned long callback_irq =
                 d->arch.hvm_domain.params[HVM_PARAM_CALLBACK_IRQ];
+            /*
+             * val[63:56] == 1: val[55:0] is a delivery PCI INTx line:
+             *                  Domain = val[47:32], Bus  = val[31:16],
+             *                  DevFn  = val[15: 8], IntX = val[ 1: 0]
+             * val[63:56] == 0: val[55:0] is a delivery as GSI
+             */
             if (callback_irq != 0 && local_events_need_delivery()) {
                 /* change level for para-device callback irq */
                 /* use level irq to send discrete event */
-                if (callback_irq & IA64_CALLBACK_IRQ_RID) {
-                    /* case of using Requester-ID as callback irq */
-                    /* RID: '<#bus(8)><#dev(5)><#func(3)>' */
-                    int dev = (callback_irq >> 3) & 0x1f;
-                    viosapic_set_pci_irq(d, dev, 0, 1);
-                    viosapic_set_pci_irq(d, dev, 0, 0);
+                if ((uint8_t)(callback_irq >> 56) == 1) {
+                    /* case of using PCI INTx line as callback irq */
+                    int pdev = (callback_irq >> 11) & 0x1f;
+                    int pintx = callback_irq & 3;
+                    viosapic_set_pci_irq(d, pdev, pintx, 1);
+                    viosapic_set_pci_irq(d, pdev, pintx, 0);
                 } else {
                     /* case of using GSI as callback irq */
                     viosapic_set_irq(d, callback_irq, 1);
diff -r d7f7021902a2 -r 32d787da5ff5 xen/include/public/arch-ia64.h
--- a/xen/include/public/arch-ia64.h    Mon Feb 05 15:41:58 2007 -0700
+++ b/xen/include/public/arch-ia64.h    Tue Feb 06 16:03:38 2007 +0900
@@ -63,10 +63,6 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
 #define VIRQ_ITC        VIRQ_ARCH_0 /* V. Virtual itc timer */
 #define VIRQ_MCA_CMC    VIRQ_ARCH_1 /* MCA cmc interrupt */
 #define VIRQ_MCA_CPE    VIRQ_ARCH_2 /* MCA cpe interrupt */
-
-/* Arch specific callback irq definition */
-/* using Requester-ID(RID) as callback irq */
-#define IA64_CALLBACK_IRQ_RID        (1 << 31)
 
 /* Maximum number of virtual CPUs in multi-processor guests. */
 /* WARNING: before changing this, check that shared_info fits on a page */
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel