All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 00/04] xen: public interface (and foreign check) changes for arm
@ 2013-02-14 15:59 Ian Campbell
  2013-02-14 15:59 ` [PATCH 1/4] tools: s/arm/arm32/ in foreign header checks Ian Campbell
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Ian Campbell @ 2013-02-14 15:59 UTC (permalink / raw)
  To: xen-devel
  Cc: Keir (Xen.org), Konrad Rzeszutek Wilk, Tim (Xen.org),
	Jan Beulich, Stefano Stabellini

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.

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

* [PATCH 1/4] tools: s/arm/arm32/ in foreign header checks.
  2013-02-14 15:59 [PATCH V2 00/04] xen: public interface (and foreign check) changes for arm Ian Campbell
@ 2013-02-14 15:59 ` Ian Campbell
  2013-02-21 16:56   ` Stefano Stabellini
  2013-02-14 15:59 ` [PATCH 2/4] xen: event channel arrays are xen_ulong_t and not unsigned long Ian Campbell
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 13+ messages in thread
From: Ian Campbell @ 2013-02-14 15:59 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Campbell, Jan Beulich

Also define __arm__ARM32 as required.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Jan Beulich <JBeulich@suse.com>
---
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(-)

diff --git a/.gitignore b/.gitignore
index 125a582..73c5b77 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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
diff --git a/tools/include/xen-foreign/Makefile b/tools/include/xen-foreign/Makefile
index cfaf790..5bc2d46 100644
--- a/tools/include/xen-foreign/Makefile
+++ b/tools/include/xen-foreign/Makefile
@@ -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
diff --git a/tools/include/xen-foreign/mkheader.py b/tools/include/xen-foreign/mkheader.py
index d189b07..eee28f3 100644
--- a/tools/include/xen-foreign/mkheader.py
+++ b/tools/include/xen-foreign/mkheader.py
@@ -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"] = {
diff --git a/tools/include/xen-foreign/reference.size b/tools/include/xen-foreign/reference.size
index a2cbfd6..9f1bfac 100644
--- a/tools/include/xen-foreign/reference.size
+++ b/tools/include/xen-foreign/reference.size
@@ -1,5 +1,5 @@
 
-structs                   |     arm  x86_32  x86_64
+structs                   |   arm32  x86_32  x86_64
 
 start_info                |       -    1112    1168
 trap_info                 |       -       8      16
-- 
1.7.2.5

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

