[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 19/19] hvf: arm: Handle Windows 10 SMC call
From: |
Alexander Graf |
Subject: |
[PATCH v7 19/19] hvf: arm: Handle Windows 10 SMC call |
Date: |
Sun, 16 May 2021 21:58:55 +0200 |
Windows 10 calls an SMCCC call via SMC unconditionally on boot. It lives
in the trusted application call number space, but its purpose is unknown.
In our current SMC implementation, we inject a UDEF for unknown SMC calls,
including this one. However, Windows breaks on boot when we do this. Instead,
let's return an error code.
With this patch applied I can successfully boot the current Windows 10
Insider Preview in HVF.
Signed-off-by: Alexander Graf <agraf@csgraf.de>
---
target/arm/hvf/hvf.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
index acf8fd4060..12dd5bbb0c 100644
--- a/target/arm/hvf/hvf.c
+++ b/target/arm/hvf/hvf.c
@@ -928,6 +928,10 @@ int hvf_vcpu_exec(CPUState *cpu)
cpu_synchronize_state(cpu);
if (!hvf_handle_psci_call(cpu)) {
advance_pc = true;
+ } else if (env->xregs[0] == QEMU_SMCCC_TC_WINDOWS10_BOOT) {
+ /* This special SMC is called by Windows 10 on boot. Return error.
*/
+ env->xregs[0] = -1;
+ advance_pc = true;
} else {
trace_hvf_unknown_smc(env->xregs[0]);
hvf_raise_exception(env, EXCP_UDEF, syn_uncategorized());
--
2.30.1 (Apple Git-130)
- [PATCH v7 07/19] hvf: Split out common code on vcpu init and destroy, (continued)
- [PATCH v7 07/19] hvf: Split out common code on vcpu init and destroy, Alexander Graf, 2021/05/16
- [PATCH v7 09/19] hvf: Make synchronize functions static, Alexander Graf, 2021/05/16
- [PATCH v7 10/19] hvf: Remove hvf-accel-ops.h, Alexander Graf, 2021/05/16
- [PATCH v7 12/19] hvf: Simplify post reset/init/loadvm hooks, Alexander Graf, 2021/05/16
- [PATCH v7 11/19] hvf: Introduce hvf vcpu struct, Alexander Graf, 2021/05/16
- [PATCH v7 14/19] arm/hvf: Add a WFI handler, Alexander Graf, 2021/05/16
- [PATCH v7 13/19] hvf: Add Apple Silicon support, Alexander Graf, 2021/05/16
- [PATCH v7 17/19] arm: Add Hypervisor.framework build target, Alexander Graf, 2021/05/16
- [PATCH v7 16/19] hvf: arm: Implement PSCI handling, Alexander Graf, 2021/05/16
- [PATCH v7 15/19] hvf: arm: Implement -cpu host, Alexander Graf, 2021/05/16
- [PATCH v7 19/19] hvf: arm: Handle Windows 10 SMC call,
Alexander Graf <=
- [PATCH v7 18/19] arm: Enable Windows 10 trusted SMCCC boot call, Alexander Graf, 2021/05/16
- Re: [PATCH v7 00/19] hvf: Implement Apple Silicon Support, no-reply, 2021/05/16