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

[PATCH 1/3] x86: drop NOP_DS_PREFIX


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 23 Feb 2022 11:12:29 +0100
  • 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=LI5XIykVTVe8uWmfaLRy4nPxEkgSqXOP7UAzhSepRo8=; b=MQfWo27d7mIgjjnQGS7Z25Qy6FxRjutcbfQLnL2d2TcexSI0PjmJ6mXhirglBBrd68rDlpCoL8Kv9rpZFeDv0gnNhMk3FHN7hGCRxL+ZZ8UhtxqPDf84wigBf5/fJDIjS0gim8i1KQxe7sxAgWzgK6MY6uw3vqAeDlx32qnwvaWc4JxODpo+tRrNmdJG5eX4yPi06p6MaiciIfPneNSlQWy5mv/lma7jaxBxpe8kADGSp1FpZ6F6ub3HLJC2FskxXIcLCgYFVpQKe0r0qEWchFZrktD6vbuJtYvOUdCaB8xNOygSW50JIC85qByucb4yIl0fYQ3D4kmq3q2aMILLFg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I8cJ3SunquUDnonYw6Ockk+aAATSSc52wp8pvvENqGSgjOVd73W0ccfD2SdVpEEZXJ+IQW10oscfLJmMK41kiFVxbQa+im+x7iLjHjUd2izuQ6O9Kjc5Tyk25MGf9JEElKFJAsg/xj0j4EHuOJ8XGNs+2mzKIJeztzdGYCoRWKn0jRJDql+8nZbdEnjteGnFGwIIcltlwkGj/RfGG0RZJRkbU1ofCJ6XRBSDdYLVf6v9MsTmz6yR6ZF51sBWzuVx/Joz3Dgs0k/OQbaLgKqgtJ+9zLDk2gKxR64Ha0RopRAe9da+kU+28ebcb9vWB4JtKIXTiadZATVoQKwZR6efIA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Wed, 23 Feb 2022 10:12:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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>
---
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",
                                   "data16 clflush %0",      /* clflushopt */
                                   X86_FEATURE_CLFLUSHOPT,
                                   "m" (((const char *)va)[i]));
@@ -298,11 +297,11 @@ void cache_writeback(const void *addr, u
 # define INPUT(addr) "a" (addr), BASE_INPUT(addr)
 #endif
         /*
-         * Note regarding the use of NOP_DS_PREFIX: it's faster to do a clflush
+         * Note regarding the "ds" prefix use: it's faster to do a clflush
          * + prefix than a clflush + nop, and hence the prefix is added instead
          * of letting the alternative framework fill the gap by appending nops.
          */
-        alternative_io_2(".byte " __stringify(NOP_DS_PREFIX) "; clflush %[p]",
+        alternative_io_2("ds; clflush %[p]",
                          "data16 clflush %[p]", /* clflushopt */
                          X86_FEATURE_CLFLUSHOPT,
                          CLWB_ENCODING,
--- a/xen/arch/x86/include/asm/nops.h
+++ b/xen/arch/x86/include/asm/nops.h
@@ -5,8 +5,6 @@
  * Define nops for use with alternative().
  */
 
-#define NOP_DS_PREFIX 0x3e
-
 /*
  * Opteron 64bit nops
  * 1: nop




 


Rackspace

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