* [PATCH 2/4] xen: event channel arrays are xen_ulong_t and not unsigned long
  2013-02-14 15:59 [PATCH V2 00/04] xen: public interface (and foreign check) changes for arm Ian Campbell
  2013-02-14 15:59 ` [PATCH 1/4] tools: s/arm/arm32/ in foreign header checks Ian Campbell
@ 2013-02-14 15:59 ` Ian Campbell
  2013-02-15 11:58   ` Stefano Stabellini
  2013-02-14 15:59 ` [PATCH 3/4] xen: make start_info x86 specific Ian Campbell
  2013-02-14 15:59 ` [PATCH 4/4] xen: arm: include public/xen.h in foreign interface checking Ian Campbell
  3 siblings, 1 reply; 13+ messages in thread
From: Ian Campbell @ 2013-02-14 15:59 UTC (permalink / raw)
  To: xen-devel
  Cc: Keir (Xen.org),
	Ian Campbell, Konrad Rzeszutek Wilk, Stefano Stabellini,
	Tim Deegan, Jan Beulich

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 <ian.campbell@citrix.com>
Cc: Jan Beulich <JBeulich@suse.com>
Cc: Keir (Xen.org) <keir@xen.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 tools/include/xen-foreign/mkheader.py |    4 +++-
 xen/include/public/xen.h              |    8 ++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/tools/include/xen-foreign/mkheader.py b/tools/include/xen-foreign/mkheader.py
index eee28f3..e3e61f3 100644
--- a/tools/include/xen-foreign/mkheader.py
+++ b/tools/include/xen-foreign/mkheader.py
@@ -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__)
diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index 5593066..99c8212 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -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
-- 
1.7.2.5

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

* [PATCH 3/4] xen: make start_info x86 specific.
  2013-02-14 15:59 [PATCH V2 00/04] xen: public interface (and foreign check) changes for arm Ian Campbell
  2013-02-14 15:59 ` [PATCH 1/4] tools: s/arm/arm32/ in foreign header checks Ian Campbell
  2013-02-14 15:59 ` [PATCH 2/4] xen: event channel arrays are xen_ulong_t and not unsigned long Ian Campbell
@ 2013-02-14 15:59 ` Ian Campbell
  2013-02-14 15:59 ` [PATCH 4/4] xen: arm: include public/xen.h in foreign interface checking Ian Campbell
  3 siblings, 0 replies; 13+ messages in thread
From: Ian Campbell @ 2013-02-14 15:59 UTC (permalink / raw)
  To: xen-devel
  Cc: Keir (Xen.org),
	Ian Campbell, Stefano Stabellini, Konrad Rzeszutek Wilk,
	Tim Deegan, Jan Beulich

Most of this struct is PV MMU specific and it is not used on ARM at all.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Jan Beulich <JBeulich@suse.com>
Cc: Keir (Xen.org) <keir@xen.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 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(-)

diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 32122fd..9e4a741 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -395,15 +395,14 @@ typedef union
     shared_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,
diff --git a/xen/include/public/arch-x86/xen.h b/xen/include/public/arch-x86/xen.h
index 13c21dc..00f0306 100644
--- a/xen/include/public/arch-x86/xen.h
+++ b/xen/include/public/arch-x86/xen.h
@@ -147,6 +147,79 @@ DEFINE_XEN_GUEST_HANDLE(trap_info_t);
 
 typedef uint64_t tsc_timestamp_t; /* RDTSC timestamp */
 
+#define MAX_GUEST_CMDLINE 1024
+struct start_info {
+    /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME.    */
+    char magic[32];             /* "xen-<version>-<platform>".            */
+    unsigned long nr_pages;     /* Total pages allocated to this domain.  */
+    unsigned long shared_info;  /* MACHINE address of shared info struct. */
+    uint32_t flags;             /* SIF_xxx flags.                         */
+    xen_pfn_t store_mfn;        /* MACHINE page number of shared page.    */
+    uint32_t store_evtchn;      /* Event channel for store communication. */
+    union {
+        struct {
+            xen_pfn_t mfn;      /* MACHINE page number of console page.   */
+            uint32_t  evtchn;   /* Event channel for console page.        */
+        } domU;
+        struct {
+            uint32_t info_off;  /* Offset of console_info struct.         */
+            uint32_t info_size; /* Size of console_info struct from start.*/
+        } dom0;
+    } console;
+    /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME).     */
+    unsigned long pt_base;      /* VIRTUAL address of page directory.     */
+    unsigned long nr_pt_frames; /* Number of bootstrap p.t. frames.       */
+    unsigned long mfn_list;     /* VIRTUAL address of page-frame list.    */
+    unsigned long mod_start;    /* VIRTUAL address of pre-loaded module   */
+                                /* (PFN of pre-loaded module if           */
+                                /*  SIF_MOD_START_PFN set in flags).      */
+    unsigned long mod_len;      /* Size (bytes) of pre-loaded module.     */
+    int8_t cmd_line[MAX_GUEST_CMDLINE];
+    /* The pfn range here covers both page table and p->m table frames.   */
+    unsigned long first_p2m_pfn;/* 1st pfn forming initial P->M table.    */
+    unsigned long nr_p2m_frames;/* # of pfns forming initial P->M table.  */
+};
+typedef struct start_info start_info_t;
+
+/* New console union for dom0 introduced in 0x00030203. */
+#if __XEN_INTERFACE_VERSION__ < 0x00030203
+#define console_mfn    console.domU.mfn
+#define console_evtchn console.domU.evtchn
+#endif
+
+/* These flags are passed in the 'flags' field of start_info_t. */
+#define SIF_PRIVILEGED    (1<<0)  /* Is the domain privileged? */
+#define SIF_INITDOMAIN    (1<<1)  /* Is this the initial control domain? */
+#define SIF_MULTIBOOT_MOD (1<<2)  /* Is mod_start a multiboot module? */
+#define SIF_MOD_START_PFN (1<<3)  /* Is mod_start a PFN? */
+#define SIF_PM_MASK       (0xFF<<8) /* reserve 1 byte for xen-pm options */
+
+/*
+ * A multiboot module is a package containing modules very similar to a
+ * multiboot module array. The only differences are:
+ * - the array of module descriptors is by convention simply at the beginning
+ *   of the multiboot module,
+ * - addresses in the module descriptors are based on the beginning of the
+ *   multiboot module,
+ * - the number of modules is determined by a termination descriptor that has
+ *   mod_start == 0.
+ *
+ * This permits to both build it statically and reference it in a configuration
+ * file, and let the PV guest easily rebase the addresses to virtual addresses
+ * and at the same time count the number of modules.
+ */
+struct xen_multiboot_mod_list
+{
+    /* Address of first byte of the module */
+    uint32_t mod_start;
+    /* Address of last byte of the module (inclusive) */
+    uint32_t mod_end;
+    /* Address of zero-terminated command line */
+    uint32_t cmdline;
+    /* Unused, must be zero */
+    uint32_t pad;
+};
+
 /*
  * The following is all CPU context. Note that the fpu_ctxt block is filled 
  * in by FXSAVE if the CPU has feature FXSR; otherwise FSAVE is used.
diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index 99c8212..846f446 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -706,79 +706,6 @@ typedef struct shared_info shared_info_t;
  *     extended by an extra 4MB to ensure this.
  */
 
-#define MAX_GUEST_CMDLINE 1024
-struct start_info {
-    /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME.    */
-    char magic[32];             /* "xen-<version>-<platform>".            */
-    unsigned long nr_pages;     /* Total pages allocated to this domain.  */
-    unsigned long shared_info;  /* MACHINE address of shared info struct. */
-    uint32_t flags;             /* SIF_xxx flags.                         */
-    xen_pfn_t store_mfn;        /* MACHINE page number of shared page.    */
-    uint32_t store_evtchn;      /* Event channel for store communication. */
-    union {
-        struct {
-            xen_pfn_t mfn;      /* MACHINE page number of console page.   */
-            uint32_t  evtchn;   /* Event channel for console page.        */
-        } domU;
-        struct {
-            uint32_t info_off;  /* Offset of console_info struct.         */
-            uint32_t info_size; /* Size of console_info struct from start.*/
-        } dom0;
-    } console;
-    /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME).     */
-    unsigned long pt_base;      /* VIRTUAL address of page directory.     */
-    unsigned long nr_pt_frames; /* Number of bootstrap p.t. frames.       */
-    unsigned long mfn_list;     /* VIRTUAL address of page-frame list.    */
-    unsigned long mod_start;    /* VIRTUAL address of pre-loaded module   */
-                                /* (PFN of pre-loaded module if           */
-                                /*  SIF_MOD_START_PFN set in flags).      */
-    unsigned long mod_len;      /* Size (bytes) of pre-loaded module.     */
-    int8_t cmd_line[MAX_GUEST_CMDLINE];
-    /* The pfn range here covers both page table and p->m table frames.   */
-    unsigned long first_p2m_pfn;/* 1st pfn forming initial P->M table.    */
-    unsigned long nr_p2m_frames;/* # of pfns forming initial P->M table.  */
-};
-typedef struct start_info start_info_t;
-
-/* New console union for dom0 introduced in 0x00030203. */
-#if __XEN_INTERFACE_VERSION__ < 0x00030203
-#define console_mfn    console.domU.mfn
-#define console_evtchn console.domU.evtchn
-#endif
-
-/* These flags are passed in the 'flags' field of start_info_t. */
-#define SIF_PRIVILEGED    (1<<0)  /* Is the domain privileged? */
-#define SIF_INITDOMAIN    (1<<1)  /* Is this the initial control domain? */
-#define SIF_MULTIBOOT_MOD (1<<2)  /* Is mod_start a multiboot module? */
-#define SIF_MOD_START_PFN (1<<3)  /* Is mod_start a PFN? */
-#define SIF_PM_MASK       (0xFF<<8) /* reserve 1 byte for xen-pm options */
-
-/*
- * A multiboot module is a package containing modules very similar to a
- * multiboot module array. The only differences are:
- * - the array of module descriptors is by convention simply at the beginning
- *   of the multiboot module,
- * - addresses in the module descriptors are based on the beginning of the
- *   multiboot module,
- * - the number of modules is determined by a termination descriptor that has
- *   mod_start == 0.
- *
- * This permits to both build it statically and reference it in a configuration
- * file, and let the PV guest easily rebase the addresses to virtual addresses
- * and at the same time count the number of modules.
- */
-struct xen_multiboot_mod_list
-{
-    /* Address of first byte of the module */
-    uint32_t mod_start;
-    /* Address of last byte of the module (inclusive) */
-    uint32_t mod_end;
-    /* Address of zero-terminated command line */
-    uint32_t cmdline;
-    /* Unused, must be zero */
-    uint32_t pad;
-};
-
 typedef struct dom0_vga_console_info {
     uint8_t video_type; /* DOM0_VGA_CONSOLE_??? */
 #define XEN_VGATYPE_TEXT_MODE_3 0x03
diff --git a/xen/include/xlat.lst b/xen/include/xlat.lst
index 3d4f1e3..5b0ff35 100644
--- a/xen/include/xlat.lst
+++ b/xen/include/xlat.lst
@@ -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-@arch@.h
+!	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
-- 
1.7.2.5

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

* [PATCH 4/4] xen: arm: include public/xen.h in foreign interface checking
  2013-02-14 15:59 [PATCH V2 00/04] xen: public interface (and foreign check) changes for arm Ian Campbell
                   ` (2 preceding siblings ...)
  2013-02-14 15:59 ` [PATCH 3/4] xen: make start_info x86 specific Ian Campbell
@ 2013-02-14 15:59 ` Ian Campbell
  3 siblings, 0 replies; 13+ messages in thread
