Skip to contentSkip to conversation

xen: arm: document which hypercalls (and subops) are supported on ARM

PATCH In review Ian Campbell 5 participants 12 messages Jul 22, 2013 – Aug 8, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: arm: document which hypercalls (and subops) are supported on ARM

From: Ian Campbell <[email protected]>

There are many hypercalls which make no sense or which are not supported on ARM systems but it's not all that obvious which ones we do support. So lets try and document the hypercalls which are useful on ARM.

I'm not sure this is the best way to go about this, I'm open to other ideas.

---
 xen/include/public/arch-arm.h | 66 +++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 64 insertions(+), 2 deletions(-)
xen/include/public/arch-arm.h +64 -2
index 8aa62d3..b4a20bb 100644
@@ -27,8 +27,8 @@
 #ifndef __XEN_PUBLIC_ARCH_ARM_H__
 #define __XEN_PUBLIC_ARCH_ARM_H__
 
-/* hypercall calling convention
- * ----------------------------
+/*
+ * `incontents 50 arm_abi Hypercall Calling Convention
  *
  * A hypercall is issued using the ARM HVC instruction.
  *
@@ -60,6 +60,68 @@
  * hypercall arguments are always little endian.
  */
 
+/*
+ * `incontents 55 arm_hcall Supported Hypercalls
+ *
+ * Xen on ARM makes extensive use of hardware facilities and therefore
+ * only a subset of the potential hypercalls are required.
+ *
+ * Since ARM uses second stage paging any machine/physical addresses
+ * passed to hypercalls are Guest Physical Addresses (Intermediate
+ * Physical Addresses) unless otherwise noted.
+ *
+ * The following hypercalls (and sub operations) are supported on the
+ * ARM platform. Other hypercalls should be considered
+ * unavailable/unsupported.
+ *
+ *  HYPERVISOR_memory_op
+ *   All generic sub-operations.
+ *
+ *   In addition the following arch specific sub-ops:
+ *    * XENMEM_add_to_physmap
+ *    * XENMEM_add_to_physmap_range
+ *
+ *  HYPERVISOR_domctl
+ *   All generic sub-operations, with the exception of:
+ *    * XEN_DOMCTL_iomem_permission (not yet implemented)
+ *    * XEN_DOMCTL_irq_permission (not yet implemented)
+ *
+ *  HYPERVISOR_sched_op
+ *   All generic sub-operations, with the exception of:
+ *    * SCHEDOP_block -- prefer wfi hardware instruction
+ *
+ *  HYPERVISOR_console_io
+ *   All generic sub-operations
+ *
+ *  HYPERVISOR_xen_version
+ *   All generic sub-operations
+ *
+ *  HYPERVISOR_event_channel_op
+ *   All generic sub-operations
+ *
+ *  HYPERVISOR_physdev_op
+ *   No sub-operations are currenty supported
+ *
+ *  HYPERVISOR_sysctl
+ *   All generic sub-operations, with the exception of:
+ *    * XEN_SYSCTL_page_offline_op
+ *    * XEN_SYSCTL_get_pmstat
+ *    * XEN_SYSCTL_pm_op
+ *
+ *  HYPERVISOR_hvm_op
+ *   Exactly these sub-operations are supported:
+ *    * HVMOP_set_param
+ *    * HVMOP_get_param
+ *
+ *  HYPERVISOR_grant_table_op
+ *   All generic sub-operations
+ *
+ *  HYPERVISOR_vcpu_op
+ *   Exactly these sub-operations are supported:
+ *    * VCPUOP_register_vcpu_info
+ *    * VCPUOP_register_runstate_memory_area
+ */
+
 #define XEN_HYPERCALL_TAG   0XEA1
 
 #define uint64_aligned_t uint64_t __attribute__((aligned(8)))
Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 84 lines · Ian Campbell

From: Ian Campbell <[email protected]>

There are many hypercalls which make no sense or which are not supported on ARM systems but it's not all that obvious which ones we do support. So lets try and document the hypercalls which are useful on ARM.

I'm not sure this is the best way to go about this, I'm open to other ideas.

---
 xen/include/public/arch-arm.h | 66 +++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 64 insertions(+), 2 deletions(-)
