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

Re: [PATCH 8/9] x86emul: support AVX-NE-CONVERT insns


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 17 Apr 2023 14:50:59 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YkNfOviI4hf1AzPUv3CbDAXMwM+GNKcA60lFWDNu3Zg=; b=aMNwt2n9G6K6fDxY3mjZGzYmNbqLgZfOXF4yixK+HEgLgPMQG3/IwPBR0z+whooe8Cw4NIC3arz+6Xh2tls7F4H8lm3oq0eYtuO+Me1M5qNxaaxJJaDhW2lZAUGS7GQI4ayi0q4jopH/mrv9bsrtQ13ein/08Ae8NuTRkl4Yl44QHZ5NIhbK296qZr0aW64UkhyxL69zObZ09KDXit2FcWHfCh0YkbavfvUcPBi7o0P/zXC6CY9h8vzLQfewBJnKGtoyNqCWvRAwjuZX28pz2G+XlmSYv6UQV933KDOu9la8ITwfRrMevdbZLdasUuZt5ura867dY4gMKJjawSuDyw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AyO7EAA4USMbp63Kr6iijrENMI7rzHjsGKHr4WP1u+ipxxfhyCmUajt9vtTYVVlDNnOGhvBdLu0HeooRoxSHKu5kce+5FK4EiJY7ZhFRCbJwL5KMkjs7UF2A01iBe89MqCrt9/EjLKhmqVBZTpPl3SK1/VkXdCMtvAtw2rq+JxgECb2cKkQzQAZCiC0PQDRS4lT5wgEnoD09mBeV5F17mdba+/W6VABxSyzV03x3agq/Iv+qPcQUgqsUsor4pJkCh6j1kNIubhe8Q2aOSdZMXb9jPii9LmNWrhCDIAuj1F9TNQ9WxZePKwdD7mVhry/ojOV6mskTbl6hMRlENc5s7A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 17 Apr 2023 12:51:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 06.04.2023 23:22, Andrew Cooper wrote:
> On 04/04/2023 3:54 pm, Jan Beulich wrote:
>> Matching what was done earlier, explicit tests are added only for
>> irregular insn / memory access patterns.
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>,

Thanks.

> with two minor requests.
> 
>> --- a/tools/misc/xen-cpuid.c
>> +++ b/tools/misc/xen-cpuid.c
>> @@ -214,7 +214,7 @@ static const char *const str_7c1[32] =
>>  
>>  static const char *const str_7d1[32] =
>>  {
>> -    [ 4] = "avx-vnni-int8",
>> +    [ 4] = "avx-vnni-int8", [ 5] = "avx-ne-convert",
> 
> I'd leave a bit more horizontal space.  These names are getting rather
> long, and we're only 10% into this word.

Sure. I had taken neighboring arrays as reference; I've now switched
to "aligning" with rtm-always-abort.

>> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
>> @@ -6208,6 +6208,19 @@ x86_emulate(
>>          host_and_vcpu_must_have(avx512_vbmi2);
>>          goto avx512f_no_sae;
>>  
>> +    case X86EMUL_OPC_VEX   (0x0f38, 0xb0): /* vcvtneoph2ps mem,[xy]mm */
>> +    case X86EMUL_OPC_VEX_66(0x0f38, 0xb0): /* vcvtneeph2ps mem,[xy]mm */
>> +    case X86EMUL_OPC_VEX_F3(0x0f38, 0xb0): /* vcvtneebf162ps mem,[xy]mm */
>> +    case X86EMUL_OPC_VEX_F2(0x0f38, 0xb0): /* vcvtneobf162ps mem,[xy]mm */
>> +        generate_exception_if(ea.type != OP_MEM, EXC_UD);
>> +        /* fall through */
> 
> Only just occurred to me, but we should probably be using fallthrough;
> in new code, now there's a real attribute to use.

I did actually consider doing so (and iirc also already on an earlier
occasion), but that'll be yet another item we also need to cater for
in the harness'es x86-emulate.h. For the moment I prefer to stick to
comments, switching over - if necessary for e.g. Misra - all in one
go at some point.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.