1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

KVM: x86: rename apic_access_page_done to apic_access_memslot_enabled

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>
This commit is contained in:
Maxim Levitsky 2021-06-23 14:29:55 +03:00 committed by Paolo Bonzini
parent 88213da235
commit a01b45e9d3
3 changed files with 5 additions and 5 deletions

View file

@ -1054,7 +1054,7 @@ struct kvm_arch {
struct kvm_apic_map __rcu *apic_map; struct kvm_apic_map __rcu *apic_map;
atomic_t apic_map_dirty; atomic_t apic_map_dirty;
bool apic_access_page_done; bool apic_access_memslot_enabled;
unsigned long apicv_inhibit_reasons; unsigned long apicv_inhibit_reasons;
gpa_t wall_clock; gpa_t wall_clock;

View 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 * APICv mode change, which update APIC_ACCESS_PAGE_PRIVATE_MEMSLOT
* memory region. So, we need to ensure that kvm->mm == current->mm. * 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)) (kvm->mm != current->mm))
goto out; goto out;
@ -249,7 +249,7 @@ static int avic_update_access_page(struct kvm *kvm, bool activate)
goto out; goto out;
} }
kvm->arch.apic_access_page_done = activate; kvm->arch.apic_access_memslot_enabled = activate;
out: out:
mutex_unlock(&kvm->slots_lock); mutex_unlock(&kvm->slots_lock);
return r; return r;

View file

@ -3621,7 +3621,7 @@ static int alloc_apic_access_page(struct kvm *kvm)
int ret = 0; int ret = 0;
mutex_lock(&kvm->slots_lock); mutex_lock(&kvm->slots_lock);
if (kvm->arch.apic_access_page_done) if (kvm->arch.apic_access_memslot_enabled)
goto out; goto out;
hva = __x86_set_memory_region(kvm, APIC_ACCESS_PAGE_PRIVATE_MEMSLOT, hva = __x86_set_memory_region(kvm, APIC_ACCESS_PAGE_PRIVATE_MEMSLOT,
APIC_DEFAULT_PHYS_BASE, PAGE_SIZE); APIC_DEFAULT_PHYS_BASE, PAGE_SIZE);
@ -3641,7 +3641,7 @@ static int alloc_apic_access_page(struct kvm *kvm)
* is able to migrate it. * is able to migrate it.
*/ */
put_page(page); put_page(page);
kvm->arch.apic_access_page_done = true; kvm->arch.apic_access_memslot_enabled = true;
out: out:
mutex_unlock(&kvm->slots_lock); mutex_unlock(&kvm->slots_lock);
return ret; return ret;