On 05/11/18 17:08, Wei Liu wrote: > On Mon, Nov 05, 2018 at 02:33:23PM +0000, Andrew Cooper wrote: >> On 02/11/18 15:55, Wei Liu wrote: >>> Skip building x86_64/compat/entry.S and put CONFIG_PV in >>> x86_64/entry.S. >>> >>> Signed-off-by: Wei Liu <[email protected]> >>> --- >>> v3: >>> 1. make CR4_PV32_RESTORE expand to nothing when !PV >>> 2. use unconditional jmp and add assertions >>> >>> v2: new >>> --- >>> xen/arch/x86/x86_64/Makefile | 2 +- >>> xen/arch/x86/x86_64/entry.S | 39 +++++++++++++++++++++++++++++++++- >>> xen/include/asm-x86/asm_defns.h | 4 +++- >>> 3 files changed, 43 insertions(+), 2 deletions(-) >>> >>> diff --git a/xen/arch/x86/x86_64/Makefile b/xen/arch/x86/x86_64/Makefile >>> index f336a6a..4bfa148 100644 >>> --- a/xen/arch/x86/x86_64/Makefile >>> +++ b/xen/arch/x86/x86_64/Makefile >>> @@ -1,4 +1,4 @@ >>> -subdir-y += compat >>> +subdir-$(CONFIG_PV) += compat >>> >>> obj-bin-y += entry.o >>> obj-y += traps.o >>> diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S >>> index 9b02899..975ed6a 100644 >>> --- a/xen/arch/x86/x86_64/entry.S >>> +++ b/xen/arch/x86/x86_64/entry.S >>> @@ -15,6 +15,18 @@ >>> #include <public/xen.h> >>> #include <irq_vectors.h> >>> >>> +#ifndef NDEBUG >>> +/* %rsp: struct cpu_user_regs */ >>> +#define ASSERT_INTERRUPTED_XEN_CONTEXT \ >> Could I suggest ASSERT_CONTEXT_IS_XEN which I think fits better in some >> of the cases below? >> >>> + testb $3, UREGS_cs(%rsp); \ >>> + jz 1f; \ >>> + ASSERT_FAILED("INTERRUPTED XEN CONTEXT"); \ >> This probably wants to be: >> >> .macro ASSERT_CONTEXT_IS_XEN >> #ifndef NDEBUG >> testb $3, UREGS_cs(%rsp); >> UNLIKELY_START(nz, ASSERT_XEN_\@); >> ASSERT_FAILED("CONTEXT IS XEN"); >> __UNLIKELY_END(ASSERT_XEN_\@); >> #endif >> .endm > This works. I have deleted all semicolons though.
Nice! > > (To avoid posting other patches) > > ---8<--- > From 8f3ce0b0a5b6a215d4309d77d2c63229fb4af900 Mon Sep 17 00:00:00 2001 > From: Wei Liu <[email protected]> > Date: Fri, 19 Oct 2018 12:32:12 +0100 > Subject: [PATCH] x86: make entry point code build when !CONFIG_PV > > Skip building x86_64/compat/entry.S and put CONFIG_PV in > x86_64/entry.S. > > Signed-off-by: Wei Liu <[email protected]> Reviewed-by: Andrew Cooper <[email protected]> _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
