Re: [RFC] Check if X86_FEATURE_OSPKE is supported before accessing pkru

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/04/19 17:43, Xiexiangyou wrote:
> 1. The VM is migrated from the A host to the B host. The A host is configured
>    with nopku but the B host is not.
> 2. The VM has an internal restart on the B host. The "setup_pku" is executed
>    during the booting of the VM kernel. Because pku is supported, CR4.PKE is set.
> 3. Next, migrate the VM from the B host back to the A host. Panic will be
>    triggered. Because vcpu vmexit will do host pkru restoring if guest_CR4.PKE
>    is enabled.

The VM should have never been migrated to host B, since it does not 
support setting guest CPUID.PKU

                        /* PKU is not yet implemented for shadow paging. */
                        if (!tdp_enabled || !boot_cpu_has(X86_FEATURE_OSPKE))
                                entry->ecx &= ~F(PKU);

Paolo



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux