mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
kvm: don't register smram_listener when smm is off
If the user set disable smm by '-machine smm=off', we should not register smram_listener so that we can avoid waster memory in kvm since the added sencond address space. Meanwhile we should assign value of the global kvm_state before invoking the kvm_arch_init(), because pc_machine_is_smm_enabled() may use it by kvm_has_mm(). Signed-off-by: Gonglei <arei.gonglei@huawei.com> Message-Id: <1496316915-121196-1-git-send-email-arei.gonglei@huawei.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
6bdcc018a6
commit
d870cfdea5
2 changed files with 5 additions and 3 deletions
|
@ -1255,7 +1255,9 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
|
|||
}
|
||||
}
|
||||
|
||||
if (kvm_check_extension(s, KVM_CAP_X86_SMM)) {
|
||||
if (kvm_check_extension(s, KVM_CAP_X86_SMM) &&
|
||||
object_dynamic_cast(OBJECT(ms), TYPE_PC_MACHINE) &&
|
||||
pc_machine_is_smm_enabled(PC_MACHINE(ms))) {
|
||||
smram_machine_done.notify = register_smram_listener;
|
||||
qemu_add_machine_init_done_notifier(&smram_machine_done);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue