From nobody Fri Apr 26 19:37:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1584567156; cv=none; d=zohomail.com; s=zohoarc; b=nFc/rqp2pmP6i43s54+4kedlXj0F19shQcG7ewDmOUWp5mqtBHLvyxsmP1kcM+W3xWS+0yAa6QeEznMzm47aqpC9FOvFUggdcK8oX/YRqbsLcrG/HgZMotfjZR+zAnkOcU8OumEjXaEQYIjZrGirp117jNA9FRCNfSsB8Cl2BCY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584567156; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=I3mtD1ZLrNS+9h46z7DANd2yet4wyVZRauFg29LTbsI=; b=bBMkDDpNHMzWnw8S6N5IaDlI4/u9c5YGCb8ESZEY2oojZsEt4P7ya8DW5PX7BDG4SEahDqubG7Veqtd+spmkeTc9SwKu4yvYZMR7CSlC+89aBAgrXvc5I39N75+dUNZtK8ckUlkI9Hrc7JjCaC3iENDEStgj8gR85gwFF1h/sX4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1584567156843176.3074797025257; Wed, 18 Mar 2020 14:32:36 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jEgHL-0001Vr-An; Wed, 18 Mar 2020 21:31:07 +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 1jEgHJ-0001Vm-VQ for xen-devel@lists.xenproject.org; Wed, 18 Mar 2020 21:31:06 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id c47b1884-695f-11ea-bb92-12813bfff9fa; Wed, 18 Mar 2020 21:31:03 +0000 (UTC) X-Inumbo-ID: c47b1884-695f-11ea-bb92-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1584567064; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vCWcLpFiUYZVvgN4d9X8DBSgF4YRzoIMAEowyOkzPMM=; b=d39ZzExKpMsAnABZpHOun4I3eci/ULyv6GeyUPU7XJGdq7W7lVhwMVld jhVylRROruMdTO0BswTmJoYBZvskeyqozIRGUfZNMPAzO7DZzPFwrr1p7 rUl5Kf7vOt+rXe1Q5whInI6Wsi4cVx19RianCx01GNN6AOqziU/ORUE/o s=; Authentication-Results: esa3.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: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa3.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=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.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=esa3.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 (esa3.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=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: Je8iIf8eTYAo5FyYJ6WnH7CIhmx0QIfp8Y03PyN1k/tVYwlwn4jDA37cuA0UOmJQd+ddOW7i++ 5MIaeTs2uwAMFeIAQrY0hWGERgkHM7Y/ndZmLAddzoCE24Lg8egenHDMOk7BZ8wdLHaeuaWu3G XVuIj2tFSqfgYnQ7knGsU6/aJdBLrwmzQxSKc9rOhEK7aCTEktBvpxqzmfeS8cNztbjRACuHpy dTV0Si9VyIXxkl+P++WvETEXjehqeJGOsnFDl9V2hKcT9K+/A2jwZeXZEMmP3LAVCU3KEBYfjP 1jo= X-SBRS: 2.7 X-MesageID: 14217460 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,569,1574139600"; d="scan'208";a="14217460" From: Andrew Cooper To: Xen-devel Date: Wed, 18 Mar 2020 21:30:57 +0000 Message-ID: <20200318213057.19214-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200318210540.5602-1-andrew.cooper3@citrix.com> References: <20200318210540.5602-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 2/n] x86/microcode: 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=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 7 function declarations are actually called externally. early_microcode_update_cpu() has no callers so make it static, and move the vendor 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=C3=A9 --- xen/arch/x86/acpi/power.c | 1 + xen/arch/x86/efi/efi-boot.h | 2 +- xen/arch/x86/microcode/core.c | 2 +- xen/arch/x86/microcode/private.h | 3 +++ 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 | 9 --------- 10 files changed, 17 insertions(+), 12 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 =20 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 =20 static struct file __initdata ucode; static multiboot_info_t __initdata mbi =3D { diff --git a/xen/arch/x86/microcode/core.c b/xen/arch/x86/microcode/core.c index e99f4ab06c..e54a5fec51 100644 --- a/xen/arch/x86/microcode/core.c +++ b/xen/arch/x86/microcode/core.c @@ -756,7 +756,7 @@ int microcode_update_one(bool start_update) } =20 /* BSP calls this function to parse ucode blob and then apply an update. */ -int __init early_microcode_update_cpu(void) +static int __init early_microcode_update_cpu(void) { int rc =3D 0; const void *data =3D NULL; diff --git a/xen/arch/x86/microcode/private.h b/xen/arch/x86/microcode/priv= ate.h index 97c7405dad..cdfe637b6d 100644 --- a/xen/arch/x86/microcode/private.h +++ b/xen/arch/x86/microcode/private.h @@ -36,4 +36,7 @@ extern const struct microcode_ops *microcode_ops; =20 void microcode_free_patch(struct microcode_patch *patch); =20 +int microcode_init_intel(void); +int microcode_init_amd(void); + #endif /* ASM_X86_MICROCODE_PRIVATE_H */ diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hype= rcall.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 =20 /* 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 @@ =20 #include #include -#include #include #include #include diff --git a/xen/include/asm-x86/microcode.h b/xen/include/asm-x86/microcod= e.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 =20 +#include #include =20 +#include + struct cpu_signature { unsigned int sig; unsigned int pf; @@ -11,4 +14,9 @@ struct cpu_signature { =20 DECLARE_PER_CPU(struct cpu_signature, cpu_sig); =20 +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/processo= r.h index b2b19a02cd..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,14 +578,6 @@ void cpuid_hypervisor_leaves(const struct vcpu *v, uin= t32_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); =20 -void microcode_set_module(unsigned int); -int microcode_update(XEN_GUEST_HANDLE_PARAM(const_void), unsigned long len= ); -int early_microcode_update_cpu(void); -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) { --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel