summarylogtreecommitdiffstats
path: root/vmmon.patch
diff options
context:
space:
mode:
authorJean-Marc Lenoir2018-05-01 20:52:25 +0200
committerJean-Marc Lenoir2018-05-01 20:52:25 +0200
commitcf718f86e466f5c628f059ac3155faf999a438ba (patch)
treecb81ad299b2a06d6246041c9c28b8ec7c93279ab /vmmon.patch
parent586a18a2437249a9a57a93341cef5909ac2ab48c (diff)
downloadaur-cf718f86e466f5c628f059ac3155faf999a438ba.tar.gz
Fix indirect call with retpoline
Diffstat (limited to 'vmmon.patch')
-rw-r--r--vmmon.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/vmmon.patch b/vmmon.patch
index d69f3135cb1b..2aff1e3a7347 100644
--- a/vmmon.patch
+++ b/vmmon.patch
@@ -14,3 +14,34 @@ index de8162e..6124a71 100644
# Header directory for the running kernel
ifdef LINUXINCLUDE
+From: Michal Kubecek <mkubecek@suse.cz>
+Date: Mon, 26 Mar 2018 13:33:32 +0200
+Subject: [PATCH] vmmon: fix indirect call with retpoline build
+diff --git a/vmmon/common/task.c b/vmmon/common/task.c
+index 98cc74a..400ebfe 100644
+--- a/vmmon/common/task.c
++++ b/vmmon/common/task.c
+@@ -2203,12 +2203,23 @@ TaskSwitchToMonitor(VMCrossPage *crosspage)
+ {
+ uint64 raxGetsWiped, rcxGetsWiped;
+
++#ifdef CALL_NOSPEC
++ __asm__ __volatile__(CALL_NOSPEC
++ : "=a" (raxGetsWiped),
++ "=c" (rcxGetsWiped)
++ : "0" (codePtr),
++ "1" (crosspage),
++ THUNK_TARGET(codePtr)
++ : "rdx", "r8", "r9", "r10", "r11", "cc", "memory");
++#else
+ __asm__ __volatile__("call *%%rax"
+ : "=a" (raxGetsWiped),
+ "=c" (rcxGetsWiped)
+ : "0" (codePtr),
+ "1" (crosspage)
+ : "rdx", "r8", "r9", "r10", "r11", "cc", "memory");
++#endif
++
+ }
+ #elif defined(_MSC_VER)
+ /*