hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/arch/powerpc/kvm/e500_mmu_host.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2008-2013 Freescale Semiconductor, Inc. All rights reserved.
34 *
....@@ -10,10 +11,6 @@
1011 * Description:
1112 * This file is based on arch/powerpc/kvm/44x_tlb.c,
1213 * by Hollis Blanchard <hollisb@us.ibm.com>.
13
- *
14
- * This program is free software; you can redistribute it and/or modify
15
- * it under the terms of the GNU General Public License, version 2, as
16
- * published by the Free Software Foundation.
1714 */
1815
1916 #include <linux/kernel.h>
....@@ -358,9 +355,9 @@
358355
359356 if (tlbsel == 1) {
360357 struct vm_area_struct *vma;
361
- down_read(&current->mm->mmap_sem);
358
+ mmap_read_lock(kvm->mm);
362359
363
- vma = find_vma(current->mm, hva);
360
+ vma = find_vma(kvm->mm, hva);
364361 if (vma && hva >= vma->vm_start &&
365362 (vma->vm_flags & VM_PFNMAP)) {
366363 /*
....@@ -425,7 +422,7 @@
425422 break;
426423 }
427424 } else if (vma && hva >= vma->vm_start &&
428
- (vma->vm_flags & VM_HUGETLB)) {
425
+ is_vm_hugetlb_page(vma)) {
429426 unsigned long psize = vma_kernel_pagesize(vma);
430427
431428 tsize = (gtlbe->mas1 & MAS1_TSIZE_MASK) >>
....@@ -444,7 +441,7 @@
444441 tsize = max(BOOK3E_PAGESZ_4K, tsize & ~1);
445442 }
446443
447
- up_read(&current->mm->mmap_sem);
444
+ mmap_read_unlock(kvm->mm);
448445 }
449446
450447 if (likely(!pfnmap)) {
....@@ -738,7 +735,7 @@
738735 }
739736
740737 int kvm_unmap_hva_range(struct kvm *kvm, unsigned long start, unsigned long end,
741
- bool blockable)
738
+ unsigned flags)
742739 {
743740 /* kvm_unmap_hva flushes everything anyways */
744741 kvm_unmap_hva(kvm, start);
....@@ -758,10 +755,11 @@
758755 return 0;
759756 }
760757
761
-void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte)
758
+int kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte)
762759 {
763760 /* The page will get remapped properly on its next fault */
764761 kvm_unmap_hva(kvm, hva);
762
+ return 0;
765763 }
766764
767765 /*****************************************/