lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