xen/include/public/arch-arm.h +54 -2
index 8aa62d3..b4a20bb 100644
@@ -27,8 +27,8 @@
 #ifndef __XEN_PUBLIC_ARCH_ARM_H__
 #define __XEN_PUBLIC_ARCH_ARM_H__
 
-/* hypercall calling convention
- * ----------------------------
+/*
+ * `incontents 50 arm_abi Hypercall Calling Convention
  *
  * A hypercall is issued using the ARM HVC instruction.
  *
@@ -60,6 +60,68 @@
  * hypercall arguments are always little endian.
  */
 
+/*
+ * `incontents 55 arm_hcall Supported Hypercalls
+ *
+ * Xen on ARM makes extensive use of hardware facilities and therefore
+ * only a subset of the potential hypercalls are required.
+ *
+ * Since ARM uses second stage paging any machine/physical addresses
+ * passed to hypercalls are Guest Physical Addresses (Intermediate
+ * Physical Addresses) unless otherwise noted.
+ *
+ * The following hypercalls (and sub operations) are supported on the
+ * ARM platform. Other hypercalls should be considered
+ * unavailable/unsupported.
+ *
+ *  HYPERVISOR_memory_op
+ *   All generic sub-operations.
+ *
+ *   In addition the following arch specific sub-ops:
+ *    * XENMEM_add_to_physmap
+ *    * XENMEM_add_to_physmap_range
+ *
+ *  HYPERVISOR_domctl
+ *   All generic sub-operations, with the exception of:
+ *    * XEN_DOMCTL_iomem_permission (not yet implemented)
+ *    * XEN_DOMCTL_irq_permission (not yet implemented)
+ *
+ *  HYPERVISOR_sched_op
+ *   All generic sub-operations, with the exception of:
+ *    * SCHEDOP_block -- prefer wfi hardware instruction
+ *
+ *  HYPERVISOR_console_io
+ *   All generic sub-operations
+ *
+ *  HYPERVISOR_xen_version
+ *   All generic sub-operations
+ *
+ *  HYPERVISOR_event_channel_op
+ *   All generic sub-operations
+ *
+ *  HYPERVISOR_physdev_op
+ *   No sub-operations are currenty supported
+ *
+ *  HYPERVISOR_sysctl
+ *   All generic sub-operations, with the exception of:
+ *    * XEN_SYSCTL_page_offline_op
+ *    * XEN_SYSCTL_get_pmstat
+ *    * XEN_SYSCTL_pm_op
+ *
+ *  HYPERVISOR_hvm_op
+ *   Exactly these sub-operations are supported:
+ *    * HVMOP_set_param
+ *    * HVMOP_get_param

xen/include/public/arch-arm.h line 124

Quoted 10 lines
xen/include/public/arch-arm.h +10 -0
+ *
+ *  HYPERVISOR_grant_table_op
+ *   All generic sub-operations
+ *
+ *  HYPERVISOR_vcpu_op
+ *   Exactly these sub-operations are supported:
+ *    * VCPUOP_register_vcpu_info
+ *    * VCPUOP_register_runstate_memory_area
+ */
+

You are missing all the common tmem ops.

#2 lore raw
Quoted 1 line · Stefano Stabellini

You are missing all the common tmem ops.

tmem_ops are not hooked up in arm_hypercall_table, so they are currently not supported. We should add them here when we add the necessary support. ISTR stubbing out some functions which are used by tmem (steal_page and donate_page perhaps?) so it's not just a case or wiring it up either.

Ian.

#3 lore raw
Quoted 9 lines · Ian Campbell
Quoted 1 line · Stefano Stabellini

You are missing all the common tmem ops.

tmem_ops are not hooked up in arm_hypercall_table, so they are currently not supported. We should add them here when we add the necessary support. ISTR stubbing out some functions which are used by tmem (steal_page and donate_page perhaps?) so it's not just a case or wiring it up either.

Right.. I was confused by the fact that we do compile tmem_op in Linux, even though XEN_TMEM is actually not available on ARM or ARM64

#4 lore raw
Quoted 5 lines · Stefano Stabellini
Quoted 4 lines · Ian Campbell
Quoted 1 line · Stefano Stabellini

You are missing all the common tmem ops.

Quoted 8 lines
Quoted 5 lines

