On Thu, 25 Feb 2016, Huacai Chen wrote: > Please read my explaination: New Loongson 3 has a bug that di > instruction can not save the irqflag, so arch_local_irq_save() is > modified. Since CPU_MIPSR2 is selected by > CONFIG_LOONGSON3_ENHANCEMENT, generic kernel doesn't use ei/di at all > (because old Loongson 3 doesn't support ei/di at all). Thanks. This opens an interesting question though. You've written that the enhancements controlled by CONFIG_LOONGSON3_ENHANCEMENT cannot be determined at the run time, but it looks to me like they can, either by checking for MIPSr2 in the CP0.Config.AR or, if you did something wrong about that, by trying to execute EI or DI early on and seeing if it's triggered an RI exception or not. Have I missed anything? Maciej