File x86-Spectre-multicall.patch of Package xen.7652

x86/pv: Protect multicalls against Spectre v2 - Branch Target Injection

This is a missing adjustment in c/s 88602190f69 "x86: Support indirect thunks
from assembly code".

This is part of XSA-254.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>

--- sle12sp2.orig/xen/include/asm-x86/multicall.h	2017-07-07 17:40:14.000000000 +0200
+++ sle12sp2/xen/include/asm-x86/multicall.h	2018-05-18 12:19:44.677455911 +0200
@@ -34,7 +34,7 @@ enum mc_disposition {
             "    movq  %c2+3*%c3(%0),%%rcx; "                \
             "    movq  %c2+4*%c3(%0),%%r8; "                 \
             "    movq  %c2+5*%c3(%0),%%r9; "                 \
-            "    callq *%%rax; "                             \
+            "    INDIRECT_CALL %%rax; "                      \
             "1:  movq  %%rax,%c4(%0)\n"                      \
             ".section .fixup,\"ax\"\n"                       \
             "2:  movq  %5,%%rax\n"                           \
@@ -67,7 +67,7 @@ enum mc_disposition {
             "    movl  %c2+3*%c3(%0),%%ecx; "                \
             "    movl  %c2+4*%c3(%0),%%r8d; "                \
             "    movl  %c2+5*%c3(%0),%%r9d; "                \
-            "    callq *%%rax; "                             \
+            "    INDIRECT_CALL %%rax; "                      \
             "1:  movl  %%eax,%c4(%0)\n"                      \
             ".section .fixup,\"ax\"\n"                       \
             "2:  movl  %5,%%eax\n"                           \
openSUSE Build Service is sponsored by