On 13/07/2017 03:02, Junkang Fu wrote: > There is no need to do the opposite in load_xsave or > setting vmx->guest_pkru_valid. > the right guest_pkru will be restored as long as the right guest_pkru > was saved. > Without this patch Pkeys self-tests (commit 5f23f6d082a9) may reports > _rdpkru: Assertion `pkru == shadow_pkru' failed on migration Even if it is restored correctly, you will have the wrong PKRU on the host between kvm_load_guest_fpu and entering the guest. I think it's safer to do the symmetric change to load_xsave. Paolo