Hollis Blanchard | 75f74f0 | 2008-11-05 09:36:16 -0600 | [diff] [blame] | 1 | /* |
| 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 | * |
| 15 | * Copyright IBM Corp. 2008 |
| 16 | * |
| 17 | * Authors: Hollis Blanchard <hollisb@us.ibm.com> |
| 18 | */ |
| 19 | |
| 20 | #ifndef __KVM_BOOKE_H__ |
| 21 | #define __KVM_BOOKE_H__ |
| 22 | |
| 23 | #include <linux/types.h> |
| 24 | #include <linux/kvm_host.h> |
Hollis Blanchard | d0c7dc0 | 2009-01-03 16:23:06 -0600 | [diff] [blame] | 25 | #include <asm/kvm_ppc.h> |
Hollis Blanchard | 73e75b4 | 2008-12-02 15:51:57 -0600 | [diff] [blame] | 26 | #include "timing.h" |
Hollis Blanchard | 75f74f0 | 2008-11-05 09:36:16 -0600 | [diff] [blame] | 27 | |
Hollis Blanchard | d4cf389 | 2008-11-05 09:36:23 -0600 | [diff] [blame] | 28 | /* interrupt priortity ordering */ |
| 29 | #define BOOKE_IRQPRIO_DATA_STORAGE 0 |
| 30 | #define BOOKE_IRQPRIO_INST_STORAGE 1 |
| 31 | #define BOOKE_IRQPRIO_ALIGNMENT 2 |
| 32 | #define BOOKE_IRQPRIO_PROGRAM 3 |
| 33 | #define BOOKE_IRQPRIO_FP_UNAVAIL 4 |
Hollis Blanchard | bb3a8a1 | 2009-01-03 16:23:13 -0600 | [diff] [blame] | 34 | #define BOOKE_IRQPRIO_SPE_UNAVAIL 5 |
| 35 | #define BOOKE_IRQPRIO_SPE_FP_DATA 6 |
| 36 | #define BOOKE_IRQPRIO_SPE_FP_ROUND 7 |
| 37 | #define BOOKE_IRQPRIO_SYSCALL 8 |
| 38 | #define BOOKE_IRQPRIO_AP_UNAVAIL 9 |
| 39 | #define BOOKE_IRQPRIO_DTLB_MISS 10 |
| 40 | #define BOOKE_IRQPRIO_ITLB_MISS 11 |
| 41 | #define BOOKE_IRQPRIO_MACHINE_CHECK 12 |
| 42 | #define BOOKE_IRQPRIO_DEBUG 13 |
| 43 | #define BOOKE_IRQPRIO_CRITICAL 14 |
| 44 | #define BOOKE_IRQPRIO_WATCHDOG 15 |
| 45 | #define BOOKE_IRQPRIO_EXTERNAL 16 |
| 46 | #define BOOKE_IRQPRIO_FIT 17 |
| 47 | #define BOOKE_IRQPRIO_DECREMENTER 18 |
| 48 | #define BOOKE_IRQPRIO_PERFORMANCE_MONITOR 19 |
Alexander Graf | c5335f1 | 2010-08-30 14:03:24 +0200 | [diff] [blame] | 49 | /* Internal pseudo-irqprio for level triggered externals */ |
| 50 | #define BOOKE_IRQPRIO_EXTERNAL_LEVEL 20 |
| 51 | #define BOOKE_IRQPRIO_MAX 20 |
Hollis Blanchard | bb3a8a1 | 2009-01-03 16:23:13 -0600 | [diff] [blame] | 52 | |
| 53 | extern unsigned long kvmppc_booke_handlers; |
Hollis Blanchard | d4cf389 | 2008-11-05 09:36:23 -0600 | [diff] [blame] | 54 | |
Scott Wood | 4cd35f67 | 2011-06-14 18:34:31 -0500 | [diff] [blame] | 55 | void kvmppc_set_msr(struct kvm_vcpu *vcpu, u32 new_msr); |
Liu Yu | dd9ebf1f | 2011-06-14 18:35:14 -0500 | [diff] [blame] | 56 | void kvmppc_mmu_msr_notify(struct kvm_vcpu *vcpu, u32 old_msr); |
Hollis Blanchard | 75f74f0 | 2008-11-05 09:36:16 -0600 | [diff] [blame] | 57 | |
Scott Wood | dfd4d47 | 2011-11-17 12:39:59 +0000 | [diff] [blame] | 58 | void kvmppc_set_tcr(struct kvm_vcpu *vcpu, u32 new_tcr); |
| 59 | void kvmppc_set_tsr_bits(struct kvm_vcpu *vcpu, u32 tsr_bits); |
| 60 | void kvmppc_clr_tsr_bits(struct kvm_vcpu *vcpu, u32 tsr_bits); |
| 61 | |
Hollis Blanchard | d0c7dc0 | 2009-01-03 16:23:06 -0600 | [diff] [blame] | 62 | int kvmppc_booke_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu, |
| 63 | unsigned int inst, int *advance); |
| 64 | int kvmppc_booke_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt); |
| 65 | int kvmppc_booke_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, int rs); |
| 66 | |
Scott Wood | 4cd35f67 | 2011-06-14 18:34:31 -0500 | [diff] [blame] | 67 | /* low-level asm code to transfer guest state */ |
| 68 | void kvmppc_load_guest_spe(struct kvm_vcpu *vcpu); |
| 69 | void kvmppc_save_guest_spe(struct kvm_vcpu *vcpu); |
| 70 | |
| 71 | /* high-level function, manages flags, host state */ |
| 72 | void kvmppc_vcpu_disable_spe(struct kvm_vcpu *vcpu); |
| 73 | |
Hollis Blanchard | 75f74f0 | 2008-11-05 09:36:16 -0600 | [diff] [blame] | 74 | #endif /* __KVM_BOOKE_H__ */ |