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

Re: [PATCH 1/3] x86: drop NOP_DS_PREFIX


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 23 Feb 2022 12:11:34 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=E5rtqIYRQyrk6uH1BJMVlZRSirGX8jY1S+9ht0rwAa4=; b=F+tVVK2TLL0LArofk0X/mLnk5sC/nvKzaeQsYHcgLl8HCcJHFl60vXnqedqaWepDlY1F4YLumHEm3FZtWG2oJAw4IkyP6hhW8Inx3v9Z9OTnSn06BvJ05WBCyZh/vlbqOPUtXHxFMe+IBN7Jq/LmcP80nlNYr/Ulq5Ntd8FjoBCd7hKoF1+J0F9D5x7GfmJarVa3eoy9ZpxXJdip++AiwjVIc2pGBbeqzKDdUVMQ1fH6Hqrw6OlQET+bh4rqQ2MFhbFRjugNuLAeMBWshVu6lqgIdNGLHzFcRP+j8uhLsh4ebkg+iyJFSzdhBvAqsuL3f5/Tl7lYZMCS0qmmBIsa8Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KpdoFjZy3b8/LHegeRiLsJrLDgrpJL90wcbACqrmTaf0rhATQnbhHSOJtp3kMg0q/NEgT2JyeUs0tPI5OyCVbFEe04mfseBRPm4kymeGrS31p/VKcggudz+N7ZTuwiItpTvxo3Vf0D7ywiOdu/8vXQOuF0tMEBqp6mCsaknhEp8usQ+Pk1AuDPhyK79qU8Crl1eysuK7l1ErxVAnsbC6iyDduUBX49FttUCGCLWW5mmonF4Y0Xls4JFijczZ4CxVwNqK28Vat5jhsHsOqR19THvDOmdOVDYY19H7GEvRvBNbK1ooG1MRGelSXh/OvSgXNawTBRrMuEylovN32lR7uQ==
  • 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 Monne <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 23 Feb 2022 11:11:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 23.02.2022 11:54, Andrew Cooper wrote:
> On 23/02/2022 10:12, Jan Beulich wrote:
>> This wasn't really necessary to introduce: The binutils change
>> permitting use of standalone "ds" (and "cs") in 64-bit code predates
>> the minimum binutils version we support.
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Thanks.

> I was never a fan of NOP_DS_PREFIX.  Far too verbose for what it's doing.
> 
>> ---
>> In fact we could patch _just_ the opcode prefix in flush_area_local().
>>
>> --- a/xen/arch/x86/flushtlb.c
>> +++ b/xen/arch/x86/flushtlb.c
>> @@ -247,8 +247,7 @@ unsigned int flush_area_local(const void
>>          {
>>              alternative("", "sfence", X86_FEATURE_CLFLUSHOPT);
>>              for ( i = 0; i < sz; i += c->x86_clflush_size )
>> -                alternative_input(".byte " __stringify(NOP_DS_PREFIX) ";"
>> -                                  " clflush %0",
>> +                alternative_input("ds; clflush %0",
> 
> Binutils appears to be happy with "ds clflush", i.e. treating it like a
> proper prefix on the instruction.  Drop the semicolon at the same time?

I'd rather not. A clever assembler may eliminate the prefix as redundant
when the base register isn't stack or frame pointer. In 64-bit mode an
assembler might even decide to eliminate all non-standalone segment
overrides using the pre-386 segment registers.

Jan




 


Rackspace

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