tmem_ops are not hooked up in arm_hypercall_table, so they are currently not supported. We should add them here when we add the necessary support. ISTR stubbing out some functions which are used by tmem (steal_page and donate_page perhaps?) so it's not just a case or wiring it up either.

Right.. I was confused by the fact that we do compile tmem_op in Linux, even though XEN_TMEM is actually not available on ARM or ARM64

It is an attractive option of using TMEM on those platforms - but I hadn't had a chance yet to get my Chromebook setup to work with Xen :-(

(It also did not help that I stepped on it and crushed the LCD).

#5 lore raw
In reply to Stefano Stabellini
Quoted 5 lines · Stefano Stabellini
Quoted 4 lines · Ian Campbell
Quoted 1 line · Stefano Stabellini

You are missing all the common tmem ops.

Quoted 8 lines
Quoted 5 lines

tmem_ops are not hooked up in arm_hypercall_table, so they are currently not supported. We should add them here when we add the necessary support. ISTR stubbing out some functions which are used by tmem (steal_page and donate_page perhaps?) so it's not just a case or wiring it up either.

Right.. I was confused by the fact that we do compile tmem_op in Linux, even though XEN_TMEM is actually not available on ARM or ARM64

I started from the other end and looked at what the hypervisor actually implements rather than what Linux calls. It's useful to validate from both angles though. For now I think we should stick with documenting what the hypervisor provides even if the kernel might try and optimistically call other stuff too.

Ian.

#6 lore raw
Quoted 12 lines · Ian Campbell
Quoted 11 lines · Stefano Stabellini
Quoted 9 lines · Ian Campbell
Quoted 1 line · Stefano Stabellini

You are missing all the common tmem ops.

tmem_ops are not hooked up in arm_hypercall_table, so they are currently not supported. We should add them here when we add the necessary support. ISTR stubbing out some functions which are used by tmem (steal_page and donate_page perhaps?) so it's not just a case or wiring it up either.

Quoted 8 lines
Quoted 2 lines

Right.. I was confused by the fact that we do compile tmem_op in Linux, even though XEN_TMEM is actually not available on ARM or ARM64

I started from the other end and looked at what the hypervisor actually implements rather than what Linux calls. It's useful to validate from both angles though. For now I think we should stick with documenting what the hypervisor provides even if the kernel might try and optimistically call other stuff too.

So did we decide whether to run with this patch or not?

Ian.

#7 lore raw
Quoted 16 lines · Ian Campbell
Quoted 15 lines · Ian Campbell
Quoted 13 lines · Stefano Stabellini
Quoted 9 lines · Ian Campbell
Quoted 1 line · Stefano Stabellini

You are missing all the common tmem ops.

tmem_ops are not hooked up in arm_hypercall_table, so they are currently not supported. We should add them here when we add the necessary support. ISTR stubbing out some functions which are used by tmem (steal_page and donate_page perhaps?) so it's not just a case or wiring it up either.

Right.. I was confused by the fact that we do compile tmem_op in Linux, even though XEN_TMEM is actually not available on ARM or ARM64

Quoted 7 lines
Quoted 5 lines

I started from the other end and looked at what the hypervisor actually implements rather than what Linux calls. It's useful to validate from both angles though. For now I think we should stick with documenting what the hypervisor provides even if the kernel might try and optimistically call other stuff too.

So did we decide whether to run with this patch or not?

I would say a better option is to just disable by default tmem in Xen hypervisor for ARM. So even if you boot with 'tmem=1' nothing will happen.

That way when I get an ARM box up and I can test tmem we can just revert that simple patch without much trouble.

#8 lore raw
Quoted 23 lines · Konrad Rzeszutek Wilk
Quoted 22 lines · Ian Campbell
Quoted 20 lines · Ian Campbell
Quoted 5 lines · Stefano Stabellini
Quoted 4 lines · Ian Campbell
Quoted 1 line · Stefano Stabellini

You are missing all the common tmem ops.

Quoted 8 lines
Quoted 5 lines

tmem_ops are not hooked up in arm_hypercall_table, so they are currently not supported. We should add them here when we add the necessary support. ISTR stubbing out some functions which are used by tmem (steal_page and donate_page perhaps?) so it's not just a case or wiring it up either.

