xref: /openbmc/linux/arch/x86/lib/cache-smp.c (revision caa75932)
1b2441318SGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0
2a7b480e7SBorislav Petkov #include <linux/smp.h>
3e683014cSPaul Gortmaker #include <linux/export.h>
4a7b480e7SBorislav Petkov 
__wbinvd(void * dummy)5a7b480e7SBorislav Petkov static void __wbinvd(void *dummy)
6a7b480e7SBorislav Petkov {
7a7b480e7SBorislav Petkov 	wbinvd();
8a7b480e7SBorislav Petkov }
9a7b480e7SBorislav Petkov 
wbinvd_on_cpu(int cpu)10a7b480e7SBorislav Petkov void wbinvd_on_cpu(int cpu)
11a7b480e7SBorislav Petkov {
12a7b480e7SBorislav Petkov 	smp_call_function_single(cpu, __wbinvd, NULL, 1);
13a7b480e7SBorislav Petkov }
14a7b480e7SBorislav Petkov EXPORT_SYMBOL(wbinvd_on_cpu);
15a7b480e7SBorislav Petkov 
wbinvd_on_all_cpus(void)16a7b480e7SBorislav Petkov int wbinvd_on_all_cpus(void)
17a7b480e7SBorislav Petkov {
18caa75932SNadav Amit 	on_each_cpu(__wbinvd, NULL, 1);
19caa75932SNadav Amit 	return 0;
20a7b480e7SBorislav Petkov }
21a7b480e7SBorislav Petkov EXPORT_SYMBOL(wbinvd_on_all_cpus);
22