From: Andrew Cooper Date: Fri, 22 Apr 2016 18:47:42 +0000 (+0100) Subject: Annotate hypercall stubs as functions X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=424bcd697313d555d21a88bf739ac8a6a8220fae;p=people%2Froyger%2Fxen-test-framework.git Annotate hypercall stubs as functions Move DECLARE_HYPERCALL() from asm_macros.h to being local, as it is not useful elsewhere. Link hypercall_page in .data rather than .text, to avoid polluting the disassembly. Annotate hypercall_page itself as data. Signed-off-by: Andrew Cooper --- diff --git a/arch/x86/hypercall_page.S b/arch/x86/hypercall_page.S index 5e0b6db..5b94a49 100644 --- a/arch/x86/hypercall_page.S +++ b/arch/x86/hypercall_page.S @@ -2,13 +2,24 @@ #include #include -.text +.data .align PAGE_SIZE GLOBAL(hypercall_page) /* Poisoned with `ret` for safety before hypercalls are set up. */ .fill PAGE_SIZE, 1, 0xc3 + .type hypercall_page, STT_OBJECT .size hypercall_page, PAGE_SIZE +/* + * Identify a specific hypercall in the hypercall page + * @param name Hypercall name. + */ +#define DECLARE_HYPERCALL(name) \ + .globl HYPERCALL_ ## name; \ + .set HYPERCALL_ ## name, hypercall_page + __HYPERVISOR_ ## name * 32; \ + .type HYPERCALL_ ## name, STT_FUNC; \ + .size HYPERCALL_ ## name, 32 + DECLARE_HYPERCALL(set_trap_table) DECLARE_HYPERCALL(mmu_update) DECLARE_HYPERCALL(set_gdt) diff --git a/build/files.mk b/build/files.mk index f411c8a..ea34b8b 100644 --- a/build/files.mk +++ b/build/files.mk @@ -15,12 +15,10 @@ obj-perarch += $(ROOT)/common/report.o obj-perarch += $(ROOT)/common/setup.o obj-perenv += $(ROOT)/arch/x86/desc.o +obj-perenv += $(ROOT)/arch/x86/hypercall_page.o obj-perenv += $(ROOT)/arch/x86/setup.o obj-perenv += $(ROOT)/arch/x86/traps.o -# Always link hypercall_page.S last as it is a page of data replaced by the hyperisor -obj-perenv += $(ROOT)/arch/x86/hypercall_page.o - # HVM specific objects obj-hvm += $(ROOT)/arch/x86/hvm/pagetables.o diff --git a/include/xtf/asm_macros.h b/include/xtf/asm_macros.h index 71ec874..1de91ae 100644 --- a/include/xtf/asm_macros.h +++ b/include/xtf/asm_macros.h @@ -35,15 +35,6 @@ name: #define SIZE(name) \ .size name, . - name; -/** - * Identify a specific hypercall in the hypercall page - * @param name Hypercall name. - */ -#define DECLARE_HYPERCALL(name) \ - .globl HYPERCALL_ ## name; \ - .set HYPERCALL_ ## name, hypercall_page + __HYPERVISOR_ ## name * 32; \ - .size HYPERCALL_ ## name, 32 - /** * Create an ELF note entry. *