From: Jan Beulich Date: Wed, 29 Aug 2018 14:32:17 +0000 (+0200) Subject: x86: reduce "visibility" of spec_ctrl_asm.h X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~3367 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=55924f9d923b51ce8ed6d2ecc7a3644a8562e8d9;p=xen.git 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 Acked-by: Andrew Cooper --- diff --git a/xen/include/asm-x86/asm_defns.h b/xen/include/asm-x86/asm_defns.h index 89a0fb41a2..da504eaec2 100644 --- a/xen/include/asm-x86/asm_defns.h +++ b/xen/include/asm-x86/asm_defns.h @@ -326,6 +326,8 @@ static always_inline void stac(void) "call cr4_pv32_restore", X86_FEATURE_XEN_SMEP, \ "call cr4_pv32_restore", X86_FEATURE_XEN_SMAP +#include + #endif #ifdef CONFIG_PERF_COUNTERS @@ -368,6 +370,4 @@ static always_inline void stac(void) 4: .p2align 2 ; \ .popsection -#include - #endif /* __X86_ASM_DEFNS_H__ */ diff --git a/xen/include/asm-x86/spec_ctrl.h b/xen/include/asm-x86/spec_ctrl.h index e7d946ecb6..e06fa84865 100644 --- 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 #include #include @@ -91,6 +98,7 @@ static always_inline void spec_ctrl_exit_idle(struct cpu_info *info) :: "a" (val), "c" (MSR_SPEC_CTRL), "d" (0) : "memory" ); } +#endif /* __ASSEMBLY__ */ #endif /* !__X86_SPEC_CTRL_H__ */ /* diff --git a/xen/include/asm-x86/spec_ctrl_asm.h b/xen/include/asm-x86/spec_ctrl_asm.h index 686a0f77a5..803f7ce5ef 100644 --- 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 +#include /* * Saving and restoring MSR_SPEC_CTRL state is a little tricky.