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

Dave Hansen
2021-05-11T19:08:53Z

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 <dave.hansen@intel.com>