diff options
Diffstat (limited to 'arch/powerpc/kvm/book3s_64_mmu_hv.c')
-rw-r--r-- | arch/powerpc/kvm/book3s_64_mmu_hv.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c index 043eec8461e7..f3ff587a8b7d 100644 --- a/arch/powerpc/kvm/book3s_64_mmu_hv.c +++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c | |||
@@ -260,10 +260,6 @@ int kvmppc_mmu_hv_init(void) | |||
260 | return 0; | 260 | return 0; |
261 | } | 261 | } |
262 | 262 | ||
263 | void kvmppc_mmu_destroy(struct kvm_vcpu *vcpu) | ||
264 | { | ||
265 | } | ||
266 | |||
267 | static void kvmppc_mmu_book3s_64_hv_reset_msr(struct kvm_vcpu *vcpu) | 263 | static void kvmppc_mmu_book3s_64_hv_reset_msr(struct kvm_vcpu *vcpu) |
268 | { | 264 | { |
269 | kvmppc_set_msr(vcpu, MSR_SF | MSR_ME); | 265 | kvmppc_set_msr(vcpu, MSR_SF | MSR_ME); |
@@ -451,7 +447,7 @@ static unsigned long kvmppc_mmu_get_real_addr(unsigned long v, unsigned long r, | |||
451 | } | 447 | } |
452 | 448 | ||
453 | static int kvmppc_mmu_book3s_64_hv_xlate(struct kvm_vcpu *vcpu, gva_t eaddr, | 449 | static int kvmppc_mmu_book3s_64_hv_xlate(struct kvm_vcpu *vcpu, gva_t eaddr, |
454 | struct kvmppc_pte *gpte, bool data) | 450 | struct kvmppc_pte *gpte, bool data, bool iswrite) |
455 | { | 451 | { |
456 | struct kvm *kvm = vcpu->kvm; | 452 | struct kvm *kvm = vcpu->kvm; |
457 | struct kvmppc_slb *slbe; | 453 | struct kvmppc_slb *slbe; |
@@ -906,21 +902,22 @@ static int kvm_unmap_rmapp(struct kvm *kvm, unsigned long *rmapp, | |||
906 | return 0; | 902 | return 0; |
907 | } | 903 | } |
908 | 904 | ||
909 | int kvm_unmap_hva(struct kvm *kvm, unsigned long hva) | 905 | int kvm_unmap_hva_hv(struct kvm *kvm, unsigned long hva) |
910 | { | 906 | { |
911 | if (kvm->arch.using_mmu_notifiers) | 907 | if (kvm->arch.using_mmu_notifiers) |
912 | kvm_handle_hva(kvm, hva, kvm_unmap_rmapp); | 908 | kvm_handle_hva(kvm, hva, kvm_unmap_rmapp); |
913 | return 0; | 909 | return 0; |
914 | } | 910 | } |
915 | 911 | ||
916 | int kvm_unmap_hva_range(struct kvm *kvm, unsigned long start, unsigned long end) | 912 | int kvm_unmap_hva_range_hv(struct kvm *kvm, unsigned long start, unsigned long end) |
917 | { | 913 | { |
918 | if (kvm->arch.using_mmu_notifiers) | 914 | if (kvm->arch.using_mmu_notifiers) |
919 | kvm_handle_hva_range(kvm, start, end, kvm_unmap_rmapp); | 915 | kvm_handle_hva_range(kvm, start, end, kvm_unmap_rmapp); |
920 | return 0; | 916 | return 0; |
921 | } | 917 | } |
922 | 918 | ||
923 | void kvmppc_core_flush_memslot(struct kvm *kvm, struct kvm_memory_slot *memslot) | 919 | void kvmppc_core_flush_memslot_hv(struct kvm *kvm, |
920 | struct kvm_memory_slot *memslot) | ||
924 | { | 921 | { |
925 | unsigned long *rmapp; | 922 | unsigned long *rmapp; |
926 | unsigned long gfn; | 923 | unsigned long gfn; |
@@ -994,7 +991,7 @@ static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp, | |||
994 | return ret; | 991 | return ret; |
995 | } | 992 | } |
996 | 993 | ||
997 | int kvm_age_hva(struct kvm *kvm, unsigned long hva) | 994 | int kvm_age_hva_hv(struct kvm *kvm, unsigned long hva) |
998 | { | 995 | { |
999 | if (!kvm->arch.using_mmu_notifiers) | 996 | if (!kvm->arch.using_mmu_notifiers) |
1000 | return 0; | 997 | return 0; |
@@ -1032,14 +1029,14 @@ static int kvm_test_age_rmapp(struct kvm *kvm, unsigned long *rmapp, | |||
1032 | return ret; | 1029 | return ret; |
1033 | } | 1030 | } |
1034 | 1031 | ||
1035 | int kvm_test_age_hva(struct kvm *kvm, unsigned long hva) | 1032 | int kvm_test_age_hva_hv(struct kvm *kvm, unsigned long hva) |
1036 | { | 1033 | { |
1037 | if (!kvm->arch.using_mmu_notifiers) | 1034 | if (!kvm->arch.using_mmu_notifiers) |
1038 | return 0; | 1035 | return 0; |
1039 | return kvm_handle_hva(kvm, hva, kvm_test_age_rmapp); | 1036 | return kvm_handle_hva(kvm, hva, kvm_test_age_rmapp); |
1040 | } | 1037 | } |
1041 | 1038 | ||
1042 | void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte) | 1039 | void kvm_set_spte_hva_hv(struct kvm *kvm, unsigned long hva, pte_t pte) |
1043 | { | 1040 | { |
1044 | if (!kvm->arch.using_mmu_notifiers) | 1041 | if (!kvm->arch.using_mmu_notifiers) |
1045 | return; | 1042 | return; |
@@ -1512,9 +1509,8 @@ static ssize_t kvm_htab_write(struct file *file, const char __user *buf, | |||
1512 | 1509 | ||
1513 | kvm->arch.vrma_slb_v = senc | SLB_VSID_B_1T | | 1510 | kvm->arch.vrma_slb_v = senc | SLB_VSID_B_1T | |
1514 | (VRMA_VSID << SLB_VSID_SHIFT_1T); | 1511 | (VRMA_VSID << SLB_VSID_SHIFT_1T); |
1515 | lpcr = kvm->arch.lpcr & ~LPCR_VRMASD; | 1512 | lpcr = senc << (LPCR_VRMASD_SH - 4); |
1516 | lpcr |= senc << (LPCR_VRMASD_SH - 4); | 1513 | kvmppc_update_lpcr(kvm, lpcr, LPCR_VRMASD); |
1517 | kvm->arch.lpcr = lpcr; | ||
1518 | rma_setup = 1; | 1514 | rma_setup = 1; |
1519 | } | 1515 | } |
1520 | ++i; | 1516 | ++i; |