• Tang Chen's avatar
    kvm: vmx: Implement set_apic_access_page_addr · 38b99173
    Tang Chen authored
    Currently, the APIC access page is pinned by KVM for the entire life
    of the guest.  We want to make it migratable in order to make memory
    hot-unplug available for machines that run KVM.
    
    This patch prepares to handle this for the case where there is no nested
    virtualization, or where the nested guest does not have an APIC page of
    its own.  All accesses to kvm->arch.apic_access_page are changed to go
    through kvm_vcpu_reload_apic_access_page.
    
    If the APIC access page is invalidated when the host is running, we update
    the VMCS in the next guest entry.
    
    If it is invalidated when the guest is running, the MMU notifier will force
    an exit, after which we will handle everything as in the previous case.
    
    If it is invalidated when a nested guest is running, the request will update
    either the VMCS01 or the VMCS02.  Updating the VMCS01 is done at the
    next L2->L1 exit, while updating the VMCS02 is done in prepare_vmcs02.
    Signed-off-by: default avatarTang Chen <tangchen@cn.fujitsu.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    38b99173
vmx.c 262 KB