[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/8] target/i386: return bool from x86_cpu_filter_features
From: |
Zhao Liu |
Subject: |
Re: [PATCH 3/8] target/i386: return bool from x86_cpu_filter_features |
Date: |
Wed, 30 Oct 2024 13:19:01 +0800 |
[snip]
> @@ -7558,7 +7558,7 @@ void x86_cpu_expand_features(X86CPU *cpu, Error **errp)
> *
> * Returns: 0 if all flags are supported by the host, non-zero otherwise.
Comment can be updated as well. :-)
Returns: true if any flag is not supported by the host, false otherwise.
> */
> -static void x86_cpu_filter_features(X86CPU *cpu, bool verbose)
> +static bool x86_cpu_filter_features(X86CPU *cpu, bool verbose)
> {
> CPUX86State *env = &cpu->env;
> FeatureWord w;
> @@ -7610,6 +7610,8 @@ static void x86_cpu_filter_features(X86CPU *cpu, bool
> verbose)
> mark_unavailable_features(cpu, FEAT_7_0_EBX,
> CPUID_7_0_EBX_INTEL_PT, prefix);
> }
> }
> +
> + return x86_cpu_have_filtered_features(cpu);
> }
>
> static void x86_cpu_hyperv_realize(X86CPU *cpu)
> @@ -7707,14 +7709,14 @@ static void x86_cpu_realizefn(DeviceState *dev, Error
> **errp)
> }
> }
>
> - x86_cpu_filter_features(cpu, cpu->check_cpuid || cpu->enforce_cpuid);
> -
> - if (cpu->enforce_cpuid && x86_cpu_have_filtered_features(cpu)) {
> - error_setg(&local_err,
> - accel_uses_host_cpuid() ?
> + if (x86_cpu_filter_features(cpu, cpu->check_cpuid ||
> cpu->enforce_cpuid)) {
> + if (cpu->enforce_cpuid) {
> + error_setg(&local_err,
It seems that we don't need local_err here, as this function already has
an errp parameter. I will clean up the error handling of this function
later.
> + accel_uses_host_cpuid() ?
> "Host doesn't support requested features" :
> "TCG doesn't support requested features");
> - goto out;
> + goto out;
> + }
> }
LGTM,
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
- [PATCH v2 0/8] Add AVX10.1 CPUID support and GraniteRapids-v2 model, Paolo Bonzini, 2024/10/29
- [PATCH 5/8] target/i386: add CPUID.24 features for AVX10, Paolo Bonzini, 2024/10/29
- [PATCH 1/8] target/i386: cpu: set correct supported XCR0 features for TCG, Paolo Bonzini, 2024/10/29
- [PATCH 6/8] target/i386: Add feature dependencies for AVX10, Paolo Bonzini, 2024/10/29
- [PATCH 3/8] target/i386: return bool from x86_cpu_filter_features, Paolo Bonzini, 2024/10/29
- Re: [PATCH 3/8] target/i386: return bool from x86_cpu_filter_features,
Zhao Liu <=
- [PATCH 4/8] target/i386: add AVX10 feature and AVX10 version property, Paolo Bonzini, 2024/10/29
- Re: [PATCH 4/8] target/i386: add AVX10 feature and AVX10 version property, Tao Su, 2024/10/29
- Re: [PATCH 4/8] target/i386: add AVX10 feature and AVX10 version property, Zhao Liu, 2024/10/30
- Re: [PATCH 4/8] target/i386: add AVX10 feature and AVX10 version property, Tao Su, 2024/10/30
- Re: [PATCH 4/8] target/i386: add AVX10 feature and AVX10 version property, Zhao Liu, 2024/10/30
- Re: [PATCH 4/8] target/i386: add AVX10 feature and AVX10 version property, Tao Su, 2024/10/30
- Re: [PATCH 4/8] target/i386: add AVX10 feature and AVX10 version property, Zhao Liu, 2024/10/30
- Re: [PATCH 4/8] target/i386: add AVX10 feature and AVX10 version property, Tao Su, 2024/10/31
- Re: [PATCH 4/8] target/i386: add AVX10 feature and AVX10 version property, Xiaoyao Li, 2024/10/31