From patchwork Thu Mar 19 15:26:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 11447557 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F27DC92A for ; Thu, 19 Mar 2020 15:28:08 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CE7E220658 for ; Thu, 19 Mar 2020 15:28:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="aXnJFMVM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CE7E220658 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jEx4A-0003NP-0j; Thu, 19 Mar 2020 15:26:38 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jEx48-0003NC-MW for xen-devel@lists.xenproject.org; Thu, 19 Mar 2020 15:26:36 +0000 X-Inumbo-ID: 047937b8-69f6-11ea-bc31-12813bfff9fa Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 047937b8-69f6-11ea-bc31-12813bfff9fa; Thu, 19 Mar 2020 15:26:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1584631595; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IFqmDK+pyXIICW/cF9wL4yB/wqgNWJh5iNiQY3eawJ8=; b=aXnJFMVM6pKd6mDUi4bWMnDwD/Ou6VChUA3UrZB4e8AmSxTisVna3n2M ToVtHmwWbObZC/3v8sHF2cgFEI7Lg7mfMbDZeh+vR4kKTlStRBqKHd6L+ mApuBoLUME9qVOc+R4DdVNgiG3bl15r0RaBw4Ohp0z2xSPEsQAcUurtwf 0=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa4.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa4.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: ctM7E/On9qb2FZo0C1gAA7ZhQ9ScNjOKTT4EYGkXnXHJFQSNqzz8jBj6dsQAYyrtT0hgDMI0KN 67EiV5QT2yoy70OPSx5fElAF6PrfpnZL0LP8SprkIB04ITJgiDTqZXK39y5ElXAP0ouVxyRosR jO66oXkWFPAghvgJ+5ivrO91uq+xu/HjZQ+2hMOjSVlBBZa6+jds2soseZcPUMnzsoxn9cbDZc kiS03oeDKUk4elvr/fPTmejkZZ7yAIjYiHM1lizhcnNmgU7n98M6/vtrwMhltavtrfXi6yP7xb OEc= X-SBRS: 2.7 X-MesageID: 14927763 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,572,1574139600"; d="scan'208";a="14927763" From: Andrew Cooper To: Xen-devel Date: Thu, 19 Mar 2020 15:26:19 +0000 Message-ID: <20200319152622.31758-4-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200319152622.31758-1-andrew.cooper3@citrix.com> References: <20200319152622.31758-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 3/6] x86/ucode: Move interface from processor.h to microcode.h X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Wei Liu , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This reduces the complexity of processor.h, particularly the need to include public/xen.h. Substitute processor.h includes for microcode.h in some sources, and add microcode.h includes in others. Only 4 of the function declarations are actually called externally. Move the avendor init declarations to private.h No functional change. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monné --- xen/arch/x86/acpi/power.c | 1 + xen/arch/x86/cpu/microcode/private.h | 3 +++ xen/arch/x86/efi/efi-boot.h | 2 +- xen/arch/x86/platform_hypercall.c | 1 + xen/arch/x86/setup.c | 1 + xen/arch/x86/smpboot.c | 1 + xen/arch/x86/spec_ctrl.c | 1 - xen/include/asm-x86/microcode.h | 8 ++++++++ xen/include/asm-x86/processor.h | 8 -------- 9 files changed, 16 insertions(+), 10 deletions(-) diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c index b5df00b22c..e3d6eefe65 100644 --- a/xen/arch/x86/acpi/power.c +++ b/xen/arch/x86/acpi/power.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h index 2e3be79eaf..459b6a4c54 100644 --- a/xen/arch/x86/cpu/microcode/private.h +++ b/xen/arch/x86/cpu/microcode/private.h @@ -34,4 +34,7 @@ struct microcode_ops { extern const struct microcode_ops *microcode_ops; +int microcode_init_intel(void); +int microcode_init_amd(void); + #endif /* ASM_X86_MICROCODE_PRIVATE_H */ diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h index bf7b0a61dc..7bfb96875c 100644 --- a/xen/arch/x86/efi/efi-boot.h +++ b/xen/arch/x86/efi/efi-boot.h @@ -6,8 +6,8 @@ #include #include #include +#include #include -#include static struct file __initdata ucode; static multiboot_info_t __initdata mbi = { diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c index 80efb84328..ee2efdd875 100644 --- a/xen/arch/x86/platform_hypercall.c +++ b/xen/arch/x86/platform_hypercall.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index c87040c890..885919d5c3 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -52,6 +52,7 @@ #include #include #include +#include /* opt_nosmp: If true, secondary processors are ignored. */ static bool __initdata opt_nosmp; diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c index 0e54bd14f3..09264b02d1 100644 --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c index aed2c6613a..c5d8e587a8 100644 --- a/xen/arch/x86/spec_ctrl.c +++ b/xen/arch/x86/spec_ctrl.c @@ -24,7 +24,6 @@ #include #include -#include #include #include #include diff --git a/xen/include/asm-x86/microcode.h b/xen/include/asm-x86/microcode.h index 9b6ff7db08..89b9aaa02d 100644 --- a/xen/include/asm-x86/microcode.h +++ b/xen/include/asm-x86/microcode.h @@ -1,8 +1,11 @@ #ifndef ASM_X86__MICROCODE_H #define ASM_X86__MICROCODE_H +#include #include +#include + struct cpu_signature { unsigned int sig; unsigned int pf; @@ -11,4 +14,9 @@ struct cpu_signature { DECLARE_PER_CPU(struct cpu_signature, cpu_sig); +void microcode_set_module(unsigned int idx); +int microcode_update(XEN_GUEST_HANDLE_PARAM(const_void), unsigned long len); +int early_microcode_init(void); +int microcode_update_one(bool start_update); + #endif /* ASM_X86__MICROCODE_H */ diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h index 895c7032b9..fe231c5072 100644 --- a/xen/include/asm-x86/processor.h +++ b/xen/include/asm-x86/processor.h @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -579,13 +578,6 @@ void cpuid_hypervisor_leaves(const struct vcpu *v, uint32_t leaf, int guest_rdmsr_xen(const struct vcpu *v, uint32_t idx, uint64_t *val); int guest_wrmsr_xen(struct vcpu *v, uint32_t idx, uint64_t val); -void microcode_set_module(unsigned int); -int microcode_update(XEN_GUEST_HANDLE_PARAM(const_void), unsigned long len); -int early_microcode_init(void); -int microcode_update_one(bool start_update); -int microcode_init_intel(void); -int microcode_init_amd(void); - static inline uint8_t get_cpu_family(uint32_t raw, uint8_t *model, uint8_t *stepping) {