Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Borislav Petkov | a7b480e | 2010-01-22 16:01:03 +0100 | [diff] [blame] | 2 | #include <linux/smp.h> |
Paul Gortmaker | e683014 | 2016-07-13 20:18:57 -0400 | [diff] [blame] | 3 | #include <linux/export.h> |
Borislav Petkov | a7b480e | 2010-01-22 16:01:03 +0100 | [diff] [blame] | 4 | |
| 5 | static void __wbinvd(void *dummy) |
| 6 | { |
| 7 | wbinvd(); |
| 8 | } |
| 9 | |
| 10 | void wbinvd_on_cpu(int cpu) |
| 11 | { |
| 12 | smp_call_function_single(cpu, __wbinvd, NULL, 1); |
| 13 | } |
| 14 | EXPORT_SYMBOL(wbinvd_on_cpu); |
| 15 | |
| 16 | int wbinvd_on_all_cpus(void) |
| 17 | { |
Nadav Amit | caa7593 | 2019-06-12 23:48:05 -0700 | [diff] [blame] | 18 | on_each_cpu(__wbinvd, NULL, 1); |
| 19 | return 0; |
Borislav Petkov | a7b480e | 2010-01-22 16:01:03 +0100 | [diff] [blame] | 20 | } |
| 21 | EXPORT_SYMBOL(wbinvd_on_all_cpus); |