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

[PATCH 3/3] x86/kexec: Annotate functions with ELF metadata


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 17 Feb 2023 17:48:14 +0000
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Fri, 17 Feb 2023 17:49:08 +0000
  • Ironport-data: A9a23:6pGO3a9+L3jit0PR2HqfDrUDln6TJUtcMsCJ2f8bNWPcYEJGY0x3n GsYXGuDMqmLNzfxct53b4u//E5U6JXUn941GgBs/yE8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk d7pqojUNUTNNwRcawr40Ire7kIw1BjOkGlA5AdmP6kU5AW2e0Q9V/rzG4ngdxMUfaEMdgKKb 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDklB+ sA8MDxdMSuTmvyUnr28CbdMlPwseZyD0IM34hmMzBncBPciB5vCX7/L9ZlT2zJYasJmRKiEI ZBDMHw2MUqGOkcUUrsUIMtWcOOAr3/zaTBH7nmSorI6+TP7xw1tyrn9dtHSf7RmQO0EwBbJ+ TOZrgwVBDkrLNbGwn2I4kj3l7H9pBPaZN4CGu2Bo6sCbFq7mTVIVUx+uUGAiem0jAuyVsxSL 2QQ+zEytu4i+UqzVN7/Uhak5nmesXY0efBdDuk74wGl0bfP7kCSAW1sZiFFQMwrsokxXzNC6 7OSt4q3X3o16uTTEC/DsO7O9lteJBT5M0cNahMgVQdVvOLzvZ8R0B3IDYhDApa624id9S7L/ xiGqy03hrM2hMEN1rmm8V2vvw9AtqQlXSZuuFyJAzvNAhdRIdf8Otf2sQSzAeNodt7xc7WXg JQTdyFyBsgqBIrFqiGCSf5l8FqBt6fca220bbKC8vAcG9WRF5yLJ9w4DNJWfh0B3iM4ldjBO Ra7hO+pzMUPVEZGlIcuC25LN+wkzLL7CfPuXe3OY9xFb/BZLVHYonwxPxLIjzu2wCDAdJ3T3 r/BLK6R4YsyU/w7nFJauc9DuVPU+szO7TyKHs2qp/hW+bGfeGSUWd843KimN4gEAFe/iFyNq b53bpLaoyizpcWiOkE7B6ZPdwFVRZX6bLiqw/FqmhmreVY3RjhxU6WKntvMueVNxsxoqwsBx VnlMmcw9bY1rSevxdmiApy7VI7SYA==
  • Ironport-hdrordr: A9a23:1N5Kzao2CEnA+oDbgt0Dg3oaV5oUeYIsimQD101hICG9vPbo7v xG/c5rrSMc7Qx6ZJhOo6HkBEDtewK/yXcx2/hzAV7AZmjbUQmTXeVfBOLZqlWKJ8S9zI5gPM xbAs9D4bPLfD5HZAXBjDVQ0exM/DBKys+VbC7loUtQcQ==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

All of kexec_reloc(), relocate_pages() and compatibility_mode() are
function-like.  Annotate them appropriately.

Furthermore, move the data into a different cacheline from the code, so the
relocation of compat_mode_gdt_desc doesn't trigger self-modifying safety logic
in the pipeline.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
CC: Wei Liu <wl@xxxxxxx>
---
 xen/arch/x86/x86_64/kexec_reloc.S | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/x86_64/kexec_reloc.S 
b/xen/arch/x86/x86_64/kexec_reloc.S
index a81f64146190..c7fc11fa5868 100644
--- a/xen/arch/x86/x86_64/kexec_reloc.S
+++ b/xen/arch/x86/x86_64/kexec_reloc.S
@@ -13,6 +13,7 @@
 
         .file __FILE__
 
+#include <xen/cache.h>
 #include <xen/kimage.h>
 
 #include <asm/asm_defns.h>
@@ -90,7 +91,10 @@ ENTRY(kexec_reloc)
         push    %rax
         lretq
 
-relocate_pages:
+        .type kexec_reloc, @function
+        .size kexec_reloc, . - kexec_reloc
+
+ENTRY(relocate_pages)
         /* %rdi - indirection page maddr */
         pushq   %rbx
 
@@ -137,9 +141,12 @@ relocate_pages:
         popq    %rbx
         ret
 
+        .type relocate_pages, @function
+        .size relocate_pages, . - relocate_pages
+
         .code32
 
-compatibility_mode:
+ENTRY(compatibility_mode)
         /* Setup some sane segments. */
         movl    $0x0008, %eax
         movl    %eax, %ds
@@ -167,7 +174,14 @@ compatibility_mode:
         call    *%ebp
         ud2
 
-        .align 4
+        .type compatibility_mode, @function
+        .size compatibility_mode, . - compatibility_mode
+
+        /*
+         * Ensure data is in a different cache line to code.
+         */
+        .align SMP_CACHE_BYTES, 0
+
 compat_mode_gdt_desc:
         .word .Lcompat_mode_gdt_end - compat_mode_gdt -1
         .quad . - kexec_reloc        /* Relocated before use */
-- 
2.30.2




 


Rackspace

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