xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] x86: Add a new physdev_op PHYSDEVOP_nr_irqs_gsi
@ 2012-04-10 15:13 Lin Ming
  2012-04-10 15:33 ` Jan Beulich
  0 siblings, 1 reply; 9+ messages in thread
From: Lin Ming @ 2012-04-10 15:13 UTC (permalink / raw)
  To: xen-devel; +Cc: Xiantao Zhang, Konrad Rzeszutek Wilk

This new physdev_op is added for Linux guest kernel to get the correct
nr_irqs_gsi value.

See below Linux kernel patch for detail explanation.

[RFC PATCH] xen: get correct nr_irqs_gsi value from hypervisor
http://marc.info/?l=xen-devel&m=133407004503365&w=2

Signed-off-by: Lin Ming <mlin@ss.pku.edu.cn>
---
 xen/arch/x86/physdev.c       |    8 ++++++++
 xen/include/public/physdev.h |    6 ++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 05fff9e..0912db0 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -688,6 +688,14 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
                               setup_gsi.polarity);
         break; 
     }
+    case PHYSDEVOP_nr_irqs_gsi: {
+        struct physdev_nr_irqs_gsi out;
+
+        out.nr_irqs_gsi = nr_irqs_gsi;
+        ret = copy_to_guest(arg, &out, 1) ? -EFAULT : 0;
+
+        break;
+    }
     case PHYSDEVOP_get_free_pirq: {
         struct physdev_get_free_pirq out;
         struct domain *d;
diff --git a/xen/include/public/physdev.h b/xen/include/public/physdev.h
index b78eeba..7856fc2 100644
--- a/xen/include/public/physdev.h
+++ b/xen/include/public/physdev.h
@@ -312,6 +312,12 @@ struct physdev_pci_device {
 typedef struct physdev_pci_device physdev_pci_device_t;
 DEFINE_XEN_GUEST_HANDLE(physdev_pci_device_t);
 
+#define PHYSDEVOP_nr_irqs_gsi           29
+struct physdev_nr_irqs_gsi {
+    /* OUT */
+    uint32_t nr_irqs_gsi;
+};
+
 /*
  * Notify that some PIRQ-bound event channels have been unmasked.
  * ** This command is obsolete since interface version 0x00030202 and is **
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-04-11 13:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-10 15:13 [RFC PATCH] x86: Add a new physdev_op PHYSDEVOP_nr_irqs_gsi Lin Ming
2012-04-10 15:33 ` Jan Beulich
2012-04-10 15:50   ` Lin Ming
2012-04-10 16:04     ` Jan Beulich
2012-04-10 16:21     ` Stefano Stabellini
2012-04-11  0:36       ` Zhang, Xiantao
2012-04-11 11:42         ` Stefano Stabellini
2012-04-11 11:49           ` Ian Campbell
2012-04-11 13:42             ` Konrad Rzeszutek Wilk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).