|
@@ -17,6 +17,7 @@
|
|
#include <asm/mmu.h>
|
|
#include <asm/mmu.h>
|
|
#include <asm/pgtable.h>
|
|
#include <asm/pgtable.h>
|
|
#include <asm/pgalloc.h>
|
|
#include <asm/pgalloc.h>
|
|
|
|
+#include <asm/pte-walk.h>
|
|
|
|
|
|
/*
|
|
/*
|
|
* Supported radix tree geometry.
|
|
* Supported radix tree geometry.
|
|
@@ -359,8 +360,7 @@ int kvmppc_book3s_radix_page_fault(struct kvm_run *run, struct kvm_vcpu *vcpu,
|
|
if (writing)
|
|
if (writing)
|
|
pgflags |= _PAGE_DIRTY;
|
|
pgflags |= _PAGE_DIRTY;
|
|
local_irq_save(flags);
|
|
local_irq_save(flags);
|
|
- ptep = __find_linux_pte_or_hugepte(current->mm->pgd, hva,
|
|
|
|
- NULL, NULL);
|
|
|
|
|
|
+ ptep = find_current_mm_pte(current->mm->pgd, hva, NULL, NULL);
|
|
if (ptep) {
|
|
if (ptep) {
|
|
pte = READ_ONCE(*ptep);
|
|
pte = READ_ONCE(*ptep);
|
|
if (pte_present(pte) &&
|
|
if (pte_present(pte) &&
|
|
@@ -374,8 +374,12 @@ int kvmppc_book3s_radix_page_fault(struct kvm_run *run, struct kvm_vcpu *vcpu,
|
|
spin_unlock(&kvm->mmu_lock);
|
|
spin_unlock(&kvm->mmu_lock);
|
|
return RESUME_GUEST;
|
|
return RESUME_GUEST;
|
|
}
|
|
}
|
|
- ptep = __find_linux_pte_or_hugepte(kvm->arch.pgtable,
|
|
|
|
- gpa, NULL, &shift);
|
|
|
|
|
|
+ /*
|
|
|
|
+ * We are walking the secondary page table here. We can do this
|
|
|
|
+ * without disabling irq.
|
|
|
|
+ */
|
|
|
|
+ ptep = __find_linux_pte(kvm->arch.pgtable,
|
|
|
|
+ gpa, NULL, &shift);
|
|
if (ptep && pte_present(*ptep)) {
|
|
if (ptep && pte_present(*ptep)) {
|
|
kvmppc_radix_update_pte(kvm, ptep, 0, pgflags,
|
|
kvmppc_radix_update_pte(kvm, ptep, 0, pgflags,
|
|
gpa, shift);
|
|
gpa, shift);
|
|
@@ -427,8 +431,8 @@ int kvmppc_book3s_radix_page_fault(struct kvm_run *run, struct kvm_vcpu *vcpu,
|
|
pgflags |= _PAGE_WRITE;
|
|
pgflags |= _PAGE_WRITE;
|
|
} else {
|
|
} else {
|
|
local_irq_save(flags);
|
|
local_irq_save(flags);
|
|
- ptep = __find_linux_pte_or_hugepte(current->mm->pgd,
|
|
|
|
- hva, NULL, NULL);
|
|
|
|
|
|
+ ptep = find_current_mm_pte(current->mm->pgd,
|
|
|
|
+ hva, NULL, NULL);
|
|
if (ptep && pte_write(*ptep) && pte_dirty(*ptep))
|
|
if (ptep && pte_write(*ptep) && pte_dirty(*ptep))
|
|
pgflags |= _PAGE_WRITE;
|
|
pgflags |= _PAGE_WRITE;
|
|
local_irq_restore(flags);
|
|
local_irq_restore(flags);
|
|
@@ -499,8 +503,7 @@ int kvm_unmap_radix(struct kvm *kvm, struct kvm_memory_slot *memslot,
|
|
unsigned int shift;
|
|
unsigned int shift;
|
|
unsigned long old;
|
|
unsigned long old;
|
|
|
|
|
|
- ptep = __find_linux_pte_or_hugepte(kvm->arch.pgtable, gpa,
|
|
|
|
- NULL, &shift);
|
|
|
|
|
|
+ ptep = __find_linux_pte(kvm->arch.pgtable, gpa, NULL, &shift);
|
|
if (ptep && pte_present(*ptep)) {
|
|
if (ptep && pte_present(*ptep)) {
|
|
old = kvmppc_radix_update_pte(kvm, ptep, _PAGE_PRESENT, 0,
|
|
old = kvmppc_radix_update_pte(kvm, ptep, _PAGE_PRESENT, 0,
|
|
gpa, shift);
|
|
gpa, shift);
|
|
@@ -525,8 +528,7 @@ int kvm_age_radix(struct kvm *kvm, struct kvm_memory_slot *memslot,
|
|
unsigned int shift;
|
|
unsigned int shift;
|
|
int ref = 0;
|
|
int ref = 0;
|
|
|
|
|
|
- ptep = __find_linux_pte_or_hugepte(kvm->arch.pgtable, gpa,
|
|
|
|
- NULL, &shift);
|
|
|
|
|
|
+ ptep = __find_linux_pte(kvm->arch.pgtable, gpa, NULL, &shift);
|
|
if (ptep && pte_present(*ptep) && pte_young(*ptep)) {
|
|
if (ptep && pte_present(*ptep) && pte_young(*ptep)) {
|
|
kvmppc_radix_update_pte(kvm, ptep, _PAGE_ACCESSED, 0,
|
|
kvmppc_radix_update_pte(kvm, ptep, _PAGE_ACCESSED, 0,
|
|
gpa, shift);
|
|
gpa, shift);
|
|
@@ -545,8 +547,7 @@ int kvm_test_age_radix(struct kvm *kvm, struct kvm_memory_slot *memslot,
|
|
unsigned int shift;
|
|
unsigned int shift;
|
|
int ref = 0;
|
|
int ref = 0;
|
|
|
|
|
|
- ptep = __find_linux_pte_or_hugepte(kvm->arch.pgtable, gpa,
|
|
|
|
- NULL, &shift);
|
|
|
|
|
|
+ ptep = __find_linux_pte(kvm->arch.pgtable, gpa, NULL, &shift);
|
|
if (ptep && pte_present(*ptep) && pte_young(*ptep))
|
|
if (ptep && pte_present(*ptep) && pte_young(*ptep))
|
|
ref = 1;
|
|
ref = 1;
|
|
return ref;
|
|
return ref;
|
|
@@ -562,8 +563,7 @@ static int kvm_radix_test_clear_dirty(struct kvm *kvm,
|
|
unsigned int shift;
|
|
unsigned int shift;
|
|
int ret = 0;
|
|
int ret = 0;
|
|
|
|
|
|
- ptep = __find_linux_pte_or_hugepte(kvm->arch.pgtable, gpa,
|
|
|
|
- NULL, &shift);
|
|
|
|
|
|
+ ptep = __find_linux_pte(kvm->arch.pgtable, gpa, NULL, &shift);
|
|
if (ptep && pte_present(*ptep) && pte_dirty(*ptep)) {
|
|
if (ptep && pte_present(*ptep) && pte_dirty(*ptep)) {
|
|
ret = 1;
|
|
ret = 1;
|
|
if (shift)
|
|
if (shift)
|