Re: [PATCH v2 24/25] KVM: x86: Introduce KVM_TDX_GET_CPUID

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

 



On Fri, 2024-11-01 at 14:39 +0800, Binbin Wu wrote:
> > +static int tdx_read_cpuid(struct kvm_vcpu *vcpu, u32 leaf, u32 sub_leaf,
> > +			  bool sub_leaf_set, struct kvm_cpuid_entry2 *out)
> > +{
> > +	struct kvm_tdx *kvm_tdx = to_kvm_tdx(vcpu->kvm);
> > +	u64 field_id = TD_MD_FIELD_ID_CPUID_VALUES;
> > +	u64 ebx_eax, edx_ecx;
> > +	u64 err = 0;
> > +
> > +	if (sub_leaf & TDX_MD_UNREADABLE_LEAF_MASK ||
> > +	    sub_leaf_set & TDX_MD_UNREADABLE_SUBLEAF_MASK)
> > +		return -EINVAL;
> It looks weird.
> Should be the following?
> 
> +	if (leaf & TDX_MD_UNREADABLE_LEAF_MASK ||
> +	    sub_leaf & TDX_MD_UNREADABLE_SUBLEAF_MASK)
> +		return -EINVAL;
> 

Yes, nice catch.




[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