2021-05-11 19:11:59

by Dave Hansen

[permalink] [raw]
Subject: Re: [PATCH v3] KVM: x86: use wrpkru directly in kvm_load_{guest|host}_xsave_state

On 5/11/21 10:05 AM, Jon Kohler wrote:
> To improve performance, use wrpkru directly in KVM code and simplify
> the uses of __write_pkru such that it can be removed completely.

I don't love the repeated:

+ if (pkru_val != rdpkru())
+ wrpkru(pkru_val);

But, all of the w*pkru() variants were getting confusing, even to me. :)

Being explicit about the "wkpkru suppression" in a limited number of
places looks fine.

Acked-by: Dave Hansen <[email protected]>