Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1649557

[PATCH v4 02/10] x86/hyper-v: stash the max number of virtual/logical processor

From Vitaly Kuznetsov <vkuznets@redhat.com>
Newsgroups linux.kernel
Subject [PATCH v4 02/10] x86/hyper-v: stash the max number of virtual/logical processor
Date 2017-05-24 14:10 +0200
Message-ID <tKDh1-2cD-27@gated-at.bofh.it> (permalink)
References <tKDh0-2cD-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Max virtual processor will be needed for 'extended' hypercalls supporting
more than 64 vCPUs. While on it, unify on 'Hyper-V' in mshyperv.c as we
currently have a mix, report acquired misc features as well.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Acked-by: K. Y. Srinivasan <kys@microsoft.com>
Tested-by: Simon Xiao <sixiao@microsoft.com>
Tested-by: Srikanth Myakam <v-srm@microsoft.com>
---
 arch/x86/include/asm/mshyperv.h |  2 ++
 arch/x86/kernel/cpu/mshyperv.c  | 13 ++++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h
index 91acec7..d42b6eb 100644
--- a/arch/x86/include/asm/mshyperv.h
+++ b/arch/x86/include/asm/mshyperv.h
@@ -29,6 +29,8 @@ struct ms_hyperv_info {
 	u32 features;
 	u32 misc_features;
 	u32 hints;
+	u32 max_vp_index;
+	u32 max_lp_index;
 };
 
 extern struct ms_hyperv_info ms_hyperv;
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index 04cb8d3..a8b4765 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -175,9 +175,16 @@ static void __init ms_hyperv_init_platform(void)
 	ms_hyperv.misc_features = cpuid_edx(HYPERV_CPUID_FEATURES);
 	ms_hyperv.hints    = cpuid_eax(HYPERV_CPUID_ENLIGHTMENT_INFO);
 
-	pr_info("HyperV: features 0x%x, hints 0x%x\n",
+	pr_info("Hyper-V: features 0x%x, hints 0x%x\n",
 		ms_hyperv.features, ms_hyperv.hints);
 
+	ms_hyperv.max_vp_index = cpuid_eax(HVCPUID_IMPLEMENTATION_LIMITS);
+	ms_hyperv.max_lp_index = cpuid_ebx(HVCPUID_IMPLEMENTATION_LIMITS);
+
+	pr_info("Hyper-V: max %d virtual processors, %d logical processors\n",
+		ms_hyperv.max_vp_index, ms_hyperv.max_lp_index);
+
+
 	/*
 	 * Extract host information.
 	 */
@@ -203,7 +210,7 @@ static void __init ms_hyperv_init_platform(void)
 		rdmsrl(HV_X64_MSR_APIC_FREQUENCY, hv_lapic_frequency);
 		hv_lapic_frequency = div_u64(hv_lapic_frequency, HZ);
 		lapic_timer_frequency = hv_lapic_frequency;
-		pr_info("HyperV: LAPIC Timer Frequency: %#x\n",
+		pr_info("Hyper-V: LAPIC Timer Frequency: %#x\n",
 			lapic_timer_frequency);
 	}
 
@@ -237,7 +244,7 @@ static void __init ms_hyperv_init_platform(void)
 }
 
 const __refconst struct hypervisor_x86 x86_hyper_ms_hyperv = {
-	.name			= "Microsoft HyperV",
+	.name			= "Microsoft Hyper-V",
 	.detect			= ms_hyperv_platform,
 	.init_platform		= ms_hyperv_init_platform,
 };
-- 
2.9.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 00/10] Hyper-V: praravirtualized remote TLB flushing and hypercall improvements Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-05-24 14:10 +0200
  [PATCH v4 06/10] x86/hyper-v: implement rep hypercalls Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-05-24 14:10 +0200
  [PATCH v4 09/10] x86/hyper-v: support extended CPU ranges for TLB flush hypercalls Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-05-24 14:10 +0200
    Re: [PATCH v4 09/10] x86/hyper-v: support extended CPU ranges for TLB  flush hypercalls Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-27 20:20 +0200
  [PATCH v4 01/10] x86/hyper-v: include hyperv/ only when CONFIG_HYPERV is set Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-05-24 14:10 +0200
  [PATCH v4 03/10] x86/hyper-v: make hv_do_hypercall() inline Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-05-24 14:10 +0200
    Re: [PATCH v4 03/10] x86/hyper-v: make hv_do_hypercall() inline Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-27 19:50 +0200
  [PATCH v4 04/10] x86/hyper-v: fast hypercall implementation Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-05-24 14:10 +0200
    Re: [PATCH v4 04/10] x86/hyper-v: fast hypercall implementation Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-27 19:50 +0200
  [PATCH v4 08/10] x86/hyper-v: use hypercall for remote TLB flush Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-05-24 14:10 +0200
  [PATCH v4 05/10] hyper-v: use fast hypercall for HVCALL_SIGNAL_EVENT Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-05-24 14:10 +0200
    Re: [PATCH v4 05/10] hyper-v: use fast hypercall for HVCALL_SIGNAL_EVENT Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-27 20:00 +0200
  [PATCH v4 02/10] x86/hyper-v: stash the max number of virtual/logical processor Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-05-24 14:10 +0200
    Re: [PATCH v4 02/10] x86/hyper-v: stash the max number of  virtual/logical processor Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-27 19:50 +0200
      Re: [PATCH v4 02/10] x86/hyper-v: stash the max number of  virtual/logical processor Steven Rostedt <rostedt@goodmis.org> - 2017-06-05 17:30 +0200
        Re: [PATCH v4 02/10] x86/hyper-v: stash the max number of  virtual/logical processor Stephen Hemminger <stephen@networkplumber.org> - 2017-06-05 17:40 +0200
  [PATCH v4 10/10] tracing/hyper-v: trace hyperv_mmu_flush_tlb_others() Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-05-24 14:10 +0200
    Re: [PATCH v4 10/10] tracing/hyper-v: trace  hyperv_mmu_flush_tlb_others() Steven Rostedt <rostedt@goodmis.org> - 2017-06-05 18:00 +0200
      Re: [PATCH v4 10/10] tracing/hyper-v: trace hyperv_mmu_flush_tlb_others() Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-06-05 18:20 +0200
        Re: [PATCH v4 10/10] tracing/hyper-v: trace  hyperv_mmu_flush_tlb_others() Steven Rostedt <rostedt@goodmis.org> - 2017-06-07 16:00 +0200
          Re: [PATCH v4 10/10] tracing/hyper-v: trace hyperv_mmu_flush_tlb_others() Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-06-07 16:10 +0200

csiph-web