lkml.org 
[lkml]   [2018]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[tip:x86/pti] x86/retpoline/xen: Convert Xen hypercall indirect jumps
    Commit-ID:  b569cb1e72bda00e7e6245519fe7d0d0ab13898e
    Gitweb: https://git.kernel.org/tip/b569cb1e72bda00e7e6245519fe7d0d0ab13898e
    Author: David Woodhouse <dwmw@amazon.co.uk>
    AuthorDate: Tue, 9 Jan 2018 14:43:14 +0000
    Committer: Thomas Gleixner <tglx@linutronix.de>
    CommitDate: Wed, 10 Jan 2018 19:36:25 +0100

    x86/retpoline/xen: Convert Xen hypercall indirect jumps

    Convert indirect call in Xen hypercall to use non-speculative sequence,
    when CONFIG_RETPOLINE is enabled.

    Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Arjan van de Ven <arjan@linux.intel.com>
    Acked-by: Ingo Molnar <mingo@kernel.org>
    Cc: gnomes@lxorguk.ukuu.org.uk
    Cc: Rik van Riel <riel@redhat.com>
    Cc: Andi Kleen <ak@linux.intel.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Jiri Kosina <jikos@kernel.org>
    Cc: Andy Lutomirski <luto@amacapital.net>
    Cc: Dave Hansen <dave.hansen@intel.com>
    Cc: Kees Cook <keescook@google.com>
    Cc: Tim Chen <tim.c.chen@linux.intel.com>
    Cc: Greg Kroah-Hartman <gregkh@linux-foundation.org>
    Cc: Paul Turner <pjt@google.com>
    Link: https://lkml.kernel.org/r/1515508997-6154-9-git-send-email-dwmw@amazon.co.uk


    ---
    arch/x86/include/asm/xen/hypercall.h | 5 +++--
    1 file changed, 3 insertions(+), 2 deletions(-)

    diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h
    index 7cb282e..bfd8826 100644
    --- a/arch/x86/include/asm/xen/hypercall.h
    +++ b/arch/x86/include/asm/xen/hypercall.h
    @@ -44,6 +44,7 @@
    #include <asm/page.h>
    #include <asm/pgtable.h>
    #include <asm/smap.h>
    +#include <asm/nospec-branch.h>

    #include <xen/interface/xen.h>
    #include <xen/interface/sched.h>
    @@ -217,9 +218,9 @@ privcmd_call(unsigned call,
    __HYPERCALL_5ARG(a1, a2, a3, a4, a5);

    stac();
    - asm volatile("call *%[call]"
    + asm volatile(CALL_NOSPEC
    : __HYPERCALL_5PARAM
    - : [call] "a" (&hypercall_page[call])
    + : [thunk_target] "a" (&hypercall_page[call])
    : __HYPERCALL_CLOBBER5);
    clac();

    \
     
     \ /
      Last update: 2018-01-14 23:21    [W:3.100 / U:0.260 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site