Right.. I was confused by the fact that we do compile tmem_op in Linux, even though XEN_TMEM is actually not available on ARM or ARM64

I started from the other end and looked at what the hypervisor actually implements rather than what Linux calls. It's useful to validate from both angles though. For now I think we should stick with documenting what the hypervisor provides even if the kernel might try and optimistically call other stuff too.

Quoted 7 lines
Quoted 1 line

So did we decide whether to run with this patch or not?

I would say a better option is to just disable by default tmem in Xen hypervisor for ARM. So even if you boot with 'tmem=1' nothing will happen.

That way when I get an ARM box up and I can test tmem we can just revert that simple patch without much trouble.

The "this patch" I was talking about was the original documentation only patch at the root of this thread which has nothing to do with tmem.

What we want to do with tmem on ARM is a different question. If you want to start a separate thread on that topic please feel free.

Ian.

#9 lore raw
In reply to Ian Campbell

ping?

There was some discussion but I think the conclusion was to go with this version, but no acks yet.

Quoted 97 lines · Ian Campbell

From: Ian Campbell <[email protected]>

There are many hypercalls which make no sense or which are not supported on ARM systems but it's not all that obvious which ones we do support. So lets try and document the hypercalls which are useful on ARM.

I'm not sure this is the best way to go about this, I'm open to other ideas.

---
 xen/include/public/arch-arm.h | 66 +++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 64 insertions(+), 2 deletions(-)
xen/include/public/arch-arm.h +64 -2
index 8aa62d3..b4a20bb 100644
@@ -27,8 +27,8 @@
 #ifndef __XEN_PUBLIC_ARCH_ARM_H__
 #define __XEN_PUBLIC_ARCH_ARM_H__
 
-/* hypercall calling convention
- * ----------------------------
+/*
+ * `incontents 50 arm_abi Hypercall Calling Convention
  *
  * A hypercall is issued using the ARM HVC instruction.
  *
@@ -60,6 +60,68 @@
  * hypercall arguments are always little endian.
  */
 
+/*
+ * `incontents 55 arm_hcall Supported Hypercalls
+ *
+ * Xen on ARM makes extensive use of hardware facilities and therefore
+ * only a subset of the potential hypercalls are required.
+ *
+ * Since ARM uses second stage paging any machine/physical addresses
+ * passed to hypercalls are Guest Physical Addresses (Intermediate
+ * Physical Addresses) unless otherwise noted.
+ *
+ * The following hypercalls (and sub operations) are supported on the
+ * ARM platform. Other hypercalls should be considered
+ * unavailable/unsupported.
+ *
+ *  HYPERVISOR_memory_op
+ *   All generic sub-operations.
+ *
+ *   In addition the following arch specific sub-ops:
+ *    * XENMEM_add_to_physmap
+ *    * XENMEM_add_to_physmap_range
+ *
+ *  HYPERVISOR_domctl
+ *   All generic sub-operations, with the exception of:
+ *    * XEN_DOMCTL_iomem_permission (not yet implemented)
+ *    * XEN_DOMCTL_irq_permission (not yet implemented)
+ *
+ *  HYPERVISOR_sched_op
+ *   All generic sub-operations, with the exception of:
+ *    * SCHEDOP_block -- prefer wfi hardware instruction
+ *
+ *  HYPERVISOR_console_io
+ *   All generic sub-operations
+ *
+ *  HYPERVISOR_xen_version
+ *   All generic sub-operations
+ *
+ *  HYPERVISOR_event_channel_op
+ *   All generic sub-operations
+ *
+ *  HYPERVISOR_physdev_op
+ *   No sub-operations are currenty supported
+ *
+ *  HYPERVISOR_sysctl
+ *   All generic sub-operations, with the exception of:
+ *    * XEN_SYSCTL_page_offline_op
+ *    * XEN_SYSCTL_get_pmstat
+ *    * XEN_SYSCTL_pm_op
+ *
+ *  HYPERVISOR_hvm_op
+ *   Exactly these sub-operations are supported:
+ *    * HVMOP_set_param
+ *    * HVMOP_get_param
+ *
+ *  HYPERVISOR_grant_table_op
+ *   All generic sub-operations
+ *
+ *  HYPERVISOR_vcpu_op
+ *   Exactly these sub-operations are supported:
+ *    * VCPUOP_register_vcpu_info
+ *    * VCPUOP_register_runstate_memory_area
+ */
+
 #define XEN_HYPERCALL_TAG   0XEA1
 
 #define uint64_aligned_t uint64_t __attribute__((aligned(8)))
