.. | .. |
---|
| 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 | * |
---|
.. | .. |
---|
36 | 25 | #define OP_31_XOP_MTSR 210 |
---|
37 | 26 | #define OP_31_XOP_MTSRIN 242 |
---|
38 | 27 | #define OP_31_XOP_TLBIEL 274 |
---|
39 | | -#define OP_31_XOP_TLBIE 306 |
---|
40 | 28 | /* Opcode is officially reserved, reuse it as sc 1 when sc 1 doesn't trap */ |
---|
41 | 29 | #define OP_31_XOP_FAKE_SC1 308 |
---|
42 | 30 | #define OP_31_XOP_SLBMTE 402 |
---|
.. | .. |
---|
48 | 36 | #define OP_31_XOP_SLBMFEV 851 |
---|
49 | 37 | #define OP_31_XOP_EIOIO 854 |
---|
50 | 38 | #define OP_31_XOP_SLBMFEE 915 |
---|
| 39 | +#define OP_31_XOP_SLBFEE 979 |
---|
51 | 40 | |
---|
52 | 41 | #define OP_31_XOP_TBEGIN 654 |
---|
53 | 42 | #define OP_31_XOP_TABORT 910 |
---|
.. | .. |
---|
246 | 235 | |
---|
247 | 236 | #endif |
---|
248 | 237 | |
---|
249 | | -int kvmppc_core_emulate_op_pr(struct kvm_run *run, struct kvm_vcpu *vcpu, |
---|
| 238 | +int kvmppc_core_emulate_op_pr(struct kvm_vcpu *vcpu, |
---|
250 | 239 | unsigned int inst, int *advance) |
---|
251 | 240 | { |
---|
252 | 241 | int emulated = EMULATE_DONE; |
---|
.. | .. |
---|
382 | 371 | if (kvmppc_h_pr(vcpu, cmd) == EMULATE_DONE) |
---|
383 | 372 | break; |
---|
384 | 373 | |
---|
385 | | - run->papr_hcall.nr = cmd; |
---|
| 374 | + vcpu->run->papr_hcall.nr = cmd; |
---|
386 | 375 | for (i = 0; i < 9; ++i) { |
---|
387 | 376 | ulong gpr = kvmppc_get_gpr(vcpu, 4 + i); |
---|
388 | | - run->papr_hcall.args[i] = gpr; |
---|
| 377 | + vcpu->run->papr_hcall.args[i] = gpr; |
---|
389 | 378 | } |
---|
390 | 379 | |
---|
391 | | - run->exit_reason = KVM_EXIT_PAPR_HCALL; |
---|
| 380 | + vcpu->run->exit_reason = KVM_EXIT_PAPR_HCALL; |
---|
392 | 381 | vcpu->arch.hcall_needed = 1; |
---|
393 | 382 | emulated = EMULATE_EXIT_USER; |
---|
394 | 383 | break; |
---|
.. | .. |
---|
416 | 405 | return EMULATE_FAIL; |
---|
417 | 406 | |
---|
418 | 407 | vcpu->arch.mmu.slbia(vcpu); |
---|
| 408 | + break; |
---|
| 409 | + case OP_31_XOP_SLBFEE: |
---|
| 410 | + if (!(inst & 1) || !vcpu->arch.mmu.slbfee) { |
---|
| 411 | + return EMULATE_FAIL; |
---|
| 412 | + } else { |
---|
| 413 | + ulong b, t; |
---|
| 414 | + ulong cr = kvmppc_get_cr(vcpu) & ~CR0_MASK; |
---|
| 415 | + |
---|
| 416 | + b = kvmppc_get_gpr(vcpu, rb); |
---|
| 417 | + if (!vcpu->arch.mmu.slbfee(vcpu, b, &t)) |
---|
| 418 | + cr |= 2 << CR0_SHIFT; |
---|
| 419 | + kvmppc_set_gpr(vcpu, rt, t); |
---|
| 420 | + /* copy XER[SO] bit to CR0[SO] */ |
---|
| 421 | + cr |= (vcpu->arch.regs.xer & 0x80000000) >> |
---|
| 422 | + (31 - CR0_SHIFT); |
---|
| 423 | + kvmppc_set_cr(vcpu, cr); |
---|
| 424 | + } |
---|
419 | 425 | break; |
---|
420 | 426 | case OP_31_XOP_SLBMFEE: |
---|
421 | 427 | if (!vcpu->arch.mmu.slbmfee) { |
---|
.. | .. |
---|
623 | 629 | } |
---|
624 | 630 | |
---|
625 | 631 | if (emulated == EMULATE_FAIL) |
---|
626 | | - emulated = kvmppc_emulate_paired_single(run, vcpu); |
---|
| 632 | + emulated = kvmppc_emulate_paired_single(vcpu); |
---|
627 | 633 | |
---|
628 | 634 | return emulated; |
---|
629 | 635 | } |
---|