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

2006-12-20 Thread Alex Williamson
On Wed, 2006-12-20 at 13:01 +0900, DOI Tsunehisa wrote:
 Hi Alex,
 
 [EMAIL PROTECTED] 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.

   Applied.  As you saw, I forwarded on the patch I committed to Keir
for 3.0.4.  It's a bit late, but we'll see if he adds it.  Thanks,

Alex

-- 
Alex Williamson HP Open Source  Linux Org.


___
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel


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

2006-12-19 Thread DOI Tsunehisa
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 [EMAIL PROTECTED]
# Node ID 656f00fcd551061c268b73bfe9d7b92a2f53bdcc
# Parent  6e68e8a8cc99717b372c482efa0e153e868ae6f4
Follow new interrupt deliver mechanism for PV-on-HVM/IPF (driver side)

Signed-off-by: Tsunehisa Doi [EMAIL PROTECTED]

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 [EMAIL PROTECTED]
# Node ID 8217a7ba6d9adbadeda939756346bcedb080a0f8
# Parent  656f00fcd551061c268b73bfe9d7b92a2f53bdcc
Follow new interrupt deliver mechanism for PV-on-HVM/IPF (hypervisor side)

Signed-off-by: Tsunehisa Doi [EMAIL PROTECTED]

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@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel

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

2006-12-19 Thread Alex Williamson
On Tue, 2006-12-19 at 20:01 +0900, DOI Tsunehisa wrote:
 --- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.cMon Dec 
 18 10:56:34 2006 -0700
 +++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.cTue 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) */

   Ok, except (1  31) needs to be defined in a common header somewhere
so it's not just a random magic bit.  Thanks,

Alex

-- 
Alex Williamson HP Open Source  Linux Org.


___
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel


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

2006-12-19 Thread Doi . Tsunehisa
Hi Alex,

  Thank you for your comment.

You (alex.williamson) said:
 +return rid | (1  31); /* with RID marker(MSB) */
 
Ok, except (1  31) needs to be defined in a common header somewhere
 so it's not just a random magic bit.  Thanks,

  I agree it.

  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 ?

- Tsunehisa Doi

___
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel


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

2006-12-19 Thread Alex Williamson
On Wed, 2006-12-20 at 08:29 +0900, [EMAIL PROTECTED] wrote:
 Hi Alex,
 
   Thank you for your comment.
 
 You (alex.williamson) said:
  +  return rid | (1  31); /* with RID marker(MSB) */
  
 Ok, except (1  31) needs to be defined in a common header somewhere
  so it's not just a random magic bit.  Thanks,
 
   I agree it.
 
   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.  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,

Alex

-- 
Alex Williamson HP Open Source  Linux Org.


___
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel


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

2006-12-19 Thread Doi . Tsunehisa
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.

 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.

Thanks,
- Tsunehisa Doi

___
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel


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

2006-12-19 Thread DOI Tsunehisa
Hi Alex,

[EMAIL PROTECTED] 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 [EMAIL PROTECTED]
# Node ID 6870c9948e5c63cd9ba8d9427b70f91ec467605e
# Parent  934315daf75988b8b5b6cc370d6114ec014ed20b
Follow new interrupt deliver mechanism for PV-on-HVM/IPF (driver side)

Signed-off-by: Tsunehisa Doi [EMAIL PROTECTED]

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 [EMAIL PROTECTED]
# Node ID 934315daf75988b8b5b6cc370d6114ec014ed20b
# Parent  c3b455c4676c6446cd541d4c67a521609d046ddb
Follow new interrupt deliver mechanism for PV-on-HVM/IPF (hypervisor side)

Signed-off-by: Tsunehisa Doi [EMAIL PROTECTED]

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.hTue Dec 19 13:31:48 2006 -0700
+++ b/xen/include/public/arch-ia64.hWed Dec 20 11:36:49 2006 +0900
@@ -61,6 +61,10 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
 #define VIRQ_ITCVIRQ_ARCH_0 /* V. Virtual itc timer */
 #define VIRQ_MCA_CMCVIRQ_ARCH_1 /* MCA cmc interrupt */
 #define VIRQ_MCA_CPEVIRQ_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@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel