lkml.org 
[lkml]   [2018]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v1 1/2] x86/hyperv: get spinlock retry number on Hyper-V
    Date
    EBX of Implementation Recommendations MSR (0x40000004) indicates
    recommended number of attempts to retry a spinlock failure before
    notifying the hypervisor about the failures.

    0xFFFFFFFF indicates never to retry.

    Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
    Cc: "K. Y. Srinivasan" <kys@microsoft.com>
    Cc: Haiyang Zhang <haiyangz@microsoft.com>
    Cc: Stephen Hemminger <sthemmin@microsoft.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Michael Kelley (EOSG) <Michael.H.Kelley@microsoft.com>
    Cc: Juergen Gross <jgross@suse.com>
    ---
    arch/x86/include/asm/mshyperv.h | 3 +++
    arch/x86/kernel/cpu/mshyperv.c | 1 +
    2 files changed, 4 insertions(+)

    diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h
    index 0d6271c..f909365 100644
    --- a/arch/x86/include/asm/mshyperv.h
    +++ b/arch/x86/include/asm/mshyperv.h
    @@ -11,10 +11,13 @@

    #define VP_INVAL U32_MAX

    +#define HYPERV_SPINLOCK_RETRY_NEVER U32_MAX
    +
    struct ms_hyperv_info {
    u32 features;
    u32 misc_features;
    u32 hints;
    + u32 num_spin_retry;
    u32 nested_features;
    u32 max_vp_index;
    u32 max_lp_index;
    diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
    index 1c72f38..04f480a 100644
    --- a/arch/x86/kernel/cpu/mshyperv.c
    +++ b/arch/x86/kernel/cpu/mshyperv.c
    @@ -222,6 +222,7 @@ static void __init ms_hyperv_init_platform(void)
    ms_hyperv.features = cpuid_eax(HYPERV_CPUID_FEATURES);
    ms_hyperv.misc_features = cpuid_edx(HYPERV_CPUID_FEATURES);
    ms_hyperv.hints = cpuid_eax(HYPERV_CPUID_ENLIGHTMENT_INFO);
    + ms_hyperv.num_spin_retry = cpuid_ebx(HYPERV_CPUID_ENLIGHTMENT_INFO);

    pr_info("Hyper-V: features 0x%x, hints 0x%x\n",
    ms_hyperv.features, ms_hyperv.hints);
    --
    1.9.1
    \
     
     \ /
      Last update: 2018-10-19 15:40    [W:4.350 / U:0.116 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site