0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <signal.h>
0010 #include <ucontext.h>
0011 #include <sys/prctl.h>
0012
0013 #include "test_signals_utils.h"
0014 #include "testcases.h"
0015
0016 int sme_trap_non_streaming_trigger(struct tdescr *td)
0017 {
0018
0019
0020
0021
0022
0023 asm volatile(".inst 0xd503437f; /* SMSTART ZA */ \
0024 cnt v0.16b, v0.16b; \
0025 .inst 0xd503447f /* SMSTOP ZA */");
0026
0027 return 0;
0028 }
0029
0030 int sme_trap_non_streaming_run(struct tdescr *td, siginfo_t *si, ucontext_t *uc)
0031 {
0032 return 1;
0033 }
0034
0035 struct tdescr tde = {
0036 .name = "SME SM trap unsupported instruction",
0037 .descr = "Check that we get a SIGILL if we use an unsupported instruction in streaming mode",
0038 .feats_required = FEAT_SME,
0039 .feats_incompatible = FEAT_SME_FA64,
0040 .timeout = 3,
0041 .sanity_disabled = true,
0042 .trigger = sme_trap_non_streaming_trigger,
0043 .run = sme_trap_non_streaming_run,
0044 .sig_ok = SIGILL,
0045 };