]> xenbits.xensource.com Git - people/andrewcoop/xen-test-framework.git/commitdiff
Introduce __user_data
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 22 Mar 2018 11:50:50 +0000 (11:50 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 13 Apr 2018 18:48:47 +0000 (19:48 +0100)
Fix up the missing __user_text in Doxyfile, and the missing linker assertions
that the user bss boundaries are page aligned.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Doxyfile
arch/x86/hvm/traps.c
arch/x86/link.lds.S
arch/x86/pv/traps.c
include/xtf/compiler.h

index c5a53aa83cf4543efef1d249ebd064ed53049d16..9e39aeb572212cf39e90e33daa2d91e60bc8d704 100644 (file)
--- a/Doxyfile
+++ b/Doxyfile
@@ -2036,7 +2036,9 @@ PREDEFINED             = __alias(x)= \
                          __noinline \
                          __noreturn \
                          __used \
+                         __user_data \
                          __user_page_aligned_bss \
+                         __user_text \
                          __weak \
 
 
index ab095e791e01c7a5ebdb17a96101ee904f43bdbf..34c340b8da0fd2b1bbe461ab7f46df6daa853011 100644 (file)
@@ -138,11 +138,15 @@ void arch_init_traps(void)
     if ( !test_wants_user_mappings )
     {
         extern const char __start_user_text[], __end_user_text[];
+        extern const char __start_user_data[], __end_user_data[];
         extern const char __start_user_bss[],  __end_user_bss[];
 
         remap_user(virt_to_gfn(__start_user_text),
                    virt_to_gfn(__end_user_text));
 
+        remap_user(virt_to_gfn(__start_user_data),
+                   virt_to_gfn(__end_user_data));
+
         remap_user(virt_to_gfn(__start_user_bss),
                    virt_to_gfn(__end_user_bss));
 
index ca25a6cf7e2e0c69d88b532c15881b5917a538e3..916b671084e5c4f2fd93d73cdd3be7346940166a 100644 (file)
@@ -50,6 +50,12 @@ SECTIONS
         . = ALIGN(PAGE_SIZE);
                 *(.data.page_aligned)
         . = ALIGN(PAGE_SIZE);
+
+        __start_user_data = .;
+                *(.data.user)
+       . = ALIGN(PAGE_SIZE);
+        __end_user_data = .;
+
         }
 
         .rodata : {
@@ -94,6 +100,10 @@ ASSERT(IS_ALIGNED(user_stack, PAGE_SIZE), "user_stack misaligned");
 
 ASSERT(IS_ALIGNED(__start_user_text, PAGE_SIZE), "__start_user_text misaligned");
 ASSERT(IS_ALIGNED(__end_user_text,   PAGE_SIZE), "__end_user_text misaligned");
+ASSERT(IS_ALIGNED(__start_user_data, PAGE_SIZE), "__start_user_data misaligned");
+ASSERT(IS_ALIGNED(__end_user_data,   PAGE_SIZE), "__end_user_data misaligned")
+ASSERT(IS_ALIGNED(__start_user_bss,  PAGE_SIZE), "__start_user_data misaligned");
+ASSERT(IS_ALIGNED(__end_user_bss,    PAGE_SIZE), "__end_user_data misaligned")
 
 #ifdef CONFIG_HVM
 
index 4b484a6f0f3d04b0fbc3eca8bf959fe5767fa34b..1899d0b9a0bad741c37694a30acca211b26172a9 100644 (file)
@@ -255,11 +255,15 @@ void arch_init_traps(void)
          * structures which specifically want to be user.
          */
         extern const char __start_user_text[], __end_user_text[];
+        extern const char __start_user_data[], __end_user_data[];
         extern const char __start_user_bss[],  __end_user_bss[];
 
         remap_linear_range(__start_user_text, __end_user_text,
                            PF_SYM(AD, U, RW, P));
 
+        remap_linear_range(__start_user_data, __end_user_data,
+                           PF_SYM(AD, U, RW, P));
+
         remap_linear_range(__start_user_bss, __end_user_bss,
                            PF_SYM(AD, U, RW, P));
     }
index 3324f47e95d7a07edd4abe0fc3e5cd148520d23b..19d93492eadfed917392f1cc0a93f35a5ae241fc 100644 (file)
@@ -31,6 +31,8 @@
 
 /* Convenience wrappers. */
 #define __user_text           __section(".text.user")
+#define __user_data           __section(".data.user")
+
 #define __page_aligned_data   __section(".data.page_aligned") __aligned(4096)
 #define __page_aligned_bss    __section(".bss.page_aligned")  __aligned(4096)