Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1729832yba; Sun, 14 Apr 2019 19:04:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxrrO5+okmDTUaW/e/TjZj4Ior175M+5V9CWcOI/jQ2GDoHLjMrTPpTPhQqsjVZ56RjqE2S X-Received: by 2002:a63:36ce:: with SMTP id d197mr68714710pga.180.1555293850490; Sun, 14 Apr 2019 19:04:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555293850; cv=none; d=google.com; s=arc-20160816; b=JnYgWISC+MetwaX2LPb5bCcwqrl+b7Sz6k0XhY4+qK5SUapyrfVWBhLGvBkAnlh658 UeC1QbLFwdUpf+sF9uoDljWk135lMVpZIZFePL8Xyp19xvyI3fTorDWIN4OYLG34NJxh O5Z3CSqWSmtBLMRC3FQmeJWxrB26zpge0EEnt3OBOqxwLeE3jqH29qChVvxJafVzAA44 p9VKm2qOJi8k5XNY6D4hR5XkN/Wd5pXO9yj/nB+QTQQOKbdkACKEF7CfPzielohhmlr7 Q/tQ6LWpRbkoB5vsgztGmQodBtuvMJJoffKrPX/BT7MIC+jiAIj7TyGuImtCXbmeOPh9 fhIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=qUYbs3pCvsRTU5mSGpKyy15oeeK2bbjRf4DaatKDNns=; b=ICgVKogstAXPXNUv3Wmq5QoCSa9zIKOcQEsKAFJ/nt+3ha11S8xtGAwq8k7XWqhv2e OF8fupZiGgmiJ2LEgtwqqHfAeLtk2WXFAbGivHQ4MIvFA8MS5fpDI7phRA8AYWz3YeQZ WVg1IevdTjWUCHe0ct6IB+lmQAiRcV/Ss/qDxwE7Xnhhz/lh61YK9diwKXvGoJ3B/hZO pklVOA8C+g0tmbj/ACld3BvV0mxwro0ViRPc/Mn9ZTLEiGiL6plbeTcXUIzzhWRuIJnd v6OIbPawGP7JyBd2/dz2EYuIP8cWcGczqFCpRbxDnTOxO8T8YdavUUX0KBJjipuVAL/k PnZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r11si38923414pgm.353.2019.04.14.19.03.54; Sun, 14 Apr 2019 19:04:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726950AbfDOCDJ (ORCPT + 99 others); Sun, 14 Apr 2019 22:03:09 -0400 Received: from mga07.intel.com ([134.134.136.100]:30382 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726835AbfDOCDF (ORCPT ); Sun, 14 Apr 2019 22:03:05 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Apr 2019 19:03:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,351,1549958400"; d="scan'208";a="149422492" Received: from genxtest-ykzhao.sh.intel.com ([10.239.143.71]) by FMSMGA003.fm.intel.com with ESMTP; 14 Apr 2019 19:03:03 -0700 From: Zhao Yakui To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: bp@alien8.de, tglx@linutronix.de, Zhao Yakui Subject: [RFC PATCH v4 1/4] x86/Kconfig: Add new config symbol to unify conditional definition of hv_irq_callback_count Date: Mon, 15 Apr 2019 10:00:54 +0800 Message-Id: <1555293657-32233-2-git-send-email-yakui.zhao@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555293657-32233-1-git-send-email-yakui.zhao@intel.com> References: <1555293657-32233-1-git-send-email-yakui.zhao@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Borislav Petkov --- v3->v4: Follow the comments to refine the commit log. --- arch/x86/Kconfig | 3 +++ arch/x86/include/asm/hardirq.h | 2 +- arch/x86/kernel/irq.c | 2 +- arch/x86/xen/Kconfig | 1 + drivers/hv/Kconfig | 1 + 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 5ad9241..54d1fbc 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -791,6 +791,9 @@ config QUEUED_LOCK_STAT behavior of paravirtualized queued spinlocks and report them on debugfs. +config X86_HV_CALLBACK_VECTOR + def_bool n + source "arch/x86/xen/Kconfig" config KVM_GUEST diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h index d9069bb..0753379 100644 --- a/arch/x86/include/asm/hardirq.h +++ b/arch/x86/include/asm/hardirq.h @@ -37,7 +37,7 @@ typedef struct { #ifdef CONFIG_X86_MCE_AMD unsigned int irq_deferred_error_count; #endif -#if IS_ENABLED(CONFIG_HYPERV) || defined(CONFIG_XEN) +#ifdef CONFIG_X86_HV_CALLBACK_VECTOR unsigned int irq_hv_callback_count; #endif #if IS_ENABLED(CONFIG_HYPERV) diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index 59b5f2e..a147826 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c @@ -134,7 +134,7 @@ int arch_show_interrupts(struct seq_file *p, int prec) seq_printf(p, "%10u ", per_cpu(mce_poll_count, j)); seq_puts(p, " Machine check polls\n"); #endif -#if IS_ENABLED(CONFIG_HYPERV) || defined(CONFIG_XEN) +#ifdef CONFIG_X86_HV_CALLBACK_VECTOR if (test_bit(HYPERVISOR_CALLBACK_VECTOR, system_vectors)) { seq_printf(p, "%*s: ", prec, "HYP"); for_each_online_cpu(j) diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig index e07abef..ba5a418 100644 --- a/arch/x86/xen/Kconfig +++ b/arch/x86/xen/Kconfig @@ -7,6 +7,7 @@ config XEN bool "Xen guest support" depends on PARAVIRT select PARAVIRT_CLOCK + select X86_HV_CALLBACK_VECTOR depends on X86_64 || (X86_32 && X86_PAE) depends on X86_LOCAL_APIC && X86_TSC help diff --git a/drivers/hv/Kconfig b/drivers/hv/Kconfig index 1c1a251..cafcb97 100644 --- a/drivers/hv/Kconfig +++ b/drivers/hv/Kconfig @@ -6,6 +6,7 @@ config HYPERV tristate "Microsoft Hyper-V client drivers" depends on X86 && ACPI && X86_LOCAL_APIC && HYPERVISOR_GUEST select PARAVIRT + select X86_HV_CALLBACK_VECTOR help Select this option to run Linux as a Hyper-V client operating system. -- 2.7.4