mirror of
https://github.com/xemu-project/xemu.git
synced 2025-02-27 07:56:11 +00:00
x86: Check for machine state object class before typecasting it
In ed9e923c3c ("x86: move SMM property to X86MachineState", 2019-12-17) In v4.2.0-246-ged9e923c3c the SMM property was moved from PC machine class to x86 machine class. Makes sense, but the change was too aggressive: in target/i386/kvm.c:kvm_arch_init() it altered check which sets SMRAM if given machine has SMM enabled. The line that detects whether given machine object is class of PC_MACHINE was removed from the check. This makes qemu try to enable SMRAM for all machine types, which is not what we want. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Fixes: ed9e923c3c ("x86: move SMM property to X86MachineState", 2019-12-17) Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <7cc91bab3191bfd7e071bdd3fdf7fe2a2991deb0.1577692822.git.mprivozn@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
c4d1069c25
commit
8f54bbd0b4
@ -2173,6 +2173,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
|
||||
}
|
||||
|
||||
if (kvm_check_extension(s, KVM_CAP_X86_SMM) &&
|
||||
object_dynamic_cast(OBJECT(ms), TYPE_X86_MACHINE) &&
|
||||
x86_machine_is_smm_enabled(X86_MACHINE(ms))) {
|
||||
smram_machine_done.notify = register_smram_listener;
|
||||
qemu_add_machine_init_done_notifier(&smram_machine_done);
|
||||
|
Loading…
x
Reference in New Issue
Block a user