]> xenbits.xensource.com Git - xtf.git/commitdiff
Rename start_info to pv_start_info
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 31 Jan 2018 10:57:58 +0000 (10:57 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 31 Jan 2018 11:43:42 +0000 (11:43 +0000)
In preparation to introduce pvh_start_info.  Rename the type to match, fix up
the accidental double extern, and move the variable into pv/traps.c to match
with its declaration in traps.h.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
arch/x86/include/arch/mm.h
arch/x86/include/arch/traps.h
arch/x86/pv/head.S
arch/x86/pv/traps.c
arch/x86/setup.c
include/xen/xen.h
tests/pv-iopl/main.c
tests/xsa-227/main.c

index c7de84b54bbaa443b2f106c2fd16f39da3cca9c6..b151f59ef4dc32fb4759429002964da7d6141392 100644 (file)
@@ -5,6 +5,7 @@
 #include <xtf/types.h>
 
 #include <arch/page.h>
+#include <arch/traps.h>
 
 #include <xen/xen.h>
 
@@ -46,7 +47,6 @@ static inline unsigned long virt_to_pfn(const void *va)
 #if defined(CONFIG_PV)
 
 #define m2p ((unsigned long *)MACH2PHYS_VIRT_START)
-extern start_info_t *start_info;
 
 static inline void *mfn_to_virt(unsigned long mfn)
 {
@@ -60,7 +60,7 @@ static inline void *maddr_to_virt(uint64_t maddr)
 
 static inline unsigned long pfn_to_mfn(unsigned long pfn)
 {
-    unsigned long *p2m = _p(start_info->mfn_list);
+    unsigned long *p2m = _p(pv_start_info->mfn_list);
 
     return p2m[pfn];
 }
index 8965e4be14f31bb12d479fa6d4e8dafd7e1b500a..1a0e7470d0c4b6821dadc972323e13c40b8a0df1 100644 (file)
@@ -54,7 +54,7 @@ static inline unsigned int cpu_regs_ss(const struct cpu_regs *regs)
 extern uint8_t boot_stack[3 * PAGE_SIZE];
 extern uint8_t user_stack[PAGE_SIZE];
 
-extern start_info_t *start_info;
+extern xen_pv_start_info_t *pv_start_info;
 extern shared_info_t shared_info;
 
 #endif /* XTF_X86_TRAPS_H */
index df4b608d13469aa8e0cf11d9818468316108860d..9dd45c99abc8c2a6a676b6644b0cf65930c8a227 100644 (file)
@@ -27,8 +27,8 @@ ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE, .asciz "yes")
  /* PV entry point. */
 GLOBAL(_start)
 
-        /* Stash start_info_t pointer from domain build. */
-        mov %_ASM_SI, start_info
+        /* Stash the pv_start_info pointer from domain builder. */
+        mov %_ASM_SI, pv_start_info
 
         /* Move onto own stack. */
         mov $boot_stack + PAGE_SIZE, %esp
index 4a772f8b435f2fe75e64f0cc2d55dba0f6bcc871..336da9ef7ade01530b96d9960a1469c5d91831ab 100644 (file)
@@ -10,6 +10,9 @@
 #include <arch/pagetable.h>
 #include <arch/symbolic-const.h>
 
+/* Filled in by pv/head.S */
+xen_pv_start_info_t *pv_start_info = NULL;
+
 /* Real entry points */
 void entry_DE(void);
 void entry_DB(void);
@@ -169,7 +172,7 @@ void arch_init_traps(void)
          * If we have got this far, SMEP/SMAP are not leaking into guest
          * context.  Proceed with remapping all mappings as _PAGE_USER.
          */
-        uint64_t *l3 = _p(start_info->pt_base);
+        uint64_t *l3 = _p(pv_start_info->pt_base);
         unsigned long linear = 0;
 
         while ( linear < __HYPERVISOR_VIRT_START_PAE )
index 526361d2a2187661b2e1e5798f4b228dc00664ba..5e317c5597a4332da94750a05f83e0ec94aef0af 100644 (file)
@@ -29,11 +29,6 @@ unsigned int maxphysaddr, maxvirtaddr;
 
 const char environment_description[] = ENVIRONMENT_DESCRIPTION;
 
-#ifdef CONFIG_PV
-/* Filled in by head_pv.S */
-start_info_t *start_info = NULL;
-#endif
-
 shared_info_t shared_info __page_aligned_bss;
 
 static void collect_cpuid(cpuid_count_fn_t cpuid_fn)
@@ -155,8 +150,8 @@ static void setup_pv_console(void)
 
     if ( IS_DEFINED(CONFIG_PV) )
     {
-        cons_ring = mfn_to_virt(start_info->console.domU.mfn);
-        cons_evtchn = start_info->console.domU.evtchn;
+        cons_ring = mfn_to_virt(pv_start_info->console.domU.mfn);
+        cons_evtchn = pv_start_info->console.domU.evtchn;
     }
     else /* HVM */
     {
@@ -180,8 +175,8 @@ static void setup_xenbus(void)
 
     if ( IS_DEFINED(CONFIG_PV) )
     {
-        xb_ring = mfn_to_virt(start_info->store_mfn);
-        xb_port = start_info->store_evtchn;
+        xb_ring = mfn_to_virt(pv_start_info->store_mfn);
+        xb_port = pv_start_info->store_evtchn;
     }
     else /* HVM */
     {
@@ -221,7 +216,7 @@ static void map_shared_info(void)
     }
     else /* PV */
         rc = hypercall_update_va_mapping(
-            _u(&shared_info), start_info->shared_info | PF_SYM(RW, P),
+            _u(&shared_info), pv_start_info->shared_info | PF_SYM(RW, P),
             UVMF_INVLPG);
 
     if ( rc )
index 85aaba8cacf06ca76807a7ab805635936c39cc7b..fe0d6d8522cd18bb5bfa9f89f51ec416cd070bdd 100644 (file)
@@ -201,7 +201,7 @@ struct shared_info {
 };
 typedef struct shared_info shared_info_t;
 
-struct start_info {
+struct xen_pv_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.  */
@@ -233,7 +233,7 @@ struct start_info {
     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;
+typedef struct xen_pv_start_info xen_pv_start_info_t;
 #endif
 
 /* MMU UPDATE operations */
index 74f47b6f68065f26df2c53efa7928f89f8a24bd2..ead80a32b5a90722c3c1fb6719dbb4aa08be9889 100644 (file)
@@ -253,12 +253,12 @@ void test_main(void)
      * @todo Implement better command line infrastructure, but this will do
      * for now.
      */
-    if ( !strcmp((char *)start_info->cmd_line, "hypercall") )
+    if ( !strcmp((char *)pv_start_info->cmd_line, "hypercall") )
     {
         printk("Test: PHYSDEVOP_set_iopl\n");
         test = &hypercall;
     }
-    else if ( !strcmp((char *)start_info->cmd_line, "vmassist") )
+    else if ( !strcmp((char *)pv_start_info->cmd_line, "vmassist") )
     {
         if ( hypercall_vm_assist(VMASST_CMD_enable,
                                  VMASST_TYPE_architectural_iopl) )
index 4902550dc9d445ff97295b68dd12f0dc9113085a..cd7e8febd54e88a549ca056f4ae4f0b004acfa2a 100644 (file)
@@ -49,7 +49,7 @@ void test_main(void)
     gnttab_v1[8].flags = GTF_permit_access;
 
     /* Opencoded pagewalk to KB(4) */
-    intpte_t *l4t = _p(start_info->pt_base);
+    intpte_t *l4t = _p(pv_start_info->pt_base);
     intpte_t *l3t = maddr_to_virt(pte_to_paddr(l4t[0]));
     intpte_t *l2t = maddr_to_virt(pte_to_paddr(l3t[0]));
     intpte_t *l1t = maddr_to_virt(pte_to_paddr(l2t[0]));