]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blobdiff - arch/mips/kernel/cpu-probe.c
mips: properly account for stack randomization and stack guard gap
[mirror_ubuntu-eoan-kernel.git] / arch / mips / kernel / cpu-probe.c
index 9635c1db3ae6a95b62d576b7b1c7f260259e052d..e654ffc1c8a0d59e20aa8f3d0f6316e453ef69c5 100644 (file)
@@ -1964,6 +1964,13 @@ static inline void cpu_probe_ingenic(struct cpuinfo_mips *c, unsigned int cpu)
                c->cputype = CPU_JZRISC;
                c->writecombine = _CACHE_UNCACHED_ACCELERATED;
                __cpu_name[cpu] = "Ingenic JZRISC";
+               /*
+                * The XBurst core by default attempts to avoid branch target
+                * buffer lookups by detecting & special casing loops. This
+                * feature will cause BogoMIPS and lpj calculate in error.
+                * Set cp0 config7 bit 4 to disable this feature.
+                */
+               set_c0_config7(MIPS_CONF7_BTB_LOOP_EN);
                break;
        default:
                panic("Unknown Ingenic Processor ID!");