qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] hvf: arm: Ignore cache operations on MMIO
@ 2021-10-26  7:12 Alexander Graf
  2021-10-26  8:57 ` Philippe Mathieu-Daudé
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Alexander Graf @ 2021-10-26  7:12 UTC (permalink / raw)
  To: Cameron Esfahani
  Cc: kettenis, Richard Henderson, Philippe Mathieu-Daudé,
	qemu-devel, Roman Bolshakov, Paolo Bonzini

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.

Signed-off-by: Alexander Graf <agraf@csgraf.de>
Reported-by: AJ Barris <AwlsomeAlex@github.com>
Reference: https://github.com/utmapp/UTM/issues/3197
---
 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.30.1 (Apple Git-130)



^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2021-11-02 18:30 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-26  7:12 [PATCH v2] hvf: arm: Ignore cache operations on MMIO Alexander Graf
2021-10-26  8:57 ` Philippe Mathieu-Daudé
2021-10-26  9:34 ` Mark Kettenis
2021-10-26 16:10 ` Richard Henderson
2021-10-26 16:38   ` Alexander Graf
2021-10-26 17:39     ` Richard Henderson
2021-11-01 18:03       ` Peter Maydell
2021-11-01 17:55   ` Peter Maydell
2021-11-01 18:04     ` Richard Henderson
2021-11-01 18:02 ` Richard Henderson
2021-11-01 19:35   ` Peter Maydell
2021-11-02 10:01     ` Richard Henderson
2021-11-02 10:42       ` Peter Maydell
2021-11-02 11:15         ` Richard Henderson
2021-11-02 18:19           ` Richard Henderson
2021-11-01 18:19 ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).