lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1539954835-34035-2-git-send-email-yi.y.sun@linux.intel.com>
Date:   Fri, 19 Oct 2018 21:13:54 +0800
From:   Yi Sun <yi.y.sun@...ux.intel.com>
To:     linux-kernel@...r.kernel.org
Cc:     x86@...nel.org, tglx@...utronix.de, jgross@...e.com,
        chao.p.peng@...el.com, chao.gao@...el.com,
        isaku.yamahata@...el.com, michael.h.kelley@...rosoft.com,
        tianyu.lan@...rosoft.com, Yi Sun <yi.y.sun@...ux.intel.com>,
        "K. Y. Srinivasan" <kys@...rosoft.com>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        Stephen Hemminger <sthemmin@...rosoft.com>,
        "Michael Kelley (EOSG)" <Michael.H.Kelley@...rosoft.com>
Subject: [PATCH v1 1/2] x86/hyperv: get spinlock retry number on Hyper-V

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@...ux.intel.com>
Cc: "K. Y. Srinivasan" <kys@...rosoft.com>
Cc: Haiyang Zhang <haiyangz@...rosoft.com>
Cc: Stephen Hemminger <sthemmin@...rosoft.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Michael Kelley (EOSG) <Michael.H.Kelley@...rosoft.com>
Cc: Juergen Gross <jgross@...e.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