Hi, Maciej, 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). Huacai On Thu, Feb 25, 2016 at 8:49 AM, Maciej W. Rozycki <macro@xxxxxxxxxx> wrote: > On Wed, 24 Feb 2016, Huacai Chen wrote: > >> This patch introduce a config option, CONFIG_LOONGSON3_ENHANCEMENT, to >> enable those enhancements which cannot be probed at run time. If you >> want a generic kernel to run on all Loongson 3 machines, please say 'N' >> here. If you want a high-performance kernel to run on new Loongson 3 >> machines only, please say 'Y' here. > [...] >> diff --git a/arch/mips/include/asm/irqflags.h b/arch/mips/include/asm/irqflags.h >> index 65c351e..9d3610b 100644 >> --- a/arch/mips/include/asm/irqflags.h >> +++ b/arch/mips/include/asm/irqflags.h >> @@ -41,7 +41,12 @@ static inline unsigned long arch_local_irq_save(void) >> " .set push \n" >> " .set reorder \n" >> " .set noat \n" >> +#if defined(CONFIG_CPU_LOONGSON3) >> + " mfc0 %[flags], $12 \n" >> + " di \n" >> +#else >> " di %[flags] \n" >> +#endif >> " andi %[flags], 1 \n" >> " " __stringify(__irq_disable_hazard) " \n" >> " .set pop \n" > > This part does not appear related to CONFIG_LOONGSON3_ENHANCEMENT -- > please either fold it into one of the other changes in the set, if there's > one it really belongs to, or make it an entirely separate change > otherwise. > > Maciej >