Merge tag 'arc-4.11-final' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc

Pull ARC fix from Vineet Gupta:
"Last minute fixes for ARC:

- build error in Mellanox nps platform

- addressing lack of saving FPU regs in releavnt configs"

* tag 'arc-4.11-final' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
ARCv2: entry: save Accumulator register pair (r58:59) if present
ARC: [plat-eznps] Fix build error

Changed files
+45 -10
arch
arc
+8
arch/arc/Kconfig
··· 406 406 bool "Insn: div, divu, rem, remu" 407 407 default y 408 408 409 + config ARC_HAS_ACCL_REGS 410 + bool "Reg Pair ACCL:ACCH (FPU and/or MPY > 6)" 411 + default n 412 + help 413 + Depending on the configuration, CPU can contain accumulator reg-pair 414 + (also referred to as r58:r59). These can also be used by gcc as GPR so 415 + kernel needs to save/restore per process 416 + 409 417 endif # ISA_ARCV2 410 418 411 419 endmenu # "ARC CPU Configuration"
+2 -1
arch/arc/include/asm/atomic.h
··· 17 17 #include <asm/barrier.h> 18 18 #include <asm/smp.h> 19 19 20 + #define ATOMIC_INIT(i) { (i) } 21 + 20 22 #ifndef CONFIG_ARC_PLAT_EZNPS 21 23 22 24 #define atomic_read(v) READ_ONCE((v)->counter) 23 - #define ATOMIC_INIT(i) { (i) } 24 25 25 26 #ifdef CONFIG_ARC_HAS_LLSC 26 27
+10
arch/arc/include/asm/entry-arcv2.h
··· 16 16 ; 17 17 ; Now manually save: r12, sp, fp, gp, r25 18 18 19 + #ifdef CONFIG_ARC_HAS_ACCL_REGS 20 + PUSH r59 21 + PUSH r58 22 + #endif 23 + 19 24 PUSH r30 20 25 PUSH r12 21 26 ··· 79 74 1: 80 75 POP r12 81 76 POP r30 77 + 78 + #ifdef CONFIG_ARC_HAS_ACCL_REGS 79 + POP r58 80 + POP r59 81 + #endif 82 82 83 83 .endm 84 84
+4
arch/arc/include/asm/ptrace.h
··· 86 86 87 87 unsigned long r12, r30; 88 88 89 + #ifdef CONFIG_ARC_HAS_ACCL_REGS 90 + unsigned long r58, r59; /* ACCL/ACCH used by FPU / DSP MPY */ 91 + #endif 92 + 89 93 /*------- Below list auto saved by h/w -----------*/ 90 94 unsigned long r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11; 91 95
+21 -9
arch/arc/kernel/setup.c
··· 319 319 static void arc_chk_core_config(void) 320 320 { 321 321 struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; 322 - int fpu_enabled; 322 + int saved = 0, present = 0; 323 + char *opt_nm = NULL;; 323 324 324 325 if (!cpu->extn.timer0) 325 326 panic("Timer0 is not present!\n"); ··· 347 346 348 347 /* 349 348 * FP hardware/software config sanity 350 - * -If hardware contains DPFP, kernel needs to save/restore FPU state 349 + * -If hardware present, kernel needs to save/restore FPU state 351 350 * -If not, it will crash trying to save/restore the non-existant regs 352 - * 353 - * (only DPDP checked since SP has no arch visible regs) 354 351 */ 355 - fpu_enabled = IS_ENABLED(CONFIG_ARC_FPU_SAVE_RESTORE); 356 352 357 - if (cpu->extn.fpu_dp && !fpu_enabled) 358 - pr_warn("CONFIG_ARC_FPU_SAVE_RESTORE needed for working apps\n"); 359 - else if (!cpu->extn.fpu_dp && fpu_enabled) 360 - panic("FPU non-existent, disable CONFIG_ARC_FPU_SAVE_RESTORE\n"); 353 + if (is_isa_arcompact()) { 354 + opt_nm = "CONFIG_ARC_FPU_SAVE_RESTORE"; 355 + saved = IS_ENABLED(CONFIG_ARC_FPU_SAVE_RESTORE); 356 + 357 + /* only DPDP checked since SP has no arch visible regs */ 358 + present = cpu->extn.fpu_dp; 359 + } else { 360 + opt_nm = "CONFIG_ARC_HAS_ACCL_REGS"; 361 + saved = IS_ENABLED(CONFIG_ARC_HAS_ACCL_REGS); 362 + 363 + /* Accumulator Low:High pair (r58:59) present if DSP MPY or FPU */ 364 + present = cpu->extn_mpy.dsp | cpu->extn.fpu_sp | cpu->extn.fpu_dp; 365 + } 366 + 367 + if (present && !saved) 368 + pr_warn("Enable %s for working apps\n", opt_nm); 369 + else if (!present && saved) 370 + panic("Disable %s, hardware NOT present\n", opt_nm); 361 371 } 362 372 363 373 /*