Re: [PATCH v7 4/5] KVM: x86: Untag address when LAM applicable

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

 



On Tue, 2023-04-04 at 21:09 +0800, Binbin Wu wrote:
>  	case VMX_VPID_EXTENT_INDIVIDUAL_ADDR:
> +		/* invvpid is not valid in compatibility mode */
> +		if (is_long_mode(vcpu))
> +			operand.gla = vmx_untag_addr(vcpu, operand.gla, 0);

This comment doesn't make sense.  The code does nothing to distinguish the
compatibility mode and the 64-bit mode.

Now although we are all clear that here is_long_mode() basically equals to
is_64_bit_mode(), but I do think we need a comment or WARN() _SOMEWHERE_ to
indicate that compatibility mode is not possible when handling VMEXIT for VMX
instructions (except VMCALL).  Not everyone will be able to notice this small
thing in the SDM.

Then you can just delete this comment here.

Alternatively, for better readability actually I am thinking maybe we should
just use is_64_bit_mode(), because those segments are cached by KVM anyway so I
don't think there's measurable performance difference between is_long_mode() and
is_64_bit_mode().

Sean, any comments?




[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