Hi, Maciej, Yes, we can probe whether the platform support ei/di or not. But whether use ei/di is not depend on runtime flag, but depend on CONFIG_* in current kernel. So I have no idea how to use ei/di by probing. Huacai On Thu, Feb 25, 2016 at 8:25 PM, Maciej W. Rozycki <macro@xxxxxxxxxx> wrote: > 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 >