qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86: Check for machine state object class before typecasting


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] x86: Check for machine state object class before typecasting it
Date: Mon, 30 Dec 2019 09:41:14 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2

On 12/30/19 9:00 AM, Michal Privoznik wrote:
In v4.2.0-246-ged9e923c3c the SMM property was moved from PC

Typo v4.2.0-246-ged9e923c3c -> ed9e923c3c.

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.


Fixes: ed9e923c3c
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>

Signed-off-by: Michal Privoznik <address@hidden>
---
  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);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]