qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: Check for machine state object class before typecasting it
@ 2019-12-30  8:00 Michal Privoznik
  2019-12-30  8:06 ` no-reply
  2019-12-30  8:41 ` Philippe Mathieu-Daudé
  0 siblings, 2 replies; 8+ messages in thread
From: Michal Privoznik @ 2019-12-30  8:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, mtosatti

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>
---
 target/i386/kvm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 0b511906e3..7ee3202634 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -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);
-- 
2.24.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-01-07 10:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-30  8:00 [PATCH] x86: Check for machine state object class before typecasting it Michal Privoznik
2019-12-30  8:06 ` no-reply
2019-12-30  8:41 ` Philippe Mathieu-Daudé
2019-12-30  9:35   ` Michal Prívozník
2019-12-30  9:45     ` Philippe Mathieu-Daudé
2019-12-30 13:17       ` Michal Prívozník
2019-12-30 13:47         ` Philippe Mathieu-Daudé
2020-01-07 10:27         ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).