[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cfed8876-332a-569b-2bad-7e1789f139e2@redhat.com>
Date: Fri, 10 Dec 2021 22:52:43 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Yang Zhong <yang.zhong@...el.com>, x86@...nel.org,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com
Cc: seanjc@...gle.com, jun.nakajima@...el.com, kevin.tian@...el.com,
jing2.liu@...ux.intel.com, jing2.liu@...el.com
Subject: Re: [PATCH 19/19] kvm: x86: Add AMX CPUIDs support
On 12/8/21 01:03, Yang Zhong wrote:
> @@ -914,7 +918,8 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
> break;
> /* Intel PT */
> case 0x14:
> - if (!kvm_cpu_cap_has(X86_FEATURE_INTEL_PT)) {
> + if ((function == 0x14 && !kvm_cpu_cap_has(X86_FEATURE_INTEL_PT)) ||
> + (function == 0x1d && !kvm_cpu_cap_has(X86_FEATURE_AMX_TILE))) {
This hunk is wrong.
> entry->eax = entry->ebx = entry->ecx = entry->edx = 0;
> break;
> }
> @@ -924,6 +929,11 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
> goto out;
> }
> break;
> + /* Intel AMX TILE */
> + case 0x1d:
> + if (!kvm_cpu_cap_has(X86_FEATURE_AMX_TILE))
> + entry->eax = entry->ebx = entry->ecx = entry->edx = 0;
> + break;
This also needs a loop similar to the one in case 0x14; so the "break"
goes inside the "if" and then you have
for (i = 1, max_idx = entry->eax; i <= max_idx; ++i) {
if (!do_host_cpuid(array, function, i))
goto out;
}
Same for 0x1e, which also needs to be marked conditional.
Paolo
Powered by blists - more mailing lists