hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/powerpc/kvm/book3s_64_mmu.c
....@@ -1,16 +1,5 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
2
- * This program is free software; you can redistribute it and/or modify
3
- * it under the terms of the GNU General Public License, version 2, as
4
- * published by the Free Software Foundation.
5
- *
6
- * This program is distributed in the hope that it will be useful,
7
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
8
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
- * GNU General Public License for more details.
10
- *
11
- * You should have received a copy of the GNU General Public License
12
- * along with this program; if not, write to the Free Software
13
- * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
143 *
154 * Copyright SUSE Linux Products GmbH 2009
165 *
....@@ -34,20 +23,6 @@
3423 #else
3524 #define dprintk(X...) do { } while(0)
3625 #endif
37
-
38
-static void kvmppc_mmu_book3s_64_reset_msr(struct kvm_vcpu *vcpu)
39
-{
40
- unsigned long msr = vcpu->arch.intr_msr;
41
- unsigned long cur_msr = kvmppc_get_msr(vcpu);
42
-
43
- /* If transactional, change to suspend mode on IRQ delivery */
44
- if (MSR_TM_TRANSACTIONAL(cur_msr))
45
- msr |= MSR_TS_S;
46
- else
47
- msr |= cur_msr & MSR_TS_MASK;
48
-
49
- kvmppc_set_msr(vcpu, msr);
50
-}
5126
5227 static struct kvmppc_slb *kvmppc_mmu_book3s_64_find_slbe(
5328 struct kvm_vcpu *vcpu,
....@@ -336,7 +311,7 @@
336311 case 2:
337312 case 6:
338313 gpte->may_write = true;
339
- /* fall through */
314
+ fallthrough;
340315 case 3:
341316 case 5:
342317 case 7:
....@@ -433,6 +408,19 @@
433408
434409 /* Map the new segment */
435410 kvmppc_mmu_map_segment(vcpu, esid << SID_SHIFT);
411
+}
412
+
413
+static int kvmppc_mmu_book3s_64_slbfee(struct kvm_vcpu *vcpu, gva_t eaddr,
414
+ ulong *ret_slb)
415
+{
416
+ struct kvmppc_slb *slbe = kvmppc_mmu_book3s_64_find_slbe(vcpu, eaddr);
417
+
418
+ if (slbe) {
419
+ *ret_slb = slbe->origv;
420
+ return 0;
421
+ }
422
+ *ret_slb = 0;
423
+ return -ENOENT;
436424 }
437425
438426 static u64 kvmppc_mmu_book3s_64_slbmfee(struct kvm_vcpu *vcpu, u64 slb_nr)
....@@ -670,10 +658,10 @@
670658 mmu->slbmte = kvmppc_mmu_book3s_64_slbmte;
671659 mmu->slbmfee = kvmppc_mmu_book3s_64_slbmfee;
672660 mmu->slbmfev = kvmppc_mmu_book3s_64_slbmfev;
661
+ mmu->slbfee = kvmppc_mmu_book3s_64_slbfee;
673662 mmu->slbie = kvmppc_mmu_book3s_64_slbie;
674663 mmu->slbia = kvmppc_mmu_book3s_64_slbia;
675664 mmu->xlate = kvmppc_mmu_book3s_64_xlate;
676
- mmu->reset_msr = kvmppc_mmu_book3s_64_reset_msr;
677665 mmu->tlbie = kvmppc_mmu_book3s_64_tlbie;
678666 mmu->esid_to_vsid = kvmppc_mmu_book3s_64_esid_to_vsid;
679667 mmu->ea_to_vp = kvmppc_mmu_book3s_64_ea_to_vp;