Skip to content

Commit e8ffde9

Browse files
committed
HACK: hvf: arm: Always treat SMC as enabled conduit
The Windows 10 and 11 for ARM boot code implicitly assumes that SMC is a valid SMCCC conduit to call for an OEM SMCCC call. This patch forces HVF to treat SMC as an always active conduit, even when the user has configured HVC. That way, the OEM SMCCC call gets handled as an unimplemented SMCCC function (return -1) rather than an invalid conduit (inject undefined instruction exception) which crashes Windows. With this patch applied, I can successfully boot Windows for ARM Insider Previews. Signed-off-by: Alexander Graf <agraf@csgraf.de>
1 parent 44f28df commit e8ffde9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

target/arm/hvf/hvf.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@
6161
#define TMR_CTL_IMASK (1 << 1)
6262
#define TMR_CTL_ISTATUS (1 << 2)
6363

64+
static const bool windows_workaround_enabled = true;
65+
6466
static void hvf_wfi(CPUState *cpu);
6567

6668
typedef struct HVFVTimer {
@@ -1218,7 +1220,8 @@ int hvf_vcpu_exec(CPUState *cpu)
12181220
break;
12191221
case EC_AA64_SMC:
12201222
cpu_synchronize_state(cpu);
1221-
if (arm_cpu->psci_conduit == QEMU_PSCI_CONDUIT_SMC) {
1223+
if (windows_workaround_enabled ||
1224+
arm_cpu->psci_conduit == QEMU_PSCI_CONDUIT_SMC) {
12221225
advance_pc = true;
12231226

12241227
if (!hvf_handle_psci_call(cpu)) {

0 commit comments

Comments
 (0)