Skip to contentSkip to conversation

whpx: arm: fix -cpu host

PATCH Superseded Mohamed Mediouni 1 participant 2 messages Mar 11

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 whpx: arm: fix -cpu host

"hw/arm/virt: Register valid CPU types dynamically" went under my radar, so fix this for WHPX.

---
 hw/arm/virt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/virt.c +1 -1
index bced9f67f4..af3f03ced3 100644
@@ -3477,7 +3477,7 @@ static GPtrArray *virt_get_valid_cpu_types(const MachineState *ms)
     if (target_aarch64()) {
         g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a53")));
         g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a57")));
-        if (kvm_enabled() || hvf_enabled()) {
+        if (kvm_enabled() || hvf_enabled() || whpx_enabled()) {
             g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("host")));
         }
     }
Signature · 1 line
2.50.1 (Apple Git-155)
#1 lore raw

PATCH 2/2 whpx: arm: add EC_DATAABORT assert for WHvRunVpExitReasonGpaIntercept/UnmappedGpa

If we get anything else from Hyper-V there's a problem, so enforce this.

---
 target/arm/whpx/whpx-all.c | 1 +
 1 file changed, 1 insertion(+)
target/arm/whpx/whpx-all.c +1 -0
index 513551bec1..3df60a950d 100644
@@ -439,6 +439,7 @@ int whpx_vcpu_run(CPUState *cpu)
         switch (vcpu->exit_ctx.ExitReason) {
         case WHvRunVpExitReasonGpaIntercept:
         case WHvRunVpExitReasonUnmappedGpa:
+            assert(syn_get_ec(vcpu->exit_ctx.MemoryAccess.Syndrome) == EC_DATAABORT);
             advance_pc = true;
 
             if (vcpu->exit_ctx.MemoryAccess.Syndrome & BIT(8)) {
Signature · 1 line
2.50.1 (Apple Git-155)