Skip to content

Commit 29188c1

Browse files
jgross1Ingo Molnar
authored andcommitted
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]> Link: https://lore.kernel.org/r/[email protected]
1 parent 7a470e8 commit 29188c1

File tree

7 files changed

+4
-27
lines changed

7 files changed

+4
-27
lines changed

arch/x86/include/asm/paravirt.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,6 @@ static inline void halt(void)
180180
PVOP_VCALL0(irq.halt);
181181
}
182182

183-
extern noinstr void pv_native_wbinvd(void);
184-
185-
static __always_inline void wbinvd(void)
186-
{
187-
PVOP_ALT_VCALL0(cpu.wbinvd, "wbinvd", ALT_NOT_XEN);
188-
}
189-
190183
static inline u64 paravirt_read_msr(unsigned msr)
191184
{
192185
return PVOP_CALL1(u64, cpu.read_msr, msr);

arch/x86/include/asm/paravirt_types.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ struct pv_cpu_ops {
8686
void (*update_io_bitmap)(void);
8787
#endif
8888

89-
void (*wbinvd)(void);
90-
9189
/* cpuid emulation, mostly so that caps bits can be disabled */
9290
void (*cpuid)(unsigned int *eax, unsigned int *ebx,
9391
unsigned int *ecx, unsigned int *edx);

arch/x86/include/asm/special_insns.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static inline void wrpkru(u32 pkru)
115115
}
116116
#endif
117117

118-
static __always_inline void native_wbinvd(void)
118+
static __always_inline void wbinvd(void)
119119
{
120120
asm volatile("wbinvd": : :"memory");
121121
}
@@ -167,12 +167,6 @@ static inline void __write_cr4(unsigned long x)
167167
{
168168
native_write_cr4(x);
169169
}
170-
171-
static __always_inline void wbinvd(void)
172-
{
173-
native_wbinvd();
174-
}
175-
176170
#endif /* CONFIG_PARAVIRT_XXL */
177171

178172
static __always_inline void clflush(volatile void *__p)

arch/x86/kernel/cpu/resctrl/pseudo_lock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ static int pseudo_lock_fn(void *_rdtgrp)
459459
* increase likelihood that allocated cache portion will be filled
460460
* with associated memory.
461461
*/
462-
native_wbinvd();
462+
wbinvd();
463463

464464
/*
465465
* Always called with interrupts enabled. By disabling interrupts

arch/x86/kernel/paravirt.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,6 @@ static noinstr void pv_native_set_debugreg(int regno, unsigned long val)
116116
native_set_debugreg(regno, val);
117117
}
118118

119-
noinstr void pv_native_wbinvd(void)
120-
{
121-
native_wbinvd();
122-
}
123-
124119
static noinstr void pv_native_safe_halt(void)
125120
{
126121
native_safe_halt();
@@ -148,7 +143,6 @@ struct paravirt_patch_template pv_ops = {
148143
.cpu.read_cr0 = native_read_cr0,
149144
.cpu.write_cr0 = native_write_cr0,
150145
.cpu.write_cr4 = native_write_cr4,
151-
.cpu.wbinvd = pv_native_wbinvd,
152146
.cpu.read_msr = native_read_msr,
153147
.cpu.write_msr = native_write_msr,
154148
.cpu.read_msr_safe = native_read_msr_safe,

arch/x86/kernel/process.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ void __noreturn stop_this_cpu(void *dummy)
825825
* X86_FEATURE_SME due to cmdline options.
826826
*/
827827
if (c->extended_cpuid_level >= 0x8000001f && (cpuid_eax(0x8000001f) & BIT(0)))
828-
native_wbinvd();
828+
wbinvd();
829829

830830
/*
831831
* This brings a cache line back and dirties it, but
@@ -846,7 +846,7 @@ void __noreturn stop_this_cpu(void *dummy)
846846
/*
847847
* Use native_halt() so that memory contents don't change
848848
* (stack usage and variables) after possibly issuing the
849-
* native_wbinvd() above.
849+
* wbinvd() above.
850850
*/
851851
native_halt();
852852
}

arch/x86/xen/enlighten_pv.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,8 +1161,6 @@ static const typeof(pv_ops) xen_cpu_ops __initconst = {
11611161

11621162
.write_cr4 = xen_write_cr4,
11631163

1164-
.wbinvd = pv_native_wbinvd,
1165-
11661164
.read_msr = xen_read_msr,
11671165
.write_msr = xen_write_msr,
11681166

0 commit comments

Comments
 (0)