KVM: x86: rename apic_access_page_done to apic_access_memslot_enabled
authorMaxim Levitsky <mlevitsk@redhat.com>
Wed, 23 Jun 2021 11:29:55 +0000 (14:29 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 24 Jun 2021 22:00:49 +0000 (18:00 -0400)
This better reflects the purpose of this variable on AMD, since
on AMD the AVIC's memory slot can be enabled and disabled dynamically.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20210623113002.111448-4-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/svm/avic.c
arch/x86/kvm/vmx/vmx.c

index c9ec5c76c4381c5091255ae76a0f8ccd4a557c55..974cbfb1eefe362dcb894b000236b9e007556886 100644 (file)
@@ -1054,7 +1054,7 @@ struct kvm_arch {
        struct kvm_apic_map __rcu *apic_map;
        atomic_t apic_map_dirty;
 
-       bool apic_access_page_done;
+       bool apic_access_memslot_enabled;
        unsigned long apicv_inhibit_reasons;
 
        gpa_t wall_clock;
index a9abed054cd5c6d1296feaccd630960839367909..1d01da64c333df801fbaa4fb04b4c1d4be8850b0 100644 (file)
@@ -236,7 +236,7 @@ static int avic_update_access_page(struct kvm *kvm, bool activate)
         * APICv mode change, which update APIC_ACCESS_PAGE_PRIVATE_MEMSLOT
         * memory region. So, we need to ensure that kvm->mm == current->mm.
         */
-       if ((kvm->arch.apic_access_page_done == activate) ||
+       if ((kvm->arch.apic_access_memslot_enabled == activate) ||
            (kvm->mm != current->mm))
                goto out;
 
@@ -249,7 +249,7 @@ static int avic_update_access_page(struct kvm *kvm, bool activate)
                goto out;
        }
 
-       kvm->arch.apic_access_page_done = activate;
+       kvm->arch.apic_access_memslot_enabled = activate;
 out:
        mutex_unlock(&kvm->slots_lock);
        return r;
index 104bbbe2dfd06ecb56d1ad38cb8c2241a058a7bd..927a552393b969bef742533c0961d3b3aec8d64e 100644 (file)
@@ -3621,7 +3621,7 @@ static int alloc_apic_access_page(struct kvm *kvm)
        int ret = 0;
 
        mutex_lock(&kvm->slots_lock);
-       if (kvm->arch.apic_access_page_done)
+       if (kvm->arch.apic_access_memslot_enabled)
                goto out;
        hva = __x86_set_memory_region(kvm, APIC_ACCESS_PAGE_PRIVATE_MEMSLOT,
                                      APIC_DEFAULT_PHYS_BASE, PAGE_SIZE);
@@ -3641,7 +3641,7 @@ static int alloc_apic_access_page(struct kvm *kvm)
         * is able to migrate it.
         */
        put_page(page);
-       kvm->arch.apic_access_page_done = true;
+       kvm->arch.apic_access_memslot_enabled = true;
 out:
        mutex_unlock(&kvm->slots_lock);
        return ret;