62 lines · plain
1// SPDX-License-Identifier: GPL-2.0-only2// Copyright (C) 2021 ARM Limited.3 4#include "sme-inst.h"5 6.arch_extension sve7 8#define MAGIC 429 10#define MAXVL 204811#define MAXVL_B (MAXVL / 8)12 13.pushsection .text14.data15.align 416scratch:17 .space MAXVL_B18.popsection19 20.globl fork_test21fork_test:22 smstart_za23 24 // For simplicity just set one word in one vector, other tests25 // cover general data corruption issues.26 ldr x0, =scratch27 mov x1, #MAGIC28 str x1, [x0]29 mov w12, wzr30 _ldr_za 12, 0 // ZA.H[W12] loaded from [X0]31 32 // Tail call into the C portion that does the fork & verify33 b fork_test_c34 35.globl verify_fork36verify_fork:37 // SVCR should have ZA=1, SM=038 mrs x0, S3_3_C4_C2_239 and x1, x0, #340 cmp x1, #241 beq 1f42 mov x0, xzr43 b 100f441:45 46 // ZA should still have the value we loaded47 ldr x0, =scratch48 mov w12, wzr49 _str_za 12, 0 // ZA.H[W12] stored to [X0]50 ldr x1, [x0]51 cmp x1, #MAGIC52 beq 2f53 mov x0, xzr54 b 100f55 562:57 // All tests passed58 mov x0, #159100:60 ret61 62