diff options
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/configs/sparc32_defconfig | 4 | ||||
-rw-r--r-- | arch/sparc/configs/sparc64_defconfig | 4 | ||||
-rw-r--r-- | arch/sparc/crypto/aes_glue.c | 3 | ||||
-rw-r--r-- | arch/sparc/include/asm/atomic_32.h | 2 | ||||
-rw-r--r-- | arch/sparc/include/asm/futex_64.h | 26 | ||||
-rw-r--r-- | arch/sparc/include/asm/mmu_context_64.h | 14 | ||||
-rw-r--r-- | arch/sparc/include/asm/page_32.h | 2 | ||||
-rw-r--r-- | arch/sparc/include/asm/spinlock_32.h | 5 | ||||
-rw-r--r-- | arch/sparc/include/asm/spitfire.h | 16 | ||||
-rw-r--r-- | arch/sparc/include/uapi/asm/socket.h | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/cpu.c | 6 | ||||
-rw-r--r-- | arch/sparc/kernel/cpumap.c | 1 | ||||
-rw-r--r-- | arch/sparc/kernel/head_64.S | 22 | ||||
-rw-r--r-- | arch/sparc/kernel/pci_sun4v.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/pcic.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/setup_64.c | 15 | ||||
-rw-r--r-- | arch/sparc/kernel/tsb.S | 12 | ||||
-rw-r--r-- | arch/sparc/lib/U3memcpy.S | 4 | ||||
-rw-r--r-- | arch/sparc/lib/multi3.S | 24 | ||||
-rw-r--r-- | arch/sparc/mm/init_64.c | 39 | ||||
-rw-r--r-- | arch/sparc/net/bpf_jit_comp_64.c | 34 | ||||
-rw-r--r-- | arch/sparc/power/hibernate.c | 3 |
22 files changed, 170 insertions, 72 deletions
diff --git a/arch/sparc/configs/sparc32_defconfig b/arch/sparc/configs/sparc32_defconfig index c74d3701ad68..207a43a2d8b3 100644 --- a/arch/sparc/configs/sparc32_defconfig +++ b/arch/sparc/configs/sparc32_defconfig | |||
@@ -1,4 +1,3 @@ | |||
1 | CONFIG_EXPERIMENTAL=y | ||
2 | CONFIG_SYSVIPC=y | 1 | CONFIG_SYSVIPC=y |
3 | CONFIG_POSIX_MQUEUE=y | 2 | CONFIG_POSIX_MQUEUE=y |
4 | CONFIG_LOG_BUF_SHIFT=14 | 3 | CONFIG_LOG_BUF_SHIFT=14 |
@@ -23,7 +22,6 @@ CONFIG_IP_PNP_DHCP=y | |||
23 | CONFIG_INET_AH=y | 22 | CONFIG_INET_AH=y |
24 | CONFIG_INET_ESP=y | 23 | CONFIG_INET_ESP=y |
25 | CONFIG_INET_IPCOMP=y | 24 | CONFIG_INET_IPCOMP=y |
26 | # CONFIG_INET_LRO is not set | ||
27 | CONFIG_INET6_AH=m | 25 | CONFIG_INET6_AH=m |
28 | CONFIG_INET6_ESP=m | 26 | CONFIG_INET6_ESP=m |
29 | CONFIG_INET6_IPCOMP=m | 27 | CONFIG_INET6_IPCOMP=m |
@@ -69,7 +67,6 @@ CONFIG_EXT2_FS=y | |||
69 | CONFIG_EXT2_FS_XATTR=y | 67 | CONFIG_EXT2_FS_XATTR=y |
70 | CONFIG_EXT2_FS_POSIX_ACL=y | 68 | CONFIG_EXT2_FS_POSIX_ACL=y |
71 | CONFIG_EXT2_FS_SECURITY=y | 69 | CONFIG_EXT2_FS_SECURITY=y |
72 | CONFIG_AUTOFS_FS=m | ||
73 | CONFIG_AUTOFS4_FS=m | 70 | CONFIG_AUTOFS4_FS=m |
74 | CONFIG_ISO9660_FS=m | 71 | CONFIG_ISO9660_FS=m |
75 | CONFIG_PROC_KCORE=y | 72 | CONFIG_PROC_KCORE=y |
@@ -82,7 +79,6 @@ CONFIG_NLS=y | |||
82 | CONFIG_DEBUG_KERNEL=y | 79 | CONFIG_DEBUG_KERNEL=y |
83 | CONFIG_DETECT_HUNG_TASK=y | 80 | CONFIG_DETECT_HUNG_TASK=y |
84 | # CONFIG_SCHED_DEBUG is not set | 81 | # CONFIG_SCHED_DEBUG is not set |
85 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
86 | CONFIG_KGDB=y | 82 | CONFIG_KGDB=y |
87 | CONFIG_KGDB_TESTS=y | 83 | CONFIG_KGDB_TESTS=y |
88 | CONFIG_CRYPTO_NULL=m | 84 | CONFIG_CRYPTO_NULL=m |
diff --git a/arch/sparc/configs/sparc64_defconfig b/arch/sparc/configs/sparc64_defconfig index b2e650d1764f..ca8609d7292f 100644 --- a/arch/sparc/configs/sparc64_defconfig +++ b/arch/sparc/configs/sparc64_defconfig | |||
@@ -1,5 +1,4 @@ | |||
1 | CONFIG_64BIT=y | 1 | CONFIG_64BIT=y |
2 | CONFIG_EXPERIMENTAL=y | ||
3 | # CONFIG_LOCALVERSION_AUTO is not set | 2 | # CONFIG_LOCALVERSION_AUTO is not set |
4 | CONFIG_SYSVIPC=y | 3 | CONFIG_SYSVIPC=y |
5 | CONFIG_POSIX_MQUEUE=y | 4 | CONFIG_POSIX_MQUEUE=y |
@@ -184,7 +183,6 @@ CONFIG_HID_TOPSEED=y | |||
184 | CONFIG_HID_THRUSTMASTER=y | 183 | CONFIG_HID_THRUSTMASTER=y |
185 | CONFIG_HID_ZEROPLUS=y | 184 | CONFIG_HID_ZEROPLUS=y |
186 | CONFIG_USB=y | 185 | CONFIG_USB=y |
187 | # CONFIG_USB_DEVICE_CLASS is not set | ||
188 | CONFIG_USB_EHCI_HCD=m | 186 | CONFIG_USB_EHCI_HCD=m |
189 | # CONFIG_USB_EHCI_TT_NEWSCHED is not set | 187 | # CONFIG_USB_EHCI_TT_NEWSCHED is not set |
190 | CONFIG_USB_OHCI_HCD=y | 188 | CONFIG_USB_OHCI_HCD=y |
@@ -210,8 +208,6 @@ CONFIG_LOCKUP_DETECTOR=y | |||
210 | CONFIG_DETECT_HUNG_TASK=y | 208 | CONFIG_DETECT_HUNG_TASK=y |
211 | # CONFIG_SCHED_DEBUG is not set | 209 | # CONFIG_SCHED_DEBUG is not set |
212 | CONFIG_SCHEDSTATS=y | 210 | CONFIG_SCHEDSTATS=y |
213 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
214 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
215 | CONFIG_BLK_DEV_IO_TRACE=y | 211 | CONFIG_BLK_DEV_IO_TRACE=y |
216 | CONFIG_UPROBE_EVENTS=y | 212 | CONFIG_UPROBE_EVENTS=y |
217 | CONFIG_KEYS=y | 213 | CONFIG_KEYS=y |
diff --git a/arch/sparc/crypto/aes_glue.c b/arch/sparc/crypto/aes_glue.c index c90930de76ba..3cd4f6b198b6 100644 --- a/arch/sparc/crypto/aes_glue.c +++ b/arch/sparc/crypto/aes_glue.c | |||
@@ -344,8 +344,7 @@ static void ctr_crypt_final(struct crypto_sparc64_aes_ctx *ctx, | |||
344 | 344 | ||
345 | ctx->ops->ecb_encrypt(&ctx->key[0], (const u64 *)ctrblk, | 345 | ctx->ops->ecb_encrypt(&ctx->key[0], (const u64 *)ctrblk, |
346 | keystream, AES_BLOCK_SIZE); | 346 | keystream, AES_BLOCK_SIZE); |
347 | crypto_xor((u8 *) keystream, src, nbytes); | 347 | crypto_xor_cpy(dst, (u8 *) keystream, src, nbytes); |
348 | memcpy(dst, keystream, nbytes); | ||
349 | crypto_inc(ctrblk, AES_BLOCK_SIZE); | 348 | crypto_inc(ctrblk, AES_BLOCK_SIZE); |
350 | } | 349 | } |
351 | 350 | ||
diff --git a/arch/sparc/include/asm/atomic_32.h b/arch/sparc/include/asm/atomic_32.h index ee3f11c43cda..7643e979e333 100644 --- a/arch/sparc/include/asm/atomic_32.h +++ b/arch/sparc/include/asm/atomic_32.h | |||
@@ -29,6 +29,8 @@ int atomic_xchg(atomic_t *, int); | |||
29 | int __atomic_add_unless(atomic_t *, int, int); | 29 | int __atomic_add_unless(atomic_t *, int, int); |
30 | void atomic_set(atomic_t *, int); | 30 | void atomic_set(atomic_t *, int); |
31 | 31 | ||
32 | #define atomic_set_release(v, i) atomic_set((v), (i)) | ||
33 | |||
32 | #define atomic_read(v) ACCESS_ONCE((v)->counter) | 34 | #define atomic_read(v) ACCESS_ONCE((v)->counter) |
33 | 35 | ||
34 | #define atomic_add(i, v) ((void)atomic_add_return( (int)(i), (v))) | 36 | #define atomic_add(i, v) ((void)atomic_add_return( (int)(i), (v))) |
diff --git a/arch/sparc/include/asm/futex_64.h b/arch/sparc/include/asm/futex_64.h index 4e899b0dabf7..1cfd89d92208 100644 --- a/arch/sparc/include/asm/futex_64.h +++ b/arch/sparc/include/asm/futex_64.h | |||
@@ -29,22 +29,14 @@ | |||
29 | : "r" (uaddr), "r" (oparg), "i" (-EFAULT) \ | 29 | : "r" (uaddr), "r" (oparg), "i" (-EFAULT) \ |
30 | : "memory") | 30 | : "memory") |
31 | 31 | ||
32 | static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr) | 32 | static inline int arch_futex_atomic_op_inuser(int op, int oparg, int *oval, |
33 | u32 __user *uaddr) | ||
33 | { | 34 | { |
34 | int op = (encoded_op >> 28) & 7; | ||
35 | int cmp = (encoded_op >> 24) & 15; | ||
36 | int oparg = (encoded_op << 8) >> 20; | ||
37 | int cmparg = (encoded_op << 20) >> 20; | ||
38 | int oldval = 0, ret, tem; | 35 | int oldval = 0, ret, tem; |
39 | 36 | ||
40 | if (unlikely(!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))) | ||
41 | return -EFAULT; | ||
42 | if (unlikely((((unsigned long) uaddr) & 0x3UL))) | 37 | if (unlikely((((unsigned long) uaddr) & 0x3UL))) |
43 | return -EINVAL; | 38 | return -EINVAL; |
44 | 39 | ||
45 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) | ||
46 | oparg = 1 << oparg; | ||
47 | |||
48 | pagefault_disable(); | 40 | pagefault_disable(); |
49 | 41 | ||
50 | switch (op) { | 42 | switch (op) { |
@@ -69,17 +61,9 @@ static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr) | |||
69 | 61 | ||
70 | pagefault_enable(); | 62 | pagefault_enable(); |
71 | 63 | ||
72 | if (!ret) { | 64 | if (!ret) |
73 | switch (cmp) { | 65 | *oval = oldval; |
74 | case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; | 66 | |
75 | case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; | ||
76 | case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; | ||
77 | case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; | ||
78 | case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; | ||
79 | case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; | ||
80 | default: ret = -ENOSYS; | ||
81 | } | ||
82 | } | ||
83 | return ret; | 67 | return ret; |
84 | } | 68 | } |
85 | 69 | ||
diff --git a/arch/sparc/include/asm/mmu_context_64.h b/arch/sparc/include/asm/mmu_context_64.h index 2cddcda4f85f..87841d687f8d 100644 --- a/arch/sparc/include/asm/mmu_context_64.h +++ b/arch/sparc/include/asm/mmu_context_64.h | |||
@@ -27,9 +27,11 @@ void destroy_context(struct mm_struct *mm); | |||
27 | void __tsb_context_switch(unsigned long pgd_pa, | 27 | void __tsb_context_switch(unsigned long pgd_pa, |
28 | struct tsb_config *tsb_base, | 28 | struct tsb_config *tsb_base, |
29 | struct tsb_config *tsb_huge, | 29 | struct tsb_config *tsb_huge, |
30 | unsigned long tsb_descr_pa); | 30 | unsigned long tsb_descr_pa, |
31 | unsigned long secondary_ctx); | ||
31 | 32 | ||
32 | static inline void tsb_context_switch(struct mm_struct *mm) | 33 | static inline void tsb_context_switch_ctx(struct mm_struct *mm, |
34 | unsigned long ctx) | ||
33 | { | 35 | { |
34 | __tsb_context_switch(__pa(mm->pgd), | 36 | __tsb_context_switch(__pa(mm->pgd), |
35 | &mm->context.tsb_block[MM_TSB_BASE], | 37 | &mm->context.tsb_block[MM_TSB_BASE], |
@@ -40,9 +42,12 @@ static inline void tsb_context_switch(struct mm_struct *mm) | |||
40 | #else | 42 | #else |
41 | NULL | 43 | NULL |
42 | #endif | 44 | #endif |
43 | , __pa(&mm->context.tsb_descr[MM_TSB_BASE])); | 45 | , __pa(&mm->context.tsb_descr[MM_TSB_BASE]), |
46 | ctx); | ||
44 | } | 47 | } |
45 | 48 | ||
49 | #define tsb_context_switch(X) tsb_context_switch_ctx(X, 0) | ||
50 | |||
46 | void tsb_grow(struct mm_struct *mm, | 51 | void tsb_grow(struct mm_struct *mm, |
47 | unsigned long tsb_index, | 52 | unsigned long tsb_index, |
48 | unsigned long mm_rss); | 53 | unsigned long mm_rss); |
@@ -112,8 +117,7 @@ static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, str | |||
112 | * cpu0 to update it's TSB because at that point the cpu_vm_mask | 117 | * cpu0 to update it's TSB because at that point the cpu_vm_mask |
113 | * only had cpu1 set in it. | 118 | * only had cpu1 set in it. |
114 | */ | 119 | */ |
115 | load_secondary_context(mm); | 120 | tsb_context_switch_ctx(mm, CTX_HWBITS(mm->context)); |
116 | tsb_context_switch(mm); | ||
117 | 121 | ||
118 | /* Any time a processor runs a context on an address space | 122 | /* Any time a processor runs a context on an address space |
119 | * for the first time, we must flush that context out of the | 123 | * for the first time, we must flush that context out of the |
diff --git a/arch/sparc/include/asm/page_32.h b/arch/sparc/include/asm/page_32.h index 0efd0583a8c9..6249214148c2 100644 --- a/arch/sparc/include/asm/page_32.h +++ b/arch/sparc/include/asm/page_32.h | |||
@@ -68,6 +68,7 @@ typedef struct { unsigned long iopgprot; } iopgprot_t; | |||
68 | #define iopgprot_val(x) ((x).iopgprot) | 68 | #define iopgprot_val(x) ((x).iopgprot) |
69 | 69 | ||
70 | #define __pte(x) ((pte_t) { (x) } ) | 70 | #define __pte(x) ((pte_t) { (x) } ) |
71 | #define __pmd(x) ((pmd_t) { { (x) }, }) | ||
71 | #define __iopte(x) ((iopte_t) { (x) } ) | 72 | #define __iopte(x) ((iopte_t) { (x) } ) |
72 | #define __pgd(x) ((pgd_t) { (x) } ) | 73 | #define __pgd(x) ((pgd_t) { (x) } ) |
73 | #define __ctxd(x) ((ctxd_t) { (x) } ) | 74 | #define __ctxd(x) ((ctxd_t) { (x) } ) |
@@ -95,6 +96,7 @@ typedef unsigned long iopgprot_t; | |||
95 | #define iopgprot_val(x) (x) | 96 | #define iopgprot_val(x) (x) |
96 | 97 | ||
97 | #define __pte(x) (x) | 98 | #define __pte(x) (x) |
99 | #define __pmd(x) ((pmd_t) { { (x) }, }) | ||
98 | #define __iopte(x) (x) | 100 | #define __iopte(x) (x) |
99 | #define __pgd(x) (x) | 101 | #define __pgd(x) (x) |
100 | #define __ctxd(x) (x) | 102 | #define __ctxd(x) (x) |
diff --git a/arch/sparc/include/asm/spinlock_32.h b/arch/sparc/include/asm/spinlock_32.h index 8011e79f59c9..67345b2dc408 100644 --- a/arch/sparc/include/asm/spinlock_32.h +++ b/arch/sparc/include/asm/spinlock_32.h | |||
@@ -14,11 +14,6 @@ | |||
14 | 14 | ||
15 | #define arch_spin_is_locked(lock) (*((volatile unsigned char *)(lock)) != 0) | 15 | #define arch_spin_is_locked(lock) (*((volatile unsigned char *)(lock)) != 0) |
16 | 16 | ||
17 | static inline void arch_spin_unlock_wait(arch_spinlock_t *lock) | ||
18 | { | ||
19 | smp_cond_load_acquire(&lock->lock, !VAL); | ||
20 | } | ||
21 | |||
22 | static inline void arch_spin_lock(arch_spinlock_t *lock) | 17 | static inline void arch_spin_lock(arch_spinlock_t *lock) |
23 | { | 18 | { |
24 | __asm__ __volatile__( | 19 | __asm__ __volatile__( |
diff --git a/arch/sparc/include/asm/spitfire.h b/arch/sparc/include/asm/spitfire.h index 1d8321c827a8..1b1286d05069 100644 --- a/arch/sparc/include/asm/spitfire.h +++ b/arch/sparc/include/asm/spitfire.h | |||
@@ -47,10 +47,26 @@ | |||
47 | #define SUN4V_CHIP_NIAGARA5 0x05 | 47 | #define SUN4V_CHIP_NIAGARA5 0x05 |
48 | #define SUN4V_CHIP_SPARC_M6 0x06 | 48 | #define SUN4V_CHIP_SPARC_M6 0x06 |
49 | #define SUN4V_CHIP_SPARC_M7 0x07 | 49 | #define SUN4V_CHIP_SPARC_M7 0x07 |
50 | #define SUN4V_CHIP_SPARC_M8 0x08 | ||
50 | #define SUN4V_CHIP_SPARC64X 0x8a | 51 | #define SUN4V_CHIP_SPARC64X 0x8a |
51 | #define SUN4V_CHIP_SPARC_SN 0x8b | 52 | #define SUN4V_CHIP_SPARC_SN 0x8b |
52 | #define SUN4V_CHIP_UNKNOWN 0xff | 53 | #define SUN4V_CHIP_UNKNOWN 0xff |
53 | 54 | ||
55 | /* | ||
56 | * The following CPU_ID_xxx constants are used | ||
57 | * to identify the CPU type in the setup phase | ||
58 | * (see head_64.S) | ||
59 | */ | ||
60 | #define CPU_ID_NIAGARA1 ('1') | ||
61 | #define CPU_ID_NIAGARA2 ('2') | ||
62 | #define CPU_ID_NIAGARA3 ('3') | ||
63 | #define CPU_ID_NIAGARA4 ('4') | ||
64 | #define CPU_ID_NIAGARA5 ('5') | ||
65 | #define CPU_ID_M6 ('6') | ||
66 | #define CPU_ID_M7 ('7') | ||
67 | #define CPU_ID_M8 ('8') | ||
68 | #define CPU_ID_SONOMA1 ('N') | ||
69 | |||
54 | #ifndef __ASSEMBLY__ | 70 | #ifndef __ASSEMBLY__ |
55 | 71 | ||
56 | enum ultra_tlb_layout { | 72 | enum ultra_tlb_layout { |
diff --git a/arch/sparc/include/uapi/asm/socket.h b/arch/sparc/include/uapi/asm/socket.h index 186fd8199f54..b2f5c50d0947 100644 --- a/arch/sparc/include/uapi/asm/socket.h +++ b/arch/sparc/include/uapi/asm/socket.h | |||
@@ -98,6 +98,8 @@ | |||
98 | 98 | ||
99 | #define SO_PEERGROUPS 0x003d | 99 | #define SO_PEERGROUPS 0x003d |
100 | 100 | ||
101 | #define SO_ZEROCOPY 0x003e | ||
102 | |||
101 | /* Security levels - as per NRL IPv6 - don't actually do anything */ | 103 | /* Security levels - as per NRL IPv6 - don't actually do anything */ |
102 | #define SO_SECURITY_AUTHENTICATION 0x5001 | 104 | #define SO_SECURITY_AUTHENTICATION 0x5001 |
103 | #define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002 | 105 | #define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002 |
diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c index 493e023a468a..ef4f18f7a674 100644 --- a/arch/sparc/kernel/cpu.c +++ b/arch/sparc/kernel/cpu.c | |||
@@ -506,6 +506,12 @@ static void __init sun4v_cpu_probe(void) | |||
506 | sparc_pmu_type = "sparc-m7"; | 506 | sparc_pmu_type = "sparc-m7"; |
507 | break; | 507 | break; |
508 | 508 | ||
509 | case SUN4V_CHIP_SPARC_M8: | ||
510 | sparc_cpu_type = "SPARC-M8"; | ||
511 | sparc_fpu_type = "SPARC-M8 integrated FPU"; | ||
512 | sparc_pmu_type = "sparc-m8"; | ||
513 | break; | ||
514 | |||
509 | case SUN4V_CHIP_SPARC_SN: | 515 | case SUN4V_CHIP_SPARC_SN: |
510 | sparc_cpu_type = "SPARC-SN"; | 516 | sparc_cpu_type = "SPARC-SN"; |
511 | sparc_fpu_type = "SPARC-SN integrated FPU"; | 517 | sparc_fpu_type = "SPARC-SN integrated FPU"; |
diff --git a/arch/sparc/kernel/cpumap.c b/arch/sparc/kernel/cpumap.c index 45c820e1cba5..90d550bbfeef 100644 --- a/arch/sparc/kernel/cpumap.c +++ b/arch/sparc/kernel/cpumap.c | |||
@@ -328,6 +328,7 @@ static int iterate_cpu(struct cpuinfo_tree *t, unsigned int root_index) | |||
328 | case SUN4V_CHIP_NIAGARA5: | 328 | case SUN4V_CHIP_NIAGARA5: |
329 | case SUN4V_CHIP_SPARC_M6: | 329 | case SUN4V_CHIP_SPARC_M6: |
330 | case SUN4V_CHIP_SPARC_M7: | 330 | case SUN4V_CHIP_SPARC_M7: |
331 | case SUN4V_CHIP_SPARC_M8: | ||
331 | case SUN4V_CHIP_SPARC_SN: | 332 | case SUN4V_CHIP_SPARC_SN: |
332 | case SUN4V_CHIP_SPARC64X: | 333 | case SUN4V_CHIP_SPARC64X: |
333 | rover_inc_table = niagara_iterate_method; | 334 | rover_inc_table = niagara_iterate_method; |
diff --git a/arch/sparc/kernel/head_64.S b/arch/sparc/kernel/head_64.S index 41a407328667..78e0211753d2 100644 --- a/arch/sparc/kernel/head_64.S +++ b/arch/sparc/kernel/head_64.S | |||
@@ -424,22 +424,25 @@ EXPORT_SYMBOL(sun4v_chip_type) | |||
424 | nop | 424 | nop |
425 | 425 | ||
426 | 70: ldub [%g1 + 7], %g2 | 426 | 70: ldub [%g1 + 7], %g2 |
427 | cmp %g2, '3' | 427 | cmp %g2, CPU_ID_NIAGARA3 |
428 | be,pt %xcc, 5f | 428 | be,pt %xcc, 5f |
429 | mov SUN4V_CHIP_NIAGARA3, %g4 | 429 | mov SUN4V_CHIP_NIAGARA3, %g4 |
430 | cmp %g2, '4' | 430 | cmp %g2, CPU_ID_NIAGARA4 |
431 | be,pt %xcc, 5f | 431 | be,pt %xcc, 5f |
432 | mov SUN4V_CHIP_NIAGARA4, %g4 | 432 | mov SUN4V_CHIP_NIAGARA4, %g4 |
433 | cmp %g2, '5' | 433 | cmp %g2, CPU_ID_NIAGARA5 |
434 | be,pt %xcc, 5f | 434 | be,pt %xcc, 5f |
435 | mov SUN4V_CHIP_NIAGARA5, %g4 | 435 | mov SUN4V_CHIP_NIAGARA5, %g4 |
436 | cmp %g2, '6' | 436 | cmp %g2, CPU_ID_M6 |
437 | be,pt %xcc, 5f | 437 | be,pt %xcc, 5f |
438 | mov SUN4V_CHIP_SPARC_M6, %g4 | 438 | mov SUN4V_CHIP_SPARC_M6, %g4 |
439 | cmp %g2, '7' | 439 | cmp %g2, CPU_ID_M7 |
440 | be,pt %xcc, 5f | 440 | be,pt %xcc, 5f |
441 | mov SUN4V_CHIP_SPARC_M7, %g4 | 441 | mov SUN4V_CHIP_SPARC_M7, %g4 |
442 | cmp %g2, 'N' | 442 | cmp %g2, CPU_ID_M8 |
443 | be,pt %xcc, 5f | ||
444 | mov SUN4V_CHIP_SPARC_M8, %g4 | ||
445 | cmp %g2, CPU_ID_SONOMA1 | ||
443 | be,pt %xcc, 5f | 446 | be,pt %xcc, 5f |
444 | mov SUN4V_CHIP_SPARC_SN, %g4 | 447 | mov SUN4V_CHIP_SPARC_SN, %g4 |
445 | ba,pt %xcc, 49f | 448 | ba,pt %xcc, 49f |
@@ -448,10 +451,10 @@ EXPORT_SYMBOL(sun4v_chip_type) | |||
448 | 91: sethi %hi(prom_cpu_compatible), %g1 | 451 | 91: sethi %hi(prom_cpu_compatible), %g1 |
449 | or %g1, %lo(prom_cpu_compatible), %g1 | 452 | or %g1, %lo(prom_cpu_compatible), %g1 |
450 | ldub [%g1 + 17], %g2 | 453 | ldub [%g1 + 17], %g2 |
451 | cmp %g2, '1' | 454 | cmp %g2, CPU_ID_NIAGARA1 |
452 | be,pt %xcc, 5f | 455 | be,pt %xcc, 5f |
453 | mov SUN4V_CHIP_NIAGARA1, %g4 | 456 | mov SUN4V_CHIP_NIAGARA1, %g4 |
454 | cmp %g2, '2' | 457 | cmp %g2, CPU_ID_NIAGARA2 |
455 | be,pt %xcc, 5f | 458 | be,pt %xcc, 5f |
456 | mov SUN4V_CHIP_NIAGARA2, %g4 | 459 | mov SUN4V_CHIP_NIAGARA2, %g4 |
457 | 460 | ||
@@ -602,6 +605,9 @@ niagara_tlb_fixup: | |||
602 | cmp %g1, SUN4V_CHIP_SPARC_M7 | 605 | cmp %g1, SUN4V_CHIP_SPARC_M7 |
603 | be,pt %xcc, niagara4_patch | 606 | be,pt %xcc, niagara4_patch |
604 | nop | 607 | nop |
608 | cmp %g1, SUN4V_CHIP_SPARC_M8 | ||
609 | be,pt %xcc, niagara4_patch | ||
610 | nop | ||
605 | cmp %g1, SUN4V_CHIP_SPARC_SN | 611 | cmp %g1, SUN4V_CHIP_SPARC_SN |
606 | be,pt %xcc, niagara4_patch | 612 | be,pt %xcc, niagara4_patch |
607 | nop | 613 | nop |
diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c index f10e2f712394..9ebebf1fd93d 100644 --- a/arch/sparc/kernel/pci_sun4v.c +++ b/arch/sparc/kernel/pci_sun4v.c | |||
@@ -1266,8 +1266,6 @@ static int pci_sun4v_probe(struct platform_device *op) | |||
1266 | * ATU group, but ATU hcalls won't be available. | 1266 | * ATU group, but ATU hcalls won't be available. |
1267 | */ | 1267 | */ |
1268 | hv_atu = false; | 1268 | hv_atu = false; |
1269 | pr_err(PFX "Could not register hvapi ATU err=%d\n", | ||
1270 | err); | ||
1271 | } else { | 1269 | } else { |
1272 | pr_info(PFX "Registered hvapi ATU major[%lu] minor[%lu]\n", | 1270 | pr_info(PFX "Registered hvapi ATU major[%lu] minor[%lu]\n", |
1273 | vatu_major, vatu_minor); | 1271 | vatu_major, vatu_minor); |
diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c index e038e343f2c1..4a133c052af8 100644 --- a/arch/sparc/kernel/pcic.c +++ b/arch/sparc/kernel/pcic.c | |||
@@ -602,7 +602,7 @@ void pcibios_fixup_bus(struct pci_bus *bus) | |||
602 | { | 602 | { |
603 | struct pci_dev *dev; | 603 | struct pci_dev *dev; |
604 | int i, has_io, has_mem; | 604 | int i, has_io, has_mem; |
605 | unsigned int cmd; | 605 | unsigned int cmd = 0; |
606 | struct linux_pcic *pcic; | 606 | struct linux_pcic *pcic; |
607 | /* struct linux_pbm_info* pbm = &pcic->pbm; */ | 607 | /* struct linux_pbm_info* pbm = &pcic->pbm; */ |
608 | int node; | 608 | int node; |
diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c index 4d9c3e13c150..150ee7d4b059 100644 --- a/arch/sparc/kernel/setup_64.c +++ b/arch/sparc/kernel/setup_64.c | |||
@@ -288,10 +288,17 @@ static void __init sun4v_patch(void) | |||
288 | 288 | ||
289 | sun4v_patch_2insn_range(&__sun4v_2insn_patch, | 289 | sun4v_patch_2insn_range(&__sun4v_2insn_patch, |
290 | &__sun4v_2insn_patch_end); | 290 | &__sun4v_2insn_patch_end); |
291 | if (sun4v_chip_type == SUN4V_CHIP_SPARC_M7 || | 291 | |
292 | sun4v_chip_type == SUN4V_CHIP_SPARC_SN) | 292 | switch (sun4v_chip_type) { |
293 | case SUN4V_CHIP_SPARC_M7: | ||
294 | case SUN4V_CHIP_SPARC_M8: | ||
295 | case SUN4V_CHIP_SPARC_SN: | ||
293 | sun_m7_patch_2insn_range(&__sun_m7_2insn_patch, | 296 | sun_m7_patch_2insn_range(&__sun_m7_2insn_patch, |
294 | &__sun_m7_2insn_patch_end); | 297 | &__sun_m7_2insn_patch_end); |
298 | break; | ||
299 | default: | ||
300 | break; | ||
301 | } | ||
295 | 302 | ||
296 | sun4v_hvapi_init(); | 303 | sun4v_hvapi_init(); |
297 | } | 304 | } |
@@ -529,6 +536,7 @@ static void __init init_sparc64_elf_hwcap(void) | |||
529 | sun4v_chip_type == SUN4V_CHIP_NIAGARA5 || | 536 | sun4v_chip_type == SUN4V_CHIP_NIAGARA5 || |
530 | sun4v_chip_type == SUN4V_CHIP_SPARC_M6 || | 537 | sun4v_chip_type == SUN4V_CHIP_SPARC_M6 || |
531 | sun4v_chip_type == SUN4V_CHIP_SPARC_M7 || | 538 | sun4v_chip_type == SUN4V_CHIP_SPARC_M7 || |
539 | sun4v_chip_type == SUN4V_CHIP_SPARC_M8 || | ||
532 | sun4v_chip_type == SUN4V_CHIP_SPARC_SN || | 540 | sun4v_chip_type == SUN4V_CHIP_SPARC_SN || |
533 | sun4v_chip_type == SUN4V_CHIP_SPARC64X) | 541 | sun4v_chip_type == SUN4V_CHIP_SPARC64X) |
534 | cap |= HWCAP_SPARC_BLKINIT; | 542 | cap |= HWCAP_SPARC_BLKINIT; |
@@ -538,6 +546,7 @@ static void __init init_sparc64_elf_hwcap(void) | |||
538 | sun4v_chip_type == SUN4V_CHIP_NIAGARA5 || | 546 | sun4v_chip_type == SUN4V_CHIP_NIAGARA5 || |
539 | sun4v_chip_type == SUN4V_CHIP_SPARC_M6 || | 547 | sun4v_chip_type == SUN4V_CHIP_SPARC_M6 || |
540 | sun4v_chip_type == SUN4V_CHIP_SPARC_M7 || | 548 | sun4v_chip_type == SUN4V_CHIP_SPARC_M7 || |
549 | sun4v_chip_type == SUN4V_CHIP_SPARC_M8 || | ||
541 | sun4v_chip_type == SUN4V_CHIP_SPARC_SN || | 550 | sun4v_chip_type == SUN4V_CHIP_SPARC_SN || |
542 | sun4v_chip_type == SUN4V_CHIP_SPARC64X) | 551 | sun4v_chip_type == SUN4V_CHIP_SPARC64X) |
543 | cap |= HWCAP_SPARC_N2; | 552 | cap |= HWCAP_SPARC_N2; |
@@ -568,6 +577,7 @@ static void __init init_sparc64_elf_hwcap(void) | |||
568 | sun4v_chip_type == SUN4V_CHIP_NIAGARA5 || | 577 | sun4v_chip_type == SUN4V_CHIP_NIAGARA5 || |
569 | sun4v_chip_type == SUN4V_CHIP_SPARC_M6 || | 578 | sun4v_chip_type == SUN4V_CHIP_SPARC_M6 || |
570 | sun4v_chip_type == SUN4V_CHIP_SPARC_M7 || | 579 | sun4v_chip_type == SUN4V_CHIP_SPARC_M7 || |
580 | sun4v_chip_type == SUN4V_CHIP_SPARC_M8 || | ||
571 | sun4v_chip_type == SUN4V_CHIP_SPARC_SN || | 581 | sun4v_chip_type == SUN4V_CHIP_SPARC_SN || |
572 | sun4v_chip_type == SUN4V_CHIP_SPARC64X) | 582 | sun4v_chip_type == SUN4V_CHIP_SPARC64X) |
573 | cap |= (AV_SPARC_VIS | AV_SPARC_VIS2 | | 583 | cap |= (AV_SPARC_VIS | AV_SPARC_VIS2 | |
@@ -578,6 +588,7 @@ static void __init init_sparc64_elf_hwcap(void) | |||
578 | sun4v_chip_type == SUN4V_CHIP_NIAGARA5 || | 588 | sun4v_chip_type == SUN4V_CHIP_NIAGARA5 || |
579 | sun4v_chip_type == SUN4V_CHIP_SPARC_M6 || | 589 | sun4v_chip_type == SUN4V_CHIP_SPARC_M6 || |
580 | sun4v_chip_type == SUN4V_CHIP_SPARC_M7 || | 590 | sun4v_chip_type == SUN4V_CHIP_SPARC_M7 || |
591 | sun4v_chip_type == SUN4V_CHIP_SPARC_M8 || | ||
581 | sun4v_chip_type == SUN4V_CHIP_SPARC_SN || | 592 | sun4v_chip_type == SUN4V_CHIP_SPARC_SN || |
582 | sun4v_chip_type == SUN4V_CHIP_SPARC64X) | 593 | sun4v_chip_type == SUN4V_CHIP_SPARC64X) |
583 | cap |= (AV_SPARC_VIS3 | AV_SPARC_HPC | | 594 | cap |= (AV_SPARC_VIS3 | AV_SPARC_HPC | |
diff --git a/arch/sparc/kernel/tsb.S b/arch/sparc/kernel/tsb.S index 07c0df924960..db872dbfafe9 100644 --- a/arch/sparc/kernel/tsb.S +++ b/arch/sparc/kernel/tsb.S | |||
@@ -360,6 +360,7 @@ tsb_flush: | |||
360 | * %o1: TSB base config pointer | 360 | * %o1: TSB base config pointer |
361 | * %o2: TSB huge config pointer, or NULL if none | 361 | * %o2: TSB huge config pointer, or NULL if none |
362 | * %o3: Hypervisor TSB descriptor physical address | 362 | * %o3: Hypervisor TSB descriptor physical address |
363 | * %o4: Secondary context to load, if non-zero | ||
363 | * | 364 | * |
364 | * We have to run this whole thing with interrupts | 365 | * We have to run this whole thing with interrupts |
365 | * disabled so that the current cpu doesn't change | 366 | * disabled so that the current cpu doesn't change |
@@ -372,6 +373,17 @@ __tsb_context_switch: | |||
372 | rdpr %pstate, %g1 | 373 | rdpr %pstate, %g1 |
373 | wrpr %g1, PSTATE_IE, %pstate | 374 | wrpr %g1, PSTATE_IE, %pstate |
374 | 375 | ||
376 | brz,pn %o4, 1f | ||
377 | mov SECONDARY_CONTEXT, %o5 | ||
378 | |||
379 | 661: stxa %o4, [%o5] ASI_DMMU | ||
380 | .section .sun4v_1insn_patch, "ax" | ||
381 | .word 661b | ||
382 | stxa %o4, [%o5] ASI_MMU | ||
383 | .previous | ||
384 | flush %g6 | ||
385 | |||
386 | 1: | ||
375 | TRAP_LOAD_TRAP_BLOCK(%g2, %g3) | 387 | TRAP_LOAD_TRAP_BLOCK(%g2, %g3) |
376 | 388 | ||
377 | stx %o0, [%g2 + TRAP_PER_CPU_PGD_PADDR] | 389 | stx %o0, [%g2 + TRAP_PER_CPU_PGD_PADDR] |
diff --git a/arch/sparc/lib/U3memcpy.S b/arch/sparc/lib/U3memcpy.S index 54f98706b03b..5a8cb37f0a3b 100644 --- a/arch/sparc/lib/U3memcpy.S +++ b/arch/sparc/lib/U3memcpy.S | |||
@@ -145,13 +145,13 @@ ENDPROC(U3_retl_o2_plus_GS_plus_0x08) | |||
145 | ENTRY(U3_retl_o2_and_7_plus_GS) | 145 | ENTRY(U3_retl_o2_and_7_plus_GS) |
146 | and %o2, 7, %o2 | 146 | and %o2, 7, %o2 |
147 | retl | 147 | retl |
148 | add %o2, GLOBAL_SPARE, %o2 | 148 | add %o2, GLOBAL_SPARE, %o0 |
149 | ENDPROC(U3_retl_o2_and_7_plus_GS) | 149 | ENDPROC(U3_retl_o2_and_7_plus_GS) |
150 | ENTRY(U3_retl_o2_and_7_plus_GS_plus_8) | 150 | ENTRY(U3_retl_o2_and_7_plus_GS_plus_8) |
151 | add GLOBAL_SPARE, 8, GLOBAL_SPARE | 151 | add GLOBAL_SPARE, 8, GLOBAL_SPARE |
152 | and %o2, 7, %o2 | 152 | and %o2, 7, %o2 |
153 | retl | 153 | retl |
154 | add %o2, GLOBAL_SPARE, %o2 | 154 | add %o2, GLOBAL_SPARE, %o0 |
155 | ENDPROC(U3_retl_o2_and_7_plus_GS_plus_8) | 155 | ENDPROC(U3_retl_o2_and_7_plus_GS_plus_8) |
156 | #endif | 156 | #endif |
157 | 157 | ||
diff --git a/arch/sparc/lib/multi3.S b/arch/sparc/lib/multi3.S index d6b6c97fe3c7..703127aaf4a5 100644 --- a/arch/sparc/lib/multi3.S +++ b/arch/sparc/lib/multi3.S | |||
@@ -5,26 +5,26 @@ | |||
5 | .align 4 | 5 | .align 4 |
6 | ENTRY(__multi3) /* %o0 = u, %o1 = v */ | 6 | ENTRY(__multi3) /* %o0 = u, %o1 = v */ |
7 | mov %o1, %g1 | 7 | mov %o1, %g1 |
8 | srl %o3, 0, %g4 | 8 | srl %o3, 0, %o4 |
9 | mulx %g4, %g1, %o1 | 9 | mulx %o4, %g1, %o1 |
10 | srlx %g1, 0x20, %g3 | 10 | srlx %g1, 0x20, %g3 |
11 | mulx %g3, %g4, %g5 | 11 | mulx %g3, %o4, %g7 |
12 | sllx %g5, 0x20, %o5 | 12 | sllx %g7, 0x20, %o5 |
13 | srl %g1, 0, %g4 | 13 | srl %g1, 0, %o4 |
14 | sub %o1, %o5, %o5 | 14 | sub %o1, %o5, %o5 |
15 | srlx %o5, 0x20, %o5 | 15 | srlx %o5, 0x20, %o5 |
16 | addcc %g5, %o5, %g5 | 16 | addcc %g7, %o5, %g7 |
17 | srlx %o3, 0x20, %o5 | 17 | srlx %o3, 0x20, %o5 |
18 | mulx %g4, %o5, %g4 | 18 | mulx %o4, %o5, %o4 |
19 | mulx %g3, %o5, %o5 | 19 | mulx %g3, %o5, %o5 |
20 | sethi %hi(0x80000000), %g3 | 20 | sethi %hi(0x80000000), %g3 |
21 | addcc %g5, %g4, %g5 | 21 | addcc %g7, %o4, %g7 |
22 | srlx %g5, 0x20, %g5 | 22 | srlx %g7, 0x20, %g7 |
23 | add %g3, %g3, %g3 | 23 | add %g3, %g3, %g3 |
24 | movcc %xcc, %g0, %g3 | 24 | movcc %xcc, %g0, %g3 |
25 | addcc %o5, %g5, %o5 | 25 | addcc %o5, %g7, %o5 |
26 | sllx %g4, 0x20, %g4 | 26 | sllx %o4, 0x20, %o4 |
27 | add %o1, %g4, %o1 | 27 | add %o1, %o4, %o1 |
28 | add %o5, %g3, %g2 | 28 | add %o5, %g3, %g2 |
29 | mulx %g1, %o2, %g1 | 29 | mulx %g1, %o2, %g1 |
30 | add %g1, %g2, %g1 | 30 | add %g1, %g2, %g1 |
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 3c40ebd50f92..afa0099f3748 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c | |||
@@ -325,6 +325,29 @@ static void __update_mmu_tsb_insert(struct mm_struct *mm, unsigned long tsb_inde | |||
325 | } | 325 | } |
326 | 326 | ||
327 | #ifdef CONFIG_HUGETLB_PAGE | 327 | #ifdef CONFIG_HUGETLB_PAGE |
328 | static void __init add_huge_page_size(unsigned long size) | ||
329 | { | ||
330 | unsigned int order; | ||
331 | |||
332 | if (size_to_hstate(size)) | ||
333 | return; | ||
334 | |||
335 | order = ilog2(size) - PAGE_SHIFT; | ||
336 | hugetlb_add_hstate(order); | ||
337 | } | ||
338 | |||
339 | static int __init hugetlbpage_init(void) | ||
340 | { | ||
341 | add_huge_page_size(1UL << HPAGE_64K_SHIFT); | ||
342 | add_huge_page_size(1UL << HPAGE_SHIFT); | ||
343 | add_huge_page_size(1UL << HPAGE_256MB_SHIFT); | ||
344 | add_huge_page_size(1UL << HPAGE_2GB_SHIFT); | ||
345 | |||
346 | return 0; | ||
347 | } | ||
348 | |||
349 | arch_initcall(hugetlbpage_init); | ||
350 | |||
328 | static int __init setup_hugepagesz(char *string) | 351 | static int __init setup_hugepagesz(char *string) |
329 | { | 352 | { |
330 | unsigned long long hugepage_size; | 353 | unsigned long long hugepage_size; |
@@ -364,7 +387,7 @@ static int __init setup_hugepagesz(char *string) | |||
364 | goto out; | 387 | goto out; |
365 | } | 388 | } |
366 | 389 | ||
367 | hugetlb_add_hstate(hugepage_shift - PAGE_SHIFT); | 390 | add_huge_page_size(hugepage_size); |
368 | rc = 1; | 391 | rc = 1; |
369 | 392 | ||
370 | out: | 393 | out: |
@@ -1921,12 +1944,22 @@ static void __init setup_page_offset(void) | |||
1921 | break; | 1944 | break; |
1922 | case SUN4V_CHIP_SPARC_M7: | 1945 | case SUN4V_CHIP_SPARC_M7: |
1923 | case SUN4V_CHIP_SPARC_SN: | 1946 | case SUN4V_CHIP_SPARC_SN: |
1924 | default: | ||
1925 | /* M7 and later support 52-bit virtual addresses. */ | 1947 | /* M7 and later support 52-bit virtual addresses. */ |
1926 | sparc64_va_hole_top = 0xfff8000000000000UL; | 1948 | sparc64_va_hole_top = 0xfff8000000000000UL; |
1927 | sparc64_va_hole_bottom = 0x0008000000000000UL; | 1949 | sparc64_va_hole_bottom = 0x0008000000000000UL; |
1928 | max_phys_bits = 49; | 1950 | max_phys_bits = 49; |
1929 | break; | 1951 | break; |
1952 | case SUN4V_CHIP_SPARC_M8: | ||
1953 | default: | ||
1954 | /* M8 and later support 54-bit virtual addresses. | ||
1955 | * However, restricting M8 and above VA bits to 53 | ||
1956 | * as 4-level page table cannot support more than | ||
1957 | * 53 VA bits. | ||
1958 | */ | ||
1959 | sparc64_va_hole_top = 0xfff0000000000000UL; | ||
1960 | sparc64_va_hole_bottom = 0x0010000000000000UL; | ||
1961 | max_phys_bits = 51; | ||
1962 | break; | ||
1930 | } | 1963 | } |
1931 | } | 1964 | } |
1932 | 1965 | ||
@@ -2138,6 +2171,7 @@ static void __init sun4v_linear_pte_xor_finalize(void) | |||
2138 | */ | 2171 | */ |
2139 | switch (sun4v_chip_type) { | 2172 | switch (sun4v_chip_type) { |
2140 | case SUN4V_CHIP_SPARC_M7: | 2173 | case SUN4V_CHIP_SPARC_M7: |
2174 | case SUN4V_CHIP_SPARC_M8: | ||
2141 | case SUN4V_CHIP_SPARC_SN: | 2175 | case SUN4V_CHIP_SPARC_SN: |
2142 | pagecv_flag = 0x00; | 2176 | pagecv_flag = 0x00; |
2143 | break; | 2177 | break; |
@@ -2290,6 +2324,7 @@ void __init paging_init(void) | |||
2290 | */ | 2324 | */ |
2291 | switch (sun4v_chip_type) { | 2325 | switch (sun4v_chip_type) { |
2292 | case SUN4V_CHIP_SPARC_M7: | 2326 | case SUN4V_CHIP_SPARC_M7: |
2327 | case SUN4V_CHIP_SPARC_M8: | ||
2293 | case SUN4V_CHIP_SPARC_SN: | 2328 | case SUN4V_CHIP_SPARC_SN: |
2294 | page_cache4v_flag = _PAGE_CP_4V; | 2329 | page_cache4v_flag = _PAGE_CP_4V; |
2295 | break; | 2330 | break; |
diff --git a/arch/sparc/net/bpf_jit_comp_64.c b/arch/sparc/net/bpf_jit_comp_64.c index 8799ae9a8788..c340af7b1371 100644 --- a/arch/sparc/net/bpf_jit_comp_64.c +++ b/arch/sparc/net/bpf_jit_comp_64.c | |||
@@ -128,6 +128,8 @@ static u32 WDISP10(u32 off) | |||
128 | 128 | ||
129 | #define BA (BRANCH | CONDA) | 129 | #define BA (BRANCH | CONDA) |
130 | #define BG (BRANCH | CONDG) | 130 | #define BG (BRANCH | CONDG) |
131 | #define BL (BRANCH | CONDL) | ||
132 | #define BLE (BRANCH | CONDLE) | ||
131 | #define BGU (BRANCH | CONDGU) | 133 | #define BGU (BRANCH | CONDGU) |
132 | #define BLEU (BRANCH | CONDLEU) | 134 | #define BLEU (BRANCH | CONDLEU) |
133 | #define BGE (BRANCH | CONDGE) | 135 | #define BGE (BRANCH | CONDGE) |
@@ -715,9 +717,15 @@ static int emit_compare_and_branch(const u8 code, const u8 dst, u8 src, | |||
715 | case BPF_JGT: | 717 | case BPF_JGT: |
716 | br_opcode = BGU; | 718 | br_opcode = BGU; |
717 | break; | 719 | break; |
720 | case BPF_JLT: | ||
721 | br_opcode = BLU; | ||
722 | break; | ||
718 | case BPF_JGE: | 723 | case BPF_JGE: |
719 | br_opcode = BGEU; | 724 | br_opcode = BGEU; |
720 | break; | 725 | break; |
726 | case BPF_JLE: | ||
727 | br_opcode = BLEU; | ||
728 | break; | ||
721 | case BPF_JSET: | 729 | case BPF_JSET: |
722 | case BPF_JNE: | 730 | case BPF_JNE: |
723 | br_opcode = BNE; | 731 | br_opcode = BNE; |
@@ -725,9 +733,15 @@ static int emit_compare_and_branch(const u8 code, const u8 dst, u8 src, | |||
725 | case BPF_JSGT: | 733 | case BPF_JSGT: |
726 | br_opcode = BG; | 734 | br_opcode = BG; |
727 | break; | 735 | break; |
736 | case BPF_JSLT: | ||
737 | br_opcode = BL; | ||
738 | break; | ||
728 | case BPF_JSGE: | 739 | case BPF_JSGE: |
729 | br_opcode = BGE; | 740 | br_opcode = BGE; |
730 | break; | 741 | break; |
742 | case BPF_JSLE: | ||
743 | br_opcode = BLE; | ||
744 | break; | ||
731 | default: | 745 | default: |
732 | /* Make sure we dont leak kernel information to the | 746 | /* Make sure we dont leak kernel information to the |
733 | * user. | 747 | * user. |
@@ -746,18 +760,30 @@ static int emit_compare_and_branch(const u8 code, const u8 dst, u8 src, | |||
746 | case BPF_JGT: | 760 | case BPF_JGT: |
747 | cbcond_opcode = CBCONDGU; | 761 | cbcond_opcode = CBCONDGU; |
748 | break; | 762 | break; |
763 | case BPF_JLT: | ||
764 | cbcond_opcode = CBCONDLU; | ||
765 | break; | ||
749 | case BPF_JGE: | 766 | case BPF_JGE: |
750 | cbcond_opcode = CBCONDGEU; | 767 | cbcond_opcode = CBCONDGEU; |
751 | break; | 768 | break; |
769 | case BPF_JLE: | ||
770 | cbcond_opcode = CBCONDLEU; | ||
771 | break; | ||
752 | case BPF_JNE: | 772 | case BPF_JNE: |
753 | cbcond_opcode = CBCONDNE; | 773 | cbcond_opcode = CBCONDNE; |
754 | break; | 774 | break; |
755 | case BPF_JSGT: | 775 | case BPF_JSGT: |
756 | cbcond_opcode = CBCONDG; | 776 | cbcond_opcode = CBCONDG; |
757 | break; | 777 | break; |
778 | case BPF_JSLT: | ||
779 | cbcond_opcode = CBCONDL; | ||
780 | break; | ||
758 | case BPF_JSGE: | 781 | case BPF_JSGE: |
759 | cbcond_opcode = CBCONDGE; | 782 | cbcond_opcode = CBCONDGE; |
760 | break; | 783 | break; |
784 | case BPF_JSLE: | ||
785 | cbcond_opcode = CBCONDLE; | ||
786 | break; | ||
761 | default: | 787 | default: |
762 | /* Make sure we dont leak kernel information to the | 788 | /* Make sure we dont leak kernel information to the |
763 | * user. | 789 | * user. |
@@ -1176,10 +1202,14 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx) | |||
1176 | /* IF (dst COND src) JUMP off */ | 1202 | /* IF (dst COND src) JUMP off */ |
1177 | case BPF_JMP | BPF_JEQ | BPF_X: | 1203 | case BPF_JMP | BPF_JEQ | BPF_X: |
1178 | case BPF_JMP | BPF_JGT | BPF_X: | 1204 | case BPF_JMP | BPF_JGT | BPF_X: |
1205 | case BPF_JMP | BPF_JLT | BPF_X: | ||
1179 | case BPF_JMP | BPF_JGE | BPF_X: | 1206 | case BPF_JMP | BPF_JGE | BPF_X: |
1207 | case BPF_JMP | BPF_JLE | BPF_X: | ||
1180 | case BPF_JMP | BPF_JNE | BPF_X: | 1208 | case BPF_JMP | BPF_JNE | BPF_X: |
1181 | case BPF_JMP | BPF_JSGT | BPF_X: | 1209 | case BPF_JMP | BPF_JSGT | BPF_X: |
1210 | case BPF_JMP | BPF_JSLT | BPF_X: | ||
1182 | case BPF_JMP | BPF_JSGE | BPF_X: | 1211 | case BPF_JMP | BPF_JSGE | BPF_X: |
1212 | case BPF_JMP | BPF_JSLE | BPF_X: | ||
1183 | case BPF_JMP | BPF_JSET | BPF_X: { | 1213 | case BPF_JMP | BPF_JSET | BPF_X: { |
1184 | int err; | 1214 | int err; |
1185 | 1215 | ||
@@ -1191,10 +1221,14 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx) | |||
1191 | /* IF (dst COND imm) JUMP off */ | 1221 | /* IF (dst COND imm) JUMP off */ |
1192 | case BPF_JMP | BPF_JEQ | BPF_K: | 1222 | case BPF_JMP | BPF_JEQ | BPF_K: |
1193 | case BPF_JMP | BPF_JGT | BPF_K: | 1223 | case BPF_JMP | BPF_JGT | BPF_K: |
1224 | case BPF_JMP | BPF_JLT | BPF_K: | ||
1194 | case BPF_JMP | BPF_JGE | BPF_K: | 1225 | case BPF_JMP | BPF_JGE | BPF_K: |
1226 | case BPF_JMP | BPF_JLE | BPF_K: | ||
1195 | case BPF_JMP | BPF_JNE | BPF_K: | 1227 | case BPF_JMP | BPF_JNE | BPF_K: |
1196 | case BPF_JMP | BPF_JSGT | BPF_K: | 1228 | case BPF_JMP | BPF_JSGT | BPF_K: |
1229 | case BPF_JMP | BPF_JSLT | BPF_K: | ||
1197 | case BPF_JMP | BPF_JSGE | BPF_K: | 1230 | case BPF_JMP | BPF_JSGE | BPF_K: |
1231 | case BPF_JMP | BPF_JSLE | BPF_K: | ||
1198 | case BPF_JMP | BPF_JSET | BPF_K: { | 1232 | case BPF_JMP | BPF_JSET | BPF_K: { |
1199 | int err; | 1233 | int err; |
1200 | 1234 | ||
diff --git a/arch/sparc/power/hibernate.c b/arch/sparc/power/hibernate.c index 17bd2e167e07..df707a8ad311 100644 --- a/arch/sparc/power/hibernate.c +++ b/arch/sparc/power/hibernate.c | |||
@@ -35,6 +35,5 @@ void restore_processor_state(void) | |||
35 | { | 35 | { |
36 | struct mm_struct *mm = current->active_mm; | 36 | struct mm_struct *mm = current->active_mm; |
37 | 37 | ||
38 | load_secondary_context(mm); | 38 | tsb_context_switch_ctx(mm, CTX_HWBITS(mm->context)); |
39 | tsb_context_switch(mm); | ||
40 | } | 39 | } |