[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v2 3/3] x86: reduce "visibility" of spec_ctrl_asm.h
Other than indirect_thunk_asm.h, spec_ctrl_asm.h is a header generally needed by assembly source files only. Avoid having all C sources have a dependency on that header (the set of assembly sources now gaining a dependency on the C header is much smaller and hence more acceptable). Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> --- a/xen/include/asm-x86/asm_defns.h +++ b/xen/include/asm-x86/asm_defns.h @@ -328,6 +328,8 @@ static always_inline void stac(void) "call cr4_pv32_restore", X86_FEATURE_XEN_SMEP, \ "call cr4_pv32_restore", X86_FEATURE_XEN_SMAP +#include <asm/spec_ctrl_asm.h> + #endif #ifdef CONFIG_PERF_COUNTERS @@ -370,6 +372,4 @@ static always_inline void stac(void) 4: .p2align 2 ; \ .popsection -#include <asm/spec_ctrl_asm.h> - #endif /* __X86_ASM_DEFNS_H__ */ --- a/xen/include/asm-x86/spec_ctrl.h +++ b/xen/include/asm-x86/spec_ctrl.h @@ -20,6 +20,13 @@ #ifndef __X86_SPEC_CTRL_H__ #define __X86_SPEC_CTRL_H__ +/* Encoding of cpuinfo.spec_ctrl_flags */ +#define SCF_use_shadow (1 << 0) +#define SCF_ist_wrmsr (1 << 1) +#define SCF_ist_rsb (1 << 2) + +#ifndef __ASSEMBLY__ + #include <asm/alternative.h> #include <asm/current.h> #include <asm/msr-index.h> @@ -79,6 +86,7 @@ static always_inline void spec_ctrl_exit :: "a" (val), "c" (MSR_SPEC_CTRL), "d" (0) : "memory" ); } +#endif /* __ASSEMBLY__ */ #endif /* !__X86_SPEC_CTRL_H__ */ /* --- a/xen/include/asm-x86/spec_ctrl_asm.h +++ b/xen/include/asm-x86/spec_ctrl_asm.h @@ -20,13 +20,9 @@ #ifndef __X86_SPEC_CTRL_ASM_H__ #define __X86_SPEC_CTRL_ASM_H__ -/* Encoding of cpuinfo.spec_ctrl_flags */ -#define SCF_use_shadow (1 << 0) -#define SCF_ist_wrmsr (1 << 1) -#define SCF_ist_rsb (1 << 2) - #ifdef __ASSEMBLY__ #include <asm/msr-index.h> +#include <asm/spec_ctrl.h> /* * Saving and restoring MSR_SPEC_CTRL state is a little tricky. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |