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

Re: [PATCH v2 2/2] x86/ucode: Add Kconfig option to remove microcode loading


  • To: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 12 Jan 2026 19:51:38 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • 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=vWFk+q3EFqAXyrK3dawiPlj98LVzN7Lf6nZXfrgFruU=; b=lcOYEVb9sOJgBYUe+6ct4LOyYzAEwNS83G2fLMK524M+sD1BVaKGfjNdmJBC8XBcGYu+jVGXS/w4VzuTRBMDPMZpzbWjO1tkCbjAoGW+72BMs7BYMqzhVnb5GJVOQEoglHdo6v4JdrZ1jzLrd0P6Z26Zsb4R/+O/enWyY7hM2NwzOVV2u/rsArfTgjAU/tFN7n84dJf/xDh7/h7SjKq+Is/f/ZDJBcLDClgIlyU+X9TZ80YPwCkAWOuv9XZdSZhXxopkumWZKRRi5q7TkRmObv06qWu4m5HDRn7FmYqwSnlBni+mpopg8wtFTjkQjscpXqlsFG3e74so2UU8GBay7g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zAj6v9b/5I6iHbVo+TNiAr+GWsvpNWxCwAPuz0wcKxae/pab0sgpVTU0iHqIaGhftGjnBUQxC51O+yo6Xw8Trx71a0v2mOY7ZksedZhTYweUSSaOV3gIriUMZAPE6yHjfXvuJnqRwKfGUkR2Kkp2GZqR/4g8BB/Co+7XpX+tttP7+Uw6fdFncbmjGihId0mq1IkUeydhL9VcV+RhkyvHSryEGtrTywPhlfF3GWn+rnL5daOBf07OxA80kMhtJPdwS/UI3SRmOMHR8KNFgkhtbW8PbQ+4IJPX+HE+F0wZa7OZlcObuJohqp28tF73al1QsvmpaYv06W6vCEfsbz6ZXg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Xen-devel <xen-devel-bounces@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 12 Jan 2026 19:51:50 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 12/01/2026 7:12 pm, Alejandro Vallejo wrote:
> Hi,
>
> On Mon Jan 12, 2026 at 7:47 PM CET, Alejandro Vallejo wrote:
>> On Mon Jan 12, 2026 at 6:15 PM CET, Andrew Cooper wrote:
>>> On 12/01/2026 3:02 pm, Alejandro Vallejo wrote:
>>>>  automation/gitlab-ci/build.yaml    |  2 +-
>>>>  docs/misc/efi.pandoc               |  2 ++
>>>>  docs/misc/xen-command-line.pandoc  |  4 ++--
>>>>  xen/arch/x86/Kconfig               | 14 +++++++++++++-
>>>>  xen/arch/x86/cpu/microcode/amd.c   | 22 +++++++++++++---------
>>>>  xen/arch/x86/cpu/microcode/core.c  | 25 ++++++++++++++++++-------
>>>>  xen/arch/x86/cpu/microcode/intel.c | 16 +++++++++-------
>>>>  xen/arch/x86/efi/efi-boot.h        |  3 ++-
>>>>  xen/arch/x86/platform_hypercall.c  |  2 ++
>>>>  xen/common/Makefile                |  3 ++-
>>>>  10 files changed, 64 insertions(+), 29 deletions(-)
>>> Much nicer in terms of (non) invasiveness.
> An interesting fact came to my attention. If you set a function pointer as
> IS_ENABLED(x) ? foo : NULL, rather than ifdeffing out the compiler doesn't 
> even
> need __maybe_unused to eliminate the statics.

Oh, yes.  I'd forgotten that trick when I suggested __maybe_unused.  Sorry.

>
> I'm adjusting as needed and creating something so that...
>
>   custom_param_if("ucode", parse_ucode, IS_ENABLED(CONFIG_MICROCODE_LOADING));
>
> ... does the right thing. I'm sure it'll have uses outside this (minor) patch 
> to
> remove a number of cmdline handlers when the feature they control isn't 
> active.

This I'm rather less sure about.  The lockdown patches are also
competing for a 3rd parameter in the param() APIs.

Again, I think microcode is a weird (i.e. rare) subsystem where we're
only compiling out part of it.  Personally I'd leave it as you had in
this patch.  It was minimally invasive.

~Andrew



 


Rackspace

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