Skip to contentSkip to conversation

x86/ucode: Exclude Zen6 from entrysign digest checking

PATCH In review Andrew Cooper 4 participants 6 messages Jun 16

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/ucode: Exclude Zen6 from entrysign digest checking

There is a 3rd path which should have gained an is_zen6_uarch() check to exclude Zen6 from entrysign mitigations.

Fixes bd15fdedafb3 ("x86/ucode: Exclude Zen6 from entrysign mitigations")

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Teddy Astie <[email protected]>
CC: Oleksii Kurochko <[email protected]>

For 4.22. This wants backporting too.

---
 xen/arch/x86/cpu/microcode/amd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
xen/arch/x86/cpu/microcode/amd.c +2 -1
index 2ba1fa825f2f..2d4911022835 100644
@@ -128,7 +128,8 @@ static bool check_digest(const struct container_microcode *mc)
      * the digest of the patch against a list of known provenance.
      */
     if ( boot_cpu_data.family < 0x17 || boot_cpu_data.family > 0x1a ||
-         entrysign_mitigated_in_firmware || !opt_digest_check )
+         is_zen6_uarch() || entrysign_mitigated_in_firmware ||
+         !opt_digest_check )
         return true;
 
     pd = bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_digests),

base-commit: 1cfceee62d8b086a1713d04522f741a09d50cbb3

Signature · 1 line
2.39.5
Reviewed-by on v1 1/1
#1 lore raw

Le 16/06/2026 à 12:47, Andrew Cooper a écrit :

Quoted 31 lines

There is a 3rd path which should have gained an is_zen6_uarch() check to exclude Zen6 from entrysign mitigations.

Fixes bd15fdedafb3 ("x86/ucode: Exclude Zen6 from entrysign mitigations")

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Teddy Astie <[email protected]>
CC: Oleksii Kurochko <[email protected]>

For 4.22. This wants backporting too.

---
  xen/arch/x86/cpu/microcode/amd.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
xen/arch/x86/cpu/microcode/amd.c +2 -1
index 2ba1fa825f2f..2d4911022835 100644
@@ -128,7 +128,8 @@ static bool check_digest(const struct container_microcode *mc)
       * the digest of the patch against a list of known provenance.
       */
      if ( boot_cpu_data.family < 0x17 || boot_cpu_data.family > 0x1a ||
-         entrysign_mitigated_in_firmware || !opt_digest_check )
+         is_zen6_uarch() || entrysign_mitigated_in_firmware ||
+         !opt_digest_check )
          return true;
 
      pd = bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_digests),
Quoted 1 line

base-commit: 1cfceee62d8b086a1713d04522f741a09d50cbb3

Teddy

#2 lore raw
In reply to Andrew Cooper

xen/arch/x86/cpu/microcode/amd.c static bool check_digest(const struct container_microcode *mc) · line 133

Quoted 10 lines · Andrew Cooper
xen/arch/x86/cpu/microcode/amd.c +2 -1
@@ -128,7 +128,8 @@ static bool check_digest(const struct container_microcode *mc)
      * the digest of the patch against a list of known provenance.
      */
     if ( boot_cpu_data.family < 0x17 || boot_cpu_data.family > 0x1a ||
-         entrysign_mitigated_in_firmware || !opt_digest_check )
+         is_zen6_uarch() || entrysign_mitigated_in_firmware ||
+         !opt_digest_check )
         return true;

Besides being somewhat fragile towards future changes (to the family range covered), this also sets a bad precedent towards the comment ahead is is_zen<N>_uarch() saying "The caller is required to perform the appropriate vendor/family checks first." My understanding was that a single family should be checked for in all such cases, not - as is the case here - a range of families. Using the (seemingly) opposite is_zen5_uarch() wouldn't be correct here, after all.

Jan

#3 lore raw
Quoted 10 lines · Jan Beulich
Quoted 9 lines · Andrew Cooper
xen/arch/x86/cpu/microcode/amd.c +2 -1
@@ -128,7 +128,8 @@ static bool check_digest(const struct container_microcode *mc)
      * the digest of the patch against a list of known provenance.
      */
     if ( boot_cpu_data.family < 0x17 || boot_cpu_data.family > 0x1a ||
-         entrysign_mitigated_in_firmware || !opt_digest_check )
+         is_zen6_uarch() || entrysign_mitigated_in_firmware ||
+         !opt_digest_check )
Quoted 8 lines

xen/arch/x86/cpu/microcode/amd.c static bool check_digest(const struct container_microcode *mc) · line 133

Quoted 1 line
xen/arch/x86/cpu/microcode/amd.c +0 -0
         return true;

Besides being somewhat fragile towards future changes (to the family range covered), this also sets a bad precedent towards the comment ahead is is_zen<N>_uarch() saying "The caller is required to perform the appropriate vendor/family checks first." My understanding was that a single family should be checked for in all such cases, not - as is the case here - a range of families. Using the (seemingly) opposite is_zen5_uarch() wouldn't be correct here, after all.

It is true that they're not symmetric when used with ranges.

But "appropriate checks" doesn't mean single family.  I suppose it really means "know what you're doing".

Entrysign is weird.  All other uses of is_zen?_uarch() come with single family checks.

~Andrew

Acked-by
#4 lore raw
Quoted 20 lines · Andrew Cooper
Quoted 10 lines · Jan Beulich
Quoted 9 lines · Andrew Cooper
xen/arch/x86/cpu/microcode/amd.c +2 -1
@@ -128,7 +128,8 @@ static bool check_digest(const struct container_microcode *mc)
      * the digest of the patch against a list of known provenance.
      */
     if ( boot_cpu_data.family < 0x17 || boot_cpu_data.family > 0x1a ||
-         entrysign_mitigated_in_firmware || !opt_digest_check )
+         is_zen6_uarch() || entrysign_mitigated_in_firmware ||
+         !opt_digest_check )
Quoted 8 lines

xen/arch/x86/cpu/microcode/amd.c static bool check_digest(const struct container_microcode *mc) · line 133

Quoted 1 line
xen/arch/x86/cpu/microcode/amd.c +0 -0
         return true;

Besides being somewhat fragile towards future changes (to the family range covered), this also sets a bad precedent towards the comment ahead is is_zen<N>_uarch() saying "The caller is required to perform the appropriate vendor/family checks first." My understanding was that a single family should be checked for in all such cases, not - as is the case here - a range of families. Using the (seemingly) opposite is_zen5_uarch() wouldn't be correct here, after all.

Quoted 7 lines

It is true that they're not symmetric when used with ranges.

But "appropriate checks" doesn't mean single family.  I suppose it really means "know what you're doing".

Entrysign is weird.  All other uses of is_zen?_uarch() come with single family checks.

If you're not afraid of building ourselves a trap here:

Jan

#5 lore raw
In reply to Andrew Cooper
Quoted 5 lines · Andrew Cooper

There is a 3rd path which should have gained an is_zen6_uarch() check to exclude Zen6 from entrysign mitigations.

Fixes bd15fdedafb3 ("x86/ucode: Exclude Zen6 from entrysign mitigations")
Quoted 7 lines

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Teddy Astie <[email protected]>
CC: Oleksii Kurochko <[email protected]>

For 4.22. This wants backporting too.

Thanks.

~ Oleksii