lkml.org 
[lkml]   [2015]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2 2/2] x86/msr: Set the return value to zero when native_rdmsr_safe fails
    Date
    This will cause unchecked native_rdmsr_safe failures to return
    deterministic results.

    Signed-off-by: Andy Lutomirski <luto@kernel.org>
    ---
    arch/x86/include/asm/msr.h | 5 ++++-
    1 file changed, 4 insertions(+), 1 deletion(-)

    diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h
    index 77d8b284e4a7..9eda52205d42 100644
    --- a/arch/x86/include/asm/msr.h
    +++ b/arch/x86/include/asm/msr.h
    @@ -73,7 +73,10 @@ static inline unsigned long long native_read_msr_safe(unsigned int msr,
    asm volatile("2: rdmsr ; xor %[err],%[err]\n"
    "1:\n\t"
    ".section .fixup,\"ax\"\n\t"
    - "3: mov %[fault],%[err] ; jmp 1b\n\t"
    + "3: mov %[fault],%[err]\n\t"
    + "xorl %%eax, %%eax\n\t"
    + "xorl %%edx, %%edx\n\t"
    + "jmp 1b\n\t"
    ".previous\n\t"
    _ASM_EXTABLE(2b, 3b)
    : [err] "=r" (*err), EAX_EDX_RET(val, low, high)
    --
    2.4.3


    \
     
     \ /
      Last update: 2015-09-21 02:21    [W:5.541 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site