lkml.org 
[lkml]   [2018]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v3 06/13] x86/retpoline/xen: Convert Xen hypercall indirect jumps
    Date
    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>
    ---
    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 7cb282e9e587..393c0048c63e 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(NOSPEC_CALL
    : __HYPERCALL_5PARAM
    - : [call] "a" (&hypercall_page[call])
    + : [thunk_target] "a" (&hypercall_page[call])
    : __HYPERCALL_CLOBBER5);
    clac();

    --
    2.14.3
    \
     
     \ /
      Last update: 2018-01-04 15:44    [W:3.930 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site