diff options
author | Gonglei | 2017-06-01 13:35:15 +0200 |
---|---|---|
committer | Paolo Bonzini | 2017-06-07 18:22:02 +0200 |
commit | d870cfdea5b5fc7934cacc9786f185d741eab308 (patch) | |
tree | c420e575846558480aee8431310b4d9192a36629 /kvm-all.c | |
parent | nbd: make it thread-safe, fix qcow2 over nbd (diff) | |
download | qemu-d870cfdea5b5fc7934cacc9786f185d741eab308.tar.gz qemu-d870cfdea5b5fc7934cacc9786f185d741eab308.tar.xz qemu-d870cfdea5b5fc7934cacc9786f185d741eab308.zip |
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>
Diffstat (limited to 'kvm-all.c')
-rw-r--r-- | kvm-all.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1748,6 +1748,8 @@ static int kvm_init(MachineState *ms) kvm_ioeventfd_any_length_allowed = (kvm_check_extension(s, KVM_CAP_IOEVENTFD_ANY_LENGTH) > 0); + kvm_state = s; + ret = kvm_arch_init(ms, s); if (ret < 0) { goto err; @@ -1757,8 +1759,6 @@ static int kvm_init(MachineState *ms) kvm_irqchip_create(ms, s); } - kvm_state = s; - if (kvm_eventfds_allowed) { s->memory_listener.listener.eventfd_add = kvm_mem_ioeventfd_add; s->memory_listener.listener.eventfd_del = kvm_mem_ioeventfd_del; |