[PATCH 42/48] MIPS: Correct ISA masking in FPU feature determination

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Correct an ISA level determination problem introduced with 8b8aa636 
[MIPS: kernel: cpu-probe.c: Add support for MIPS R6], reverting explicit 
masking against individual `MIPS_CPU_ISA_*' macros in FPU feature 
determination.

Feature macros such as `cpu_has_mips_r' cannot be used here, because 
they operate on CPU #0 and we want to refer to the current CPU instead.  
They cannot be used for masking against the current CPU either because 
they mask against CPU #0 too, e.g.:

# define cpu_has_mips32r1	(cpu_data[0].isa_level & MIPS_CPU_ISA_M32R1)

Cc: Leonid Yegoshin <Leonid.Yegoshin@xxxxxxxxxx>
Signed-off-by: Maciej W. Rozycki <macro@xxxxxxxxxxxxxx>
---
linux-mips-fpu-probe-isa.diff
Index: linux/arch/mips/kernel/cpu-probe.c
===================================================================
--- linux.orig/arch/mips/kernel/cpu-probe.c	2015-04-02 20:27:52.971189000 +0100
+++ linux/arch/mips/kernel/cpu-probe.c	2015-04-02 20:27:58.700229000 +0100
@@ -1367,7 +1367,9 @@ void cpu_probe(void)
 	if (c->options & MIPS_CPU_FPU) {
 		c->fpu_id = cpu_get_fpu_id();
 
-		if (c->isa_level & cpu_has_mips_r) {
+		if (c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M64R1 |
+				    MIPS_CPU_ISA_M32R2 | MIPS_CPU_ISA_M64R2 |
+				    MIPS_CPU_ISA_M32R6 | MIPS_CPU_ISA_M64R6)) {
 			if (c->fpu_id & MIPS_FPIR_3D)
 				c->ases |= MIPS_ASE_MIPS3D;
 			if (c->fpu_id & MIPS_FPIR_FREP)





[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux