Re: [PATCH 01/23] x86, kaiser: prepare assembly for entry/exit CR3 switching

From: Borislav Petkov
Date: Wed Nov 01 2017 - 16:42:54 EST


On Wed, Nov 01, 2017 at 11:27:48AM -0700, Dave Hansen wrote:
> This allows for a tiny optimization of Andy's that I realize I must have
> blown away at some point. It lets us do a 32-bit-register instruction
> (and using %eXX) when checking KAISER_SWITCH_MASK instead of a 64-bit
> register via %rXX.
>
> I don't feel strongly about maintaining that optimization it looks weird
> and surely doesn't actually do much.

Yeah, and consistent syntax would probably bring more.

> Thanks for catching that. We can kill one of these. I'm inclined to
> kill the first one. Looking at the second one since we've just saved
> off ptregs, that should make %rdi safe to clobber without the push/pop
> at all.
>
> Does that seem like it would work?

Yap, sounds about right.

Thx.

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.