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

Re: [PATCH v2] x86/ucode: Adjust parse_ucode() to match other list handling


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 15 Dec 2025 17:08:13 +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=w/PkPy5oGpKPCENYhicY2DpHfY5ZU+4J8Ci1LC+baXI=; b=WEejFWHWILAZmeGpNuoJnZi8S4CDoaqY66cNyBp8/cTpuSrsfJdaSfEs6RkIWAp0XPm0UzKG0SUDEaDdYQB358xtid5TRXmMNRDBgglWNuuOeHwCWR1pS2u5OwJqpt9hens1g57UnDsZYcivkXbaElVQAwE5cHGKeDfRIAGq3L1dwwFaEq8a5YhCWUtdmOka8Sekg7lAPO18QnEZmg+2NApiLle5ly1C0IsPgEcGDR+QJyvnhkyMZVOWikAer+5XBzt3AkudBv9AZDArjhTVi/gFNSxjuQPuXRLsJlP0aB+RlucZO28MjzBwXv/VSbQVXqYiVZGmjzRpALZIBM4Qyg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=H64hlM7XUCLVua85T/FkxDRCWDQ8ZnctBhSte/jJKTMe7boGhVpOOLxPnZltfdGi8tcgzqvO0pyi8m1lJEHyQp8SULY+Q1swas9yZGDoWu1LLNbAXrM+5y8mkgyyUgdS/2WM0+FPxq96acaA5GIsWM99zNwfngMMQ8pZ0f6uTNubEs1PPt0JH+40YXuMTkvEw22+J3nKxZnUphGOaLlh3f2bQUGT83rllRKIXVoMTYMGgrZxghJmK4jC0Ctr6mKRSNOor7Res61X1El1/jEVN0ZIr7IkxJnaiKTojk3tREmJKxI4q70q4vVZ3SKpzzDG0+G2jxwrDDlqoQ0agOgn8A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 15 Dec 2025 17:08:28 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 15/12/2025 5:00 pm, Jan Beulich wrote:
> On 15.12.2025 16:32, Andrew Cooper wrote:
>> parse_ucode() is abnormal compared to similar parsing elsewhere in Xen.
>>
>> Invert the ucode_mod_forced check with respect to the "scan" and integer
>> handling, so we can warn the user when we've elected to ignore the 
>> parameters,
>> and yield -EINVAL for any unrecognised list element.
>>
>> Rewrite the ucode= command line docs for clarity.
>>
>> No practical change.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
> albeit I'm not quite happy with ...
>
>> --- a/docs/misc/xen-command-line.pandoc
>> +++ b/docs/misc/xen-command-line.pandoc
>> @@ -2752,34 +2752,52 @@ performance.
>>     Alternatively, selecting `tsx=1` will re-enable TSX at the users own 
>> risk.
>>  
>>  ### ucode
>> -> `= List of [ <integer> | scan=<bool>, nmi=<bool>, digest-check=<bool> ]`
>> +> `= List of [ <integer>, scan=<bool>, nmi=<bool>, digest-check=<bool> ]`
> ... this change when ...
>
>>      Applicability: x86
>>      Default: `scan` is selectable via Kconfig, `nmi,digest-check`
>>  
>> -Controls for CPU microcode loading. For early loading, this parameter can
>> -specify how and where to find the microcode update blob. For late loading,
>> -this parameter specifies if the update happens within a NMI handler.
>> -
>> -'integer' specifies the CPU microcode update blob module index. When 
>> positive,
>> -this specifies the n-th module (in the GrUB entry, zero based) to be used
>> -for updating CPU micrcode. When negative, counting starts at the end of
>> -the modules in the GrUB entry (so with the blob commonly being last,
>> -one could specify `ucode=-1`). Note that the value of zero is not valid
>> -here (entry zero, i.e. the first module, is always the Dom0 kernel
>> -image). Note further that use of this option has an unspecified effect
>> -when used with xen.efi (there the concept of modules doesn't exist, and
>> -the blob gets specified via the `ucode=<filename>` config file/section
>> -entry; see [EFI configuration file description](efi.html)).
>> -
>> -'scan' instructs the hypervisor to scan the multiboot images for an cpio
>> -image that contains microcode. Depending on the platform the blob with the
>> -microcode in the cpio name space must be:
>> -  - on Intel: kernel/x86/microcode/GenuineIntel.bin
>> -  - on AMD  : kernel/x86/microcode/AuthenticAMD.bin
>> -When using xen.efi, the `ucode=<filename>` config file setting takes
>> -precedence over `scan`. The default value for `scan` is set with
>> -`CONFIG_UCODE_SCAN_DEFAULT`.
>> +Controls for CPU microcode loading.
>> +
>> +In order to load microcode at boot, Xen needs to find a suitable update
>> +amongst the modules provided by the bootloader.  Two kinds of microcode 
>> update
>> +are supported:
>> +
>> + 1. Raw microcode containers.  The format of the container is CPU vendor
>> +    specific.
>> +
>> + 2. CPIO archive.  This is Linux's preferred mechanism, and involves having
>> +    the raw containers expressed as files
>> +    (e.g. `kernel/x86/microcode/{GenuineIntel,AuthenticAMD}.bin`) in a CPIO
>> +    archive, typically prepended to the initrd.
>> +
>> +The `<integer>` and `scan=<bool>` options are mutually exclusive and select
>> +between these two options.  Further restrictions exist for booting xen.efi
>> +(see below).
> ... then you say verbally that the two are exclusive of one another. That's
> what the | there was intended to indicate. IOW I would prefer that line to
> be left alone, but I'm not intending to insist.

You said that last time around, but it's still not how the parsing works.

ucode=1,1,1,scan,scan,scan,2 is legal.  The latest takes priority and
cancels prior selections.

The reality is that | used in this context is meaningless when there's a
comma separated loop around the whole thing.

If you don't like "mutually exclusive", what else do you suggest?

~Andrew



 


Rackspace

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