From patchwork Thu Mar 19 15:26:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 11447549 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 526ED14B4 for ; Thu, 19 Mar 2020 15:28:04 +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 2DB0A20658 for ; Thu, 19 Mar 2020 15:28:04 +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="BjcOU/Xy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2DB0A20658 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 1jEx45-0003N6-Nv; Thu, 19 Mar 2020 15:26:33 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jEx44-0003N1-5W for xen-devel@lists.xenproject.org; Thu, 19 Mar 2020 15:26:32 +0000 X-Inumbo-ID: 023af7f2-69f6-11ea-bec1-bc764e2007e4 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 023af7f2-69f6-11ea-bec1-bc764e2007e4; Thu, 19 Mar 2020 15:26:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1584631592; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=QCGrVYGEjLEO6zVWZL79iMw684v/rwuLqSMN1zEE6Qo=; b=BjcOU/XyseZokFWyYZTyjbW1on8KOOJxDRmr2b9Ej4Uwfz/SiSbjodBg /dnWbJHYPCLzamgFANbZR0F21sETErXQ0d8kYSSqLMifOFxOeCzvH6Nze bSUwb20Bh4g7Qj9M2jLy2uNLTLTJhTZBjVh3QrtbKYB6tT6cYEtnf0BxU 8=; Authentication-Results: esa1.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 (esa1.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=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.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=esa1.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 (esa1.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=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 9QttPkrtMrdeKawQXhq2M4u1trwngHKXPjWEFw3crRdAu+EsQFrz4jQNfp9P5M/3k8XZ0gjDkp 6hXDbwJqOJXHPu9y4FqzmM/Gd2KqkFQ2gQ8vlYf2hfCTuaFM7Zy6Dc1YBF9K2LzkFvv8bDpxB1 LF0muTGj2y/gqLDjJTRHZ2lqlT3CaAaWWpxpZ4e2pPz42oiRXBhuDuDTlUwBfk4chQXm7Y78mA 5uT1pJuDxuAngnVQKS8rs9NadWd2OjGk0kfd1RY7W77trq4oktA/Xy3h1bWVOTbMe7CjUPuE2i RPc= X-SBRS: 2.7 X-MesageID: 14487476 X-Ironport-Server: esa1.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="14487476" From: Andrew Cooper To: Xen-devel Date: Thu, 19 Mar 2020 15:26:16 +0000 Message-ID: <20200319152622.31758-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 0/6] x86/ucode: Cleanup - Part 1/n 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 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" I got sad at the state of microcode handling while investigating an issue. This is some preliminary cleanup, with the only practical changes in patch 4. Andrew Cooper (6): x86/ucode: Remove declarations for non-external functions x86/ucode: Move microcode into its own directory x86/ucode: Move interface from processor.h to microcode.h x86/ucode: Rationalise startup and family/model checks x86/ucode: Alter ops->free_patch() to free the entire patch x86/ucode: Make struct microcode_patch opaque xen/arch/x86/Makefile | 3 -- xen/arch/x86/acpi/power.c | 1 + xen/arch/x86/cpu/Makefile | 1 + xen/arch/x86/cpu/microcode/Makefile | 3 ++ .../x86/{microcode_amd.c => cpu/microcode/amd.c} | 54 ++++++++----------- xen/arch/x86/{microcode.c => cpu/microcode/core.c} | 62 +++++++++++----------- .../{microcode_intel.c => cpu/microcode/intel.c} | 47 ++++++---------- .../x86/cpu/microcode/private.h} | 33 ++++-------- 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 | 36 +++---------- xen/include/asm-x86/processor.h | 9 ---- 15 files changed, 93 insertions(+), 162 deletions(-) create mode 100644 xen/arch/x86/cpu/microcode/Makefile rename xen/arch/x86/{microcode_amd.c => cpu/microcode/amd.c} (95%) rename xen/arch/x86/{microcode.c => cpu/microcode/core.c} (96%) rename xen/arch/x86/{microcode_intel.c => cpu/microcode/intel.c} (92%) copy xen/{include/asm-x86/microcode.h => arch/x86/cpu/microcode/private.h} (57%)