xen: public interface (and foreign check) changes for arm
v2 cover xen: public interface (and foreign check) changes for arm
Changes in v2 are to the first patch which I botched a fair bit in the first cut.
The main change here is to switch evtchns to xen_ulong_t on arm, this enables us to have the same interface on arm32 and arm64. I will post a Linux side series shortly. This is an ABI change for ARM but not x86.
The remainder of the series fixes the tools/include/xen-foreign checks to cover more stuff on ARM.
As part of this I have moved start_info out of the generic public headers and into x86-specific public headers -- ARM does not use this struct in its ABI and the majority of start_info is PV MMU stuff. Removing it from ARM means I don't have to worry about the unsigned longs in there.
PATCH v2 1/4 tools: s/arm/arm32/ in foreign header checks.
Also define __arm__ARM32 as required.
---
v2: s/x86_32/arm32/ in the right place
s/__arm__ARM32/__arm___ARM32/
Update gitignore
---
.gitignore | 2 +-
tools/include/xen-foreign/Makefile | 4 ++--
tools/include/xen-foreign/mkheader.py | 6 +++++-
tools/include/xen-foreign/reference.size | 2 +-
4 files changed, 9 insertions(+), 5 deletions(-).gitignore +1 -1
@@ -363,7 +363,7 @@ tools/include/xen-foreign/checker.c tools/include/xen-foreign/structs.pyc tools/include/xen-foreign/x86_32.h tools/include/xen-foreign/x86_64.h -tools/include/xen-foreign/arm.h +tools/include/xen-foreign/arm32.h .git tools/misc/xen-hptool
tools/include/xen-foreign/Makefile +2 -2
@@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk ROOT = $(XEN_ROOT)/xen/include/public -architectures := arm x86_32 x86_64 +architectures := arm32 x86_32 x86_64 headers := $(patsubst %, %.h, $(architectures)) .PHONY: all clean check-headers
@@ -22,7 +22,7 @@ check-headers: checker diff -u reference.size tmp.size rm tmp.size -arm.h: mkheader.py structs.py $(ROOT)/arch-arm.h +arm32.h: mkheader.py structs.py $(ROOT)/arch-arm.h $(PYTHON) $< $* $@ $(filter %.h,$^) x86_32.h: mkheader.py structs.py $(ROOT)/arch-x86/xen-x86_32.h $(ROOT)/arch-x86/xen.h $(ROOT)/xen.h
tools/include/xen-foreign/mkheader.py +5 -1
@@ -17,11 +17,15 @@ header = {}; footer = {}; #arm -inttypes["arm"] = { +inttypes["arm32"] = { "unsigned long" : "uint32_t", "long" : "uint32_t", "xen_pfn_t" : "uint64_t", }; +header["arm32"] = """ +#define __arm___ARM32 1 +"""; + # x86_32 inttypes["x86_32"] = {
tools/include/xen-foreign/reference.size +1 -1
@@ -1,5 +1,5 @@ -structs | arm x86_32 x86_64 +structs | arm32 x86_32 x86_64 start_info | - 1112 1168 trap_info | - 8 16
Signature · 1 line
1.7.2.5
Re: [PATCH 1/4] tools: s/arm/arm32/ in foreign header checks.
Quoted 8 lines · Ian Campbell
Also define
__arm__ARM32as required.Signed-off-by Ian Campbell <[email protected]>Cc Jan Beulich <[email protected]>---
v2: s/x86_32/arm32/ in the right places/__arm__ARM32/__arm___ARM32/ Update gitignore
It looks OK to me
Quoted 82 lines
.gitignore | 2 +- tools/include/xen-foreign/Makefile | 4 ++-- tools/include/xen-foreign/mkheader.py | 6 +++++- tools/include/xen-foreign/reference.size | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-).gitignore +1
-1@@ -363,7 +363,7 @@ tools/include/xen-foreign/checker.c tools/include/xen-foreign/structs.pyc tools/include/xen-foreign/x86_32.h tools/include/xen-foreign/x86_64.h -tools/include/xen-foreign/arm.h +tools/include/xen-foreign/arm32.h .git tools/misc/xen-hptooltools/include/xen-foreign/Makefile +2
-2@@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk ROOT = $(XEN_ROOT)/xen/include/public -architectures := arm x86_32 x86_64 +architectures := arm32 x86_32 x86_64 headers := $(patsubst %, %.h, $(architectures)) .PHONY: all clean check-headers@@ -22,7 +22,7 @@ check-headers: checker diff -u reference.size tmp.size rm tmp.size -arm.h: mkheader.py structs.py $(ROOT)/arch-arm.h +arm32.h: mkheader.py structs.py $(ROOT)/arch-arm.h $(PYTHON) $< $* $@ $(filter %.h,$^) x86_32.h: mkheader.py structs.py $(ROOT)/arch-x86/xen-x86_32.h $(ROOT)/arch-x86/xen.h $(ROOT)/xen.htools/include/xen-foreign/mkheader.py +5
-1@@ -17,11 +17,15 @@ header = {}; footer = {}; #arm -inttypes["arm"] = { +inttypes["arm32"] = { "unsigned long" : "uint32_t", "long" : "uint32_t", "xen_pfn_t" : "uint64_t", }; +header["arm32"] = """ +#define __arm___ARM32 1 +"""; + # x86_32 inttypes["x86_32"] = {tools/include/xen-foreign/reference.size +1
-1@@ -1,5 +1,5 @@ -structs | arm x86_32 x86_64 +structs | arm32 x86_32 x86_64 start_info | - 1112 1168 trap_info | - 8 16Signature · 7 lines
1.7.2.5 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
PATCH v2 2/4 xen: event channel arrays are xen_ulong_t and not unsigned long
In reply to Ian CampbellOn ARM we want these to be the same size on 32- and 64-bit.
This is an ABI change on ARM. X86 does not change.
--- tools/include/xen-foreign/mkheader.py | 4 +++- xen/include/public/xen.h | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-)
tools/include/xen-foreign/mkheader.py +3 -1
@@ -21,17 +21,18 @@ inttypes["arm32"] = { "unsigned long" : "uint32_t", "long" : "uint32_t", "xen_pfn_t" : "uint64_t", + "xen_ulong_t" : "uint64_t", }; header["arm32"] = """ #define __arm___ARM32 1 """; - # x86_32 inttypes["x86_32"] = { "unsigned long" : "uint32_t", "long" : "uint32_t", "xen_pfn_t" : "uint32_t", + "xen_ulong_t" : "uint32_t", }; header["x86_32"] = """ #define __i386___X86_32 1
@@ -46,6 +47,7 @@ inttypes["x86_64"] = { "unsigned long" : "__align8__ uint64_t", "long" : "__align8__ uint64_t", "xen_pfn_t" : "__align8__ uint64_t", + "xen_ulong_t" : "__align8__ uint64_t", }; header["x86_64"] = """ #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
xen/include/public/xen.h +4 -4
@@ -556,7 +556,7 @@ DEFINE_XEN_GUEST_HANDLE(multicall_entry_t);* Event channel endpoints per domain: * 1024 if a long is 32 bits; 4096 if a long is 64 bits. */ -#define NR_EVENT_CHANNELS (sizeof(unsigned long) * sizeof(unsigned long) * 64) +#define NR_EVENT_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64)struct vcpu_time_info {/*
@@ -613,7 +613,7 @@ struct vcpu_info {*/ uint8_t evtchn_upcall_pending;uint8_t evtchn_upcall_mask; -unsigned long evtchn_pending_sel; +xen_ulong_t evtchn_pending_sel;struct arch_vcpu_info arch;struct vcpu_time_info time; };/* 64 bytes (x86) */
@@ -663,8 +663,8 @@ struct shared_info {* per-vcpu selector word to be set. Each bit in the selector covers a * 'C long' in the PENDING bitfield array. */ -unsigned long evtchn_pending[sizeof (unsigned long ) *8 ]; -unsigned long evtchn_mask[sizeof (unsigned long ) *8 ]; +xen_ulong_t evtchn_pending[sizeof (xen_ulong_t) *8 ]; +xen_ulong_t evtchn_mask[sizeof (xen_ulong_t) *8 ];/* * Wallclock time: updated only by control software. Guests should base
Signature · 1 line
1.7.2.5
Re: [PATCH 2/4] xen: event channel arrays are xen_ulong_t and not unsigned long
Quoted 10 lines · Ian Campbell
On ARM we want these to be the same size on 32- and 64-bit.
This is an ABI change on ARM. X86 does not change.
Signed-off-by Ian Campbell <[email protected]>Cc Jan Beulich <[email protected]>Cc Keir (Xen.org) <[email protected]>Cc Tim Deegan <[email protected]>Cc Stefano Stabellini <[email protected]>Cc Konrad Rzeszutek Wilk <[email protected]>
Quoted 72 lines
tools/include/xen-foreign/mkheader.py | 4 +++- xen/include/public/xen.h | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-)tools/include/xen-foreign/mkheader.py +3
-1@@ -21,17 +21,18 @@ inttypes["arm32"] = { "unsigned long" : "uint32_t", "long" : "uint32_t", "xen_pfn_t" : "uint64_t", + "xen_ulong_t" : "uint64_t", }; header["arm32"] = """ #define __arm___ARM32 1 """; - # x86_32 inttypes["x86_32"] = { "unsigned long" : "uint32_t", "long" : "uint32_t", "xen_pfn_t" : "uint32_t", + "xen_ulong_t" : "uint32_t", }; header["x86_32"] = """ #define __i386___X86_32 1@@ -46,6 +47,7 @@ inttypes["x86_64"] = { "unsigned long" : "__align8__ uint64_t", "long" : "__align8__ uint64_t", "xen_pfn_t" : "__align8__ uint64_t", + "xen_ulong_t" : "__align8__ uint64_t", }; header["x86_64"] = """ #if defined(__GNUC__) && !defined(__STRICT_ANSI__)xen/include/public/xen.h +4
-4@@ -556,7 +556,7 @@ DEFINE_XEN_GUEST_HANDLE(multicall_entry_t);* Event channel endpoints per domain: * 1024 if a long is 32 bits; 4096 if a long is 64 bits. */ -#define NR_EVENT_CHANNELS (sizeof(unsigned long) * sizeof(unsigned long) * 64) +#define NR_EVENT_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64)struct vcpu_time_info {/* @@ -613,7 +613,7 @@ struct vcpu_info {*/ uint8_t evtchn_upcall_pending;uint8_t evtchn_upcall_mask; -unsigned long evtchn_pending_sel; +xen_ulong_t evtchn_pending_sel;struct arch_vcpu_info arch;struct vcpu_time_info time; };/* 64 bytes (x86) */ @@ -663,8 +663,8 @@ struct shared_info {* per-vcpu selector word to be set. Each bit in the selector covers a * 'C long' in the PENDING bitfield array. */ -unsigned long evtchn_pending[sizeof (unsigned long ) *8 ]; -unsigned long evtchn_mask[sizeof (unsigned long ) *8 ]; +xen_ulong_t evtchn_pending[sizeof (xen_ulong_t) *8 ]; +xen_ulong_t evtchn_mask[sizeof (xen_ulong_t) *8 ];/* * Wallclock time: updated only by control software. Guests should base Signature · 1 line
1.7.2.5
PATCH v2 3/4 xen: make start_info x86 specific.
In reply to Ian CampbellMost of this struct is PV MMU specific and it is not used on ARM at all.
--- tools/libxc/xenctrl.h | 5 +-- xen/include/public/arch-x86/xen.h | 73 +++++++++++++++++++++++++++++++++++++ xen/include/public/xen.h | 73 ------------------------------------- xen/include/xlat.lst | 2 +- 4 files changed, 76 insertions(+), 77 deletions(-)
tools/libxc/xenctrl.h +2 -3
@@ -395,15 +395,14 @@ typedef unionshared_info_t s; } shared_info_any_t; +#if defined(__i386__) || defined(__x86_64__)typedef union { -#if defined(__i386__) || defined(__x86_64__)start_info_x86_64_t x64;start_info_x86_32_t x32; -#endif start_info_t s; }start_info_any_t ; - +#endif int xc_domain_create(xc_interface *xch, uint32_t ssidref,
xen/include/public/arch-x86/xen.h +73 -0
79 lines not on this page · raw message
xen/include/public/xen.h +0 -73
79 lines not on this page · raw message
xen/include/xlat.lst +1 -1
@@ -5,10 +5,10 @@ ? xenctl_cpumap xen.h ? mmu_update xen.h ! mmuext_op xen.h -! start_info xen.h ? vcpu_info xen.h ? vcpu_time_info xen.h ! cpu_user_regs arch-x86/xen-@[email protected] +! start_info arch-x86/xen.h ! trap_info arch-x86/xen.h ? cpu_offline_action arch-x86/xen-mca.h ? mc arch-x86/xen-mca.h
Signature · 1 line
1.7.2.5
PATCH v2 4/4 xen: arm: include public/xen.h in foreign interface checking
In reply to Ian Campbellmkheader.py doesn't cope with
structr foo { };so add a newline.
Define unsigned long and long to a non-existent type on ARM so as to catch their use.
--- tools/include/xen-foreign/Makefile | 2 +- tools/include/xen-foreign/mkheader.py | 4 ++-- tools/include/xen-foreign/reference.size | 10 +++++----- xen/include/public/arch-arm.h | 8 +++++--- 4 files changed, 13 insertions(+), 11 deletions(-)
tools/include/xen-foreign/Makefile +1 -1
@@ -22,7 +22,7 @@ check-headers: checker diff -u reference.size tmp.size rm tmp.size -arm32.h: mkheader.py structs.py $(ROOT)/arch-arm.h +arm32.h: mkheader.py structs.py $(ROOT)/arch-arm.h $(ROOT)/xen.h $(PYTHON) $< $* $@ $(filter %.h,$^) x86_32.h: mkheader.py structs.py $(ROOT)/arch-x86/xen-x86_32.h $(ROOT)/arch-x86/xen.h $(ROOT)/xen.h
tools/include/xen-foreign/mkheader.py +2 -2
@@ -18,8 +18,8 @@ footer = {}; #arm inttypes["arm32"] = { - "unsigned long" : "uint32_t", - "long" : "uint32_t", + "unsigned long" : "__danger_unsigned_long_on_arm32", + "long" : "__danger_long_on_arm32", "xen_pfn_t" : "uint64_t", "xen_ulong_t" : "uint64_t", };
tools/include/xen-foreign/reference.size +5 -5
@@ -5,9 +5,9 @@ start_info | - 1112 1168 trap_info | - 8 16 cpu_user_regs | 160 68 200 vcpu_guest_context | 180 2800 5168 -arch_vcpu_info | - 24 16 -vcpu_time_info | - 32 32 -vcpu_info | - 64 64 -arch_shared_info | - 268 280 -shared_info | - 2584 3368 +arch_vcpu_info | 0 24 16 +vcpu_time_info | 32 32 32 +vcpu_info | 48 64 64 +arch_shared_info | 0 268 280 +shared_info | 1088 2584 3368
xen/include/public/arch-arm.h +5 -3
@@ -159,14 +159,16 @@ struct vcpu_guest_context {typedef struct vcpu_guest_context vcpu_guest_context_t ;DEFINE_XEN_GUEST_HANDLE (vcpu_guest_context_t); -struct arch_vcpu_info { }; +struct arch_vcpu_info { +};typedef struct arch_vcpu_info arch_vcpu_info_t ; -struct arch_shared_info { }; +struct arch_shared_info { +};typedef struct arch_shared_info arch_shared_info_t ;typedef uint64_t xen_callback_t ; -#endif /* ifndef __ASSEMBLY __ */ +#endif /* PSR bits (CPSR, SPSR)*/
Signature · 1 line
1.7.2.5