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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'xtensa-20230716' of https://github.com/jcmvbkbc/linux-xtensa

Pull xtensa fixes from Max Filippov:

- fix interaction between unaligned exception handler and load/store
exception handler

- fix parsing ISS network interface specification string

- add comment about etherdev freeing to ISS network driver

* tag 'xtensa-20230716' of https://github.com/jcmvbkbc/linux-xtensa:
xtensa: fix unaligned and load/store configuration interaction
xtensa: ISS: fix call to split_if_spec
xtensa: ISS: add comment about etherdev freeing

+18 -22
+14 -20
arch/xtensa/kernel/align.S
··· 1 1 /* 2 2 * arch/xtensa/kernel/align.S 3 3 * 4 - * Handle unalignment exceptions in kernel space. 4 + * Handle unalignment and load/store exceptions. 5 5 * 6 6 * This file is subject to the terms and conditions of the GNU General 7 7 * Public License. See the file "COPYING" in the main directory of ··· 26 26 #define LOAD_EXCEPTION_HANDLER 27 27 #endif 28 28 29 - #if XCHAL_UNALIGNED_STORE_EXCEPTION || defined LOAD_EXCEPTION_HANDLER 29 + #if XCHAL_UNALIGNED_STORE_EXCEPTION || defined CONFIG_XTENSA_LOAD_STORE 30 + #define STORE_EXCEPTION_HANDLER 31 + #endif 32 + 33 + #if defined LOAD_EXCEPTION_HANDLER || defined STORE_EXCEPTION_HANDLER 30 34 #define ANY_EXCEPTION_HANDLER 31 35 #endif 32 36 33 - #if XCHAL_HAVE_WINDOWED 37 + #if XCHAL_HAVE_WINDOWED && defined CONFIG_MMU 34 38 #define UNALIGNED_USER_EXCEPTION 35 39 #endif 36 - 37 - /* First-level exception handler for unaligned exceptions. 38 - * 39 - * Note: This handler works only for kernel exceptions. Unaligned user 40 - * access should get a seg fault. 41 - */ 42 40 43 41 /* Big and little endian 16-bit values are located in 44 42 * different halves of a register. HWORD_START helps to ··· 226 228 #ifdef ANY_EXCEPTION_HANDLER 227 229 ENTRY(fast_unaligned) 228 230 229 - #if XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION 230 - 231 231 call0 .Lsave_and_load_instruction 232 232 233 233 /* Analyze the instruction (load or store?). */ ··· 240 244 /* 'store indicator bit' not set, jump */ 241 245 _bbci.l a4, OP1_SI_BIT + INSN_OP1, .Lload 242 246 243 - #endif 244 - #if XCHAL_UNALIGNED_STORE_EXCEPTION 247 + #ifdef STORE_EXCEPTION_HANDLER 245 248 246 249 /* Store: Jump to table entry to get the value in the source register.*/ 247 250 ··· 249 254 addx8 a5, a6, a5 250 255 jx a5 # jump into table 251 256 #endif 252 - #if XCHAL_UNALIGNED_LOAD_EXCEPTION 257 + #ifdef LOAD_EXCEPTION_HANDLER 253 258 254 259 /* Load: Load memory address. */ 255 260 ··· 323 328 mov a14, a3 ; _j .Lexit; .align 8 324 329 mov a15, a3 ; _j .Lexit; .align 8 325 330 #endif 326 - #if XCHAL_UNALIGNED_STORE_EXCEPTION 331 + #ifdef STORE_EXCEPTION_HANDLER 327 332 .Lstore_table: 328 333 l32i a3, a2, PT_AREG0; _j .Lstore_w; .align 8 329 334 mov a3, a1; _j .Lstore_w; .align 8 # fishy?? ··· 343 348 mov a3, a15 ; _j .Lstore_w; .align 8 344 349 #endif 345 350 346 - #ifdef ANY_EXCEPTION_HANDLER 347 351 /* We cannot handle this exception. */ 348 352 349 353 .extern _kernel_exception ··· 371 377 372 378 2: movi a0, _user_exception 373 379 jx a0 374 - #endif 375 - #if XCHAL_UNALIGNED_STORE_EXCEPTION 380 + 381 + #ifdef STORE_EXCEPTION_HANDLER 376 382 377 383 # a7: instruction pointer, a4: instruction, a3: value 378 384 .Lstore_w: ··· 438 444 s32i a6, a4, 4 439 445 #endif 440 446 #endif 441 - #ifdef ANY_EXCEPTION_HANDLER 447 + 442 448 .Lexit: 443 449 #if XCHAL_HAVE_LOOPS 444 450 rsr a4, lend # check if we reached LEND ··· 533 539 __src_b a4, a4, a5 # a4 has the instruction 534 540 535 541 ret 536 - #endif 542 + 537 543 ENDPROC(fast_unaligned) 538 544 539 545 ENTRY(fast_unaligned_fixup)
+2 -1
arch/xtensa/kernel/traps.c
··· 102 102 #endif 103 103 { EXCCAUSE_INTEGER_DIVIDE_BY_ZERO, 0, do_div0 }, 104 104 /* EXCCAUSE_PRIVILEGED unhandled */ 105 - #if XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION 105 + #if XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION || \ 106 + IS_ENABLED(CONFIG_XTENSA_LOAD_STORE) 106 107 #ifdef CONFIG_XTENSA_UNALIGNED_USER 107 108 { EXCCAUSE_UNALIGNED, USER, fast_unaligned }, 108 109 #endif
+2 -1
arch/xtensa/platforms/iss/network.c
··· 237 237 238 238 init += sizeof(TRANSPORT_TUNTAP_NAME) - 1; 239 239 if (*init == ',') { 240 - rem = split_if_spec(init + 1, &mac_str, &dev_name); 240 + rem = split_if_spec(init + 1, &mac_str, &dev_name, NULL); 241 241 if (rem != NULL) { 242 242 pr_err("%s: extra garbage on specification : '%s'\n", 243 243 dev->name, rem); ··· 540 540 rtnl_unlock(); 541 541 pr_err("%s: error registering net device!\n", dev->name); 542 542 platform_device_unregister(&lp->pdev); 543 + /* dev is freed by the iss_net_pdev_release callback */ 543 544 return; 544 545 } 545 546 rtnl_unlock();