[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-ia64-devel] [Patch] Follow new interrupt deliver mechanism for PV-on-HVM/IPF



Hi Alex,

Doi.Tsunehisa@xxxxxxxxxxxxxx wrote:
> You (alex.williamson) said:
>>>   I think that the definition should be in xen/include/public/hvm/params.h
>>> or xen/include/public/arch-ia64.h.
>>>
>>>   What do you think about this ?
>>    It's ia64 specific, so arch-ia64.h seems more appropriate.
> 
>   Thank you for your advice. I'll modify the code with your opinion.

  I modified this patch, and tested it.

>> Just an
>> FYI, I think we're close enough to when Keir wants to make a final 3.0.4
>> release that I don't plan to request another pull of the xen-ia64 tree
>> unless it's absolutely necessary.  If you think this is necessary for
>> 3.0.4, please provide justification.  Thanks,
> 
>   In current xen-ia64 tree, PV-on-HVM feature does not work, thus
> this fix is necessary, I think.

  My opinion is that..

  * New interrupt deliver mechanism broke PV-on-HVM feature, thus
    it doesn't work with current xen-ia64 tree.
  * This fix is necessary for re-enabling PV-on-HVM feature on IPF.

Thanks,
- Tsunehisa Doi
# HG changeset patch
# User Doi.Tsunehisa@xxxxxxxxxxxxxx
# Node ID 6870c9948e5c63cd9ba8d9427b70f91ec467605e
# Parent  934315daf75988b8b5b6cc370d6114ec014ed20b
Follow new interrupt deliver mechanism for PV-on-HVM/IPF (driver side)

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

diff -r 934315daf759 -r 6870c9948e5c 
unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c  Wed Dec 20 
11:36:49 2006 +0900
+++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c  Wed Dec 20 
11:38:31 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 | HVM_PARAM_CALLBACK_IRQ_USING_RID;
 #else /* !__ia64__ */
        return pdev->irq;
 #endif
# HG changeset patch
# User Doi.Tsunehisa@xxxxxxxxxxxxxx
# Node ID 934315daf75988b8b5b6cc370d6114ec014ed20b
# Parent  c3b455c4676c6446cd541d4c67a521609d046ddb
Follow new interrupt deliver mechanism for PV-on-HVM/IPF (hypervisor side)

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

diff -r c3b455c4676c -r 934315daf759 xen/arch/ia64/vmx/vmx_process.c
--- a/xen/arch/ia64/vmx/vmx_process.c   Tue Dec 19 13:31:48 2006 -0700
+++ b/xen/arch/ia64/vmx/vmx_process.c   Wed Dec 20 11:36:49 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 & HVM_PARAM_CALLBACK_IRQ_USING_RID) {
+                    /* case of using Requester-ID as callback irq */
+                    /* RID: '<#bus(8)><#dev(5)><#func(3)>' */
+                    int rid = callback_irq & ~HVM_PARAM_CALLBACK_IRQ_USING_RID;
+                    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);
+                }
             }
         }
 
diff -r c3b455c4676c -r 934315daf759 xen/include/public/arch-ia64.h
--- a/xen/include/public/arch-ia64.h    Tue Dec 19 13:31:48 2006 -0700
+++ b/xen/include/public/arch-ia64.h    Wed Dec 20 11:36:49 2006 +0900
@@ -61,6 +61,10 @@ 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 HVM_PARAM_CALLBACK_IRQ_USING_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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.