Skip to contentSkip to conversation

tools/libxc: Fix ARM build broken by XEN_DOMCTL_getvcpuextstate commit

PATCH In review Razvan Cojocaru 2 participants 3 messages Mar 15, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/libxc: Fix ARM build broken by XEN_DOMCTL_getvcpuextstate commit

The previous "tools/libxc: Exposed XEN_DOMCTL_getvcpuextstate" broke the ARM build (the hypercall does not have a corresponding DOMCTL ARM struct). This patch fixes the build by returning -ENODEV for ARM from xc_vcpu_get_extstate().

---
 tools/libxc/xc_domain.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/libxc/xc_domain.c +3 -1
index 71e5d93..c7e8065 100644
@@ -560,7 +560,8 @@ int xc_vcpu_get_extstate(xc_interface *xch,
                          uint32_t vcpu,
                          xc_vcpu_extstate_t *extstate)
 {
-    int rc;
+    int rc = -ENODEV;
+#if defined (__i386) || defined(__x86_64__)
     DECLARE_DOMCTL;
     DECLARE_HYPERCALL_BUFFER(void, buffer);
     bool get_state;
@@ -610,6 +611,7 @@ int xc_vcpu_get_extstate(xc_interface *xch,
 out:
     if ( get_state )
         xc_hypercall_buffer_free(xch, buffer);
+#endif
 
     return rc;
 }
Signature · 7 lines
1.9.1


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Razvan Cojocaru

The previous "tools/libxc: Exposed XEN_DOMCTL_getvcpuextstate" broke the ARM build (the hypercall does not have a corresponding DOMCTL ARM struct). This patch fixes the build by returning -ENODEV for ARM from xc_vcpu_get_extstate().

Quoted 9 lines
---
 tools/libxc/xc_domain.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/libxc/xc_domain.c +0 -0
index 71e5d93..c7e8065 100644

tools/libxc/xc_domain.c int xc_vcpu_get_extstate(xc_interface *xch, · line 564

Quoted 6 lines
tools/libxc/xc_domain.c +2 -1
@@ -560,7 +560,8 @@ int xc_vcpu_get_extstate(xc_interface *xch,
                          uint32_t vcpu,
                          xc_vcpu_extstate_t *extstate)
 {
-    int rc;
+    int rc = -ENODEV;
+#if defined (__i386) || defined(__x86_64__)

This should be __i386__ for consistency.

Assuming you've tested ARM build, I will fix this up while committing.

Quoted 14 lines
tools/libxc/xc_domain.c +1 -0
     DECLARE_DOMCTL;
     DECLARE_HYPERCALL_BUFFER(void, buffer);
     bool get_state;
@@ -610,6 +611,7 @@ int xc_vcpu_get_extstate(xc_interface *xch,
 out:
     if ( get_state )
         xc_hypercall_buffer_free(xch, buffer);
+#endif
 
     return rc;
 }
Signature · 1 line
1.9.1

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#2 lore raw
Quoted 28 lines · Wei Liu
Quoted 6 lines · Razvan Cojocaru

The previous "tools/libxc: Exposed XEN_DOMCTL_getvcpuextstate" broke the ARM build (the hypercall does not have a corresponding DOMCTL ARM struct). This patch fixes the build by returning -ENODEV for ARM from xc_vcpu_get_extstate().

Quoted 9 lines
---
 tools/libxc/xc_domain.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/libxc/xc_domain.c +0 -0
index 71e5d93..c7e8065 100644

tools/libxc/xc_domain.c int xc_vcpu_get_extstate(xc_interface *xch, · line 564

Quoted 6 lines
tools/libxc/xc_domain.c +2 -1
@@ -560,7 +560,8 @@ int xc_vcpu_get_extstate(xc_interface *xch,
                          uint32_t vcpu,
                          xc_vcpu_extstate_t *extstate)
 {
-    int rc;
+    int rc = -ENODEV;
+#if defined (__i386) || defined(__x86_64__)

This should be __i386__ for consistency.

Quoted 1 line

Assuming you've tested ARM build, I will fix this up while committing.

Thank you. I did test it (I've cross-compiled in an ARM chroot).

Thanks,
Razvan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel