Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5889725ybi; Tue, 28 May 2019 22:39:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwiL0apkU6iOd/9GqKU6bo/t4uW8tmvlhn6xOeELUf28SkJg74o1SKQvQ2CEeQJq5qQQByU X-Received: by 2002:a63:d504:: with SMTP id c4mr9214307pgg.20.1559108356662; Tue, 28 May 2019 22:39:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559108356; cv=none; d=google.com; s=arc-20160816; b=AMt9qlZrX9SPFK2RYKdpr1Lyg08Q3v15Qe88xtXOiS8dqpJ/7dDmrbWRrTXsdG8l/b KVxnVgZPkvQck92xpgYRqE7nYi+rGoYvpBJwS25JO9inLNbzXTC1lsvz/Npca5ASPhVe LQioQJvWSz2mN/V5jnVo6rihmI3KSTOQJVxs7TT+uAucJ99E6H3l22SBDKeRde/MFRHJ kONgpeCqKgJjEf0sSHQWXgRoKUc95yItZsM6f9Ud+sbexT8wUcm4MC8YA6edJ05mdQIE qiUNJ+mXYr9W0fp+h/Dc3zumnBqONypyPtMop9szANHsAGrWmpWPz5wCpPZTVfX78C9O FCLA== 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=BWBq0e4sgAQgqKv6qeeVMrnPmgYBA/6vHG27IbEHZVw=; b=VPFc+mbg0nnOmQbV6xnIY5ptoDhubwcCPEsnN7HVPOK+5oSN/tZnz4+4azzIG5Scu7 jIys/OV6e/z9dy3yKxxwoRe6Ay5a/mJQ7lM/nSN44PsiBmT6cxK42sN3BMty2bsP39RR GLIJS8JuyWZQ9cPiaxBz44HjIwXd2xSR19aTq9eocZWzSGpkY/H6l+DbFlyqfG9bbBUR h80cd5v55Lh9qIKLkwUfwDMASI011dcwUlBjK7tlrUAaIZhDi7BAphY8s331OeGVWH5x q/6Xfnjwa2HWZ6xd7kZsADltHRDE0hGmpiIFCJiZiO7qvoEdk/MICwcqtMsEfTtOMIuX gBCQ== 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 gn19si23346100plb.67.2019.05.28.22.39.01; Tue, 28 May 2019 22:39:16 -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 S1726033AbfE2Fh6 (ORCPT + 99 others); Wed, 29 May 2019 01:37:58 -0400 Received: from mga06.intel.com ([134.134.136.31]:52060 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725855AbfE2Fh5 (ORCPT ); Wed, 29 May 2019 01:37:57 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 May 2019 22:37:57 -0700 X-ExtLoop1: 1 Received: from genxtest-ykzhao.sh.intel.com ([10.239.143.71]) by fmsmga007.fm.intel.com with ESMTP; 28 May 2019 22:37:56 -0700 From: Zhao Yakui To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: tglx@linutronix.de, bp@alien8.de, Zhao Yakui Subject: [PATCH v7 1/3] x86/Kconfig: Add new config symbol to unify conditional definition of hv_irq_callback_count Date: Wed, 29 May 2019 13:33:55 +0800 Message-Id: <1559108037-18813-2-git-send-email-yakui.zhao@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1559108037-18813-1-git-send-email-yakui.zhao@intel.com> References: <1559108037-18813-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 Reviewed-by: Thomas Gleixner --- 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 2bbbd4d..c9ab090 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -781,6 +781,9 @@ config PARAVIRT_SPINLOCKS If you are unsure how to answer this question, answer Y. +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 9b68b5b..4e8f193 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) 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