| .. | .. |
|---|
| 37 | 37 | #include <asm/signal.h> |
|---|
| 38 | 38 | #include <asm/sim.h> |
|---|
| 39 | 39 | #include <asm/shmparam.h> |
|---|
| 40 | +#include <asm/sync.h> |
|---|
| 40 | 41 | #include <asm/sysmips.h> |
|---|
| 41 | 42 | #include <asm/switch_to.h> |
|---|
| 42 | 43 | |
|---|
| .. | .. |
|---|
| 80 | 81 | |
|---|
| 81 | 82 | save_static_function(sys_fork); |
|---|
| 82 | 83 | save_static_function(sys_clone); |
|---|
| 84 | +save_static_function(sys_clone3); |
|---|
| 83 | 85 | |
|---|
| 84 | 86 | SYSCALL_DEFINE1(set_thread_area, unsigned long, addr) |
|---|
| 85 | 87 | { |
|---|
| .. | .. |
|---|
| 101 | 103 | if (unlikely(addr & 3)) |
|---|
| 102 | 104 | return -EINVAL; |
|---|
| 103 | 105 | |
|---|
| 104 | | - if (unlikely(!access_ok(VERIFY_WRITE, (const void __user *)addr, 4))) |
|---|
| 106 | + if (unlikely(!access_ok((const void __user *)addr, 4))) |
|---|
| 105 | 107 | return -EINVAL; |
|---|
| 106 | 108 | |
|---|
| 107 | | - if (cpu_has_llsc && R10000_LLSC_WAR) { |
|---|
| 109 | + if (cpu_has_llsc && IS_ENABLED(CONFIG_WAR_R10000_LLSC)) { |
|---|
| 108 | 110 | __asm__ __volatile__ ( |
|---|
| 111 | + " .set push \n" |
|---|
| 109 | 112 | " .set arch=r4000 \n" |
|---|
| 110 | 113 | " li %[err], 0 \n" |
|---|
| 111 | 114 | "1: ll %[old], (%[addr]) \n" |
|---|
| .. | .. |
|---|
| 122 | 125 | " "STR(PTR)" 1b, 4b \n" |
|---|
| 123 | 126 | " "STR(PTR)" 2b, 4b \n" |
|---|
| 124 | 127 | " .previous \n" |
|---|
| 125 | | - " .set mips0 \n" |
|---|
| 128 | + " .set pop \n" |
|---|
| 126 | 129 | : [old] "=&r" (old), |
|---|
| 127 | 130 | [err] "=&r" (err), |
|---|
| 128 | 131 | [tmp] "=&r" (tmp) |
|---|
| .. | .. |
|---|
| 132 | 135 | : "memory"); |
|---|
| 133 | 136 | } else if (cpu_has_llsc) { |
|---|
| 134 | 137 | __asm__ __volatile__ ( |
|---|
| 138 | + " .set push \n" |
|---|
| 135 | 139 | " .set "MIPS_ISA_ARCH_LEVEL" \n" |
|---|
| 136 | 140 | " li %[err], 0 \n" |
|---|
| 137 | 141 | "1: \n" |
|---|
| 142 | + " " __SYNC(full, loongson3_war) " \n" |
|---|
| 138 | 143 | user_ll("%[old]", "(%[addr])") |
|---|
| 139 | 144 | " move %[tmp], %[new] \n" |
|---|
| 140 | 145 | "2: \n" |
|---|
| .. | .. |
|---|
| 150 | 155 | " "STR(PTR)" 1b, 5b \n" |
|---|
| 151 | 156 | " "STR(PTR)" 2b, 5b \n" |
|---|
| 152 | 157 | " .previous \n" |
|---|
| 153 | | - " .set mips0 \n" |
|---|
| 158 | + " .set pop \n" |
|---|
| 154 | 159 | : [old] "=&r" (old), |
|---|
| 155 | 160 | [err] "=&r" (err), |
|---|
| 156 | 161 | [tmp] "=&r" (tmp) |
|---|