]> git.proxmox.com Git - pve-kernel.git/blob - patches/kernel/0239-x86-alternatives-Add-missing-n-at-end-of-ALTERNATIVE.patch
KPTI: add follow-up fixes
[pve-kernel.git] / patches / kernel / 0239-x86-alternatives-Add-missing-n-at-end-of-ALTERNATIVE.patch
1 From 732d51fab3401054c84be53feec624c6c992fb3f Mon Sep 17 00:00:00 2001
2 From: David Woodhouse <dwmw@amazon.co.uk>
3 Date: Thu, 4 Jan 2018 14:37:05 +0000
4 Subject: [PATCH 239/241] x86/alternatives: Add missing '\n' at end of
5 ALTERNATIVE inline asm
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 commit b9e705ef7cfaf22db0daab91ad3cd33b0fa32eb9 upstream.
11
12 Where an ALTERNATIVE is used in the middle of an inline asm block, this
13 would otherwise lead to the following instruction being appended directly
14 to the trailing ".popsection", and a failed compile.
15
16 Fixes: 9cebed423c84 ("x86, alternative: Use .pushsection/.popsection")
17 Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
18 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
19 Cc: gnomes@lxorguk.ukuu.org.uk
20 Cc: Rik van Riel <riel@redhat.com>
21 Cc: ak@linux.intel.com
22 Cc: Tim Chen <tim.c.chen@linux.intel.com>
23 Cc: Peter Zijlstra <peterz@infradead.org>
24 Cc: Paul Turner <pjt@google.com>
25 Cc: Jiri Kosina <jikos@kernel.org>
26 Cc: Andy Lutomirski <luto@amacapital.net>
27 Cc: Dave Hansen <dave.hansen@intel.com>
28 Cc: Kees Cook <keescook@google.com>
29 Cc: Linus Torvalds <torvalds@linux-foundation.org>
30 Cc: Greg Kroah-Hartman <gregkh@linux-foundation.org>
31 Link: https://lkml.kernel.org/r/20180104143710.8961-8-dwmw@amazon.co.uk
32 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
33 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
34 ---
35 arch/x86/include/asm/alternative.h | 4 ++--
36 1 file changed, 2 insertions(+), 2 deletions(-)
37
38 diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h
39 index d4aea31eec03..deca9b9c7923 100644
40 --- a/arch/x86/include/asm/alternative.h
41 +++ b/arch/x86/include/asm/alternative.h
42 @@ -139,7 +139,7 @@ static inline int alternatives_text_reserved(void *start, void *end)
43 ".popsection\n" \
44 ".pushsection .altinstr_replacement, \"ax\"\n" \
45 ALTINSTR_REPLACEMENT(newinstr, feature, 1) \
46 - ".popsection"
47 + ".popsection\n"
48
49 #define ALTERNATIVE_2(oldinstr, newinstr1, feature1, newinstr2, feature2)\
50 OLDINSTR_2(oldinstr, 1, 2) \
51 @@ -150,7 +150,7 @@ static inline int alternatives_text_reserved(void *start, void *end)
52 ".pushsection .altinstr_replacement, \"ax\"\n" \
53 ALTINSTR_REPLACEMENT(newinstr1, feature1, 1) \
54 ALTINSTR_REPLACEMENT(newinstr2, feature2, 2) \
55 - ".popsection"
56 + ".popsection\n"
57
58 /*
59 * Alternative instructions for different CPU types or capabilities.
60 --
61 2.14.2
62