[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 08/58] i386/tdx: Adjust the supported CPUID based on TDX r
From: |
Isaku Yamahata |
Subject: |
Re: [PATCH v2 08/58] i386/tdx: Adjust the supported CPUID based on TDX restrictions |
Date: |
Mon, 21 Aug 2023 16:00:54 -0700 |
On Fri, Aug 18, 2023 at 05:49:51AM -0400,
Xiaoyao Li <xiaoyao.li@intel.com> wrote:
> diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
> index 56cb826f6125..3198bc9fd5fb 100644
> --- a/target/i386/kvm/tdx.c
> +++ b/target/i386/kvm/tdx.c
...
> +static inline uint32_t host_cpuid_reg(uint32_t function,
> + uint32_t index, int reg)
> +{
> + uint32_t eax, ebx, ecx, edx;
> + uint32_t ret = 0;
> +
> + host_cpuid(function, index, &eax, &ebx, &ecx, &edx);
> +
> + switch (reg) {
> + case R_EAX:
> + ret |= eax;
> + break;
> + case R_EBX:
> + ret |= ebx;
> + break;
> + case R_ECX:
> + ret |= ecx;
> + break;
> + case R_EDX:
> + ret |= edx;
Nitpick: "|" isn't needed as we initialize ret = 0 above. Just '='.
--
Isaku Yamahata <isaku.yamahata@linux.intel.com>
- Re: [PATCH v2 04/58] target/i386: Introduce kvm_confidential_guest_init(), (continued)
- [PATCH v2 07/58] i386/tdx: Introduce is_tdx_vm() helper and cache tdx_guest object, Xiaoyao Li, 2023/08/18
- [PATCH v2 08/58] i386/tdx: Adjust the supported CPUID based on TDX restrictions, Xiaoyao Li, 2023/08/18
- Re: [PATCH v2 08/58] i386/tdx: Adjust the supported CPUID based on TDX restrictions,
Isaku Yamahata <=
- [PATCH v2 09/58] i386/tdx: Update tdx_cpuid_lookup[].tdx_fixed0/1 by tdx_caps.cpuid_config[], Xiaoyao Li, 2023/08/18
- [PATCH v2 10/58] i386/tdx: Integrate tdx_caps->xfam_fixed0/1 into tdx_cpuid_lookup, Xiaoyao Li, 2023/08/18
- [PATCH v2 11/58] i386/tdx: Integrate tdx_caps->attrs_fixed0/1 to tdx_cpuid_lookup, Xiaoyao Li, 2023/08/18
- [PATCH v2 12/58] i386/kvm: Move architectural CPUID leaf generation to separate helper, Xiaoyao Li, 2023/08/18
- [PATCH v2 13/58] kvm: Introduce kvm_arch_pre_create_vcpu(), Xiaoyao Li, 2023/08/18