From: Ian Campbell @ 2013-02-14 15:59 UTC (permalink / raw)
  To: xen-devel
  Cc: Tim Deegan, Keir (Xen.org),
	Ian Campbell, Jan Beulich, Stefano Stabellini

mkheader.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.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Jan Beulich <JBeulich@suse.com>
Cc: Keir (Xen.org) <keir@xen.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 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(-)

diff --git a/tools/include/xen-foreign/Makefile b/tools/include/xen-foreign/Makefile
index 5bc2d46..53cc6b4 100644
--- a/tools/include/xen-foreign/Makefile
+++ b/tools/include/xen-foreign/Makefile
@@ -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
diff --git a/tools/include/xen-foreign/mkheader.py b/tools/include/xen-foreign/mkheader.py
index e3e61f3..b7c34b1 100644
--- a/tools/include/xen-foreign/mkheader.py
+++ b/tools/include/xen-foreign/mkheader.py
@@ -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",
 };
diff --git a/tools/include/xen-foreign/reference.size b/tools/include/xen-foreign/reference.size
index 9f1bfac..0e5529d 100644
--- a/tools/include/xen-foreign/reference.size
+++ b/tools/include/xen-foreign/reference.size
@@ -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
 
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index d8788f2..8dd9062 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -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)*/
 
-- 
1.7.2.5

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

* Re: [PATCH 2/4] xen: event channel arrays are xen_ulong_t and not unsigned long
  2013-02-14 15:59 ` [PATCH 2/4] xen: event channel arrays are xen_ulong_t and not unsigned long Ian Campbell
@ 2013-02-15 11:58   ` Stefano Stabellini
  0 siblings, 0 replies; 13+ messages in thread
From: Stefano Stabellini @ 2013-02-15 11:58 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Keir (Xen.org),
	Konrad Rzeszutek Wilk, Stefano Stabellini, Tim (Xen.org),
	xen-devel, Jan Beulich

On Thu, 14 Feb 2013, Ian Campbell wrote:
> 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 <ian.campbell@citrix.com>
> Cc: Jan Beulich <JBeulich@suse.com>
> Cc: Keir (Xen.org) <keir@xen.org>
> Cc: Tim Deegan <tim@xen.org>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


>  tools/include/xen-foreign/mkheader.py |    4 +++-
>  xen/include/public/xen.h              |    8 ++++----
>  2 files changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/include/xen-foreign/mkheader.py b/tools/include/xen-foreign/mkheader.py
> index eee28f3..e3e61f3 100644
> --- a/tools/include/xen-foreign/mkheader.py
> +++ b/tools/include/xen-foreign/mkheader.py
> @@ -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__)
> diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
> index 5593066..99c8212 100644
> --- a/xen/include/public/xen.h
> +++ b/xen/include/public/xen.h
> @@ -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
> -- 
> 1.7.2.5
> 

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

