diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2010-05-25 02:38:26 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-05-25 02:38:26 -0400 |
commit | b1e50ebcf24668e57f058deb48b0704b5391ed0f (patch) | |
tree | 17e1b69b249d0738317b732186340c9dd053f1a1 /arch/powerpc/include/asm | |
parent | 0c2a2ae32793e3500a15a449612485f5d17dd431 (diff) | |
parent | 7e125f7b9cbfce4101191b8076d606c517a73066 (diff) |
Merge remote branch 'origin' into secretlab/next-spi
Diffstat (limited to 'arch/powerpc/include/asm')
36 files changed, 711 insertions, 156 deletions
diff --git a/arch/powerpc/include/asm/asm-compat.h b/arch/powerpc/include/asm/asm-compat.h index a9b91ed3d4b9..2048a6aeea91 100644 --- a/arch/powerpc/include/asm/asm-compat.h +++ b/arch/powerpc/include/asm/asm-compat.h | |||
@@ -21,6 +21,7 @@ | |||
21 | /* operations for longs and pointers */ | 21 | /* operations for longs and pointers */ |
22 | #define PPC_LL stringify_in_c(ld) | 22 | #define PPC_LL stringify_in_c(ld) |
23 | #define PPC_STL stringify_in_c(std) | 23 | #define PPC_STL stringify_in_c(std) |
24 | #define PPC_STLU stringify_in_c(stdu) | ||
24 | #define PPC_LCMPI stringify_in_c(cmpdi) | 25 | #define PPC_LCMPI stringify_in_c(cmpdi) |
25 | #define PPC_LONG stringify_in_c(.llong) | 26 | #define PPC_LONG stringify_in_c(.llong) |
26 | #define PPC_LONG_ALIGN stringify_in_c(.balign 8) | 27 | #define PPC_LONG_ALIGN stringify_in_c(.balign 8) |
@@ -44,6 +45,7 @@ | |||
44 | /* operations for longs and pointers */ | 45 | /* operations for longs and pointers */ |
45 | #define PPC_LL stringify_in_c(lwz) | 46 | #define PPC_LL stringify_in_c(lwz) |
46 | #define PPC_STL stringify_in_c(stw) | 47 | #define PPC_STL stringify_in_c(stw) |
48 | #define PPC_STLU stringify_in_c(stwu) | ||
47 | #define PPC_LCMPI stringify_in_c(cmpwi) | 49 | #define PPC_LCMPI stringify_in_c(cmpwi) |
48 | #define PPC_LONG stringify_in_c(.long) | 50 | #define PPC_LONG stringify_in_c(.long) |
49 | #define PPC_LONG_ALIGN stringify_in_c(.balign 4) | 51 | #define PPC_LONG_ALIGN stringify_in_c(.balign 4) |
diff --git a/arch/powerpc/include/asm/bug.h b/arch/powerpc/include/asm/bug.h index 2c15212e1700..065c590c991d 100644 --- a/arch/powerpc/include/asm/bug.h +++ b/arch/powerpc/include/asm/bug.h | |||
@@ -85,12 +85,12 @@ | |||
85 | } \ | 85 | } \ |
86 | } while (0) | 86 | } while (0) |
87 | 87 | ||
88 | #define __WARN() do { \ | 88 | #define __WARN_TAINT(taint) do { \ |
89 | __asm__ __volatile__( \ | 89 | __asm__ __volatile__( \ |
90 | "1: twi 31,0,0\n" \ | 90 | "1: twi 31,0,0\n" \ |
91 | _EMIT_BUG_ENTRY \ | 91 | _EMIT_BUG_ENTRY \ |
92 | : : "i" (__FILE__), "i" (__LINE__), \ | 92 | : : "i" (__FILE__), "i" (__LINE__), \ |
93 | "i" (BUGFLAG_WARNING), \ | 93 | "i" (BUGFLAG_TAINT(taint)), \ |
94 | "i" (sizeof(struct bug_entry))); \ | 94 | "i" (sizeof(struct bug_entry))); \ |
95 | } while (0) | 95 | } while (0) |
96 | 96 | ||
@@ -104,7 +104,7 @@ | |||
104 | "1: "PPC_TLNEI" %4,0\n" \ | 104 | "1: "PPC_TLNEI" %4,0\n" \ |
105 | _EMIT_BUG_ENTRY \ | 105 | _EMIT_BUG_ENTRY \ |
106 | : : "i" (__FILE__), "i" (__LINE__), \ | 106 | : : "i" (__FILE__), "i" (__LINE__), \ |
107 | "i" (BUGFLAG_WARNING), \ | 107 | "i" (BUGFLAG_TAINT(TAINT_WARN)), \ |
108 | "i" (sizeof(struct bug_entry)), \ | 108 | "i" (sizeof(struct bug_entry)), \ |
109 | "r" (__ret_warn_on)); \ | 109 | "r" (__ret_warn_on)); \ |
110 | } \ | 110 | } \ |
diff --git a/arch/powerpc/include/asm/cache.h b/arch/powerpc/include/asm/cache.h index 81de6eb3455d..725634fc18c6 100644 --- a/arch/powerpc/include/asm/cache.h +++ b/arch/powerpc/include/asm/cache.h | |||
@@ -12,8 +12,12 @@ | |||
12 | #define L1_CACHE_SHIFT 6 | 12 | #define L1_CACHE_SHIFT 6 |
13 | #define MAX_COPY_PREFETCH 4 | 13 | #define MAX_COPY_PREFETCH 4 |
14 | #elif defined(CONFIG_PPC32) | 14 | #elif defined(CONFIG_PPC32) |
15 | #define L1_CACHE_SHIFT 5 | ||
16 | #define MAX_COPY_PREFETCH 4 | 15 | #define MAX_COPY_PREFETCH 4 |
16 | #if defined(CONFIG_PPC_47x) | ||
17 | #define L1_CACHE_SHIFT 7 | ||
18 | #else | ||
19 | #define L1_CACHE_SHIFT 5 | ||
20 | #endif | ||
17 | #else /* CONFIG_PPC64 */ | 21 | #else /* CONFIG_PPC64 */ |
18 | #define L1_CACHE_SHIFT 7 | 22 | #define L1_CACHE_SHIFT 7 |
19 | #endif | 23 | #endif |
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h index abb833b0e58f..e3cba4e1eb34 100644 --- a/arch/powerpc/include/asm/cputable.h +++ b/arch/powerpc/include/asm/cputable.h | |||
@@ -72,6 +72,7 @@ extern int machine_check_4xx(struct pt_regs *regs); | |||
72 | extern int machine_check_440A(struct pt_regs *regs); | 72 | extern int machine_check_440A(struct pt_regs *regs); |
73 | extern int machine_check_e500(struct pt_regs *regs); | 73 | extern int machine_check_e500(struct pt_regs *regs); |
74 | extern int machine_check_e200(struct pt_regs *regs); | 74 | extern int machine_check_e200(struct pt_regs *regs); |
75 | extern int machine_check_47x(struct pt_regs *regs); | ||
75 | 76 | ||
76 | /* NOTE WELL: Update identify_cpu() if fields are added or removed! */ | 77 | /* NOTE WELL: Update identify_cpu() if fields are added or removed! */ |
77 | struct cpu_spec { | 78 | struct cpu_spec { |
@@ -365,6 +366,7 @@ extern const char *powerpc_base_platform; | |||
365 | #define CPU_FTRS_44X (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | CPU_FTR_NOEXECUTE) | 366 | #define CPU_FTRS_44X (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | CPU_FTR_NOEXECUTE) |
366 | #define CPU_FTRS_440x6 (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | CPU_FTR_NOEXECUTE | \ | 367 | #define CPU_FTRS_440x6 (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | CPU_FTR_NOEXECUTE | \ |
367 | CPU_FTR_INDEXED_DCR) | 368 | CPU_FTR_INDEXED_DCR) |
369 | #define CPU_FTRS_47X (CPU_FTRS_440x6) | ||
368 | #define CPU_FTRS_E200 (CPU_FTR_USE_TB | CPU_FTR_SPE_COMP | \ | 370 | #define CPU_FTRS_E200 (CPU_FTR_USE_TB | CPU_FTR_SPE_COMP | \ |
369 | CPU_FTR_NODSISRALIGN | CPU_FTR_COHERENT_ICACHE | \ | 371 | CPU_FTR_NODSISRALIGN | CPU_FTR_COHERENT_ICACHE | \ |
370 | CPU_FTR_UNIFIED_ID_CACHE | CPU_FTR_NOEXECUTE) | 372 | CPU_FTR_UNIFIED_ID_CACHE | CPU_FTR_NOEXECUTE) |
@@ -453,6 +455,9 @@ enum { | |||
453 | #ifdef CONFIG_44x | 455 | #ifdef CONFIG_44x |
454 | CPU_FTRS_44X | CPU_FTRS_440x6 | | 456 | CPU_FTRS_44X | CPU_FTRS_440x6 | |
455 | #endif | 457 | #endif |
458 | #ifdef CONFIG_PPC_47x | ||
459 | CPU_FTRS_47X | | ||
460 | #endif | ||
456 | #ifdef CONFIG_E200 | 461 | #ifdef CONFIG_E200 |
457 | CPU_FTRS_E200 | | 462 | CPU_FTRS_E200 | |
458 | #endif | 463 | #endif |
diff --git a/arch/powerpc/include/asm/device.h b/arch/powerpc/include/asm/device.h index 6d94d27ed850..a3954e4fcbe2 100644 --- a/arch/powerpc/include/asm/device.h +++ b/arch/powerpc/include/asm/device.h | |||
@@ -10,9 +10,6 @@ struct dma_map_ops; | |||
10 | struct device_node; | 10 | struct device_node; |
11 | 11 | ||
12 | struct dev_archdata { | 12 | struct dev_archdata { |
13 | /* Optional pointer to an OF device node */ | ||
14 | struct device_node *of_node; | ||
15 | |||
16 | /* DMA operations on that device */ | 13 | /* DMA operations on that device */ |
17 | struct dma_map_ops *dma_ops; | 14 | struct dma_map_ops *dma_ops; |
18 | 15 | ||
@@ -30,19 +27,8 @@ struct dev_archdata { | |||
30 | #endif | 27 | #endif |
31 | }; | 28 | }; |
32 | 29 | ||
33 | static inline void dev_archdata_set_node(struct dev_archdata *ad, | ||
34 | struct device_node *np) | ||
35 | { | ||
36 | ad->of_node = np; | ||
37 | } | ||
38 | |||
39 | static inline struct device_node * | ||
40 | dev_archdata_get_node(const struct dev_archdata *ad) | ||
41 | { | ||
42 | return ad->of_node; | ||
43 | } | ||
44 | |||
45 | struct pdev_archdata { | 30 | struct pdev_archdata { |
31 | u64 dma_mask; | ||
46 | }; | 32 | }; |
47 | 33 | ||
48 | #endif /* _ASM_POWERPC_DEVICE_H */ | 34 | #endif /* _ASM_POWERPC_DEVICE_H */ |
diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h index f0275818b95c..5119b7db3142 100644 --- a/arch/powerpc/include/asm/hvcall.h +++ b/arch/powerpc/include/asm/hvcall.h | |||
@@ -228,6 +228,7 @@ | |||
228 | #define H_JOIN 0x298 | 228 | #define H_JOIN 0x298 |
229 | #define H_VASI_STATE 0x2A4 | 229 | #define H_VASI_STATE 0x2A4 |
230 | #define H_ENABLE_CRQ 0x2B0 | 230 | #define H_ENABLE_CRQ 0x2B0 |
231 | #define H_GET_EM_PARMS 0x2B8 | ||
231 | #define H_SET_MPP 0x2D0 | 232 | #define H_SET_MPP 0x2D0 |
232 | #define H_GET_MPP 0x2D4 | 233 | #define H_GET_MPP 0x2D4 |
233 | #define MAX_HCALL_OPCODE H_GET_MPP | 234 | #define MAX_HCALL_OPCODE H_GET_MPP |
@@ -281,6 +282,7 @@ long plpar_hcall_raw(unsigned long opcode, unsigned long *retbuf, ...); | |||
281 | */ | 282 | */ |
282 | #define PLPAR_HCALL9_BUFSIZE 9 | 283 | #define PLPAR_HCALL9_BUFSIZE 9 |
283 | long plpar_hcall9(unsigned long opcode, unsigned long *retbuf, ...); | 284 | long plpar_hcall9(unsigned long opcode, unsigned long *retbuf, ...); |
285 | long plpar_hcall9_raw(unsigned long opcode, unsigned long *retbuf, ...); | ||
284 | 286 | ||
285 | /* For hcall instrumentation. One structure per-hcall, per-CPU */ | 287 | /* For hcall instrumentation. One structure per-hcall, per-CPU */ |
286 | struct hcall_stats { | 288 | struct hcall_stats { |
diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h index 7e06b43720d3..a6ca6da1430b 100644 --- a/arch/powerpc/include/asm/kexec.h +++ b/arch/powerpc/include/asm/kexec.h | |||
@@ -31,6 +31,10 @@ | |||
31 | #define KEXEC_ARCH KEXEC_ARCH_PPC | 31 | #define KEXEC_ARCH KEXEC_ARCH_PPC |
32 | #endif | 32 | #endif |
33 | 33 | ||
34 | #define KEXEC_STATE_NONE 0 | ||
35 | #define KEXEC_STATE_IRQS_OFF 1 | ||
36 | #define KEXEC_STATE_REAL_MODE 2 | ||
37 | |||
34 | #ifndef __ASSEMBLY__ | 38 | #ifndef __ASSEMBLY__ |
35 | #include <linux/cpumask.h> | 39 | #include <linux/cpumask.h> |
36 | #include <asm/reg.h> | 40 | #include <asm/reg.h> |
diff --git a/arch/powerpc/include/asm/kmap_types.h b/arch/powerpc/include/asm/kmap_types.h index 916369575c97..bca8fdcd2542 100644 --- a/arch/powerpc/include/asm/kmap_types.h +++ b/arch/powerpc/include/asm/kmap_types.h | |||
@@ -26,6 +26,7 @@ enum km_type { | |||
26 | KM_SOFTIRQ1, | 26 | KM_SOFTIRQ1, |
27 | KM_PPC_SYNC_PAGE, | 27 | KM_PPC_SYNC_PAGE, |
28 | KM_PPC_SYNC_ICACHE, | 28 | KM_PPC_SYNC_ICACHE, |
29 | KM_KDB, | ||
29 | KM_TYPE_NR | 30 | KM_TYPE_NR |
30 | }; | 31 | }; |
31 | 32 | ||
diff --git a/arch/powerpc/include/asm/kvm.h b/arch/powerpc/include/asm/kvm.h index 81f3b0b5601e..6c5547d82bbe 100644 --- a/arch/powerpc/include/asm/kvm.h +++ b/arch/powerpc/include/asm/kvm.h | |||
@@ -77,4 +77,14 @@ struct kvm_debug_exit_arch { | |||
77 | struct kvm_guest_debug_arch { | 77 | struct kvm_guest_debug_arch { |
78 | }; | 78 | }; |
79 | 79 | ||
80 | #define KVM_REG_MASK 0x001f | ||
81 | #define KVM_REG_EXT_MASK 0xffe0 | ||
82 | #define KVM_REG_GPR 0x0000 | ||
83 | #define KVM_REG_FPR 0x0020 | ||
84 | #define KVM_REG_QPR 0x0040 | ||
85 | #define KVM_REG_FQPR 0x0060 | ||
86 | |||
87 | #define KVM_INTERRUPT_SET -1U | ||
88 | #define KVM_INTERRUPT_UNSET -2U | ||
89 | |||
80 | #endif /* __LINUX_KVM_POWERPC_H */ | 90 | #endif /* __LINUX_KVM_POWERPC_H */ |
diff --git a/arch/powerpc/include/asm/kvm_asm.h b/arch/powerpc/include/asm/kvm_asm.h index aadf2dd6f84e..c5ea4cda34b3 100644 --- a/arch/powerpc/include/asm/kvm_asm.h +++ b/arch/powerpc/include/asm/kvm_asm.h | |||
@@ -88,6 +88,8 @@ | |||
88 | 88 | ||
89 | #define BOOK3S_HFLAG_DCBZ32 0x1 | 89 | #define BOOK3S_HFLAG_DCBZ32 0x1 |
90 | #define BOOK3S_HFLAG_SLB 0x2 | 90 | #define BOOK3S_HFLAG_SLB 0x2 |
91 | #define BOOK3S_HFLAG_PAIRED_SINGLE 0x4 | ||
92 | #define BOOK3S_HFLAG_NATIVE_PS 0x8 | ||
91 | 93 | ||
92 | #define RESUME_FLAG_NV (1<<0) /* Reload guest nonvolatile state? */ | 94 | #define RESUME_FLAG_NV (1<<0) /* Reload guest nonvolatile state? */ |
93 | #define RESUME_FLAG_HOST (1<<1) /* Resume host? */ | 95 | #define RESUME_FLAG_HOST (1<<1) /* Resume host? */ |
diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h index db7db0a96967..6f74d93725a0 100644 --- a/arch/powerpc/include/asm/kvm_book3s.h +++ b/arch/powerpc/include/asm/kvm_book3s.h | |||
@@ -22,46 +22,47 @@ | |||
22 | 22 | ||
23 | #include <linux/types.h> | 23 | #include <linux/types.h> |
24 | #include <linux/kvm_host.h> | 24 | #include <linux/kvm_host.h> |
25 | #include <asm/kvm_book3s_64_asm.h> | 25 | #include <asm/kvm_book3s_asm.h> |
26 | 26 | ||
27 | struct kvmppc_slb { | 27 | struct kvmppc_slb { |
28 | u64 esid; | 28 | u64 esid; |
29 | u64 vsid; | 29 | u64 vsid; |
30 | u64 orige; | 30 | u64 orige; |
31 | u64 origv; | 31 | u64 origv; |
32 | bool valid; | 32 | bool valid : 1; |
33 | bool Ks; | 33 | bool Ks : 1; |
34 | bool Kp; | 34 | bool Kp : 1; |
35 | bool nx; | 35 | bool nx : 1; |
36 | bool large; /* PTEs are 16MB */ | 36 | bool large : 1; /* PTEs are 16MB */ |
37 | bool tb; /* 1TB segment */ | 37 | bool tb : 1; /* 1TB segment */ |
38 | bool class; | 38 | bool class : 1; |
39 | }; | 39 | }; |
40 | 40 | ||
41 | struct kvmppc_sr { | 41 | struct kvmppc_sr { |
42 | u32 raw; | 42 | u32 raw; |
43 | u32 vsid; | 43 | u32 vsid; |
44 | bool Ks; | 44 | bool Ks : 1; |
45 | bool Kp; | 45 | bool Kp : 1; |
46 | bool nx; | 46 | bool nx : 1; |
47 | bool valid : 1; | ||
47 | }; | 48 | }; |
48 | 49 | ||
49 | struct kvmppc_bat { | 50 | struct kvmppc_bat { |
50 | u64 raw; | 51 | u64 raw; |
51 | u32 bepi; | 52 | u32 bepi; |
52 | u32 bepi_mask; | 53 | u32 bepi_mask; |
53 | bool vs; | ||
54 | bool vp; | ||
55 | u32 brpn; | 54 | u32 brpn; |
56 | u8 wimg; | 55 | u8 wimg; |
57 | u8 pp; | 56 | u8 pp; |
57 | bool vs : 1; | ||
58 | bool vp : 1; | ||
58 | }; | 59 | }; |
59 | 60 | ||
60 | struct kvmppc_sid_map { | 61 | struct kvmppc_sid_map { |
61 | u64 guest_vsid; | 62 | u64 guest_vsid; |
62 | u64 guest_esid; | 63 | u64 guest_esid; |
63 | u64 host_vsid; | 64 | u64 host_vsid; |
64 | bool valid; | 65 | bool valid : 1; |
65 | }; | 66 | }; |
66 | 67 | ||
67 | #define SID_MAP_BITS 9 | 68 | #define SID_MAP_BITS 9 |
@@ -70,7 +71,7 @@ struct kvmppc_sid_map { | |||
70 | 71 | ||
71 | struct kvmppc_vcpu_book3s { | 72 | struct kvmppc_vcpu_book3s { |
72 | struct kvm_vcpu vcpu; | 73 | struct kvm_vcpu vcpu; |
73 | struct kvmppc_book3s_shadow_vcpu shadow_vcpu; | 74 | struct kvmppc_book3s_shadow_vcpu *shadow_vcpu; |
74 | struct kvmppc_sid_map sid_map[SID_MAP_NUM]; | 75 | struct kvmppc_sid_map sid_map[SID_MAP_NUM]; |
75 | struct kvmppc_slb slb[64]; | 76 | struct kvmppc_slb slb[64]; |
76 | struct { | 77 | struct { |
@@ -82,9 +83,10 @@ struct kvmppc_vcpu_book3s { | |||
82 | struct kvmppc_bat ibat[8]; | 83 | struct kvmppc_bat ibat[8]; |
83 | struct kvmppc_bat dbat[8]; | 84 | struct kvmppc_bat dbat[8]; |
84 | u64 hid[6]; | 85 | u64 hid[6]; |
86 | u64 gqr[8]; | ||
85 | int slb_nr; | 87 | int slb_nr; |
88 | u32 dsisr; | ||
86 | u64 sdr1; | 89 | u64 sdr1; |
87 | u64 dsisr; | ||
88 | u64 hior; | 90 | u64 hior; |
89 | u64 msr_mask; | 91 | u64 msr_mask; |
90 | u64 vsid_first; | 92 | u64 vsid_first; |
@@ -98,15 +100,15 @@ struct kvmppc_vcpu_book3s { | |||
98 | #define CONTEXT_GUEST 1 | 100 | #define CONTEXT_GUEST 1 |
99 | #define CONTEXT_GUEST_END 2 | 101 | #define CONTEXT_GUEST_END 2 |
100 | 102 | ||
101 | #define VSID_REAL 0xfffffffffff00000 | 103 | #define VSID_REAL 0x1fffffffffc00000ULL |
102 | #define VSID_REAL_DR 0xffffffffffe00000 | 104 | #define VSID_BAT 0x1fffffffffb00000ULL |
103 | #define VSID_REAL_IR 0xffffffffffd00000 | 105 | #define VSID_REAL_DR 0x2000000000000000ULL |
104 | #define VSID_BAT 0xffffffffffc00000 | 106 | #define VSID_REAL_IR 0x4000000000000000ULL |
105 | #define VSID_PR 0x8000000000000000 | 107 | #define VSID_PR 0x8000000000000000ULL |
106 | 108 | ||
107 | extern void kvmppc_mmu_pte_flush(struct kvm_vcpu *vcpu, u64 ea, u64 ea_mask); | 109 | extern void kvmppc_mmu_pte_flush(struct kvm_vcpu *vcpu, ulong ea, ulong ea_mask); |
108 | extern void kvmppc_mmu_pte_vflush(struct kvm_vcpu *vcpu, u64 vp, u64 vp_mask); | 110 | extern void kvmppc_mmu_pte_vflush(struct kvm_vcpu *vcpu, u64 vp, u64 vp_mask); |
109 | extern void kvmppc_mmu_pte_pflush(struct kvm_vcpu *vcpu, u64 pa_start, u64 pa_end); | 111 | extern void kvmppc_mmu_pte_pflush(struct kvm_vcpu *vcpu, ulong pa_start, ulong pa_end); |
110 | extern void kvmppc_set_msr(struct kvm_vcpu *vcpu, u64 new_msr); | 112 | extern void kvmppc_set_msr(struct kvm_vcpu *vcpu, u64 new_msr); |
111 | extern void kvmppc_mmu_book3s_64_init(struct kvm_vcpu *vcpu); | 113 | extern void kvmppc_mmu_book3s_64_init(struct kvm_vcpu *vcpu); |
112 | extern void kvmppc_mmu_book3s_32_init(struct kvm_vcpu *vcpu); | 114 | extern void kvmppc_mmu_book3s_32_init(struct kvm_vcpu *vcpu); |
@@ -114,11 +116,13 @@ extern int kvmppc_mmu_map_page(struct kvm_vcpu *vcpu, struct kvmppc_pte *pte); | |||
114 | extern int kvmppc_mmu_map_segment(struct kvm_vcpu *vcpu, ulong eaddr); | 116 | extern int kvmppc_mmu_map_segment(struct kvm_vcpu *vcpu, ulong eaddr); |
115 | extern void kvmppc_mmu_flush_segments(struct kvm_vcpu *vcpu); | 117 | extern void kvmppc_mmu_flush_segments(struct kvm_vcpu *vcpu); |
116 | extern struct kvmppc_pte *kvmppc_mmu_find_pte(struct kvm_vcpu *vcpu, u64 ea, bool data); | 118 | extern struct kvmppc_pte *kvmppc_mmu_find_pte(struct kvm_vcpu *vcpu, u64 ea, bool data); |
117 | extern int kvmppc_ld(struct kvm_vcpu *vcpu, ulong eaddr, int size, void *ptr, bool data); | 119 | extern int kvmppc_ld(struct kvm_vcpu *vcpu, ulong *eaddr, int size, void *ptr, bool data); |
118 | extern int kvmppc_st(struct kvm_vcpu *vcpu, ulong eaddr, int size, void *ptr); | 120 | extern int kvmppc_st(struct kvm_vcpu *vcpu, ulong *eaddr, int size, void *ptr, bool data); |
119 | extern void kvmppc_book3s_queue_irqprio(struct kvm_vcpu *vcpu, unsigned int vec); | 121 | extern void kvmppc_book3s_queue_irqprio(struct kvm_vcpu *vcpu, unsigned int vec); |
120 | extern void kvmppc_set_bat(struct kvm_vcpu *vcpu, struct kvmppc_bat *bat, | 122 | extern void kvmppc_set_bat(struct kvm_vcpu *vcpu, struct kvmppc_bat *bat, |
121 | bool upper, u32 val); | 123 | bool upper, u32 val); |
124 | extern void kvmppc_giveup_ext(struct kvm_vcpu *vcpu, ulong msr); | ||
125 | extern int kvmppc_emulate_paired_single(struct kvm_run *run, struct kvm_vcpu *vcpu); | ||
122 | 126 | ||
123 | extern u32 kvmppc_trampoline_lowmem; | 127 | extern u32 kvmppc_trampoline_lowmem; |
124 | extern u32 kvmppc_trampoline_enter; | 128 | extern u32 kvmppc_trampoline_enter; |
@@ -126,6 +130,8 @@ extern void kvmppc_rmcall(ulong srr0, ulong srr1); | |||
126 | extern void kvmppc_load_up_fpu(void); | 130 | extern void kvmppc_load_up_fpu(void); |
127 | extern void kvmppc_load_up_altivec(void); | 131 | extern void kvmppc_load_up_altivec(void); |
128 | extern void kvmppc_load_up_vsx(void); | 132 | extern void kvmppc_load_up_vsx(void); |
133 | extern u32 kvmppc_alignment_dsisr(struct kvm_vcpu *vcpu, unsigned int inst); | ||
134 | extern ulong kvmppc_alignment_dar(struct kvm_vcpu *vcpu, unsigned int inst); | ||
129 | 135 | ||
130 | static inline struct kvmppc_vcpu_book3s *to_book3s(struct kvm_vcpu *vcpu) | 136 | static inline struct kvmppc_vcpu_book3s *to_book3s(struct kvm_vcpu *vcpu) |
131 | { | 137 | { |
@@ -140,7 +146,108 @@ static inline ulong dsisr(void) | |||
140 | } | 146 | } |
141 | 147 | ||
142 | extern void kvm_return_point(void); | 148 | extern void kvm_return_point(void); |
149 | static inline struct kvmppc_book3s_shadow_vcpu *to_svcpu(struct kvm_vcpu *vcpu); | ||
150 | |||
151 | static inline void kvmppc_set_gpr(struct kvm_vcpu *vcpu, int num, ulong val) | ||
152 | { | ||
153 | if ( num < 14 ) { | ||
154 | to_svcpu(vcpu)->gpr[num] = val; | ||
155 | to_book3s(vcpu)->shadow_vcpu->gpr[num] = val; | ||
156 | } else | ||
157 | vcpu->arch.gpr[num] = val; | ||
158 | } | ||
159 | |||
160 | static inline ulong kvmppc_get_gpr(struct kvm_vcpu *vcpu, int num) | ||
161 | { | ||
162 | if ( num < 14 ) | ||
163 | return to_svcpu(vcpu)->gpr[num]; | ||
164 | else | ||
165 | return vcpu->arch.gpr[num]; | ||
166 | } | ||
167 | |||
168 | static inline void kvmppc_set_cr(struct kvm_vcpu *vcpu, u32 val) | ||
169 | { | ||
170 | to_svcpu(vcpu)->cr = val; | ||
171 | to_book3s(vcpu)->shadow_vcpu->cr = val; | ||
172 | } | ||
173 | |||
174 | static inline u32 kvmppc_get_cr(struct kvm_vcpu *vcpu) | ||
175 | { | ||
176 | return to_svcpu(vcpu)->cr; | ||
177 | } | ||
178 | |||
179 | static inline void kvmppc_set_xer(struct kvm_vcpu *vcpu, u32 val) | ||
180 | { | ||
181 | to_svcpu(vcpu)->xer = val; | ||
182 | to_book3s(vcpu)->shadow_vcpu->xer = val; | ||
183 | } | ||
184 | |||
185 | static inline u32 kvmppc_get_xer(struct kvm_vcpu *vcpu) | ||
186 | { | ||
187 | return to_svcpu(vcpu)->xer; | ||
188 | } | ||
189 | |||
190 | static inline void kvmppc_set_ctr(struct kvm_vcpu *vcpu, ulong val) | ||
191 | { | ||
192 | to_svcpu(vcpu)->ctr = val; | ||
193 | } | ||
194 | |||
195 | static inline ulong kvmppc_get_ctr(struct kvm_vcpu *vcpu) | ||
196 | { | ||
197 | return to_svcpu(vcpu)->ctr; | ||
198 | } | ||
199 | |||
200 | static inline void kvmppc_set_lr(struct kvm_vcpu *vcpu, ulong val) | ||
201 | { | ||
202 | to_svcpu(vcpu)->lr = val; | ||
203 | } | ||
204 | |||
205 | static inline ulong kvmppc_get_lr(struct kvm_vcpu *vcpu) | ||
206 | { | ||
207 | return to_svcpu(vcpu)->lr; | ||
208 | } | ||
209 | |||
210 | static inline void kvmppc_set_pc(struct kvm_vcpu *vcpu, ulong val) | ||
211 | { | ||
212 | to_svcpu(vcpu)->pc = val; | ||
213 | } | ||
214 | |||
215 | static inline ulong kvmppc_get_pc(struct kvm_vcpu *vcpu) | ||
216 | { | ||
217 | return to_svcpu(vcpu)->pc; | ||
218 | } | ||
219 | |||
220 | static inline u32 kvmppc_get_last_inst(struct kvm_vcpu *vcpu) | ||
221 | { | ||
222 | ulong pc = kvmppc_get_pc(vcpu); | ||
223 | struct kvmppc_book3s_shadow_vcpu *svcpu = to_svcpu(vcpu); | ||
224 | |||
225 | /* Load the instruction manually if it failed to do so in the | ||
226 | * exit path */ | ||
227 | if (svcpu->last_inst == KVM_INST_FETCH_FAILED) | ||
228 | kvmppc_ld(vcpu, &pc, sizeof(u32), &svcpu->last_inst, false); | ||
229 | |||
230 | return svcpu->last_inst; | ||
231 | } | ||
232 | |||
233 | static inline ulong kvmppc_get_fault_dar(struct kvm_vcpu *vcpu) | ||
234 | { | ||
235 | return to_svcpu(vcpu)->fault_dar; | ||
236 | } | ||
237 | |||
238 | /* Magic register values loaded into r3 and r4 before the 'sc' assembly | ||
239 | * instruction for the OSI hypercalls */ | ||
240 | #define OSI_SC_MAGIC_R3 0x113724FA | ||
241 | #define OSI_SC_MAGIC_R4 0x77810F9B | ||
143 | 242 | ||
144 | #define INS_DCBZ 0x7c0007ec | 243 | #define INS_DCBZ 0x7c0007ec |
145 | 244 | ||
245 | /* Also add subarch specific defines */ | ||
246 | |||
247 | #ifdef CONFIG_PPC_BOOK3S_32 | ||
248 | #include <asm/kvm_book3s_32.h> | ||
249 | #else | ||
250 | #include <asm/kvm_book3s_64.h> | ||
251 | #endif | ||
252 | |||
146 | #endif /* __ASM_KVM_BOOK3S_H__ */ | 253 | #endif /* __ASM_KVM_BOOK3S_H__ */ |
diff --git a/arch/powerpc/include/asm/kvm_book3s_32.h b/arch/powerpc/include/asm/kvm_book3s_32.h new file mode 100644 index 000000000000..de604db135f5 --- /dev/null +++ b/arch/powerpc/include/asm/kvm_book3s_32.h | |||
@@ -0,0 +1,42 @@ | |||
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 SUSE Linux Products GmbH 2010 | ||
16 | * | ||
17 | * Authors: Alexander Graf <agraf@suse.de> | ||
18 | */ | ||
19 | |||
20 | #ifndef __ASM_KVM_BOOK3S_32_H__ | ||
21 | #define __ASM_KVM_BOOK3S_32_H__ | ||
22 | |||
23 | static inline struct kvmppc_book3s_shadow_vcpu *to_svcpu(struct kvm_vcpu *vcpu) | ||
24 | { | ||
25 | return to_book3s(vcpu)->shadow_vcpu; | ||
26 | } | ||
27 | |||
28 | #define PTE_SIZE 12 | ||
29 | #define VSID_ALL 0 | ||
30 | #define SR_INVALID 0x00000001 /* VSID 1 should always be unused */ | ||
31 | #define SR_KP 0x20000000 | ||
32 | #define PTE_V 0x80000000 | ||
33 | #define PTE_SEC 0x00000040 | ||
34 | #define PTE_M 0x00000010 | ||
35 | #define PTE_R 0x00000100 | ||
36 | #define PTE_C 0x00000080 | ||
37 | |||
38 | #define SID_SHIFT 28 | ||
39 | #define ESID_MASK 0xf0000000 | ||
40 | #define VSID_MASK 0x00fffffff0000000ULL | ||
41 | |||
42 | #endif /* __ASM_KVM_BOOK3S_32_H__ */ | ||
diff --git a/arch/powerpc/include/asm/kvm_book3s_64.h b/arch/powerpc/include/asm/kvm_book3s_64.h new file mode 100644 index 000000000000..4cadd612d575 --- /dev/null +++ b/arch/powerpc/include/asm/kvm_book3s_64.h | |||
@@ -0,0 +1,28 @@ | |||
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 SUSE Linux Products GmbH 2010 | ||
16 | * | ||
17 | * Authors: Alexander Graf <agraf@suse.de> | ||
18 | */ | ||
19 | |||
20 | #ifndef __ASM_KVM_BOOK3S_64_H__ | ||
21 | #define __ASM_KVM_BOOK3S_64_H__ | ||
22 | |||
23 | static inline struct kvmppc_book3s_shadow_vcpu *to_svcpu(struct kvm_vcpu *vcpu) | ||
24 | { | ||
25 | return &get_paca()->shadow_vcpu; | ||
26 | } | ||
27 | |||
28 | #endif /* __ASM_KVM_BOOK3S_64_H__ */ | ||
diff --git a/arch/powerpc/include/asm/kvm_book3s_64_asm.h b/arch/powerpc/include/asm/kvm_book3s_asm.h index 183461b48407..36fdb3aff30b 100644 --- a/arch/powerpc/include/asm/kvm_book3s_64_asm.h +++ b/arch/powerpc/include/asm/kvm_book3s_asm.h | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | #ifdef __ASSEMBLY__ | 23 | #ifdef __ASSEMBLY__ |
24 | 24 | ||
25 | #ifdef CONFIG_KVM_BOOK3S_64_HANDLER | 25 | #ifdef CONFIG_KVM_BOOK3S_HANDLER |
26 | 26 | ||
27 | #include <asm/kvm_asm.h> | 27 | #include <asm/kvm_asm.h> |
28 | 28 | ||
@@ -55,7 +55,7 @@ kvmppc_resume_\intno: | |||
55 | .macro DO_KVM intno | 55 | .macro DO_KVM intno |
56 | .endm | 56 | .endm |
57 | 57 | ||
58 | #endif /* CONFIG_KVM_BOOK3S_64_HANDLER */ | 58 | #endif /* CONFIG_KVM_BOOK3S_HANDLER */ |
59 | 59 | ||
60 | #else /*__ASSEMBLY__ */ | 60 | #else /*__ASSEMBLY__ */ |
61 | 61 | ||
@@ -63,12 +63,33 @@ struct kvmppc_book3s_shadow_vcpu { | |||
63 | ulong gpr[14]; | 63 | ulong gpr[14]; |
64 | u32 cr; | 64 | u32 cr; |
65 | u32 xer; | 65 | u32 xer; |
66 | |||
67 | u32 fault_dsisr; | ||
68 | u32 last_inst; | ||
69 | ulong ctr; | ||
70 | ulong lr; | ||
71 | ulong pc; | ||
72 | ulong shadow_srr1; | ||
73 | ulong fault_dar; | ||
74 | |||
66 | ulong host_r1; | 75 | ulong host_r1; |
67 | ulong host_r2; | 76 | ulong host_r2; |
68 | ulong handler; | 77 | ulong handler; |
69 | ulong scratch0; | 78 | ulong scratch0; |
70 | ulong scratch1; | 79 | ulong scratch1; |
71 | ulong vmhandler; | 80 | ulong vmhandler; |
81 | u8 in_guest; | ||
82 | |||
83 | #ifdef CONFIG_PPC_BOOK3S_32 | ||
84 | u32 sr[16]; /* Guest SRs */ | ||
85 | #endif | ||
86 | #ifdef CONFIG_PPC_BOOK3S_64 | ||
87 | u8 slb_max; /* highest used guest slb entry */ | ||
88 | struct { | ||
89 | u64 esid; | ||
90 | u64 vsid; | ||
91 | } slb[64]; /* guest SLB */ | ||
92 | #endif | ||
72 | }; | 93 | }; |
73 | 94 | ||
74 | #endif /*__ASSEMBLY__ */ | 95 | #endif /*__ASSEMBLY__ */ |
diff --git a/arch/powerpc/include/asm/kvm_booke.h b/arch/powerpc/include/asm/kvm_booke.h new file mode 100644 index 000000000000..9c9ba3d59b1b --- /dev/null +++ b/arch/powerpc/include/asm/kvm_booke.h | |||
@@ -0,0 +1,96 @@ | |||
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 SUSE Linux Products GmbH 2010 | ||
16 | * | ||
17 | * Authors: Alexander Graf <agraf@suse.de> | ||
18 | */ | ||
19 | |||
20 | #ifndef __ASM_KVM_BOOKE_H__ | ||
21 | #define __ASM_KVM_BOOKE_H__ | ||
22 | |||
23 | #include <linux/types.h> | ||
24 | #include <linux/kvm_host.h> | ||
25 | |||
26 | static inline void kvmppc_set_gpr(struct kvm_vcpu *vcpu, int num, ulong val) | ||
27 | { | ||
28 | vcpu->arch.gpr[num] = val; | ||
29 | } | ||
30 | |||
31 | static inline ulong kvmppc_get_gpr(struct kvm_vcpu *vcpu, int num) | ||
32 | { | ||
33 | return vcpu->arch.gpr[num]; | ||
34 | } | ||
35 | |||
36 | static inline void kvmppc_set_cr(struct kvm_vcpu *vcpu, u32 val) | ||
37 | { | ||
38 | vcpu->arch.cr = val; | ||
39 | } | ||
40 | |||
41 | static inline u32 kvmppc_get_cr(struct kvm_vcpu *vcpu) | ||
42 | { | ||
43 | return vcpu->arch.cr; | ||
44 | } | ||
45 | |||
46 | static inline void kvmppc_set_xer(struct kvm_vcpu *vcpu, u32 val) | ||
47 | { | ||
48 | vcpu->arch.xer = val; | ||
49 | } | ||
50 | |||
51 | static inline u32 kvmppc_get_xer(struct kvm_vcpu *vcpu) | ||
52 | { | ||
53 | return vcpu->arch.xer; | ||
54 | } | ||
55 | |||
56 | static inline u32 kvmppc_get_last_inst(struct kvm_vcpu *vcpu) | ||
57 | { | ||
58 | return vcpu->arch.last_inst; | ||
59 | } | ||
60 | |||
61 | static inline void kvmppc_set_ctr(struct kvm_vcpu *vcpu, ulong val) | ||
62 | { | ||
63 | vcpu->arch.ctr = val; | ||
64 | } | ||
65 | |||
66 | static inline ulong kvmppc_get_ctr(struct kvm_vcpu *vcpu) | ||
67 | { | ||
68 | return vcpu->arch.ctr; | ||
69 | } | ||
70 | |||
71 | static inline void kvmppc_set_lr(struct kvm_vcpu *vcpu, ulong val) | ||
72 | { | ||
73 | vcpu->arch.lr = val; | ||
74 | } | ||
75 | |||
76 | static inline ulong kvmppc_get_lr(struct kvm_vcpu *vcpu) | ||
77 | { | ||
78 | return vcpu->arch.lr; | ||
79 | } | ||
80 | |||
81 | static inline void kvmppc_set_pc(struct kvm_vcpu *vcpu, ulong val) | ||
82 | { | ||
83 | vcpu->arch.pc = val; | ||
84 | } | ||
85 | |||
86 | static inline ulong kvmppc_get_pc(struct kvm_vcpu *vcpu) | ||
87 | { | ||
88 | return vcpu->arch.pc; | ||
89 | } | ||
90 | |||
91 | static inline ulong kvmppc_get_fault_dar(struct kvm_vcpu *vcpu) | ||
92 | { | ||
93 | return vcpu->arch.fault_dear; | ||
94 | } | ||
95 | |||
96 | #endif /* __ASM_KVM_BOOKE_H__ */ | ||
diff --git a/arch/powerpc/include/asm/kvm_fpu.h b/arch/powerpc/include/asm/kvm_fpu.h new file mode 100644 index 000000000000..94f05de9ad04 --- /dev/null +++ b/arch/powerpc/include/asm/kvm_fpu.h | |||
@@ -0,0 +1,85 @@ | |||
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 Novell Inc. 2010 | ||
16 | * | ||
17 | * Authors: Alexander Graf <agraf@suse.de> | ||
18 | */ | ||
19 | |||
20 | #ifndef __ASM_KVM_FPU_H__ | ||
21 | #define __ASM_KVM_FPU_H__ | ||
22 | |||
23 | #include <linux/types.h> | ||
24 | |||
25 | extern void fps_fres(struct thread_struct *t, u32 *dst, u32 *src1); | ||
26 | extern void fps_frsqrte(struct thread_struct *t, u32 *dst, u32 *src1); | ||
27 | extern void fps_fsqrts(struct thread_struct *t, u32 *dst, u32 *src1); | ||
28 | |||
29 | extern void fps_fadds(struct thread_struct *t, u32 *dst, u32 *src1, u32 *src2); | ||
30 | extern void fps_fdivs(struct thread_struct *t, u32 *dst, u32 *src1, u32 *src2); | ||
31 | extern void fps_fmuls(struct thread_struct *t, u32 *dst, u32 *src1, u32 *src2); | ||
32 | extern void fps_fsubs(struct thread_struct *t, u32 *dst, u32 *src1, u32 *src2); | ||
33 | |||
34 | extern void fps_fmadds(struct thread_struct *t, u32 *dst, u32 *src1, u32 *src2, | ||
35 | u32 *src3); | ||
36 | extern void fps_fmsubs(struct thread_struct *t, u32 *dst, u32 *src1, u32 *src2, | ||
37 | u32 *src3); | ||
38 | extern void fps_fnmadds(struct thread_struct *t, u32 *dst, u32 *src1, u32 *src2, | ||
39 | u32 *src3); | ||
40 | extern void fps_fnmsubs(struct thread_struct *t, u32 *dst, u32 *src1, u32 *src2, | ||
41 | u32 *src3); | ||
42 | extern void fps_fsel(struct thread_struct *t, u32 *dst, u32 *src1, u32 *src2, | ||
43 | u32 *src3); | ||
44 | |||
45 | #define FPD_ONE_IN(name) extern void fpd_ ## name(u64 *fpscr, u32 *cr, \ | ||
46 | u64 *dst, u64 *src1); | ||
47 | #define FPD_TWO_IN(name) extern void fpd_ ## name(u64 *fpscr, u32 *cr, \ | ||
48 | u64 *dst, u64 *src1, u64 *src2); | ||
49 | #define FPD_THREE_IN(name) extern void fpd_ ## name(u64 *fpscr, u32 *cr, \ | ||
50 | u64 *dst, u64 *src1, u64 *src2, u64 *src3); | ||
51 | |||
52 | extern void fpd_fcmpu(u64 *fpscr, u32 *cr, u64 *src1, u64 *src2); | ||
53 | extern void fpd_fcmpo(u64 *fpscr, u32 *cr, u64 *src1, u64 *src2); | ||
54 | |||
55 | FPD_ONE_IN(fsqrts) | ||
56 | FPD_ONE_IN(frsqrtes) | ||
57 | FPD_ONE_IN(fres) | ||
58 | FPD_ONE_IN(frsp) | ||
59 | FPD_ONE_IN(fctiw) | ||
60 | FPD_ONE_IN(fctiwz) | ||
61 | FPD_ONE_IN(fsqrt) | ||
62 | FPD_ONE_IN(fre) | ||
63 | FPD_ONE_IN(frsqrte) | ||
64 | FPD_ONE_IN(fneg) | ||
65 | FPD_ONE_IN(fabs) | ||
66 | FPD_TWO_IN(fadds) | ||
67 | FPD_TWO_IN(fsubs) | ||
68 | FPD_TWO_IN(fdivs) | ||
69 | FPD_TWO_IN(fmuls) | ||
70 | FPD_TWO_IN(fcpsgn) | ||
71 | FPD_TWO_IN(fdiv) | ||
72 | FPD_TWO_IN(fadd) | ||
73 | FPD_TWO_IN(fmul) | ||
74 | FPD_TWO_IN(fsub) | ||
75 | FPD_THREE_IN(fmsubs) | ||
76 | FPD_THREE_IN(fmadds) | ||
77 | FPD_THREE_IN(fnmsubs) | ||
78 | FPD_THREE_IN(fnmadds) | ||
79 | FPD_THREE_IN(fsel) | ||
80 | FPD_THREE_IN(fmsub) | ||
81 | FPD_THREE_IN(fmadd) | ||
82 | FPD_THREE_IN(fnmsub) | ||
83 | FPD_THREE_IN(fnmadd) | ||
84 | |||
85 | #endif | ||
diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h index 5e5bae7e152f..0c9ad869decd 100644 --- a/arch/powerpc/include/asm/kvm_host.h +++ b/arch/powerpc/include/asm/kvm_host.h | |||
@@ -66,7 +66,7 @@ struct kvm_vcpu_stat { | |||
66 | u32 dec_exits; | 66 | u32 dec_exits; |
67 | u32 ext_intr_exits; | 67 | u32 ext_intr_exits; |
68 | u32 halt_wakeup; | 68 | u32 halt_wakeup; |
69 | #ifdef CONFIG_PPC64 | 69 | #ifdef CONFIG_PPC_BOOK3S |
70 | u32 pf_storage; | 70 | u32 pf_storage; |
71 | u32 pf_instruc; | 71 | u32 pf_instruc; |
72 | u32 sp_storage; | 72 | u32 sp_storage; |
@@ -124,12 +124,12 @@ struct kvm_arch { | |||
124 | }; | 124 | }; |
125 | 125 | ||
126 | struct kvmppc_pte { | 126 | struct kvmppc_pte { |
127 | u64 eaddr; | 127 | ulong eaddr; |
128 | u64 vpage; | 128 | u64 vpage; |
129 | u64 raddr; | 129 | ulong raddr; |
130 | bool may_read; | 130 | bool may_read : 1; |
131 | bool may_write; | 131 | bool may_write : 1; |
132 | bool may_execute; | 132 | bool may_execute : 1; |
133 | }; | 133 | }; |
134 | 134 | ||
135 | struct kvmppc_mmu { | 135 | struct kvmppc_mmu { |
@@ -145,7 +145,7 @@ struct kvmppc_mmu { | |||
145 | int (*xlate)(struct kvm_vcpu *vcpu, gva_t eaddr, struct kvmppc_pte *pte, bool data); | 145 | int (*xlate)(struct kvm_vcpu *vcpu, gva_t eaddr, struct kvmppc_pte *pte, bool data); |
146 | void (*reset_msr)(struct kvm_vcpu *vcpu); | 146 | void (*reset_msr)(struct kvm_vcpu *vcpu); |
147 | void (*tlbie)(struct kvm_vcpu *vcpu, ulong addr, bool large); | 147 | void (*tlbie)(struct kvm_vcpu *vcpu, ulong addr, bool large); |
148 | int (*esid_to_vsid)(struct kvm_vcpu *vcpu, u64 esid, u64 *vsid); | 148 | int (*esid_to_vsid)(struct kvm_vcpu *vcpu, ulong esid, u64 *vsid); |
149 | u64 (*ea_to_vp)(struct kvm_vcpu *vcpu, gva_t eaddr, bool data); | 149 | u64 (*ea_to_vp)(struct kvm_vcpu *vcpu, gva_t eaddr, bool data); |
150 | bool (*is_dcbz32)(struct kvm_vcpu *vcpu); | 150 | bool (*is_dcbz32)(struct kvm_vcpu *vcpu); |
151 | }; | 151 | }; |
@@ -160,7 +160,7 @@ struct hpte_cache { | |||
160 | struct kvm_vcpu_arch { | 160 | struct kvm_vcpu_arch { |
161 | ulong host_stack; | 161 | ulong host_stack; |
162 | u32 host_pid; | 162 | u32 host_pid; |
163 | #ifdef CONFIG_PPC64 | 163 | #ifdef CONFIG_PPC_BOOK3S |
164 | ulong host_msr; | 164 | ulong host_msr; |
165 | ulong host_r2; | 165 | ulong host_r2; |
166 | void *host_retip; | 166 | void *host_retip; |
@@ -175,7 +175,7 @@ struct kvm_vcpu_arch { | |||
175 | ulong gpr[32]; | 175 | ulong gpr[32]; |
176 | 176 | ||
177 | u64 fpr[32]; | 177 | u64 fpr[32]; |
178 | u32 fpscr; | 178 | u64 fpscr; |
179 | 179 | ||
180 | #ifdef CONFIG_ALTIVEC | 180 | #ifdef CONFIG_ALTIVEC |
181 | vector128 vr[32]; | 181 | vector128 vr[32]; |
@@ -186,19 +186,23 @@ struct kvm_vcpu_arch { | |||
186 | u64 vsr[32]; | 186 | u64 vsr[32]; |
187 | #endif | 187 | #endif |
188 | 188 | ||
189 | #ifdef CONFIG_PPC_BOOK3S | ||
190 | /* For Gekko paired singles */ | ||
191 | u32 qpr[32]; | ||
192 | #endif | ||
193 | |||
194 | #ifdef CONFIG_BOOKE | ||
189 | ulong pc; | 195 | ulong pc; |
190 | ulong ctr; | 196 | ulong ctr; |
191 | ulong lr; | 197 | ulong lr; |
192 | 198 | ||
193 | #ifdef CONFIG_BOOKE | ||
194 | ulong xer; | 199 | ulong xer; |
195 | u32 cr; | 200 | u32 cr; |
196 | #endif | 201 | #endif |
197 | 202 | ||
198 | ulong msr; | 203 | ulong msr; |
199 | #ifdef CONFIG_PPC64 | 204 | #ifdef CONFIG_PPC_BOOK3S |
200 | ulong shadow_msr; | 205 | ulong shadow_msr; |
201 | ulong shadow_srr1; | ||
202 | ulong hflags; | 206 | ulong hflags; |
203 | ulong guest_owned_ext; | 207 | ulong guest_owned_ext; |
204 | #endif | 208 | #endif |
@@ -253,20 +257,22 @@ struct kvm_vcpu_arch { | |||
253 | struct dentry *debugfs_exit_timing; | 257 | struct dentry *debugfs_exit_timing; |
254 | #endif | 258 | #endif |
255 | 259 | ||
260 | #ifdef CONFIG_BOOKE | ||
256 | u32 last_inst; | 261 | u32 last_inst; |
257 | #ifdef CONFIG_PPC64 | ||
258 | ulong fault_dsisr; | ||
259 | #endif | ||
260 | ulong fault_dear; | 262 | ulong fault_dear; |
261 | ulong fault_esr; | 263 | ulong fault_esr; |
262 | ulong queued_dear; | 264 | ulong queued_dear; |
263 | ulong queued_esr; | 265 | ulong queued_esr; |
266 | #endif | ||
264 | gpa_t paddr_accessed; | 267 | gpa_t paddr_accessed; |
265 | 268 | ||
266 | u8 io_gpr; /* GPR used as IO source/target */ | 269 | u8 io_gpr; /* GPR used as IO source/target */ |
267 | u8 mmio_is_bigendian; | 270 | u8 mmio_is_bigendian; |
271 | u8 mmio_sign_extend; | ||
268 | u8 dcr_needed; | 272 | u8 dcr_needed; |
269 | u8 dcr_is_write; | 273 | u8 dcr_is_write; |
274 | u8 osi_needed; | ||
275 | u8 osi_enabled; | ||
270 | 276 | ||
271 | u32 cpr0_cfgaddr; /* holds the last set cpr0_cfgaddr */ | 277 | u32 cpr0_cfgaddr; /* holds the last set cpr0_cfgaddr */ |
272 | 278 | ||
@@ -275,7 +281,7 @@ struct kvm_vcpu_arch { | |||
275 | u64 dec_jiffies; | 281 | u64 dec_jiffies; |
276 | unsigned long pending_exceptions; | 282 | unsigned long pending_exceptions; |
277 | 283 | ||
278 | #ifdef CONFIG_PPC64 | 284 | #ifdef CONFIG_PPC_BOOK3S |
279 | struct hpte_cache hpte_cache[HPTEG_CACHE_NUM]; | 285 | struct hpte_cache hpte_cache[HPTEG_CACHE_NUM]; |
280 | int hpte_cache_offset; | 286 | int hpte_cache_offset; |
281 | #endif | 287 | #endif |
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h index e2642829e435..18d139ec2d22 100644 --- a/arch/powerpc/include/asm/kvm_ppc.h +++ b/arch/powerpc/include/asm/kvm_ppc.h | |||
@@ -30,6 +30,8 @@ | |||
30 | #include <linux/kvm_host.h> | 30 | #include <linux/kvm_host.h> |
31 | #ifdef CONFIG_PPC_BOOK3S | 31 | #ifdef CONFIG_PPC_BOOK3S |
32 | #include <asm/kvm_book3s.h> | 32 | #include <asm/kvm_book3s.h> |
33 | #else | ||
34 | #include <asm/kvm_booke.h> | ||
33 | #endif | 35 | #endif |
34 | 36 | ||
35 | enum emulation_result { | 37 | enum emulation_result { |
@@ -37,6 +39,7 @@ enum emulation_result { | |||
37 | EMULATE_DO_MMIO, /* kvm_run filled with MMIO request */ | 39 | EMULATE_DO_MMIO, /* kvm_run filled with MMIO request */ |
38 | EMULATE_DO_DCR, /* kvm_run filled with DCR request */ | 40 | EMULATE_DO_DCR, /* kvm_run filled with DCR request */ |
39 | EMULATE_FAIL, /* can't emulate this instruction */ | 41 | EMULATE_FAIL, /* can't emulate this instruction */ |
42 | EMULATE_AGAIN, /* something went wrong. go again */ | ||
40 | }; | 43 | }; |
41 | 44 | ||
42 | extern int __kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu); | 45 | extern int __kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu); |
@@ -48,8 +51,11 @@ extern void kvmppc_dump_vcpu(struct kvm_vcpu *vcpu); | |||
48 | extern int kvmppc_handle_load(struct kvm_run *run, struct kvm_vcpu *vcpu, | 51 | extern int kvmppc_handle_load(struct kvm_run *run, struct kvm_vcpu *vcpu, |
49 | unsigned int rt, unsigned int bytes, | 52 | unsigned int rt, unsigned int bytes, |
50 | int is_bigendian); | 53 | int is_bigendian); |
54 | extern int kvmppc_handle_loads(struct kvm_run *run, struct kvm_vcpu *vcpu, | ||
55 | unsigned int rt, unsigned int bytes, | ||
56 | int is_bigendian); | ||
51 | extern int kvmppc_handle_store(struct kvm_run *run, struct kvm_vcpu *vcpu, | 57 | extern int kvmppc_handle_store(struct kvm_run *run, struct kvm_vcpu *vcpu, |
52 | u32 val, unsigned int bytes, int is_bigendian); | 58 | u64 val, unsigned int bytes, int is_bigendian); |
53 | 59 | ||
54 | extern int kvmppc_emulate_instruction(struct kvm_run *run, | 60 | extern int kvmppc_emulate_instruction(struct kvm_run *run, |
55 | struct kvm_vcpu *vcpu); | 61 | struct kvm_vcpu *vcpu); |
@@ -63,6 +69,7 @@ extern void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gpa_t gpaddr, | |||
63 | extern void kvmppc_mmu_priv_switch(struct kvm_vcpu *vcpu, int usermode); | 69 | extern void kvmppc_mmu_priv_switch(struct kvm_vcpu *vcpu, int usermode); |
64 | extern void kvmppc_mmu_switch_pid(struct kvm_vcpu *vcpu, u32 pid); | 70 | extern void kvmppc_mmu_switch_pid(struct kvm_vcpu *vcpu, u32 pid); |
65 | extern void kvmppc_mmu_destroy(struct kvm_vcpu *vcpu); | 71 | extern void kvmppc_mmu_destroy(struct kvm_vcpu *vcpu); |
72 | extern int kvmppc_mmu_init(struct kvm_vcpu *vcpu); | ||
66 | extern int kvmppc_mmu_dtlb_index(struct kvm_vcpu *vcpu, gva_t eaddr); | 73 | extern int kvmppc_mmu_dtlb_index(struct kvm_vcpu *vcpu, gva_t eaddr); |
67 | extern int kvmppc_mmu_itlb_index(struct kvm_vcpu *vcpu, gva_t eaddr); | 74 | extern int kvmppc_mmu_itlb_index(struct kvm_vcpu *vcpu, gva_t eaddr); |
68 | extern gpa_t kvmppc_mmu_xlate(struct kvm_vcpu *vcpu, unsigned int gtlb_index, | 75 | extern gpa_t kvmppc_mmu_xlate(struct kvm_vcpu *vcpu, unsigned int gtlb_index, |
@@ -88,6 +95,8 @@ extern void kvmppc_core_queue_dec(struct kvm_vcpu *vcpu); | |||
88 | extern void kvmppc_core_dequeue_dec(struct kvm_vcpu *vcpu); | 95 | extern void kvmppc_core_dequeue_dec(struct kvm_vcpu *vcpu); |
89 | extern void kvmppc_core_queue_external(struct kvm_vcpu *vcpu, | 96 | extern void kvmppc_core_queue_external(struct kvm_vcpu *vcpu, |
90 | struct kvm_interrupt *irq); | 97 | struct kvm_interrupt *irq); |
98 | extern void kvmppc_core_dequeue_external(struct kvm_vcpu *vcpu, | ||
99 | struct kvm_interrupt *irq); | ||
91 | 100 | ||
92 | extern int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu, | 101 | extern int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu, |
93 | unsigned int op, int *advance); | 102 | unsigned int op, int *advance); |
@@ -99,81 +108,37 @@ extern void kvmppc_booke_exit(void); | |||
99 | 108 | ||
100 | extern void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu); | 109 | extern void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu); |
101 | 110 | ||
102 | #ifdef CONFIG_PPC_BOOK3S | 111 | /* |
103 | 112 | * Cuts out inst bits with ordering according to spec. | |
104 | /* We assume we're always acting on the current vcpu */ | 113 | * That means the leftmost bit is zero. All given bits are included. |
105 | 114 | */ | |
106 | static inline void kvmppc_set_gpr(struct kvm_vcpu *vcpu, int num, ulong val) | 115 | static inline u32 kvmppc_get_field(u64 inst, int msb, int lsb) |
107 | { | ||
108 | if ( num < 14 ) { | ||
109 | get_paca()->shadow_vcpu.gpr[num] = val; | ||
110 | to_book3s(vcpu)->shadow_vcpu.gpr[num] = val; | ||
111 | } else | ||
112 | vcpu->arch.gpr[num] = val; | ||
113 | } | ||
114 | |||
115 | static inline ulong kvmppc_get_gpr(struct kvm_vcpu *vcpu, int num) | ||
116 | { | ||
117 | if ( num < 14 ) | ||
118 | return get_paca()->shadow_vcpu.gpr[num]; | ||
119 | else | ||
120 | return vcpu->arch.gpr[num]; | ||
121 | } | ||
122 | |||
123 | static inline void kvmppc_set_cr(struct kvm_vcpu *vcpu, u32 val) | ||
124 | { | ||
125 | get_paca()->shadow_vcpu.cr = val; | ||
126 | to_book3s(vcpu)->shadow_vcpu.cr = val; | ||
127 | } | ||
128 | |||
129 | static inline u32 kvmppc_get_cr(struct kvm_vcpu *vcpu) | ||
130 | { | ||
131 | return get_paca()->shadow_vcpu.cr; | ||
132 | } | ||
133 | |||
134 | static inline void kvmppc_set_xer(struct kvm_vcpu *vcpu, u32 val) | ||
135 | { | ||
136 | get_paca()->shadow_vcpu.xer = val; | ||
137 | to_book3s(vcpu)->shadow_vcpu.xer = val; | ||
138 | } | ||
139 | |||
140 | static inline u32 kvmppc_get_xer(struct kvm_vcpu *vcpu) | ||
141 | { | 116 | { |
142 | return get_paca()->shadow_vcpu.xer; | 117 | u32 r; |
143 | } | 118 | u32 mask; |
144 | 119 | ||
145 | #else | 120 | BUG_ON(msb > lsb); |
146 | 121 | ||
147 | static inline void kvmppc_set_gpr(struct kvm_vcpu *vcpu, int num, ulong val) | 122 | mask = (1 << (lsb - msb + 1)) - 1; |
148 | { | 123 | r = (inst >> (63 - lsb)) & mask; |
149 | vcpu->arch.gpr[num] = val; | ||
150 | } | ||
151 | 124 | ||
152 | static inline ulong kvmppc_get_gpr(struct kvm_vcpu *vcpu, int num) | 125 | return r; |
153 | { | ||
154 | return vcpu->arch.gpr[num]; | ||
155 | } | 126 | } |
156 | 127 | ||
157 | static inline void kvmppc_set_cr(struct kvm_vcpu *vcpu, u32 val) | 128 | /* |
129 | * Replaces inst bits with ordering according to spec. | ||
130 | */ | ||
131 | static inline u32 kvmppc_set_field(u64 inst, int msb, int lsb, int value) | ||
158 | { | 132 | { |
159 | vcpu->arch.cr = val; | 133 | u32 r; |
160 | } | 134 | u32 mask; |
161 | 135 | ||
162 | static inline u32 kvmppc_get_cr(struct kvm_vcpu *vcpu) | 136 | BUG_ON(msb > lsb); |
163 | { | ||
164 | return vcpu->arch.cr; | ||
165 | } | ||
166 | 137 | ||
167 | static inline void kvmppc_set_xer(struct kvm_vcpu *vcpu, u32 val) | 138 | mask = ((1 << (lsb - msb + 1)) - 1) << (63 - lsb); |
168 | { | 139 | r = (inst & ~mask) | ((value << (63 - lsb)) & mask); |
169 | vcpu->arch.xer = val; | ||
170 | } | ||
171 | 140 | ||
172 | static inline u32 kvmppc_get_xer(struct kvm_vcpu *vcpu) | 141 | return r; |
173 | { | ||
174 | return vcpu->arch.xer; | ||
175 | } | 142 | } |
176 | 143 | ||
177 | #endif | ||
178 | |||
179 | #endif /* __POWERPC_KVM_PPC_H__ */ | 144 | #endif /* __POWERPC_KVM_PPC_H__ */ |
diff --git a/arch/powerpc/include/asm/macio.h b/arch/powerpc/include/asm/macio.h index a062c57696d0..19a661b4cb98 100644 --- a/arch/powerpc/include/asm/macio.h +++ b/arch/powerpc/include/asm/macio.h | |||
@@ -108,7 +108,7 @@ static inline void* macio_get_drvdata(struct macio_dev *dev) | |||
108 | 108 | ||
109 | static inline struct device_node *macio_get_of_node(struct macio_dev *mdev) | 109 | static inline struct device_node *macio_get_of_node(struct macio_dev *mdev) |
110 | { | 110 | { |
111 | return mdev->ofdev.node; | 111 | return mdev->ofdev.dev.of_node; |
112 | } | 112 | } |
113 | 113 | ||
114 | #ifdef CONFIG_PCI | 114 | #ifdef CONFIG_PCI |
diff --git a/arch/powerpc/include/asm/mmu-44x.h b/arch/powerpc/include/asm/mmu-44x.h index 0372669383a8..bf52d704fc47 100644 --- a/arch/powerpc/include/asm/mmu-44x.h +++ b/arch/powerpc/include/asm/mmu-44x.h | |||
@@ -40,7 +40,7 @@ | |||
40 | #define PPC44x_TLB_I 0x00000400 /* Caching is inhibited */ | 40 | #define PPC44x_TLB_I 0x00000400 /* Caching is inhibited */ |
41 | #define PPC44x_TLB_M 0x00000200 /* Memory is coherent */ | 41 | #define PPC44x_TLB_M 0x00000200 /* Memory is coherent */ |
42 | #define PPC44x_TLB_G 0x00000100 /* Memory is guarded */ | 42 | #define PPC44x_TLB_G 0x00000100 /* Memory is guarded */ |
43 | #define PPC44x_TLB_E 0x00000080 /* Memory is guarded */ | 43 | #define PPC44x_TLB_E 0x00000080 /* Memory is little endian */ |
44 | 44 | ||
45 | #define PPC44x_TLB_PERM_MASK 0x0000003f | 45 | #define PPC44x_TLB_PERM_MASK 0x0000003f |
46 | #define PPC44x_TLB_UX 0x00000020 /* User execution */ | 46 | #define PPC44x_TLB_UX 0x00000020 /* User execution */ |
@@ -53,6 +53,52 @@ | |||
53 | /* Number of TLB entries */ | 53 | /* Number of TLB entries */ |
54 | #define PPC44x_TLB_SIZE 64 | 54 | #define PPC44x_TLB_SIZE 64 |
55 | 55 | ||
56 | /* 47x bits */ | ||
57 | #define PPC47x_MMUCR_TID 0x0000ffff | ||
58 | #define PPC47x_MMUCR_STS 0x00010000 | ||
59 | |||
60 | /* Page identification fields */ | ||
61 | #define PPC47x_TLB0_EPN_MASK 0xfffff000 /* Effective Page Number */ | ||
62 | #define PPC47x_TLB0_VALID 0x00000800 /* Valid flag */ | ||
63 | #define PPC47x_TLB0_TS 0x00000400 /* Translation address space */ | ||
64 | #define PPC47x_TLB0_4K 0x00000000 | ||
65 | #define PPC47x_TLB0_16K 0x00000010 | ||
66 | #define PPC47x_TLB0_64K 0x00000030 | ||
67 | #define PPC47x_TLB0_1M 0x00000070 | ||
68 | #define PPC47x_TLB0_16M 0x000000f0 | ||
69 | #define PPC47x_TLB0_256M 0x000001f0 | ||
70 | #define PPC47x_TLB0_1G 0x000003f0 | ||
71 | #define PPC47x_TLB0_BOLTED_R 0x00000008 /* tlbre only */ | ||
72 | |||
73 | /* Translation fields */ | ||
74 | #define PPC47x_TLB1_RPN_MASK 0xfffff000 /* Real Page Number */ | ||
75 | #define PPC47x_TLB1_ERPN_MASK 0x000003ff | ||
76 | |||
77 | /* Storage attribute and access control fields */ | ||
78 | #define PPC47x_TLB2_ATTR_MASK 0x0003ff80 | ||
79 | #define PPC47x_TLB2_IL1I 0x00020000 /* Memory is guarded */ | ||
80 | #define PPC47x_TLB2_IL1D 0x00010000 /* Memory is guarded */ | ||
81 | #define PPC47x_TLB2_U0 0x00008000 /* User 0 */ | ||
82 | #define PPC47x_TLB2_U1 0x00004000 /* User 1 */ | ||
83 | #define PPC47x_TLB2_U2 0x00002000 /* User 2 */ | ||
84 | #define PPC47x_TLB2_U3 0x00001000 /* User 3 */ | ||
85 | #define PPC47x_TLB2_W 0x00000800 /* Caching is write-through */ | ||
86 | #define PPC47x_TLB2_I 0x00000400 /* Caching is inhibited */ | ||
87 | #define PPC47x_TLB2_M 0x00000200 /* Memory is coherent */ | ||
88 | #define PPC47x_TLB2_G 0x00000100 /* Memory is guarded */ | ||
89 | #define PPC47x_TLB2_E 0x00000080 /* Memory is little endian */ | ||
90 | #define PPC47x_TLB2_PERM_MASK 0x0000003f | ||
91 | #define PPC47x_TLB2_UX 0x00000020 /* User execution */ | ||
92 | #define PPC47x_TLB2_UW 0x00000010 /* User write */ | ||
93 | #define PPC47x_TLB2_UR 0x00000008 /* User read */ | ||
94 | #define PPC47x_TLB2_SX 0x00000004 /* Super execution */ | ||
95 | #define PPC47x_TLB2_SW 0x00000002 /* Super write */ | ||
96 | #define PPC47x_TLB2_SR 0x00000001 /* Super read */ | ||
97 | #define PPC47x_TLB2_U_RWX (PPC47x_TLB2_UX|PPC47x_TLB2_UW|PPC47x_TLB2_UR) | ||
98 | #define PPC47x_TLB2_S_RWX (PPC47x_TLB2_SX|PPC47x_TLB2_SW|PPC47x_TLB2_SR) | ||
99 | #define PPC47x_TLB2_S_RW (PPC47x_TLB2_SW | PPC47x_TLB2_SR) | ||
100 | #define PPC47x_TLB2_IMG (PPC47x_TLB2_I | PPC47x_TLB2_M | PPC47x_TLB2_G) | ||
101 | |||
56 | #ifndef __ASSEMBLY__ | 102 | #ifndef __ASSEMBLY__ |
57 | 103 | ||
58 | extern unsigned int tlb_44x_hwater; | 104 | extern unsigned int tlb_44x_hwater; |
@@ -79,12 +125,15 @@ typedef struct { | |||
79 | 125 | ||
80 | #if (PAGE_SHIFT == 12) | 126 | #if (PAGE_SHIFT == 12) |
81 | #define PPC44x_TLBE_SIZE PPC44x_TLB_4K | 127 | #define PPC44x_TLBE_SIZE PPC44x_TLB_4K |
128 | #define PPC47x_TLBE_SIZE PPC47x_TLB0_4K | ||
82 | #define mmu_virtual_psize MMU_PAGE_4K | 129 | #define mmu_virtual_psize MMU_PAGE_4K |
83 | #elif (PAGE_SHIFT == 14) | 130 | #elif (PAGE_SHIFT == 14) |
84 | #define PPC44x_TLBE_SIZE PPC44x_TLB_16K | 131 | #define PPC44x_TLBE_SIZE PPC44x_TLB_16K |
132 | #define PPC47x_TLBE_SIZE PPC47x_TLB0_16K | ||
85 | #define mmu_virtual_psize MMU_PAGE_16K | 133 | #define mmu_virtual_psize MMU_PAGE_16K |
86 | #elif (PAGE_SHIFT == 16) | 134 | #elif (PAGE_SHIFT == 16) |
87 | #define PPC44x_TLBE_SIZE PPC44x_TLB_64K | 135 | #define PPC44x_TLBE_SIZE PPC44x_TLB_64K |
136 | #define PPC47x_TLBE_SIZE PPC47x_TLB0_64K | ||
88 | #define mmu_virtual_psize MMU_PAGE_64K | 137 | #define mmu_virtual_psize MMU_PAGE_64K |
89 | #elif (PAGE_SHIFT == 18) | 138 | #elif (PAGE_SHIFT == 18) |
90 | #define PPC44x_TLBE_SIZE PPC44x_TLB_256K | 139 | #define PPC44x_TLBE_SIZE PPC44x_TLB_256K |
diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h index 7ffbb65ff7a9..7ebf42ed84a2 100644 --- a/arch/powerpc/include/asm/mmu.h +++ b/arch/powerpc/include/asm/mmu.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #define MMU_FTR_TYPE_44x ASM_CONST(0x00000008) | 18 | #define MMU_FTR_TYPE_44x ASM_CONST(0x00000008) |
19 | #define MMU_FTR_TYPE_FSL_E ASM_CONST(0x00000010) | 19 | #define MMU_FTR_TYPE_FSL_E ASM_CONST(0x00000010) |
20 | #define MMU_FTR_TYPE_3E ASM_CONST(0x00000020) | 20 | #define MMU_FTR_TYPE_3E ASM_CONST(0x00000020) |
21 | #define MMU_FTR_TYPE_47x ASM_CONST(0x00000040) | ||
21 | 22 | ||
22 | /* | 23 | /* |
23 | * This is individual features | 24 | * This is individual features |
diff --git a/arch/powerpc/include/asm/mmu_context.h b/arch/powerpc/include/asm/mmu_context.h index 26383e0778aa..81fb41289d6c 100644 --- a/arch/powerpc/include/asm/mmu_context.h +++ b/arch/powerpc/include/asm/mmu_context.h | |||
@@ -27,6 +27,8 @@ extern int __init_new_context(void); | |||
27 | extern void __destroy_context(int context_id); | 27 | extern void __destroy_context(int context_id); |
28 | static inline void mmu_context_init(void) { } | 28 | static inline void mmu_context_init(void) { } |
29 | #else | 29 | #else |
30 | extern unsigned long __init_new_context(void); | ||
31 | extern void __destroy_context(unsigned long context_id); | ||
30 | extern void mmu_context_init(void); | 32 | extern void mmu_context_init(void); |
31 | #endif | 33 | #endif |
32 | 34 | ||
diff --git a/arch/powerpc/include/asm/mmzone.h b/arch/powerpc/include/asm/mmzone.h index 35acac90c8ca..aac87cbceb57 100644 --- a/arch/powerpc/include/asm/mmzone.h +++ b/arch/powerpc/include/asm/mmzone.h | |||
@@ -30,7 +30,7 @@ extern struct pglist_data *node_data[]; | |||
30 | */ | 30 | */ |
31 | 31 | ||
32 | extern int numa_cpu_lookup_table[]; | 32 | extern int numa_cpu_lookup_table[]; |
33 | extern cpumask_t numa_cpumask_lookup_table[]; | 33 | extern cpumask_var_t node_to_cpumask_map[]; |
34 | #ifdef CONFIG_MEMORY_HOTPLUG | 34 | #ifdef CONFIG_MEMORY_HOTPLUG |
35 | extern unsigned long max_pfn; | 35 | extern unsigned long max_pfn; |
36 | #endif | 36 | #endif |
diff --git a/arch/powerpc/include/asm/mpic.h b/arch/powerpc/include/asm/mpic.h index 61913d9a21a0..e000cce8f6dd 100644 --- a/arch/powerpc/include/asm/mpic.h +++ b/arch/powerpc/include/asm/mpic.h | |||
@@ -463,9 +463,6 @@ extern void mpic_cpu_set_priority(int prio); | |||
463 | /* Request IPIs on primary mpic */ | 463 | /* Request IPIs on primary mpic */ |
464 | extern void mpic_request_ipis(void); | 464 | extern void mpic_request_ipis(void); |
465 | 465 | ||
466 | /* Send an IPI (non offseted number 0..3) */ | ||
467 | extern void mpic_send_ipi(unsigned int ipi_no, unsigned int cpu_mask); | ||
468 | |||
469 | /* Send a message (IPI) to a given target (cpu number or MSG_*) */ | 466 | /* Send a message (IPI) to a given target (cpu number or MSG_*) */ |
470 | void smp_mpic_message_pass(int target, int msg); | 467 | void smp_mpic_message_pass(int target, int msg); |
471 | 468 | ||
diff --git a/arch/powerpc/include/asm/of_device.h b/arch/powerpc/include/asm/of_device.h index a64debf177dc..444e97e2982e 100644 --- a/arch/powerpc/include/asm/of_device.h +++ b/arch/powerpc/include/asm/of_device.h | |||
@@ -12,9 +12,8 @@ | |||
12 | */ | 12 | */ |
13 | struct of_device | 13 | struct of_device |
14 | { | 14 | { |
15 | struct device_node *node; /* to be obsoleted */ | ||
16 | u64 dma_mask; /* DMA mask */ | ||
17 | struct device dev; /* Generic device interface */ | 15 | struct device dev; /* Generic device interface */ |
16 | struct pdev_archdata archdata; | ||
18 | }; | 17 | }; |
19 | 18 | ||
20 | extern struct of_device *of_device_alloc(struct device_node *np, | 19 | extern struct of_device *of_device_alloc(struct device_node *np, |
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h index a011603d4079..8ce7963ad41d 100644 --- a/arch/powerpc/include/asm/paca.h +++ b/arch/powerpc/include/asm/paca.h | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <asm/page.h> | 23 | #include <asm/page.h> |
24 | #include <asm/exception-64e.h> | 24 | #include <asm/exception-64e.h> |
25 | #ifdef CONFIG_KVM_BOOK3S_64_HANDLER | 25 | #ifdef CONFIG_KVM_BOOK3S_64_HANDLER |
26 | #include <asm/kvm_book3s_64_asm.h> | 26 | #include <asm/kvm_book3s_asm.h> |
27 | #endif | 27 | #endif |
28 | 28 | ||
29 | register struct paca_struct *local_paca asm("r13"); | 29 | register struct paca_struct *local_paca asm("r13"); |
@@ -82,6 +82,7 @@ struct paca_struct { | |||
82 | s16 hw_cpu_id; /* Physical processor number */ | 82 | s16 hw_cpu_id; /* Physical processor number */ |
83 | u8 cpu_start; /* At startup, processor spins until */ | 83 | u8 cpu_start; /* At startup, processor spins until */ |
84 | /* this becomes non-zero. */ | 84 | /* this becomes non-zero. */ |
85 | u8 kexec_state; /* set when kexec down has irqs off */ | ||
85 | #ifdef CONFIG_PPC_STD_MMU_64 | 86 | #ifdef CONFIG_PPC_STD_MMU_64 |
86 | struct slb_shadow *slb_shadow_ptr; | 87 | struct slb_shadow *slb_shadow_ptr; |
87 | 88 | ||
@@ -136,15 +137,9 @@ struct paca_struct { | |||
136 | u64 startpurr; /* PURR/TB value snapshot */ | 137 | u64 startpurr; /* PURR/TB value snapshot */ |
137 | u64 startspurr; /* SPURR value snapshot */ | 138 | u64 startspurr; /* SPURR value snapshot */ |
138 | 139 | ||
139 | #ifdef CONFIG_KVM_BOOK3S_64_HANDLER | 140 | #ifdef CONFIG_KVM_BOOK3S_HANDLER |
140 | struct { | ||
141 | u64 esid; | ||
142 | u64 vsid; | ||
143 | } kvm_slb[64]; /* guest SLB */ | ||
144 | /* We use this to store guest state in */ | 141 | /* We use this to store guest state in */ |
145 | struct kvmppc_book3s_shadow_vcpu shadow_vcpu; | 142 | struct kvmppc_book3s_shadow_vcpu shadow_vcpu; |
146 | u8 kvm_slb_max; /* highest used guest slb entry */ | ||
147 | u8 kvm_in_guest; /* are we inside the guest? */ | ||
148 | #endif | 143 | #endif |
149 | }; | 144 | }; |
150 | 145 | ||
diff --git a/arch/powerpc/include/asm/parport.h b/arch/powerpc/include/asm/parport.h index 94942d60ddfd..1ca1102b4a2f 100644 --- a/arch/powerpc/include/asm/parport.h +++ b/arch/powerpc/include/asm/parport.h | |||
@@ -19,6 +19,8 @@ static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) | |||
19 | u32 io1, io2; | 19 | u32 io1, io2; |
20 | int propsize; | 20 | int propsize; |
21 | int count = 0; | 21 | int count = 0; |
22 | int virq; | ||
23 | |||
22 | for (np = NULL; (np = of_find_compatible_node(np, | 24 | for (np = NULL; (np = of_find_compatible_node(np, |
23 | "parallel", | 25 | "parallel", |
24 | "pnpPNP,400")) != NULL;) { | 26 | "pnpPNP,400")) != NULL;) { |
@@ -26,10 +28,13 @@ static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) | |||
26 | if (!prop || propsize > 6*sizeof(u32)) | 28 | if (!prop || propsize > 6*sizeof(u32)) |
27 | continue; | 29 | continue; |
28 | io1 = prop[1]; io2 = prop[2]; | 30 | io1 = prop[1]; io2 = prop[2]; |
29 | prop = of_get_property(np, "interrupts", NULL); | 31 | |
30 | if (!prop) | 32 | virq = irq_of_parse_and_map(np, 0); |
33 | if (virq == NO_IRQ) | ||
31 | continue; | 34 | continue; |
32 | if (parport_pc_probe_port(io1, io2, prop[0], autodma, NULL, 0) != NULL) | 35 | |
36 | if (parport_pc_probe_port(io1, io2, virq, autodma, NULL, 0) | ||
37 | != NULL) | ||
33 | count++; | 38 | count++; |
34 | } | 39 | } |
35 | return count; | 40 | return count; |
diff --git a/arch/powerpc/include/asm/pgalloc-64.h b/arch/powerpc/include/asm/pgalloc-64.h index 605f5c5398d1..292725cec2e3 100644 --- a/arch/powerpc/include/asm/pgalloc-64.h +++ b/arch/powerpc/include/asm/pgalloc-64.h | |||
@@ -11,6 +11,12 @@ | |||
11 | #include <linux/cpumask.h> | 11 | #include <linux/cpumask.h> |
12 | #include <linux/percpu.h> | 12 | #include <linux/percpu.h> |
13 | 13 | ||
14 | struct vmemmap_backing { | ||
15 | struct vmemmap_backing *list; | ||
16 | unsigned long phys; | ||
17 | unsigned long virt_addr; | ||
18 | }; | ||
19 | |||
14 | /* | 20 | /* |
15 | * Functions that deal with pagetables that could be at any level of | 21 | * Functions that deal with pagetables that could be at any level of |
16 | * the table need to be passed an "index_size" so they know how to | 22 | * the table need to be passed an "index_size" so they know how to |
diff --git a/arch/powerpc/include/asm/pgtable-ppc32.h b/arch/powerpc/include/asm/pgtable-ppc32.h index 55646adfa843..a7db96f2b5c3 100644 --- a/arch/powerpc/include/asm/pgtable-ppc32.h +++ b/arch/powerpc/include/asm/pgtable-ppc32.h | |||
@@ -287,7 +287,7 @@ static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry) | |||
287 | #define pmd_page_vaddr(pmd) \ | 287 | #define pmd_page_vaddr(pmd) \ |
288 | ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) | 288 | ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) |
289 | #define pmd_page(pmd) \ | 289 | #define pmd_page(pmd) \ |
290 | (mem_map + (pmd_val(pmd) >> PAGE_SHIFT)) | 290 | pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT) |
291 | #else | 291 | #else |
292 | #define pmd_page_vaddr(pmd) \ | 292 | #define pmd_page_vaddr(pmd) \ |
293 | ((unsigned long) (pmd_val(pmd) & PAGE_MASK)) | 293 | ((unsigned long) (pmd_val(pmd) & PAGE_MASK)) |
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h index 221ba6240464..7492fe8ad6e4 100644 --- a/arch/powerpc/include/asm/processor.h +++ b/arch/powerpc/include/asm/processor.h | |||
@@ -229,6 +229,9 @@ struct thread_struct { | |||
229 | unsigned long spefscr; /* SPE & eFP status */ | 229 | unsigned long spefscr; /* SPE & eFP status */ |
230 | int used_spe; /* set if process has used spe */ | 230 | int used_spe; /* set if process has used spe */ |
231 | #endif /* CONFIG_SPE */ | 231 | #endif /* CONFIG_SPE */ |
232 | #ifdef CONFIG_KVM_BOOK3S_32_HANDLER | ||
233 | void* kvm_shadow_vcpu; /* KVM internal data */ | ||
234 | #endif /* CONFIG_KVM_BOOK3S_32_HANDLER */ | ||
232 | }; | 235 | }; |
233 | 236 | ||
234 | #define ARCH_MIN_TASKALIGN 16 | 237 | #define ARCH_MIN_TASKALIGN 16 |
diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h index 9e2d84c06b74..5d8be0416227 100644 --- a/arch/powerpc/include/asm/ptrace.h +++ b/arch/powerpc/include/asm/ptrace.h | |||
@@ -89,6 +89,7 @@ struct pt_regs { | |||
89 | 89 | ||
90 | #define instruction_pointer(regs) ((regs)->nip) | 90 | #define instruction_pointer(regs) ((regs)->nip) |
91 | #define user_stack_pointer(regs) ((regs)->gpr[1]) | 91 | #define user_stack_pointer(regs) ((regs)->gpr[1]) |
92 | #define kernel_stack_pointer(regs) ((regs)->gpr[1]) | ||
92 | #define regs_return_value(regs) ((regs)->gpr[3]) | 93 | #define regs_return_value(regs) ((regs)->gpr[3]) |
93 | 94 | ||
94 | #ifdef CONFIG_SMP | 95 | #ifdef CONFIG_SMP |
@@ -141,6 +142,69 @@ do { \ | |||
141 | #define arch_has_block_step() (!cpu_has_feature(CPU_FTR_601)) | 142 | #define arch_has_block_step() (!cpu_has_feature(CPU_FTR_601)) |
142 | #define ARCH_HAS_USER_SINGLE_STEP_INFO | 143 | #define ARCH_HAS_USER_SINGLE_STEP_INFO |
143 | 144 | ||
145 | /* | ||
146 | * kprobe-based event tracer support | ||
147 | */ | ||
148 | |||
149 | #include <linux/stddef.h> | ||
150 | #include <linux/thread_info.h> | ||
151 | extern int regs_query_register_offset(const char *name); | ||
152 | extern const char *regs_query_register_name(unsigned int offset); | ||
153 | #define MAX_REG_OFFSET (offsetof(struct pt_regs, dsisr)) | ||
154 | |||
155 | /** | ||
156 | * regs_get_register() - get register value from its offset | ||
157 | * @regs: pt_regs from which register value is gotten | ||
158 | * @offset: offset number of the register. | ||
159 | * | ||
160 | * regs_get_register returns the value of a register whose offset from @regs. | ||
161 | * The @offset is the offset of the register in struct pt_regs. | ||
162 | * If @offset is bigger than MAX_REG_OFFSET, this returns 0. | ||
163 | */ | ||
164 | static inline unsigned long regs_get_register(struct pt_regs *regs, | ||
165 | unsigned int offset) | ||
166 | { | ||
167 | if (unlikely(offset > MAX_REG_OFFSET)) | ||
168 | return 0; | ||
169 | return *(unsigned long *)((unsigned long)regs + offset); | ||
170 | } | ||
171 | |||
172 | /** | ||
173 | * regs_within_kernel_stack() - check the address in the stack | ||
174 | * @regs: pt_regs which contains kernel stack pointer. | ||
175 | * @addr: address which is checked. | ||
176 | * | ||
177 | * regs_within_kernel_stack() checks @addr is within the kernel stack page(s). | ||
178 | * If @addr is within the kernel stack, it returns true. If not, returns false. | ||
179 | */ | ||
180 | |||
181 | static inline bool regs_within_kernel_stack(struct pt_regs *regs, | ||
182 | unsigned long addr) | ||
183 | { | ||
184 | return ((addr & ~(THREAD_SIZE - 1)) == | ||
185 | (kernel_stack_pointer(regs) & ~(THREAD_SIZE - 1))); | ||
186 | } | ||
187 | |||
188 | /** | ||
189 | * regs_get_kernel_stack_nth() - get Nth entry of the stack | ||
190 | * @regs: pt_regs which contains kernel stack pointer. | ||
191 | * @n: stack entry number. | ||
192 | * | ||
193 | * regs_get_kernel_stack_nth() returns @n th entry of the kernel stack which | ||
194 | * is specified by @regs. If the @n th entry is NOT in the kernel stack, | ||
195 | * this returns 0. | ||
196 | */ | ||
197 | static inline unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, | ||
198 | unsigned int n) | ||
199 | { | ||
200 | unsigned long *addr = (unsigned long *)kernel_stack_pointer(regs); | ||
201 | addr += n; | ||
202 | if (regs_within_kernel_stack(regs, (unsigned long)addr)) | ||
203 | return *addr; | ||
204 | else | ||
205 | return 0; | ||
206 | } | ||
207 | |||
144 | #endif /* __ASSEMBLY__ */ | 208 | #endif /* __ASSEMBLY__ */ |
145 | 209 | ||
146 | #endif /* __KERNEL__ */ | 210 | #endif /* __KERNEL__ */ |
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index 5572e86223f4..d62fdf4e504b 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h | |||
@@ -293,10 +293,12 @@ | |||
293 | #define HID1_ABE (1<<10) /* 7450 Address Broadcast Enable */ | 293 | #define HID1_ABE (1<<10) /* 7450 Address Broadcast Enable */ |
294 | #define HID1_PS (1<<16) /* 750FX PLL selection */ | 294 | #define HID1_PS (1<<16) /* 750FX PLL selection */ |
295 | #define SPRN_HID2 0x3F8 /* Hardware Implementation Register 2 */ | 295 | #define SPRN_HID2 0x3F8 /* Hardware Implementation Register 2 */ |
296 | #define SPRN_HID2_GEKKO 0x398 /* Gekko HID2 Register */ | ||
296 | #define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */ | 297 | #define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */ |
297 | #define SPRN_IABR2 0x3FA /* 83xx */ | 298 | #define SPRN_IABR2 0x3FA /* 83xx */ |
298 | #define SPRN_IBCR 0x135 /* 83xx Insn Breakpoint Control Reg */ | 299 | #define SPRN_IBCR 0x135 /* 83xx Insn Breakpoint Control Reg */ |
299 | #define SPRN_HID4 0x3F4 /* 970 HID4 */ | 300 | #define SPRN_HID4 0x3F4 /* 970 HID4 */ |
301 | #define SPRN_HID4_GEKKO 0x3F3 /* Gekko HID4 */ | ||
300 | #define SPRN_HID5 0x3F6 /* 970 HID5 */ | 302 | #define SPRN_HID5 0x3F6 /* 970 HID5 */ |
301 | #define SPRN_HID6 0x3F9 /* BE HID 6 */ | 303 | #define SPRN_HID6 0x3F9 /* BE HID 6 */ |
302 | #define HID6_LB (0x0F<<12) /* Concurrent Large Page Modes */ | 304 | #define HID6_LB (0x0F<<12) /* Concurrent Large Page Modes */ |
@@ -465,6 +467,14 @@ | |||
465 | #define SPRN_VRSAVE 0x100 /* Vector Register Save Register */ | 467 | #define SPRN_VRSAVE 0x100 /* Vector Register Save Register */ |
466 | #define SPRN_XER 0x001 /* Fixed Point Exception Register */ | 468 | #define SPRN_XER 0x001 /* Fixed Point Exception Register */ |
467 | 469 | ||
470 | #define SPRN_MMCR0_GEKKO 0x3B8 /* Gekko Monitor Mode Control Register 0 */ | ||
471 | #define SPRN_MMCR1_GEKKO 0x3BC /* Gekko Monitor Mode Control Register 1 */ | ||
472 | #define SPRN_PMC1_GEKKO 0x3B9 /* Gekko Performance Monitor Control 1 */ | ||
473 | #define SPRN_PMC2_GEKKO 0x3BA /* Gekko Performance Monitor Control 2 */ | ||
474 | #define SPRN_PMC3_GEKKO 0x3BD /* Gekko Performance Monitor Control 3 */ | ||
475 | #define SPRN_PMC4_GEKKO 0x3BE /* Gekko Performance Monitor Control 4 */ | ||
476 | #define SPRN_WPAR_GEKKO 0x399 /* Gekko Write Pipe Address Register */ | ||
477 | |||
468 | #define SPRN_SCOMC 0x114 /* SCOM Access Control */ | 478 | #define SPRN_SCOMC 0x114 /* SCOM Access Control */ |
469 | #define SPRN_SCOMD 0x115 /* SCOM Access DATA */ | 479 | #define SPRN_SCOMD 0x115 /* SCOM Access DATA */ |
470 | 480 | ||
@@ -817,6 +827,7 @@ | |||
817 | #define PVR_403GC 0x00200200 | 827 | #define PVR_403GC 0x00200200 |
818 | #define PVR_403GCX 0x00201400 | 828 | #define PVR_403GCX 0x00201400 |
819 | #define PVR_405GP 0x40110000 | 829 | #define PVR_405GP 0x40110000 |
830 | #define PVR_476 0x11a52000 | ||
820 | #define PVR_STB03XXX 0x40310000 | 831 | #define PVR_STB03XXX 0x40310000 |
821 | #define PVR_NP405H 0x41410000 | 832 | #define PVR_NP405H 0x41410000 |
822 | #define PVR_NP405L 0x41610000 | 833 | #define PVR_NP405L 0x41610000 |
@@ -853,6 +864,9 @@ | |||
853 | #define PVR_8245 0x80811014 | 864 | #define PVR_8245 0x80811014 |
854 | #define PVR_8260 PVR_8240 | 865 | #define PVR_8260 PVR_8240 |
855 | 866 | ||
867 | /* 476 Simulator seems to currently have the PVR of the 602... */ | ||
868 | #define PVR_476_ISS 0x00052000 | ||
869 | |||
856 | /* 64-bit processors */ | 870 | /* 64-bit processors */ |
857 | /* XXX the prefix should be PVR_, we'll do a global sweep to fix it one day */ | 871 | /* XXX the prefix should be PVR_, we'll do a global sweep to fix it one day */ |
858 | #define PV_NORTHSTAR 0x0033 | 872 | #define PV_NORTHSTAR 0x0033 |
diff --git a/arch/powerpc/include/asm/reg_booke.h b/arch/powerpc/include/asm/reg_booke.h index 414d434a66d0..5304a37ba425 100644 --- a/arch/powerpc/include/asm/reg_booke.h +++ b/arch/powerpc/include/asm/reg_booke.h | |||
@@ -191,6 +191,10 @@ | |||
191 | #define MCSR_DCFP 0x01000000 /* D-Cache Flush Parity Error */ | 191 | #define MCSR_DCFP 0x01000000 /* D-Cache Flush Parity Error */ |
192 | #define MCSR_IMPE 0x00800000 /* Imprecise Machine Check Exception */ | 192 | #define MCSR_IMPE 0x00800000 /* Imprecise Machine Check Exception */ |
193 | 193 | ||
194 | #define PPC47x_MCSR_GPR 0x01000000 /* GPR parity error */ | ||
195 | #define PPC47x_MCSR_FPR 0x00800000 /* FPR parity error */ | ||
196 | #define PPC47x_MCSR_IPR 0x00400000 /* Imprecise Machine Check Exception */ | ||
197 | |||
194 | #ifdef CONFIG_E500 | 198 | #ifdef CONFIG_E500 |
195 | #define MCSR_MCP 0x80000000UL /* Machine Check Input Pin */ | 199 | #define MCSR_MCP 0x80000000UL /* Machine Check Input Pin */ |
196 | #define MCSR_ICPERR 0x40000000UL /* I-Cache Parity Error */ | 200 | #define MCSR_ICPERR 0x40000000UL /* I-Cache Parity Error */ |
@@ -604,5 +608,25 @@ | |||
604 | #define DBCR_JOI 0x00000002 /* JTAG Serial Outbound Int. Enable */ | 608 | #define DBCR_JOI 0x00000002 /* JTAG Serial Outbound Int. Enable */ |
605 | #define DBCR_JII 0x00000001 /* JTAG Serial Inbound Int. Enable */ | 609 | #define DBCR_JII 0x00000001 /* JTAG Serial Inbound Int. Enable */ |
606 | #endif /* 403GCX */ | 610 | #endif /* 403GCX */ |
611 | |||
612 | /* Some 476 specific registers */ | ||
613 | #define SPRN_SSPCR 830 | ||
614 | #define SPRN_USPCR 831 | ||
615 | #define SPRN_ISPCR 829 | ||
616 | #define SPRN_MMUBE0 820 | ||
617 | #define MMUBE0_IBE0_SHIFT 24 | ||
618 | #define MMUBE0_IBE1_SHIFT 16 | ||
619 | #define MMUBE0_IBE2_SHIFT 8 | ||
620 | #define MMUBE0_VBE0 0x00000004 | ||
621 | #define MMUBE0_VBE1 0x00000002 | ||
622 | #define MMUBE0_VBE2 0x00000001 | ||
623 | #define SPRN_MMUBE1 821 | ||
624 | #define MMUBE1_IBE3_SHIFT 24 | ||
625 | #define MMUBE1_IBE4_SHIFT 16 | ||
626 | #define MMUBE1_IBE5_SHIFT 8 | ||
627 | #define MMUBE1_VBE3 0x00000004 | ||
628 | #define MMUBE1_VBE4 0x00000002 | ||
629 | #define MMUBE1_VBE5 0x00000001 | ||
630 | |||
607 | #endif /* __ASM_POWERPC_REG_BOOKE_H__ */ | 631 | #endif /* __ASM_POWERPC_REG_BOOKE_H__ */ |
608 | #endif /* __KERNEL__ */ | 632 | #endif /* __KERNEL__ */ |
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h index 1d3b270d3083..66e237bbe15f 100644 --- a/arch/powerpc/include/asm/smp.h +++ b/arch/powerpc/include/asm/smp.h | |||
@@ -40,7 +40,7 @@ extern void smp_message_recv(int); | |||
40 | DECLARE_PER_CPU(unsigned int, cpu_pvr); | 40 | DECLARE_PER_CPU(unsigned int, cpu_pvr); |
41 | 41 | ||
42 | #ifdef CONFIG_HOTPLUG_CPU | 42 | #ifdef CONFIG_HOTPLUG_CPU |
43 | extern void fixup_irqs(cpumask_t map); | 43 | extern void fixup_irqs(const struct cpumask *map); |
44 | int generic_cpu_disable(void); | 44 | int generic_cpu_disable(void); |
45 | int generic_cpu_enable(unsigned int cpu); | 45 | int generic_cpu_enable(unsigned int cpu); |
46 | void generic_cpu_die(unsigned int cpu); | 46 | void generic_cpu_die(unsigned int cpu); |
@@ -68,8 +68,19 @@ static inline void set_hard_smp_processor_id(int cpu, int phys) | |||
68 | } | 68 | } |
69 | #endif | 69 | #endif |
70 | 70 | ||
71 | DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); | 71 | DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_map); |
72 | DECLARE_PER_CPU(cpumask_t, cpu_core_map); | 72 | DECLARE_PER_CPU(cpumask_var_t, cpu_core_map); |
73 | |||
74 | static inline struct cpumask *cpu_sibling_mask(int cpu) | ||
75 | { | ||
76 | return per_cpu(cpu_sibling_map, cpu); | ||
77 | } | ||
78 | |||
79 | static inline struct cpumask *cpu_core_mask(int cpu) | ||
80 | { | ||
81 | return per_cpu(cpu_core_map, cpu); | ||
82 | } | ||
83 | |||
73 | extern int cpu_to_core_id(int cpu); | 84 | extern int cpu_to_core_id(int cpu); |
74 | 85 | ||
75 | /* Since OpenPIC has only 4 IPIs, we use slightly different message numbers. | 86 | /* Since OpenPIC has only 4 IPIs, we use slightly different message numbers. |
@@ -93,7 +104,6 @@ void smp_init_pSeries(void); | |||
93 | void smp_init_cell(void); | 104 | void smp_init_cell(void); |
94 | void smp_init_celleb(void); | 105 | void smp_init_celleb(void); |
95 | void smp_setup_cpu_maps(void); | 106 | void smp_setup_cpu_maps(void); |
96 | void smp_setup_cpu_sibling_map(void); | ||
97 | 107 | ||
98 | extern int __cpu_disable(void); | 108 | extern int __cpu_disable(void); |
99 | extern void __cpu_die(unsigned int cpu); | 109 | extern void __cpu_die(unsigned int cpu); |
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h index aa9d383a1c09..65eb85976a03 100644 --- a/arch/powerpc/include/asm/thread_info.h +++ b/arch/powerpc/include/asm/thread_info.h | |||
@@ -104,7 +104,7 @@ static inline struct thread_info *current_thread_info(void) | |||
104 | #define TIF_PERFMON_CTXSW 6 /* perfmon needs ctxsw calls */ | 104 | #define TIF_PERFMON_CTXSW 6 /* perfmon needs ctxsw calls */ |
105 | #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ | 105 | #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ |
106 | #define TIF_SINGLESTEP 8 /* singlestepping active */ | 106 | #define TIF_SINGLESTEP 8 /* singlestepping active */ |
107 | #define TIF_MEMDIE 9 | 107 | #define TIF_MEMDIE 9 /* is terminating due to OOM killer */ |
108 | #define TIF_SECCOMP 10 /* secure computing */ | 108 | #define TIF_SECCOMP 10 /* secure computing */ |
109 | #define TIF_RESTOREALL 11 /* Restore all regs (implies NOERROR) */ | 109 | #define TIF_RESTOREALL 11 /* Restore all regs (implies NOERROR) */ |
110 | #define TIF_NOERROR 12 /* Force successful syscall return */ | 110 | #define TIF_NOERROR 12 /* Force successful syscall return */ |
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h index 8eaec310a25b..32adf7280720 100644 --- a/arch/powerpc/include/asm/topology.h +++ b/arch/powerpc/include/asm/topology.h | |||
@@ -8,6 +8,26 @@ struct device_node; | |||
8 | 8 | ||
9 | #ifdef CONFIG_NUMA | 9 | #ifdef CONFIG_NUMA |
10 | 10 | ||
11 | /* | ||
12 | * Before going off node we want the VM to try and reclaim from the local | ||
13 | * node. It does this if the remote distance is larger than RECLAIM_DISTANCE. | ||
14 | * With the default REMOTE_DISTANCE of 20 and the default RECLAIM_DISTANCE of | ||
15 | * 20, we never reclaim and go off node straight away. | ||
16 | * | ||
17 | * To fix this we choose a smaller value of RECLAIM_DISTANCE. | ||
18 | */ | ||
19 | #define RECLAIM_DISTANCE 10 | ||
20 | |||
21 | /* | ||
22 | * Before going off node we want the VM to try and reclaim from the local | ||
23 | * node. It does this if the remote distance is larger than RECLAIM_DISTANCE. | ||
24 | * With the default REMOTE_DISTANCE of 20 and the default RECLAIM_DISTANCE of | ||
25 | * 20, we never reclaim and go off node straight away. | ||
26 | * | ||
27 | * To fix this we choose a smaller value of RECLAIM_DISTANCE. | ||
28 | */ | ||
29 | #define RECLAIM_DISTANCE 10 | ||
30 | |||
11 | #include <asm/mmzone.h> | 31 | #include <asm/mmzone.h> |
12 | 32 | ||
13 | static inline int cpu_to_node(int cpu) | 33 | static inline int cpu_to_node(int cpu) |
@@ -19,7 +39,7 @@ static inline int cpu_to_node(int cpu) | |||
19 | 39 | ||
20 | #define cpumask_of_node(node) ((node) == -1 ? \ | 40 | #define cpumask_of_node(node) ((node) == -1 ? \ |
21 | cpu_all_mask : \ | 41 | cpu_all_mask : \ |
22 | &numa_cpumask_lookup_table[node]) | 42 | node_to_cpumask_map[node]) |
23 | 43 | ||
24 | int of_node_to_nid(struct device_node *device); | 44 | int of_node_to_nid(struct device_node *device); |
25 | 45 | ||
@@ -102,8 +122,8 @@ static inline void sysfs_remove_device_from_node(struct sys_device *dev, | |||
102 | #ifdef CONFIG_PPC64 | 122 | #ifdef CONFIG_PPC64 |
103 | #include <asm/smp.h> | 123 | #include <asm/smp.h> |
104 | 124 | ||
105 | #define topology_thread_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu)) | 125 | #define topology_thread_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu)) |
106 | #define topology_core_cpumask(cpu) (&per_cpu(cpu_core_map, cpu)) | 126 | #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu)) |
107 | #define topology_core_id(cpu) (cpu_to_core_id(cpu)) | 127 | #define topology_core_id(cpu) (cpu_to_core_id(cpu)) |
108 | #endif | 128 | #endif |
109 | #endif | 129 | #endif |