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

[xen staging] tools/libxc: use uint32_t for pirq in xc_domain_irq_permission



commit 73c932d0ea43ddf904db9429811788480c4cb816
Author:     Igor Druzhinin <igor.druzhinin@xxxxxxxxxx>
AuthorDate: Tue Jul 13 02:31:41 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Mon Jul 26 10:32:04 2021 +0100

    tools/libxc: use uint32_t for pirq in xc_domain_irq_permission
    
    Current unit8_t for pirq argument in this interface is too restrictive
    causing failures on modern hardware with lots of GSIs. That extends down to
    XEN_DOMCTL_irq_permission ABI structure where it needs to be fixed up
    as well.
    
    Internal Xen structures appear to be fine. Existing users of the interface
    in tree (libxl, ocaml and python bindings) are currently using signed int
    for pirq representation which should be wide enough. Converting them to
    uint32_t now is desirable to avoid accidental passing of a negative
    number (probably denoting an error code) by caller as pirq, but left for
    the future clean up.
    
    Domctl interface version is needed to be bumped with this change but that
    was already done by 918b8842a8 ("arm64: Change type of hsr, cpsr, spsr_el1
    to uint64_t") in this release cycle.
    
    Additionally, take a change and convert allow_access argument to bool.
    
    Signed-off-by: Igor Druzhinin <igor.druzhinin@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Christian Lindig <christian.lindig@xxxxxxxxxx>
    Acked-by: Julien Grall <jgrall@xxxxxxxxxx>
---
 tools/include/xenctrl.h             | 4 ++--
 tools/libs/ctrl/xc_domain.c         | 4 ++--
 tools/ocaml/libs/xc/xenctrl_stubs.c | 4 ++--
 xen/include/public/domctl.h         | 3 ++-
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index 2a7c836a02..14adaa0c10 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1385,8 +1385,8 @@ int xc_domain_ioport_permission(xc_interface *xch,
 
 int xc_domain_irq_permission(xc_interface *xch,
                              uint32_t domid,
-                             uint8_t pirq,
-                             uint8_t allow_access);
+                             uint32_t pirq,
+                             bool allow_access);
 
 int xc_domain_iomem_permission(xc_interface *xch,
                                uint32_t domid,
diff --git a/tools/libs/ctrl/xc_domain.c b/tools/libs/ctrl/xc_domain.c
index 3803871538..a20e081b51 100644
--- a/tools/libs/ctrl/xc_domain.c
+++ b/tools/libs/ctrl/xc_domain.c
@@ -1385,8 +1385,8 @@ int xc_vcpu_setcontext(xc_interface *xch,
 
 int xc_domain_irq_permission(xc_interface *xch,
                              uint32_t domid,
-                             uint8_t pirq,
-                             uint8_t allow_access)
+                             uint32_t pirq,
+                             bool allow_access)
 {
     DECLARE_DOMCTL;
 
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c 
b/tools/ocaml/libs/xc/xenctrl_stubs.c
index a6756c4a8c..dd09cb90aa 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -1075,8 +1075,8 @@ CAMLprim value stub_xc_domain_irq_permission(value xch, 
value domid,
                                             value pirq, value allow)
 {
        CAMLparam4(xch, domid, pirq, allow);
-       uint8_t c_pirq;
-       uint8_t c_allow;
+       uint32_t c_pirq;
+       bool c_allow;
        int ret;
 
        c_pirq = Int_val(pirq);
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index d576bfabd6..96696e3842 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -441,8 +441,9 @@ struct xen_domctl_setdebugging {
 
 /* XEN_DOMCTL_irq_permission */
 struct xen_domctl_irq_permission {
-    uint8_t pirq;
+    uint32_t pirq;
     uint8_t allow_access;    /* flag to specify enable/disable of IRQ access */
+    uint8_t pad[3];
 };
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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