| * Test for x86 cache and memory instructions |
| * Copyright (c) 2015 Red Hat Inc |
| * Eduardo Habkost <ehabkost@redhat.com> |
| * This work is licensed under the terms of the GNU GPL, version 2. |
| int main(int ac, char **av) |
| if (this_cpu_has(X86_FEATURE_CLFLUSH)) |
| asm_safe_report("clflush (%0)", "b" (&target)); |
| if (this_cpu_has(X86_FEATURE_XMM)) |
| asm_safe_report("sfence"); |
| if (this_cpu_has(X86_FEATURE_XMM2)) { |
| asm_safe_report("lfence"); |
| asm_safe_report("mfence"); |
| if (this_cpu_has(X86_FEATURE_CLFLUSHOPT)) { |
| asm_safe_report(".byte 0x66, 0x0f, 0xae, 0x3b", "b" (&target)); |
| report_skip("clflushopt"); |
| if (this_cpu_has(X86_FEATURE_CLWB)) { |
| asm_safe_report(".byte 0x66, 0x0f, 0xae, 0x33", "b" (&target)); |
| if (this_cpu_has(X86_FEATURE_PCOMMIT)) { /* PCOMMIT */ |
| asm_safe_report(".byte 0x66, 0x0f, 0xae, 0xf8"); |