This alone drops the size of HVM tests by 8k.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
#define PAE_IDX(sym) ((. - (sym)) / PAE_PTE_SIZE)
#define PSE_IDX(sym) ((. - (sym)) / PSE_PTE_SIZE)
- .data
+ .section ".data.page_aligned", "aw"
.p2align PAGE_SHIFT
/* PAE mappings of first 2M of memory in 4k pages. Uses 1x 4k page. */
PAGETABLE_END(pse_l2_identmap)
.Lpse_l2_identmap_end:
+ .data
+ .align 32
/* PAE l3 32bit quad. Contains 4 64bit entries. */
PAGETABLE_START(pae32_l3_identmap)
.rept PAE32_L3_ENTRIES
#include <xtf/asm_macros.h>
#include <xen/xen.h>
-.data
-.align PAGE_SIZE
+ .section ".data.page_aligned", "aw"
+ .p2align PAGE_SHIFT
+
GLOBAL(hypercall_page)
/* Poisoned with `ret` for safety before hypercalls are set up. */
.fill PAGE_SIZE, 1, 0xc3
.data : {
*(.data)
+ . = ALIGN(PAGE_SIZE);
+ *(.data.page_aligned)
+ . = ALIGN(PAGE_SIZE);
}
.rodata : {
.bss : {
*(.bss)
+ . = ALIGN(PAGE_SIZE);
+ *(.bss.page_aligned)
+ . = ALIGN(PAGE_SIZE);
}
_end = .;
* boot_stack[page 2] Exception entrypoints
* boot_stack[page 1] Top of work stack
*/
-uint8_t boot_stack[3 * PAGE_SIZE] __aligned(PAGE_SIZE);
-uint8_t user_stack[PAGE_SIZE] __aligned(PAGE_SIZE);
+uint8_t boot_stack[3 * PAGE_SIZE] __page_aligned_bss;
+uint8_t user_stack[PAGE_SIZE] __page_aligned_bss;
+
uint32_t x86_features[FSCAPINTS];
enum x86_vendor x86_vendor;
unsigned int max_leaf, max_extd_leaf;
/* Convenience wrappers. */
#define __user_text __section(".text.user")
+#define __page_aligned_data __section(".data.page_aligned") __aligned(4096)
+#define __page_aligned_bss __section(".bss.page_aligned") __aligned(4096)
#endif /* XTF_COMPILER_H */
void test_main(void)
{
- static intpte_t nl2t[L2_PT_ENTRIES] __aligned(PAGE_SIZE);
- static intpte_t nl1t[L1_PT_ENTRIES] __aligned(PAGE_SIZE);
- static uint8_t buffer[PAGE_SIZE] __aligned(PAGE_SIZE);
+ static intpte_t nl2t[L2_PT_ENTRIES] __page_aligned_bss;
+ static intpte_t nl1t[L1_PT_ENTRIES] __page_aligned_bss;
+ static uint8_t buffer[PAGE_SIZE] __page_aligned_bss;
printk(" Executing user wild jump\n");
exec_user_void(wild_jump);
const char test_title[] = "XSA-173 PoC";
/* New L2 pagetable for the test to manipulate. */
-uint64_t nl2[PAE_L2_PT_ENTRIES] __aligned(PAGE_SIZE);
+uint64_t nl2[PAE_L2_PT_ENTRIES] __page_aligned_bss;
static bool seen_fault;
if ( IS_DEFINED(CONFIG_64BIT) )
{
- static intpte_t nl1t[L1_PT_ENTRIES] __aligned(PAGE_SIZE);
- static intpte_t nl2t[L2_PT_ENTRIES] __aligned(PAGE_SIZE);
+ static intpte_t nl1t[L1_PT_ENTRIES] __page_aligned_bss;
+ static intpte_t nl2t[L2_PT_ENTRIES] __page_aligned_bss;
/*
* The manuals say we can't `iretq` to a compat mode code segment with
const char test_title[] = "XSA-188 PoC";
-static uint8_t array_page[PAGE_SIZE] __aligned(PAGE_SIZE);
+static uint8_t array_page[PAGE_SIZE] __page_aligned_bss;
void test_main(void)
{
const char test_title[] = "XSA-195 PoC";
-static intpte_t nl3t[L3_PT_ENTRIES] __aligned(PAGE_SIZE);
-static intpte_t nl2t[L2_PT_ENTRIES] __aligned(PAGE_SIZE);
-static intpte_t nl1t[L1_PT_ENTRIES] __aligned(PAGE_SIZE);
+static intpte_t nl3t[L3_PT_ENTRIES] __page_aligned_bss;
+static intpte_t nl2t[L2_PT_ENTRIES] __page_aligned_bss;
+static intpte_t nl1t[L1_PT_ENTRIES] __page_aligned_bss;
void test_main(void)
{