| 1 | /* |
| 2 | * FEAT_XS Test |
| 3 | * |
| 4 | * Copyright (c) 2024 Linaro Ltd |
| 5 | * |
| 6 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 7 | */ |
| 8 | |
| 9 | #include <minilib.h> |
| 10 | #include <stdint.h> |
| 11 | |
| 12 | int main(void) |
| 13 | { |
| 14 | uint64_t isar1; |
| 15 | |
| 16 | asm volatile ("mrs %0, id_aa64isar1_el1" : "=r"(isar1)); |
| 17 | if (((isar1 >> 56) & 0xf) < 1) { |
| 18 | ml_printf("FEAT_XS not supported by CPU"); |
| 19 | return 1; |
| 20 | } |
| 21 | /* VMALLE1NXS */ |
| 22 | asm volatile (".inst 0xd508971f"); |
| 23 | /* VMALLE1OSNXS */ |
| 24 | asm volatile (".inst 0xd508911f"); |
| 25 | |
| 26 | return 0; |
| 27 | } |