* Re: [PATCH 1/4] tools: s/arm/arm32/ in foreign header checks.
  2013-02-14 15:59 ` [PATCH 1/4] tools: s/arm/arm32/ in foreign header checks Ian Campbell
@ 2013-02-21 16:56   ` Stefano Stabellini
  0 siblings, 0 replies; 13+ messages in thread
From: Stefano Stabellini @ 2013-02-21 16:56 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Jan Beulich, xen-devel

On Thu, 14 Feb 2013, Ian Campbell wrote:
> Also define __arm__ARM32 as required.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Jan Beulich <JBeulich@suse.com>
> ---
> v2: s/x86_32/arm32/ in the right place
>     s/__arm__ARM32/__arm___ARM32/
>     Update gitignore

It looks OK to me

Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


>  .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(-)
> 
> diff --git a/.gitignore b/.gitignore
> index 125a582..73c5b77 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -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
> diff --git a/tools/include/xen-foreign/Makefile b/tools/include/xen-foreign/Makefile
> index cfaf790..5bc2d46 100644
> --- a/tools/include/xen-foreign/Makefile
> +++ b/tools/include/xen-foreign/Makefile
> @@ -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
> diff --git a/tools/include/xen-foreign/mkheader.py b/tools/include/xen-foreign/mkheader.py
> index d189b07..eee28f3 100644
> --- a/tools/include/xen-foreign/mkheader.py
> +++ b/tools/include/xen-foreign/mkheader.py
> @@ -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"] = {
> diff --git a/tools/include/xen-foreign/reference.size b/tools/include/xen-foreign/reference.size
> index a2cbfd6..9f1bfac 100644
> --- a/tools/include/xen-foreign/reference.size
> +++ b/tools/include/xen-foreign/reference.size
> @@ -1,5 +1,5 @@
>  
> -structs                   |     arm  x86_32  x86_64
> +structs                   |   arm32  x86_32  x86_64
>  
>  start_info                |       -    1112    1168
>  trap_info                 |       -       8      16
> -- 
> 1.7.2.5
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 

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

* Re: [PATCH 3/4] xen: make start_info x86 specific.
  2013-02-15 13:30         ` Ian Campbell
@ 2013-02-15 13:45           ` Jan Beulich
  0 siblings, 0 replies; 13+ messages in thread
From: Jan Beulich @ 2013-02-15 13:45 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Tim (Xen.org), xen-devel, Keir (Xen.org),
	Konrad Rzeszutek Wilk, Stefano Stabellini

>>> On 15.02.13 at 14:30, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> I'd be as happy to ifdef this in the public headers instead of moving
> them if that is what people prefer. I don't think XEN_ARCH_HVM_ONLY is
> quite the right name though. XEN_HAVE_PV_GUEST_ENTRY perhaps? This makes
> some sense by virtue of start_info not being useful on ARM partly
> because we use the normal native entry points which don't allow for it.

I don't care much about the name - what you suggest reads fine
to me.

> Do we think that it is likely that a new architecture port which doesn't
> use hardware virtualisation extensions instead of PV is very likely?

I'd like to keep interfaces independent of actual implementations.
And in the case here, PV is what Xen started with, so if nothing
else I'd like to keep the interface this generic way for historical
reasons (not that I consider it likely to be revived, but ia64 surely
also used it).

Jan

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

* Re: [PATCH 3/4] xen: make start_info x86 specific.
  2013-02-14 15:20       ` Jan Beulich
@ 2013-02-15 13:30         ` Ian Campbell
  2013-02-15 13:45           ` Jan Beulich
  0 siblings, 1 reply; 13+ messages in thread
From: Ian Campbell @ 2013-02-15 13:30 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Tim (Xen.org), xen-devel, Keir (Xen.org),
	Konrad Rzeszutek Wilk, Stefano Stabellini

On Thu, 2013-02-14 at 15:20 +0000, Jan Beulich wrote:
> >>> On 14.02.13 at 15:46, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Thu, 2013-02-14 at 14:43 +0000, Jan Beulich wrote:
> >> >>> On 14.02.13 at 15:16, Ian Campbell <ian.campbell@citrix.com> wrote:
> >> > Most of this struct is PV MMU specific and it is not used on ARM at all.
> >> 
> >> I'm not convinced this is the right move.
> >> 
> >> > --- a/xen/include/public/xen.h
> >> > +++ b/xen/include/public/xen.h
> >> > @@ -706,79 +706,6 @@ typedef struct shared_info shared_info_t;
> >> >   *     extended by an extra 4MB to ensure this.
> >> >   */
> >> >  
> >> > -#define MAX_GUEST_CMDLINE 1024
> >> > -struct start_info {
> >> > -    /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME.    
> > */
> >> > -    char magic[32];             /* "xen-<version>-<platform>".            */
> >> > -    unsigned long nr_pages;     /* Total pages allocated to this domain.  
> > */
> >> > -    unsigned long shared_info;  /* MACHINE address of shared info struct. 
> > */
> >> > -    uint32_t flags;             /* SIF_xxx flags.                         
> > */
> >> > -    xen_pfn_t store_mfn;        /* MACHINE page number of shared page.    
> > */
> >> > -    uint32_t store_evtchn;      /* Event channel for store communication. 
> > */
> >> > -    union {
> >> > -        struct {
> >> > -            xen_pfn_t mfn;      /* MACHINE page number of console page.   
> > */
> >> > -            uint32_t  evtchn;   /* Event channel for console page.        
> > */
> >> > -        } domU;
> >> > -        struct {
> >> > -            uint32_t info_off;  /* Offset of console_info struct.         
> > */
> >> > -            uint32_t info_size; /* Size of console_info struct from 
> > start.*/
> >> > -        } dom0;
> >> > -    } console;
> >> 
> >> What is PV MMU related up to here?
> > 
> > Hrm, perhaps categorising this as PV MMU was a mistake on my part.
> > 
> > These are all unused on ARM in terms of the hypervisor ABI since it uses
> > HVM like mechanisms for those which are appropriate and doesn't use a
> > bunch of the others at all.
> 
> But nothing here makes this structure x86 specific, so I'd really like
> to keep it that way. If ARM doesn't use the structure at all, then
> I don't see the point in removing it from the common headers. If
> part of it (the flags come to mind) are being used by ARM, let's
> find a reasonable abstraction so that ARM doesn't need to carry
> useless baggage (e.g. a XEN_ARCH_HVM_ONLY #define).

Even the flags are unused on ARM (as part of the hypervisor ABI), which
uses XENFEAT_dom0 and not SIF_*.

I'd be as happy to ifdef this in the public headers instead of moving
them if that is what people prefer. I don't think XEN_ARCH_HVM_ONLY is
quite the right name though. XEN_HAVE_PV_GUEST_ENTRY perhaps? This makes
some sense by virtue of start_info not being useful on ARM partly
because we use the normal native entry points which don't allow for it.

Do we think that it is likely that a new architecture port which doesn't
use hardware virtualisation extensions instead of PV is very likely?

Ian.

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

* Re: [PATCH 3/4] xen: make start_info x86 specific.
  2013-02-14 14:46     ` Ian Campbell
