[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 0/4] Add Kconfig option to remove microcode loading support


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
  • Date: Thu, 13 Nov 2025 13:11:02 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=citrix.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GQ6STHSeVh9OveuC6XAfNdRZRY2Oa/qbFLZCd9oxU3o=; b=ddkbuG5HgjZCOU0184ifG3sIFqTeqDurntOSQIl7WHozjJDEfzjmmkVO9ReMwwf3nN6ulg6UR/1cXym8V0HPjpAWFjcgv6/cfUksCZCI9HBqb6FAuYHv1I0Rr3Ozo7fVFO4nYTFPuFjwVBIDaYtNPvNQv+lJ6T9q+S/hoPv4dB1I0Yz4MEY7pinkHuDghWgDaM/0J1YByEQ5M5B50glqejarzHi1OysMeIWG4+tRdfu+TsTHkoqFMkU32HksjgACM6l3GHXDb5acyKCJhlV9n/iD6hMDq39D1Qw2SkOxDrEkds2hmWwhbJEQbnOnMqi31MCpKI9mhZx19/y0eRMK6w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HP3xMrWNj6zChVsM8ZLxyhLW22eRU3drpVMvNf9qleZV68LMFYSsP+zWDva4wODCHLfxOvNRoQ9v60VZKEjuA3rpSAKze3m/UOys2Vu2uxGMxNE9+OSv935AtI5jrF1/6gWlxKt7KUghB2vko6Zj03kSWwJ0PodYGaaUemubJtSSuG8mHXKX9x2PF5HUJibscmfRaHq6PYYyHLBLGWDA0qhuYB55uXgdyNM65xe/uMlAWiRh90tl18TgVCppY4wRH/1fffd33JJwNmmLLVA+aMkW3ffsaWAtk1PiEMEfKA9mDsM9jt0gckakPmM0deQgb4l7xmIoD/3HxIMNpG8+WQ==
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 13 Nov 2025 12:11:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu Nov 13, 2025 at 9:50 AM CET, Andrew Cooper wrote:
> On 12/11/2025 4:22 pm, Alejandro Vallejo wrote:
>>  xen/arch/x86/Kconfig                    | 12 ++++
>>  xen/arch/x86/cpu/microcode/Makefile     |  9 ++-
>>  xen/arch/x86/cpu/microcode/amd-base.c   | 55 +++++++++++++++++++
>>  xen/arch/x86/cpu/microcode/amd.c        | 55 ++-----------------
>>  xen/arch/x86/cpu/microcode/amd.h        | 15 +++++
>>  xen/arch/x86/cpu/microcode/base.c       | 73 +++++++++++++++++++++++++
>>  xen/arch/x86/cpu/microcode/core.c       | 58 +-------------------
>>  xen/arch/x86/cpu/microcode/intel-base.c | 50 +++++++++++++++++
>>  xen/arch/x86/cpu/microcode/intel.c      | 56 +++----------------
>>  xen/arch/x86/cpu/microcode/intel.h      | 16 ++++++
>>  xen/arch/x86/cpu/microcode/private.h    | 14 +++++
>>  xen/arch/x86/efi/efi-boot.h             |  2 +-
>>  xen/arch/x86/platform_hypercall.c       |  2 +
>>  13 files changed, 259 insertions(+), 158 deletions(-)
>>  create mode 100644 xen/arch/x86/cpu/microcode/amd-base.c
>>  create mode 100644 xen/arch/x86/cpu/microcode/amd.h
>>  create mode 100644 xen/arch/x86/cpu/microcode/base.c
>>  create mode 100644 xen/arch/x86/cpu/microcode/intel-base.c
>>  create mode 100644 xen/arch/x86/cpu/microcode/intel.h
>
> This is awfully invasive for something that ultimately drops only a
> handful of lines of code.

Two handfuls when considering both AMD and Intel. But yes, I'd rather not modify
as much as this. However, for our purposes it's important to physically move out
the code we want to Kconfig out, as then coverage reports don't need exceptions.

>
> First, it should be CONFIG_MICROCODE_LOADING. [...]

Sure,  I don't mind it being $FOO or $BAR.

> Next, annotate the functions that you conditionally don't reference in
> {amd,intel}_ucode_ops with __maybe_unused, and dead code elimination
> should do the rest.

I considered that, but local DCE poses problems for coverage tracking, which
we care about deeply. I'll check if there's some magic we can do to enable that
pattern but as of now, there isn't.

If I can't make it work I'll just take the sledgehammer and drop all ops and
dependent functions.

Cheers,
Alejandro



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.