diff options
author | Paul Burton <paul.burton@mips.com> | 2019-02-02 01:43:25 +0000 |
---|---|---|
committer | Paul Burton <paul.burton@mips.com> | 2019-02-04 10:56:30 -0800 |
commit | 42d5b846574f0904dbaf9dbdea4f19402589cddf (patch) | |
tree | 77fdb7637de77008be9443b6b16de0be15beacb5 /arch/mips/kvm/vz.c | |
parent | 4ebea49ce233ce76421250f113a75d6d33c90e22 (diff) | |
download | lwn-42d5b846574f0904dbaf9dbdea4f19402589cddf.tar.gz lwn-42d5b846574f0904dbaf9dbdea4f19402589cddf.zip |
MIPS: mm: Unify ASID version checks
Introduce a new check_mmu_context() function to check an mm's ASID
version & get a new one if it's outdated, and a
check_switch_mmu_context() function which additionally sets up the new
ASID & page directory. Simplify switch_mm() & various
get_new_mmu_context() callsites in MIPS KVM by making use of the new
functions, which will help reduce the amount of code that requires
modification to gain MMID support.
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: linux-mips@vger.kernel.org
Diffstat (limited to 'arch/mips/kvm/vz.c')
-rw-r--r-- | arch/mips/kvm/vz.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/mips/kvm/vz.c b/arch/mips/kvm/vz.c index d98c12a22eac..dde20887a70d 100644 --- a/arch/mips/kvm/vz.c +++ b/arch/mips/kvm/vz.c @@ -2454,10 +2454,10 @@ static void kvm_vz_vcpu_load_tlb(struct kvm_vcpu *vcpu, int cpu) * Root ASID dealiases guest GPA mappings in the root TLB. * Allocate new root ASID if needed. */ - if (cpumask_test_and_clear_cpu(cpu, &kvm->arch.asid_flush_mask) - || (cpu_context(cpu, gpa_mm) ^ asid_cache(cpu)) & - asid_version_mask(cpu)) + if (cpumask_test_and_clear_cpu(cpu, &kvm->arch.asid_flush_mask)) get_new_mmu_context(gpa_mm); + else + check_mmu_context(gpa_mm); } } |