Acked-by
#10 lore raw
Quoted 1 line · Ian Campbell

ping?

Quoted 108 lines

There was some discussion but I think the conclusion was to go with this version, but no acks yet.

Quoted 87 lines · Ian Campbell

From: Ian Campbell <[email protected]>

There are many hypercalls which make no sense or which are not supported on ARM systems but it's not all that obvious which ones we do support. So lets try and document the hypercalls which are useful on ARM.

I'm not sure this is the best way to go about this, I'm open to other ideas.

---
 xen/include/public/arch-arm.h | 66 +++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 64 insertions(+), 2 deletions(-)
xen/include/public/arch-arm.h +57 -2
index 8aa62d3..b4a20bb 100644
@@ -27,8 +27,8 @@
 #ifndef __XEN_PUBLIC_ARCH_ARM_H__
 #define __XEN_PUBLIC_ARCH_ARM_H__
 
-/* hypercall calling convention
- * ----------------------------
+/*
+ * `incontents 50 arm_abi Hypercall Calling Convention
  *
  * A hypercall is issued using the ARM HVC instruction.
  *
@@ -60,6 +60,68 @@
  * hypercall arguments are always little endian.
  */
 
+/*
+ * `incontents 55 arm_hcall Supported Hypercalls
+ *
+ * Xen on ARM makes extensive use of hardware facilities and therefore
+ * only a subset of the potential hypercalls are required.
+ *
+ * Since ARM uses second stage paging any machine/physical addresses
+ * passed to hypercalls are Guest Physical Addresses (Intermediate
+ * Physical Addresses) unless otherwise noted.
+ *
+ * The following hypercalls (and sub operations) are supported on the
+ * ARM platform. Other hypercalls should be considered
+ * unavailable/unsupported.
+ *
+ *  HYPERVISOR_memory_op
+ *   All generic sub-operations.
+ *
+ *   In addition the following arch specific sub-ops:
+ *    * XENMEM_add_to_physmap
+ *    * XENMEM_add_to_physmap_range
+ *
+ *  HYPERVISOR_domctl
+ *   All generic sub-operations, with the exception of:
+ *    * XEN_DOMCTL_iomem_permission (not yet implemented)
+ *    * XEN_DOMCTL_irq_permission (not yet implemented)
+ *
+ *  HYPERVISOR_sched_op
+ *   All generic sub-operations, with the exception of:
+ *    * SCHEDOP_block -- prefer wfi hardware instruction
+ *
+ *  HYPERVISOR_console_io
+ *   All generic sub-operations
+ *
+ *  HYPERVISOR_xen_version
+ *   All generic sub-operations
+ *
+ *  HYPERVISOR_event_channel_op
+ *   All generic sub-operations
+ *
+ *  HYPERVISOR_physdev_op
+ *   No sub-operations are currenty supported
+ *
+ *  HYPERVISOR_sysctl
+ *   All generic sub-operations, with the exception of:
+ *    * XEN_SYSCTL_page_offline_op
+ *    * XEN_SYSCTL_get_pmstat
+ *    * XEN_SYSCTL_pm_op
+ *
+ *  HYPERVISOR_hvm_op
+ *   Exactly these sub-operations are supported:
+ *    * HVMOP_set_param
+ *    * HVMOP_get_param
+ *
+ *  HYPERVISOR_grant_table_op
+ *   All generic sub-operations

xen/include/public/arch-arm.h line 127

Quoted 10 lines
xen/include/public/arch-arm.h +7 -0
+ *
+ *  HYPERVISOR_vcpu_op
+ *   Exactly these sub-operations are supported:
+ *    * VCPUOP_register_vcpu_info
+ *    * VCPUOP_register_runstate_memory_area
+ */
+
 #define XEN_HYPERCALL_TAG   0XEA1
 
 #define uint64_aligned_t uint64_t __attribute__((aligned(8)))

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