Messages in this thread | | | Date | Thu, 26 May 2005 21:15:26 +0200 | From | Mikael Pettersson <> | Subject | Re: 2.6.12-rc5-mm1 |
| |
Andrea Arcangeli writes: > Speed is not an issue, cr4 would never be tweaked unless you use > seccomp, the cr4 flip is in an extreme slow path. > > I think there are two ways to solve this race: > > 1) why don't we read the cr4 from the cpu? would movl %%cr4, %%eax > generate a general protection fault? Can the cr4 be read in ring 0? > Why to read it from memory if we've that information in the cpu already?
Yes the kernel can read cr4. I believe the best solution is to modify __flush_tlb_global() to read cr4's current value and mix it in when toggling CR4.PGE and uploading mmu_cr4_features. (But please make it conditional on CONFIG_SECCOMP.)
The code called from __switch_to() would have to set or clear cr4 locally only. That's easy using write_cr4() and read_cr4().
/Mikael - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |