a tiny bit late SMM fixups
cover a tiny bit late SMM fixups
So, I just happened to resume my SMM-for-OVMF work today, with v2.4.0-rc2-2-g12e21eb, and I suddenly realized that these patches never made upstream. The first two are trivial and I kinda "insist" on them :), the last one (from Paolo) doesn't seem that trivial (to me at least), and I don't strictly need it for my work just yet. I'll let you guys decide.
Thanks
Laszlo
Laszlo Ersek (2):
hw/acpi/ich9: clear smi_en on reset
hw/acpi/ich9: clean up stale comment about KVM not supporting SMM
Paolo Bonzini (1):
target-i386: wake up processors that receive an SMI
hw/acpi/ich9.c | 4 ++-- target-i386/cpu.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
1.8.3.1
PATCH 1/3 hw/acpi/ich9: clear smi_en on reset
Otherwise on reboot firmware might think (due to APMC_EN remaining set from the previous boot) that SMI support is absent.
--- hw/acpi/ich9.c | 1 + 1 file changed, 1 insertion(+)
hw/acpi/ich9.c +1 -0
@@ -221,6 +221,7 @@ static void pm_reset(void *opaque)acpi_pm_tmr_reset (&pm->acpi_regs);acpi_gpe_reset (&pm->acpi_regs); + pm->smi_en =0 ;if (!pm->smm_enabled) {/* Mark SMM as already inited to prevent SMM from running. KVM does not * support SMM mode. */
Signature · 1 line
1.8.3.1
Re: [Qemu-devel] [PATCH for-2.4-rc3 1/3] hw/acpi/ich9: clear smi_en on reset
Quoted 2 lines · On Fri, 24 Jul 2015 20:16:00 +0200 Laszlo Ersek <[email protected]> wrote:
Otherwise on reboot firmware might think (due to
APMC_ENremaining set from the previous boot) that SMI support is absent.
Quoted 23 lines
Cc "Michael S. Tsirkin" <[email protected]>Cc Igor Mammedov <[email protected]>Cc Gerd Hoffmann <[email protected]>Cc Paolo Bonzini <[email protected]>Signed-off-by Laszlo Ersek <[email protected]>--- hw/acpi/ich9.c | 1 + 1 file changed, 1 insertion(+)hw/acpi/ich9.c +1
-0@@ -221,6 +221,7 @@ static void pm_reset(void *opaque)acpi_pm_tmr_reset (&pm->acpi_regs);acpi_gpe_reset (&pm->acpi_regs); + pm->smi_en =0 ;if (!pm->smm_enabled) {/* Mark SMM as already inited to prevent SMM from running. KVM does not * support SMM mode. */
PATCH 2/3 hw/acpi/ich9: clean up stale comment about KVM not supporting SMM
In reply to Laszlo ErsekCommit fba72476c6 ("ich9: add smm_enabled field and arguments") detached SMM availability from kvm_enabled(). However, the comment in pm_reset() was not updated; let's do it now.
--- hw/acpi/ich9.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
hw/acpi/ich9.c +1 -2
@@ -223,8 +223,7 @@ static void pm_reset(void *opaque) pm->smi_en =0 ;if (!pm->smm_enabled) { -/* Mark SMM as already inited to prevent SMM from running. KVM does not -* support SMM mode. */ +/* Mark SMM as already inited to prevent SMM from running. */ pm->smi_en |=ICH9_PMIO_SMI_EN_APMC_EN ; } pm->smi_en_wmask = ~0 ;
Signature · 1 line
1.8.3.1
Re: [Qemu-devel] [PATCH for-2.4-rc3 2/3] hw/acpi/ich9: clean up stale comment about KVM not supporting SMM
Quoted 10 lines · On Fri, 24 Jul 2015 20:16:01 +0200 Laszlo Ersek <[email protected]> wrote:
Commit
fba72476c6("ich9: addsmm_enabledfield and arguments") detached SMM availability fromkvm_enabled(). However, the comment inpm_reset()was not updated; let's do it now.Cc "Michael S. Tsirkin" <[email protected]>Cc Igor Mammedov <[email protected]>Cc Gerd Hoffmann <[email protected]>Cc Paolo Bonzini <[email protected]>Signed-off-by Laszlo Ersek <[email protected]>
Quoted 18 lines
--- hw/acpi/ich9.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)hw/acpi/ich9.c +1
-2@@ -223,8 +223,7 @@ static void pm_reset(void *opaque) pm->smi_en =0 ;if (!pm->smm_enabled) { -/* Mark SMM as already inited to prevent SMM from running. KVM does not -* support SMM mode. */ +/* Mark SMM as already inited to prevent SMM from running. */ pm->smi_en |=ICH9_PMIO_SMI_EN_APMC_EN ; } pm->smi_en_wmask = ~0 ;
PATCH 3/3 target-i386: wake up processors that receive an SMI
In reply to Laszlo ErsekFrom: Paolo Bonzini <[email protected]>
An SMI should definitely wake up a processor in halted state! This lets OVMF boot with SMM on multiprocessor systems, although it halts very soon after that with a "CpuIndex != BspIndex" assertion failure.
--- target-i386/cpu.c | 1 + 1 file changed, 1 insertion(+)
target-i386/cpu.c +1 -0
@@ -3134,6 +3134,7 @@ static bool x86_cpu_has_work(CPUState *cs)return ((cs->interrupt_request &CPU_INTERRUPT_HARD ) && (env->eflags &IF_MASK )) || (cs->interrupt_request & (CPU_INTERRUPT_NMI | +CPU_INTERRUPT_SMI |CPU_INTERRUPT_INIT |CPU_INTERRUPT_SIPI | CPU_INTERRUPT_MCE)) ||
Signature · 1 line
1.8.3.1
Re: [Qemu-devel] [PATCH for-2.4-rc3 3/3] target-i386: wake up processors that receive an SMI
Quoted 23 lines · Laszlo Ersek
From: Paolo Bonzini <[email protected]>
An SMI should definitely wake up a processor in halted state! This lets OVMF boot with SMM on multiprocessor systems, although it halts very soon after that with a "CpuIndex != BspIndex" assertion failure.
Signed-off-by Paolo Bonzini <[email protected]>Cc Andreas Faerber <[email protected]>Cc Paolo Bonzini <[email protected]>Cc Richard Henderson <[email protected]>Cc Eduardo Habkost <[email protected]>Signed-off-by Laszlo Ersek <[email protected]>--- target-i386/cpu.c | 1 + 1 file changed, 1 insertion(+)target-i386/cpu.c +0
-0
target-i386/cpu.c static bool x86_cpu_has_work(CPUState *cs) · line 3140
Quoted 7 lines
target-i386/cpu.c +1
-0@@ -3134,6 +3134,7 @@ static bool x86_cpu_has_work(CPUState *cs)return ((cs->interrupt_request &CPU_INTERRUPT_HARD ) && (env->eflags &IF_MASK )) || (cs->interrupt_request & (CPU_INTERRUPT_NMI | +CPU_INTERRUPT_SMI |CPU_INTERRUPT_INIT |CPU_INTERRUPT_SIPI | CPU_INTERRUPT_MCE)) ||
My bad, please disregard this one patch in the series -- an improved version has already been committed as a9bad65d2c1f61af74ce2ff43238d4b20bf81c3a.
Sorry about the noise (but please do pick up the first two patches).
Thanks!
Laszlo
Michael Tokarev
AppliedQuoted 6 lines · Laszlo Ersek
So, I just happened to resume my SMM-for-OVMF work today, with v2.4.0-rc2-2-g12e21eb, and I suddenly realized that these patches never made upstream. The first two are trivial and I kinda "insist" on them :), the last one (from Paolo) doesn't seem that trivial (to me at least), and I don't strictly need it for my work just yet. I'll let you guys decide.
Applied to -trivial, thanks!
/mjt