Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: mipsregs: Set proper ISA level for virt extensions

c994a3ec7ecc ("MIPS: set mips32r5 for virt extensions") setted
some instructions in virt extensions to ISA level mips32r5.

However TLB related vz instructions was leftover, also this
shouldn't be done to a R5 or R6 kernel buid.

Reorg macros to set ISA level as needed when _ASM_SET_VIRT
is called.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

authored by

Jiaxun Yang and committed by
Thomas Bogendoerfer
a640d676 dd6d29a6

+8 -5
+8 -5
arch/mips/include/asm/mipsregs.h
··· 2232 2232 _ASM_INSN_IF_MIPS(0x4200000c) \ 2233 2233 _ASM_INSN32_IF_MM(0x0000517c) 2234 2234 #else /* !TOOLCHAIN_SUPPORTS_VIRT */ 2235 - #define _ASM_SET_VIRT ".set\tvirt\n\t" 2235 + #if MIPS_ISA_REV >= 5 2236 + #define _ASM_SET_VIRT_ISA 2237 + #elif defined(CONFIG_64BIT) 2238 + #define _ASM_SET_VIRT_ISA ".set\tmips64r5\n\t" 2239 + #else 2240 + #define _ASM_SET_VIRT_ISA ".set\tmips32r5\n\t" 2241 + #endif 2242 + #define _ASM_SET_VIRT _ASM_SET_VIRT_ISA ".set\tvirt\n\t" 2236 2243 #define _ASM_SET_MFGC0 _ASM_SET_VIRT 2237 2244 #define _ASM_SET_DMFGC0 _ASM_SET_VIRT 2238 2245 #define _ASM_SET_MTGC0 _ASM_SET_VIRT ··· 2260 2253 ({ int __res; \ 2261 2254 __asm__ __volatile__( \ 2262 2255 ".set\tpush\n\t" \ 2263 - ".set\tmips32r5\n\t" \ 2264 2256 _ASM_SET_MFGC0 \ 2265 2257 "mfgc0\t%0, " #source ", %1\n\t" \ 2266 2258 _ASM_UNSET_MFGC0 \ ··· 2273 2267 ({ unsigned long long __res; \ 2274 2268 __asm__ __volatile__( \ 2275 2269 ".set\tpush\n\t" \ 2276 - ".set\tmips64r5\n\t" \ 2277 2270 _ASM_SET_DMFGC0 \ 2278 2271 "dmfgc0\t%0, " #source ", %1\n\t" \ 2279 2272 _ASM_UNSET_DMFGC0 \ ··· 2286 2281 do { \ 2287 2282 __asm__ __volatile__( \ 2288 2283 ".set\tpush\n\t" \ 2289 - ".set\tmips32r5\n\t" \ 2290 2284 _ASM_SET_MTGC0 \ 2291 2285 "mtgc0\t%z0, " #register ", %1\n\t" \ 2292 2286 _ASM_UNSET_MTGC0 \ ··· 2298 2294 do { \ 2299 2295 __asm__ __volatile__( \ 2300 2296 ".set\tpush\n\t" \ 2301 - ".set\tmips64r5\n\t" \ 2302 2297 _ASM_SET_DMTGC0 \ 2303 2298 "dmtgc0\t%z0, " #register ", %1\n\t" \ 2304 2299 _ASM_UNSET_DMTGC0 \