@ 2013-02-14 15:20       ` Jan Beulich
  2013-02-15 13:30         ` Ian Campbell
  0 siblings, 1 reply; 13+ messages in thread
From: Jan Beulich @ 2013-02-14 15:20 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Tim (Xen.org), xen-devel, Keir (Xen.org),
	Konrad Rzeszutek Wilk, Stefano Stabellini

>>> On 14.02.13 at 15:46, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Thu, 2013-02-14 at 14:43 +0000, Jan Beulich wrote:
>> >>> On 14.02.13 at 15:16, Ian Campbell <ian.campbell@citrix.com> wrote:
>> > Most of this struct is PV MMU specific and it is not used on ARM at all.
>> 
>> I'm not convinced this is the right move.
>> 
>> > --- a/xen/include/public/xen.h
>> > +++ b/xen/include/public/xen.h
>> > @@ -706,79 +706,6 @@ typedef struct shared_info shared_info_t;
>> >   *     extended by an extra 4MB to ensure this.
>> >   */
>> >  
>> > -#define MAX_GUEST_CMDLINE 1024
>> > -struct start_info {
>> > -    /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME.    
> */
>> > -    char magic[32];             /* "xen-<version>-<platform>".            */
>> > -    unsigned long nr_pages;     /* Total pages allocated to this domain.  
> */
>> > -    unsigned long shared_info;  /* MACHINE address of shared info struct. 
> */
>> > -    uint32_t flags;             /* SIF_xxx flags.                         
> */
>> > -    xen_pfn_t store_mfn;        /* MACHINE page number of shared page.    
> */
>> > -    uint32_t store_evtchn;      /* Event channel for store communication. 
> */
>> > -    union {
>> > -        struct {
>> > -            xen_pfn_t mfn;      /* MACHINE page number of console page.   
> */
>> > -            uint32_t  evtchn;   /* Event channel for console page.        
> */
>> > -        } domU;
>> > -        struct {
>> > -            uint32_t info_off;  /* Offset of console_info struct.         
> */
>> > -            uint32_t info_size; /* Size of console_info struct from 
> start.*/
>> > -        } dom0;
>> > -    } console;
>> 
>> What is PV MMU related up to here?
> 
> Hrm, perhaps categorising this as PV MMU was a mistake on my part.
> 
> These are all unused on ARM in terms of the hypervisor ABI since it uses
> HVM like mechanisms for those which are appropriate and doesn't use a
> bunch of the others at all.

But nothing here makes this structure x86 specific, so I'd really like
to keep it that way. If ARM doesn't use the structure at all, then
I don't see the point in removing it from the common headers. If
part of it (the flags come to mind) are being used by ARM, let's
find a reasonable abstraction so that ARM doesn't need to carry
useless baggage (e.g. a XEN_ARCH_HVM_ONLY #define).

Jan

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

* Re: [PATCH 3/4] xen: make start_info x86 specific.
  2013-02-14 14:43   ` Jan Beulich
@ 2013-02-14 14:46     ` Ian Campbell
  2013-02-14 15:20       ` Jan Beulich
  0 siblings, 1 reply; 13+ messages in thread
From: Ian Campbell @ 2013-02-14 14:46 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Tim (Xen.org), xen-devel, Keir (Xen.org),
	Konrad Rzeszutek Wilk, Stefano Stabellini

On Thu, 2013-02-14 at 14:43 +0000, Jan Beulich wrote:
> >>> On 14.02.13 at 15:16, Ian Campbell <ian.campbell@citrix.com> wrote:
> > Most of this struct is PV MMU specific and it is not used on ARM at all.
> 
> I'm not convinced this is the right move.
> 
> > --- a/xen/include/public/xen.h
> > +++ b/xen/include/public/xen.h
> > @@ -706,79 +706,6 @@ typedef struct shared_info shared_info_t;
> >   *     extended by an extra 4MB to ensure this.
> >   */
> >  
> > -#define MAX_GUEST_CMDLINE 1024
> > -struct start_info {
> > -    /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME.    */
> > -    char magic[32];             /* "xen-<version>-<platform>".            */
> > -    unsigned long nr_pages;     /* Total pages allocated to this domain.  */
> > -    unsigned long shared_info;  /* MACHINE address of shared info struct. */
> > -    uint32_t flags;             /* SIF_xxx flags.                         */
> > -    xen_pfn_t store_mfn;        /* MACHINE page number of shared page.    */
> > -    uint32_t store_evtchn;      /* Event channel for store communication. */
> > -    union {
> > -        struct {
> > -            xen_pfn_t mfn;      /* MACHINE page number of console page.   */
> > -            uint32_t  evtchn;   /* Event channel for console page.        */
> > -        } domU;
> > -        struct {
> > -            uint32_t info_off;  /* Offset of console_info struct.         */
> > -            uint32_t info_size; /* Size of console_info struct from start.*/
> > -        } dom0;
> > -    } console;
> 
> What is PV MMU related up to here?

Hrm, perhaps categorising this as PV MMU was a mistake on my part.

These are all unused on ARM in terms of the hypervisor ABI since it uses
HVM like mechanisms for those which are appropriate and doesn't use a
bunch of the others at all.

> > -struct xen_multiboot_mod_list
> > -{
> > -    /* Address of first byte of the module */
> > -    uint32_t mod_start;
> > -    /* Address of last byte of the module (inclusive) */
> > -    uint32_t mod_end;
> > -    /* Address of zero-terminated command line */
> > -    uint32_t cmdline;
> > -    /* Unused, must be zero */
> > -    uint32_t pad;
> > -};
> 
> And this one isn't either, albeit I'm not sure about its actual use.

It's unused AFAICT.

Ian.

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

* Re: [PATCH 3/4] xen: make start_info x86 specific.
  2013-02-14 14:16 ` [PATCH 3/4] xen: make start_info x86 specific Ian Campbell
@ 2013-02-14 14:43   ` Jan Beulich
  2013-02-14 14:46     ` Ian Campbell
  0 siblings, 1 reply; 13+ messages in thread
From: Jan Beulich @ 2013-02-14 14:43 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Tim Deegan, xen-devel, Keir (Xen.org),
	Konrad Rzeszutek Wilk, Stefano Stabellini

>>> On 14.02.13 at 15:16, Ian Campbell <ian.campbell@citrix.com> wrote:
> Most of this struct is PV MMU specific and it is not used on ARM at all.

I'm not convinced this is the right move.

> --- a/xen/include/public/xen.h
> +++ b/xen/include/public/xen.h
> @@ -706,79 +706,6 @@ typedef struct shared_info shared_info_t;
>   *     extended by an extra 4MB to ensure this.
>   */
>  
> -#define MAX_GUEST_CMDLINE 1024
> -struct start_info {
> -    /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME.    */
> -    char magic[32];             /* "xen-<version>-<platform>".            */
> -    unsigned long nr_pages;     /* Total pages allocated to this domain.  */
> -    unsigned long shared_info;  /* MACHINE address of shared info struct. */
> -    uint32_t flags;             /* SIF_xxx flags.                         */
> -    xen_pfn_t store_mfn;        /* MACHINE page number of shared page.    */
> -    uint32_t store_evtchn;      /* Event channel for store communication. */
> -    union {
> -        struct {
> -            xen_pfn_t mfn;      /* MACHINE page number of console page.   */
> -            uint32_t  evtchn;   /* Event channel for console page.        */
> -        } domU;
> -        struct {
> -            uint32_t info_off;  /* Offset of console_info struct.         */
> -            uint32_t info_size; /* Size of console_info struct from start.*/
> -        } dom0;
> -    } console;

What is PV MMU related up to here?

> -    /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME).     */
> -    unsigned long pt_base;      /* VIRTUAL address of page directory.     */
> -    unsigned long nr_pt_frames; /* Number of bootstrap p.t. frames.       */
> -    unsigned long mfn_list;     /* VIRTUAL address of page-frame list.    */
> -    unsigned long mod_start;    /* VIRTUAL address of pre-loaded module   */
> -                                /* (PFN of pre-loaded module if           */
> -                                /*  SIF_MOD_START_PFN set in flags).      */
> -    unsigned long mod_len;      /* Size (bytes) of pre-loaded module.     */
> -    int8_t cmd_line[MAX_GUEST_CMDLINE];

The last three fields above don't appear to be either.

> -    /* The pfn range here covers both page table and p->m table frames.   */
> -    unsigned long first_p2m_pfn;/* 1st pfn forming initial P->M table.    */
> -    unsigned long nr_p2m_frames;/* # of pfns forming initial P->M table.  */
> -};
> -typedef struct start_info start_info_t;
> -
> -/* New console union for dom0 introduced in 0x00030203. */
> -#if __XEN_INTERFACE_VERSION__ < 0x00030203
> -#define console_mfn    console.domU.mfn
> -#define console_evtchn console.domU.evtchn
> -#endif
> -
> -/* These flags are passed in the 'flags' field of start_info_t. */
> -#define SIF_PRIVILEGED    (1<<0)  /* Is the domain privileged? */
> -#define SIF_INITDOMAIN    (1<<1)  /* Is this the initial control domain? */
> -#define SIF_MULTIBOOT_MOD (1<<2)  /* Is mod_start a multiboot module? */
> -#define SIF_MOD_START_PFN (1<<3)  /* Is mod_start a PFN? */
> -#define SIF_PM_MASK       (0xFF<<8) /* reserve 1 byte for xen-pm options */

Nor are these flags.

> -
> -/*
> - * A multiboot module is a package containing modules very similar to a
> - * multiboot module array. The only differences are:
> - * - the array of module descriptors is by convention simply at the beginning
> - *   of the multiboot module,
> - * - addresses in the module descriptors are based on the beginning of the
> - *   multiboot module,
> - * - the number of modules is determined by a termination descriptor that has
> - *   mod_start == 0.
> - *
> - * This permits to both build it statically and reference it in a configuration
> - * file, and let the PV guest easily rebase the addresses to virtual addresses
> - * and at the same time count the number of modules.
> - */
> -struct xen_multiboot_mod_list
> -{
> -    /* Address of first byte of the module */
> -    uint32_t mod_start;
> -    /* Address of last byte of the module (inclusive) */
> -    uint32_t mod_end;
> -    /* Address of zero-terminated command line */
> -    uint32_t cmdline;
> -    /* Unused, must be zero */
> -    uint32_t pad;
> -};

And this one isn't either, albeit I'm not sure about its actual use.

Jan

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

* [PATCH 3/4] xen: make start_info x86 specific.
  2013-02-14 14:15 [PATCH 00/04] xen: public interface (and foreign check) changes for arm Ian Campbell
@ 2013-02-14 14:16 ` Ian Campbell
  2013-02-14 14:43   ` Jan Beulich
  0 siblings, 1 reply; 13+ messages in thread
From: Ian Campbell @ 2013-02-14 14:16 UTC (permalink / raw)
  To: xen-devel
  Cc: Keir (Xen.org),
	Ian Campbell, Stefano Stabellini, Konrad Rzeszutek Wilk,
	Tim Deegan, Jan Beulich

Most of this struct is PV MMU specific and it is not used on ARM at all.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Jan Beulich <JBeulich@suse.com>
Cc: Keir (Xen.org) <keir@xen.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 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(-)

diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 32122fd..9e4a741 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -395,15 +395,14 @@ typedef union
     shared_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,
diff --git a/xen/include/public/arch-x86/xen.h b/xen/include/public/arch-x86/xen.h
index 13c21dc..00f0306 100644
--- a/xen/include/public/arch-x86/xen.h
+++ b/xen/include/public/arch-x86/xen.h
@@ -147,6 +147,79 @@ DEFINE_XEN_GUEST_HANDLE(trap_info_t);
 
 typedef uint64_t tsc_timestamp_t; /* RDTSC timestamp */
 
+#define MAX_GUEST_CMDLINE 1024
+struct start_info {
+    /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME.    */
+    char magic[32];             /* "xen-<version>-<platform>".            */
+    unsigned long nr_pages;     /* Total pages allocated to this domain.  */
+    unsigned long shared_info;  /* MACHINE address of shared info struct. */
+    uint32_t flags;             /* SIF_xxx flags.                         */
+    xen_pfn_t store_mfn;        /* MACHINE page number of shared page.    */
+    uint32_t store_evtchn;      /* Event channel for store communication. */
+    union {
+        struct {
+            xen_pfn_t mfn;      /* MACHINE page number of console page.   */
+            uint32_t  evtchn;   /* Event channel for console page.        */
+        } domU;
+        struct {
+            uint32_t info_off;  /* Offset of console_info struct.         */
+            uint32_t info_size; /* Size of console_info struct from start.*/
+        } dom0;
+    } console;
+    /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME).     */
+    unsigned long pt_base;      /* VIRTUAL address of page directory.     */
+    unsigned long nr_pt_frames; /* Number of bootstrap p.t. frames.       */
+    unsigned long mfn_list;     /* VIRTUAL address of page-frame list.    */
+    unsigned long mod_start;    /* VIRTUAL address of pre-loaded module   */
+                                /* (PFN of pre-loaded module if           */
+                                /*  SIF_MOD_START_PFN set in flags).      */
+    unsigned long mod_len;      /* Size (bytes) of pre-loaded module.     */
+    int8_t cmd_line[MAX_GUEST_CMDLINE];
+    /* The pfn range here covers both page table and p->m table frames.   */
+    unsigned long first_p2m_pfn;/* 1st pfn forming initial P->M table.    */
+    unsigned long nr_p2m_frames;/* # of pfns forming initial P->M table.  */
+};
+typedef struct start_info start_info_t;
+
+/* New console union for dom0 introduced in 0x00030203. */
+#if __XEN_INTERFACE_VERSION__ < 0x00030203
+#define console_mfn    console.domU.mfn
+#define console_evtchn console.domU.evtchn
+#endif
+
+/* These flags are passed in the 'flags' field of start_info_t. */
+#define SIF_PRIVILEGED    (1<<0)  /* Is the domain privileged? */
+#define SIF_INITDOMAIN    (1<<1)  /* Is this the initial control domain? */
+#define SIF_MULTIBOOT_MOD (1<<2)  /* Is mod_start a multiboot module? */
+#define SIF_MOD_START_PFN (1<<3)  /* Is mod_start a PFN? */
+#define SIF_PM_MASK       (0xFF<<8) /* reserve 1 byte for xen-pm options */
+
+/*
+ * A multiboot module is a package containing modules very similar to a
+ * multiboot module array. The only differences are:
+ * - the array of module descriptors is by convention simply at the beginning
+ *   of the multiboot module,
+ * - addresses in the module descriptors are based on the beginning of the
+ *   multiboot module,
+ * - the number of modules is determined by a termination descriptor that has
+ *   mod_start == 0.
+ *
+ * This permits to both build it statically and reference it in a configuration
+ * file, and let the PV guest easily rebase the addresses to virtual addresses
+ * and at the same time count the number of modules.
+ */
+struct xen_multiboot_mod_list
+{
+    /* Address of first byte of the module */
+    uint32_t mod_start;
+    /* Address of last byte of the module (inclusive) */
+    uint32_t mod_end;
+    /* Address of zero-terminated command line */
+    uint32_t cmdline;
+    /* Unused, must be zero */
+    uint32_t pad;
+};
+
 /*
  * The following is all CPU context. Note that the fpu_ctxt block is filled 
  * in by FXSAVE if the CPU has feature FXSR; otherwise FSAVE is used.
diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index 99c8212..846f446 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -706,79 +706,6 @@ typedef struct shared_info shared_info_t;
  *     extended by an extra 4MB to ensure this.
  */
 
