From b838e9b7201171271d5470ce892515825f747d23 Mon Sep 17 00:00:00 2001 From: Yu Wang Date: Tue, 11 Dec 2018 11:25:19 +0800 Subject: [PATCH] dm: pm: mask the higher bits of parameter of smi_cmd handler Windows will set 0x262a0 for smi cmd pio, need to mask the higher bits due to smi command is 8 bits register. Otherwise, it cause the ACPI_ENABLE case can't be matched, and windows expecting the SCI_EN of PM1_CONTROL be set after switch to ACPI mode. Finally, cause windows trigger panic. Tracked-On: #2962 Signed-off-by: Yu Wang Acked-by: Yin Fengwei --- devicemodel/arch/x86/pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devicemodel/arch/x86/pm.c b/devicemodel/arch/x86/pm.c index bf0c870f2..d9ad99adf 100644 --- a/devicemodel/arch/x86/pm.c +++ b/devicemodel/arch/x86/pm.c @@ -457,7 +457,7 @@ smi_cmd_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, return -1; pthread_mutex_lock(&pm_lock); - switch (*eax) { + switch (*eax & 0xFF) { case ACPI_ENABLE: pm1_control |= VIRTUAL_PM1A_SCI_EN; /*