aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhao Yakui <yakui.zhao@intel.com>2019-04-29 23:45:23 -0400
committerBorislav Petkov <bp@suse.de>2019-06-11 15:21:11 -0400
commitecca25029473bee6e98ce062e76b7310904bbdd1 (patch)
treeed4b7f29a303c1a9f8b6c6a8a2b5eea88618012b
parentd1fdb6d8f6a4109a4263176c84b899076a5f8008 (diff)
x86/Kconfig: Add new X86_HV_CALLBACK_VECTOR config symbol
Add a special Kconfig symbol X86_HV_CALLBACK_VECTOR so that the guests using the hypervisor interrupt callback counter can select and thus enable that counter. Select it when xen or hyperv support is enabled. No functional changes. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Borislav Petkov <bp@suse.de> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com> Cc: Frederic Weisbecker <frederic@kernel.org> Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Juergen Gross <jgross@suse.com> Cc: "K. Y. Srinivasan" <kys@microsoft.com> Cc: linux-hyperv@vger.kernel.org Cc: Nicolai Stange <nstange@suse.de> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sasha Levin <sashal@kernel.org> Cc: Stefano Stabellini <sstabellini@kernel.org> Cc: Stephen Hemminger <sthemmin@microsoft.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: x86-ml <x86@kernel.org> Cc: xen-devel@lists.xenproject.org Link: https://lkml.kernel.org/r/1559108037-18813-2-git-send-email-yakui.zhao@intel.com
-rw-r--r--arch/x86/Kconfig3
-rw-r--r--arch/x86/include/asm/hardirq.h2
-rw-r--r--arch/x86/kernel/irq.c2
-rw-r--r--arch/x86/xen/Kconfig1
-rw-r--r--drivers/hv/Kconfig1
5 files changed, 7 insertions, 2 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 2bbbd4d1ba31..c9ab09004b16 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -781,6 +781,9 @@ config PARAVIRT_SPINLOCKS
781 781
782 If you are unsure how to answer this question, answer Y. 782 If you are unsure how to answer this question, answer Y.
783 783
784config X86_HV_CALLBACK_VECTOR
785 def_bool n
786
784source "arch/x86/xen/Kconfig" 787source "arch/x86/xen/Kconfig"
785 788
786config KVM_GUEST 789config KVM_GUEST
diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h
index d9069bb26c7f..07533795b8d2 100644
--- a/arch/x86/include/asm/hardirq.h
+++ b/arch/x86/include/asm/hardirq.h
@@ -37,7 +37,7 @@ typedef struct {
37#ifdef CONFIG_X86_MCE_AMD 37#ifdef CONFIG_X86_MCE_AMD
38 unsigned int irq_deferred_error_count; 38 unsigned int irq_deferred_error_count;
39#endif 39#endif
40#if IS_ENABLED(CONFIG_HYPERV) || defined(CONFIG_XEN) 40#ifdef CONFIG_X86_HV_CALLBACK_VECTOR
41 unsigned int irq_hv_callback_count; 41 unsigned int irq_hv_callback_count;
42#endif 42#endif
43#if IS_ENABLED(CONFIG_HYPERV) 43#if IS_ENABLED(CONFIG_HYPERV)
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index 9b68b5b00ac9..4e8f193ad81f 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -135,7 +135,7 @@ int arch_show_interrupts(struct seq_file *p, int prec)
135 seq_printf(p, "%10u ", per_cpu(mce_poll_count, j)); 135 seq_printf(p, "%10u ", per_cpu(mce_poll_count, j));
136 seq_puts(p, " Machine check polls\n"); 136 seq_puts(p, " Machine check polls\n");
137#endif 137#endif
138#if IS_ENABLED(CONFIG_HYPERV) || defined(CONFIG_XEN) 138#ifdef CONFIG_X86_HV_CALLBACK_VECTOR
139 if (test_bit(HYPERVISOR_CALLBACK_VECTOR, system_vectors)) { 139 if (test_bit(HYPERVISOR_CALLBACK_VECTOR, system_vectors)) {
140 seq_printf(p, "%*s: ", prec, "HYP"); 140 seq_printf(p, "%*s: ", prec, "HYP");
141 for_each_online_cpu(j) 141 for_each_online_cpu(j)
diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig
index e07abefd3d26..ba5a41828e9d 100644
--- a/arch/x86/xen/Kconfig
+++ b/arch/x86/xen/Kconfig
@@ -7,6 +7,7 @@ config XEN
7 bool "Xen guest support" 7 bool "Xen guest support"
8 depends on PARAVIRT 8 depends on PARAVIRT
9 select PARAVIRT_CLOCK 9 select PARAVIRT_CLOCK
10 select X86_HV_CALLBACK_VECTOR
10 depends on X86_64 || (X86_32 && X86_PAE) 11 depends on X86_64 || (X86_32 && X86_PAE)
11 depends on X86_LOCAL_APIC && X86_TSC 12 depends on X86_LOCAL_APIC && X86_TSC
12 help 13 help
diff --git a/drivers/hv/Kconfig b/drivers/hv/Kconfig
index 1c1a2514d6f3..cafcb974dcfe 100644
--- a/drivers/hv/Kconfig
+++ b/drivers/hv/Kconfig
@@ -6,6 +6,7 @@ config HYPERV
6 tristate "Microsoft Hyper-V client drivers" 6 tristate "Microsoft Hyper-V client drivers"
7 depends on X86 && ACPI && X86_LOCAL_APIC && HYPERVISOR_GUEST 7 depends on X86 && ACPI && X86_LOCAL_APIC && HYPERVISOR_GUEST
8 select PARAVIRT 8 select PARAVIRT
9 select X86_HV_CALLBACK_VECTOR
9 help 10 help
10 Select this option to run Linux as a Hyper-V client operating 11 Select this option to run Linux as a Hyper-V client operating
11 system. 12 system.