@samitouri / QOSamiQemu / commits / 63b0c321d8

target/arm: make hvf use syndrome helpers for decode

Rather than open coding a bunch of shifts and masks we can use the syndrome definitions. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20260422125250.1303100-20-alex.bennee@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Alex Bennée committed Apr 22, 2026 at 13:52 UTC 63b0c321d86d2bc9558b29ed3eadbb263b9962b4
1 file changed +7 -7
target/arm/hvf/hvf.c
+7 -7
@@ -2123,14 +2123,14 @@ static int hvf_handle_exception(CPUState *cpu, hv_vcpu_exit_exception_t *excp)
2123 break;
2124 }
2125 case EC_DATAABORT: {
2126 - bool isv = syndrome & ARM_EL_ISV;
2127 - bool iswrite = (syndrome >> 6) & 1;
2128 - bool s1ptw = (syndrome >> 7) & 1;
2129 - bool sse = (syndrome >> 21) & 1;
2130 - uint32_t sas = (syndrome >> 22) & 3;
2126 + bool isv = FIELD_EX32(syndrome, DABORT_ISS, ISV);
2127 + bool iswrite = FIELD_EX32(syndrome, DABORT_ISS, WNR);
2128 + bool s1ptw = FIELD_EX32(syndrome, DABORT_ISS, S1PTW);
2129 + bool sse = FIELD_EX32(syndrome, DABORT_ISS, SSE);
2130 + uint32_t sas = FIELD_EX32(syndrome, DABORT_ISS, SAS);
2131 uint32_t len = 1 << sas;
2132 - uint32_t srt = (syndrome >> 16) & 0x1f;
2133 - uint32_t cm = (syndrome >> 8) & 0x1;
2132 + uint32_t srt = FIELD_EX32(syndrome, DABORT_ISS, SRT);
2133 + uint32_t cm = FIELD_EX32(syndrome, DABORT_ISS, CM);
2134 uint64_t val = 0;
2135 uint64_t ipa = excp->physical_address;
2136 AddressSpace *as = cpu_get_address_space(cpu, ARMASIdx_NS);