-#define MAX_GUEST_CMDLINE 1024
-struct start_info {
-    /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME.    */
-    char magic[32];             /* "xen-<version>-<platform>".            */
-    unsigned long nr_pages;     /* Total pages allocated to this domain.  */
-    unsigned long shared_info;  /* MACHINE address of shared info struct. */
-    uint32_t flags;             /* SIF_xxx flags.                         */
-    xen_pfn_t store_mfn;        /* MACHINE page number of shared page.    */
-    uint32_t store_evtchn;      /* Event channel for store communication. */
-    union {
-        struct {
-            xen_pfn_t mfn;      /* MACHINE page number of console page.   */
-            uint32_t  evtchn;   /* Event channel for console page.        */
-        } domU;
-        struct {
-            uint32_t info_off;  /* Offset of console_info struct.         */
-            uint32_t info_size; /* Size of console_info struct from start.*/
-        } dom0;
-    } console;
-    /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME).     */
-    unsigned long pt_base;      /* VIRTUAL address of page directory.     */
-    unsigned long nr_pt_frames; /* Number of bootstrap p.t. frames.       */
-    unsigned long mfn_list;     /* VIRTUAL address of page-frame list.    */
-    unsigned long mod_start;    /* VIRTUAL address of pre-loaded module   */
-                                /* (PFN of pre-loaded module if           */
-                                /*  SIF_MOD_START_PFN set in flags).      */
-    unsigned long mod_len;      /* Size (bytes) of pre-loaded module.     */
-    int8_t cmd_line[MAX_GUEST_CMDLINE];
-    /* The pfn range here covers both page table and p->m table frames.   */
-    unsigned long first_p2m_pfn;/* 1st pfn forming initial P->M table.    */
-    unsigned long nr_p2m_frames;/* # of pfns forming initial P->M table.  */
-};
-typedef struct start_info start_info_t;
-
-/* New console union for dom0 introduced in 0x00030203. */
-#if __XEN_INTERFACE_VERSION__ < 0x00030203
-#define console_mfn    console.domU.mfn
-#define console_evtchn console.domU.evtchn
-#endif
-
-/* These flags are passed in the 'flags' field of start_info_t. */
-#define SIF_PRIVILEGED    (1<<0)  /* Is the domain privileged? */
-#define SIF_INITDOMAIN    (1<<1)  /* Is this the initial control domain? */
-#define SIF_MULTIBOOT_MOD (1<<2)  /* Is mod_start a multiboot module? */
-#define SIF_MOD_START_PFN (1<<3)  /* Is mod_start a PFN? */
-#define SIF_PM_MASK       (0xFF<<8) /* reserve 1 byte for xen-pm options */
-
-/*
- * A multiboot module is a package containing modules very similar to a
- * multiboot module array. The only differences are:
- * - the array of module descriptors is by convention simply at the beginning
- *   of the multiboot module,
- * - addresses in the module descriptors are based on the beginning of the
- *   multiboot module,
- * - the number of modules is determined by a termination descriptor that has
- *   mod_start == 0.
- *
- * This permits to both build it statically and reference it in a configuration
- * file, and let the PV guest easily rebase the addresses to virtual addresses
- * and at the same time count the number of modules.
- */
-struct xen_multiboot_mod_list
-{
-    /* Address of first byte of the module */
-    uint32_t mod_start;
-    /* Address of last byte of the module (inclusive) */
-    uint32_t mod_end;
-    /* Address of zero-terminated command line */
-    uint32_t cmdline;
-    /* Unused, must be zero */
-    uint32_t pad;
-};
-
 typedef struct dom0_vga_console_info {
     uint8_t video_type; /* DOM0_VGA_CONSOLE_??? */
 #define XEN_VGATYPE_TEXT_MODE_3 0x03
diff --git a/xen/include/xlat.lst b/xen/include/xlat.lst
index 3d4f1e3..5b0ff35 100644
--- a/xen/include/xlat.lst
+++ b/xen/include/xlat.lst
@@ -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-@arch@.h
+!	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
-- 
1.7.2.5

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

end of thread, other threads:[~2013-02-21 16:56 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-14 15:59 [PATCH V2 00/04] xen: public interface (and foreign check) changes for arm Ian Campbell
2013-02-14 15:59 ` [PATCH 1/4] tools: s/arm/arm32/ in foreign header checks Ian Campbell
2013-02-21 16:56   ` Stefano Stabellini
2013-02-14 15:59 ` [PATCH 2/4] xen: event channel arrays are xen_ulong_t and not unsigned long Ian Campbell
2013-02-15 11:58   ` Stefano Stabellini
2013-02-14 15:59 ` [PATCH 3/4] xen: make start_info x86 specific Ian Campbell
2013-02-14 15:59 ` [PATCH 4/4] xen: arm: include public/xen.h in foreign interface checking Ian Campbell
  -- strict thread matches above, loose matches on Subject: below --
2013-02-14 14:15 [PATCH 00/04] xen: public interface (and foreign check) changes for arm Ian Campbell
2013-02-14 14:16 ` [PATCH 3/4] xen: make start_info x86 specific Ian Campbell
2013-02-14 14:43   ` Jan Beulich
2013-02-14 14:46     ` Ian Campbell
2013-02-14 15:20       ` Jan Beulich
2013-02-15 13:30         ` Ian Campbell
2013-02-15 13:45           ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.