Re: [PATCH v4 2/9] KVM: x86: MMU: Clear CR3 LAM bits when allocate shadow root

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

 




On 2/9/2023 10:40 AM, Robert Hoo wrote:

[...]


-
+#ifdef CONFIG_X86_64
+	root_pgd = mmu->get_guest_pgd(vcpu) & ~(X86_CR3_LAM_U48 | X86_CR3_LAM_U57);
+#else
  	root_pgd = mmu->get_guest_pgd(vcpu);
+#endif

I prefer using:

root_pgd = mmu->get_guest_pgd(vcpu);

if (IS_ENABLED(CONFIG_X86_64))

    root_pgd &= ~(X86_CR3_LAM_U48 | X86_CR3_LAM_U57);

I looks more structured.


  	root_gfn = root_pgd >> PAGE_SHIFT;
if (mmu_check_root(vcpu, root_gfn))



[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