Earlier quoted context omitted.
The one reason I can imagine to make it privileged-only is that it could be high-overhead to switch: if a CPU conditioned various kinds of predictors on it, it might have to flush those predictors when toggling it.
IMO the best design would be to keep the flag with the data. Give each register an extra bit indicating whether it’s sensitive. Any data-dependent-timing operation can’t possibly leak the data until the data is available to it, and that’s exactly when the ALU would find out that the data is sensitive anyway. No pipeline stalls.
Re: Constant-time support coming to LLVM: Protecting cryptographic code
#61Makes sense, but "give each register an extra bit" seems like something that would very easily get lost with a spill or any number of other ways.