x86/paravirt: remove the wbinvd hook
Subsystems (5)
Juergen Gross
maintainerPATCH 1/1 x86/paravirt: remove the wbinvd hook
The wbinvd paravirt hook is a leftover of lguest times. Today it is no longer needed, as all users use the native wbinvd implementation.
Remove the hook and rename native_wbinvd() to wbinvd().
Signed-off-by Juergen Gross <[email protected]>
--- arch/x86/include/asm/paravirt.h | 7 ------- arch/x86/include/asm/paravirt_types.h | 2 -- arch/x86/include/asm/special_insns.h | 8 +------- arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 2 +- arch/x86/kernel/paravirt.c | 6 ------ arch/x86/kernel/process.c | 4 ++-- arch/x86/xen/enlighten_pv.c | 2 -- 7 files changed, 4 insertions(+), 27 deletions(-)
arch/x86/include/asm/paravirt.h +0 -7
@@ -180,13 +180,6 @@ static inline void halt(void)PVOP_VCALL0 (irq.halt); } -extern noinstr void pv_native_wbinvd(void); - -static __always_inline void wbinvd(void) -{ -PVOP_ALT_VCALL0 (cpu.wbinvd,"wbinvd" ,ALT_NOT_XEN ); -} -static inline u64 paravirt_read_msr (unsigned msr) {return PVOP_CALL1 (u64, cpu.read_msr, msr);
arch/x86/include/asm/paravirt_types.h +0 -2
@@ -86,8 +86,6 @@ struct pv_cpu_ops {void (*update_io_bitmap)(void );#endif -void (*wbinvd)(void ); -/* cpuid emulation, mostly so that caps bits can be disabled */ void (*cpuid)(unsigned int *eax,unsigned int *ebx,unsigned int *ecx,unsigned int *edx);
arch/x86/include/asm/special_insns.h +1 -7
@@ -115,7 +115,7 @@ static inline void wrpkru(u32 pkru) }#endif -static __always_inline void native_wbinvd(void) +static __always_inline void wbinvd(void) { asmvolatile ("wbinvd" : : :"memory" ); }
@@ -167,12 +167,6 @@ static inline void __write_cr4(unsigned long x) {native_write_cr4 (x); } - -static __always_inline void wbinvd(void) -{ -native_wbinvd (); -} -#endif /* CONFIG_PARAVIRT_XXL */ static __always_inline void clflush(volatile void *__p)
arch/x86/kernel/cpu/resctrl/pseudo_lock.c +1 -1
@@ -459,7 +459,7 @@ static int pseudo_lock_fn(void *_rdtgrp)* increase likelihood that allocated cache portion will be filled * with associated memory. */ -native_wbinvd (); +wbinvd ();/* * Always called with interrupts enabled. By disabling interrupts
arch/x86/kernel/paravirt.c +0 -6
@@ -116,11 +116,6 @@ static noinstr void pv_native_set_debugreg(int regno, unsigned long val)native_set_debugreg (regno, val); } -noinstr void pv_native_wbinvd(void) -{ -native_wbinvd (); -} - static noinstr void pv_native_safe_halt(void) {native_safe_halt ();
@@ -148,7 +143,6 @@ struct paravirt_patch_template pv_ops = { .cpu.read_cr0 = native_read_cr0, .cpu.write_cr0 = native_write_cr0, .cpu.write_cr4 = native_write_cr4, - .cpu.wbinvd = pv_native_wbinvd, .cpu.read_msr = native_read_msr, .cpu.write_msr = native_write_msr, .cpu.read_msr_safe = native_read_msr_safe,
arch/x86/kernel/process.c +2 -2
@@ -825,7 +825,7 @@ void __noreturn stop_this_cpu(void *dummy)* X86_FEATURE_SME due to cmdline options. */ if (c->extended_cpuid_level >=0x8000001f && (cpuid_eax (0x8000001f ) &BIT (0 ))) -native_wbinvd (); +wbinvd ();/* * This brings a cache line back and dirties it, but
@@ -846,7 +846,7 @@ void __noreturn stop_this_cpu(void *dummy)/* * Use native_halt() so that memory contents don't change * (stack usage and variables) after possibly issuing the -* native_wbinvd() above. +* wbinvd() above. */ native_halt (); }
arch/x86/xen/enlighten_pv.c +0 -2
@@ -1161,8 +1161,6 @@ static const typeof(pv_ops) xen_cpu_ops __initconst = { .write_cr4 = xen_write_cr4, - .wbinvd = pv_native_wbinvd, - .read_msr = xen_read_msr, .write_msr = xen_write_msr,
Signature · 1 line
2.43.0
[tip: x86/cpu] x86/paravirt: Remove the WBINVD callback
The following commit has been merged into the x86/cpu branch of tip:
The following commit has been merged into the x86/cpu branch of tip:
Commit-ID: 29188c16006176caee6cb6729103be51a29c1a93 Gitweb: https://git.kernel.org/tip/29188c16006176caee6cb6729103be51a29c1a93 Author: Juergen Gross <[email protected]> AuthorDate: Tue, 03 Dec 2024 08:15:50 +01:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Fri, 06 Dec 2024 11:01:36 +01:00
x86/paravirt: Remove the WBINVD callback
The pv_ops::cpu.wbinvd paravirt callback is a leftover of lguest times. Today it is no longer needed, as all users use the native WBINVD implementation.
Remove the callback and rename native_wbinvd() to wbinvd().
Signed-off-by Juergen Gross <[email protected]>
Signed-off-by Ingo Molnar <[email protected]>
--- arch/x86/include/asm/paravirt.h | 7 ------- arch/x86/include/asm/paravirt_types.h | 2 -- arch/x86/include/asm/special_insns.h | 8 +------- arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 2 +- arch/x86/kernel/paravirt.c | 6 ------ arch/x86/kernel/process.c | 4 ++-- arch/x86/xen/enlighten_pv.c | 2 -- 7 files changed, 4 insertions(+), 27 deletions(-)
arch/x86/include/asm/paravirt.h +0 -7
@@ -180,13 +180,6 @@ static inline void halt(void)PVOP_VCALL0 (irq.halt); } -extern noinstr void pv_native_wbinvd(void); - -static __always_inline void wbinvd(void) -{ -PVOP_ALT_VCALL0 (cpu.wbinvd,"wbinvd" ,ALT_NOT_XEN ); -} -static inline u64 paravirt_read_msr (unsigned msr) {return PVOP_CALL1 (u64, cpu.read_msr, msr);
arch/x86/include/asm/paravirt_types.h +0 -2
@@ -86,8 +86,6 @@ struct pv_cpu_ops {void (*update_io_bitmap)(void );#endif -void (*wbinvd)(void ); -/* cpuid emulation, mostly so that caps bits can be disabled */ void (*cpuid)(unsigned int *eax,unsigned int *ebx,unsigned int *ecx,unsigned int *edx);
arch/x86/include/asm/special_insns.h +1 -7
@@ -115,7 +115,7 @@ static inline void wrpkru(u32 pkru) }#endif -static __always_inline void native_wbinvd(void) +static __always_inline void wbinvd(void) { asmvolatile ("wbinvd" : : :"memory" ); }
@@ -167,12 +167,6 @@ static inline void __write_cr4(unsigned long x) {native_write_cr4 (x); } - -static __always_inline void wbinvd(void) -{ -native_wbinvd (); -} -#endif /* CONFIG_PARAVIRT_XXL */ static __always_inline void clflush(volatile void *__p)
arch/x86/kernel/cpu/resctrl/pseudo_lock.c +1 -1
@@ -459,7 +459,7 @@ static int pseudo_lock_fn(void *_rdtgrp)* increase likelihood that allocated cache portion will be filled * with associated memory. */ -native_wbinvd (); +wbinvd ();/* * Always called with interrupts enabled. By disabling interrupts
arch/x86/kernel/paravirt.c +0 -6
@@ -116,11 +116,6 @@ static noinstr void pv_native_set_debugreg(int regno, unsigned long val)native_set_debugreg (regno, val); } -noinstr void pv_native_wbinvd(void) -{ -native_wbinvd (); -} - static noinstr void pv_native_safe_halt(void) {native_safe_halt ();
@@ -148,7 +143,6 @@ struct paravirt_patch_template pv_ops = { .cpu.read_cr0 = native_read_cr0, .cpu.write_cr0 = native_write_cr0, .cpu.write_cr4 = native_write_cr4, - .cpu.wbinvd = pv_native_wbinvd, .cpu.read_msr = native_read_msr, .cpu.write_msr = native_write_msr, .cpu.read_msr_safe = native_read_msr_safe,
arch/x86/kernel/process.c +2 -2
@@ -825,7 +825,7 @@ void __noreturn stop_this_cpu(void *dummy)* X86_FEATURE_SME due to cmdline options. */ if (c->extended_cpuid_level >=0x8000001f && (cpuid_eax (0x8000001f ) &BIT (0 ))) -native_wbinvd (); +wbinvd ();/* * This brings a cache line back and dirties it, but
@@ -846,7 +846,7 @@ void __noreturn stop_this_cpu(void *dummy)/* * Use native_halt() so that memory contents don't change * (stack usage and variables) after possibly issuing the -* native_wbinvd() above. +* wbinvd() above. */ native_halt (); }
arch/x86/xen/enlighten_pv.c +0 -2
@@ -1161,8 +1161,6 @@ static const typeof(pv_ops) xen_cpu_ops __initconst = { .write_cr4 = xen_write_cr4, - .wbinvd = pv_native_wbinvd, - .read_msr = xen_read_msr, .write_msr = xen_write_msr,