| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 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. |
|---|
| 14 | 3 | * |
|---|
| 15 | 4 | * Copyright SUSE Linux Products GmbH 2009 |
|---|
| 16 | 5 | * |
|---|
| .. | .. |
|---|
| 34 | 23 | #else |
|---|
| 35 | 24 | #define dprintk(X...) do { } while(0) |
|---|
| 36 | 25 | #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 | | -} |
|---|
| 51 | 26 | |
|---|
| 52 | 27 | static struct kvmppc_slb *kvmppc_mmu_book3s_64_find_slbe( |
|---|
| 53 | 28 | struct kvm_vcpu *vcpu, |
|---|
| .. | .. |
|---|
| 336 | 311 | case 2: |
|---|
| 337 | 312 | case 6: |
|---|
| 338 | 313 | gpte->may_write = true; |
|---|
| 339 | | - /* fall through */ |
|---|
| 314 | + fallthrough; |
|---|
| 340 | 315 | case 3: |
|---|
| 341 | 316 | case 5: |
|---|
| 342 | 317 | case 7: |
|---|
| .. | .. |
|---|
| 433 | 408 | |
|---|
| 434 | 409 | /* Map the new segment */ |
|---|
| 435 | 410 | 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; |
|---|
| 436 | 424 | } |
|---|
| 437 | 425 | |
|---|
| 438 | 426 | static u64 kvmppc_mmu_book3s_64_slbmfee(struct kvm_vcpu *vcpu, u64 slb_nr) |
|---|
| .. | .. |
|---|
| 670 | 658 | mmu->slbmte = kvmppc_mmu_book3s_64_slbmte; |
|---|
| 671 | 659 | mmu->slbmfee = kvmppc_mmu_book3s_64_slbmfee; |
|---|
| 672 | 660 | mmu->slbmfev = kvmppc_mmu_book3s_64_slbmfev; |
|---|
| 661 | + mmu->slbfee = kvmppc_mmu_book3s_64_slbfee; |
|---|
| 673 | 662 | mmu->slbie = kvmppc_mmu_book3s_64_slbie; |
|---|
| 674 | 663 | mmu->slbia = kvmppc_mmu_book3s_64_slbia; |
|---|
| 675 | 664 | mmu->xlate = kvmppc_mmu_book3s_64_xlate; |
|---|
| 676 | | - mmu->reset_msr = kvmppc_mmu_book3s_64_reset_msr; |
|---|
| 677 | 665 | mmu->tlbie = kvmppc_mmu_book3s_64_tlbie; |
|---|
| 678 | 666 | mmu->esid_to_vsid = kvmppc_mmu_book3s_64_esid_to_vsid; |
|---|
| 679 | 667 | mmu->ea_to_vp = kvmppc_mmu_book3s_64_ea_to_vp; |
|---|