[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 12/12] hvf: arm: Ignore cache operations on MMIO
From: |
Richard Henderson |
Subject: |
[PULL v2 12/12] hvf: arm: Ignore cache operations on MMIO |
Date: |
Tue, 2 Nov 2021 14:25:19 -0400 |
From: Alexander Graf <agraf@csgraf.de>
Apple's Hypervisor.Framework forwards cache operations as MMIO traps
into user space. For MMIO however, these have no meaning: There is no
cache attached to them.
So let's just treat cache data exits as nops.
This fixes OpenBSD booting as guest.
Reported-by: AJ Barris <AwlsomeAlex@github.com>
Signed-off-by: Alexander Graf <agraf@csgraf.de>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Reference: https://github.com/utmapp/UTM/issues/3197
Message-Id: <20211026071241.74889-1-agraf@csgraf.de>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/hvf/hvf.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
index bff3e0cde7..0dc96560d3 100644
--- a/target/arm/hvf/hvf.c
+++ b/target/arm/hvf/hvf.c
@@ -1150,12 +1150,19 @@ int hvf_vcpu_exec(CPUState *cpu)
uint32_t sas = (syndrome >> 22) & 3;
uint32_t len = 1 << sas;
uint32_t srt = (syndrome >> 16) & 0x1f;
+ uint32_t cm = (syndrome >> 8) & 0x1;
uint64_t val = 0;
trace_hvf_data_abort(env->pc, hvf_exit->exception.virtual_address,
hvf_exit->exception.physical_address, isv,
iswrite, s1ptw, len, srt);
+ if (cm) {
+ /* We don't cache MMIO regions */
+ advance_pc = true;
+ break;
+ }
+
assert(isv);
if (iswrite) {
--
2.25.1
- [PULL v2 06/12] target/arm: Use tcg_constant_i32() in op_smlad(), (continued)
- [PULL v2 06/12] target/arm: Use tcg_constant_i32() in op_smlad(), Richard Henderson, 2021/11/02
- [PULL v2 03/12] hw/arm: Attach MMC to quanta-gbs-bmc, Richard Henderson, 2021/11/02
- [PULL v2 01/12] hw/sd: add nuvoton MMC, Richard Henderson, 2021/11/02
- [PULL v2 02/12] hw/arm: Add Nuvoton SD module to board, Richard Henderson, 2021/11/02
- [PULL v2 04/12] tests/qtest/libqos: add SDHCI commands, Richard Henderson, 2021/11/02
- [PULL v2 08/12] target/arm: Use the constant variant of store_cpu_field() when possible, Richard Henderson, 2021/11/02
- [PULL v2 10/12] target/arm: Use tcg_constant_i32() in gen_rev16(), Richard Henderson, 2021/11/02
- [PULL v2 11/12] hw/arm/virt: Rename default_bus_bypass_iommu, Richard Henderson, 2021/11/02
- [PULL v2 09/12] target/arm: Use tcg_constant_i64() in do_sat_addsub_64(), Richard Henderson, 2021/11/02
- [PULL v2 12/12] hvf: arm: Ignore cache operations on MMIO,
Richard Henderson <=
- [PULL v2 07/12] target/arm: Introduce store_cpu_field_constant() helper, Richard Henderson, 2021/11/02
- Re: [PULL v2 00/12] target/arm patch queue, Richard Henderson, 2021/11/03