On 12/17/24 04:25, Kirill A. Shutemov wrote: >> Clear the PGE bit in %cr4 early, before storing data in the control page. > It worth noting that flipping CR4.PGE triggers TLB flush. I was not sure > if CR3 write is required to make it happen. I thought about removing the CR3 write. But I decided against it because CR4.PGE needs to actually change value, unlike CR3 writes where any write can flush the TLB (modulo globals, PCID and bit 63 of course). X86_FEATURE_PGE itself is required but I couldn't actually remember if there are any cases where CR4.PGE==0. If there were, the CR3 write would still be needed. I don't _think_ there are any ways forx86_64 to end up with CR4.PGE==0, but I also wouldn't out the possibility that some silly issue pops up making us play stupid games and win stupid prizes. Anyway, I think we can leave the belt-and-suspenders programming in this case. A comment wouldn't hurt I guess.