Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH] x86/microcode/AMD: Increase microcode PATCH_MAX_SIZE
@ 2023-07-20 20:28 John Allen
  2023-07-21  4:47 ` Jiri Slaby
  0 siblings, 1 reply; 3+ messages in thread
From: John Allen @ 2023-07-20 20:28 UTC (permalink / raw)
  To: bp, linux-kernel; +Cc: tglx, mingo, hpa, x86, John Allen, stable

Future AMD cpus will have microcode patches that exceed the current
limit of three 4K pages. Increase substantially to avoid future size
increases.

Signed-off-by: John Allen <john.allen@amd.com>
Cc: stable@vger.kernel.org
---
 arch/x86/include/asm/microcode_amd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/microcode_amd.h b/arch/x86/include/asm/microcode_amd.h
index e6662adf3af4..e3d5f5ae2f46 100644
--- a/arch/x86/include/asm/microcode_amd.h
+++ b/arch/x86/include/asm/microcode_amd.h
@@ -41,7 +41,7 @@ struct microcode_amd {
 	unsigned int			mpb[];
 };
 
-#define PATCH_MAX_SIZE (3 * PAGE_SIZE)
+#define PATCH_MAX_SIZE (8 * PAGE_SIZE)
 
 #ifdef CONFIG_MICROCODE_AMD
 extern void __init load_ucode_amd_bsp(unsigned int family);
-- 
2.39.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/microcode/AMD: Increase microcode PATCH_MAX_SIZE
  2023-07-20 20:28 [PATCH] x86/microcode/AMD: Increase microcode PATCH_MAX_SIZE John Allen
@ 2023-07-21  4:47 ` Jiri Slaby
  2023-07-21  7:38   ` Borislav Petkov
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Slaby @ 2023-07-21  4:47 UTC (permalink / raw)
  To: John Allen, bp, linux-kernel; +Cc: tglx, mingo, hpa, x86, stable

On 20. 07. 23, 22:28, John Allen wrote:
> Future AMD cpus will have microcode patches that exceed the current
> limit of three 4K pages. Increase substantially to avoid future size
> increases.

Hi,

so with my current distro (openSUSE TW):
$ zgrep NODES_SHIFT /proc/config.gz
CONFIG_NODES_SHIFT=10

This:

static u8 amd_ucode_patch[MAX_NUMNODES][PATCH_MAX_SIZE];

is now 32M instead of 12M. That is a complete waste on my _one_ node 
system. Can we make amd_ucode_patch dynamic first, depending on 
num_online_nodes()?

> Signed-off-by: John Allen <john.allen@amd.com>
> Cc: stable@vger.kernel.org
> ---
>   arch/x86/include/asm/microcode_amd.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/include/asm/microcode_amd.h b/arch/x86/include/asm/microcode_amd.h
> index e6662adf3af4..e3d5f5ae2f46 100644
> --- a/arch/x86/include/asm/microcode_amd.h
> +++ b/arch/x86/include/asm/microcode_amd.h
> @@ -41,7 +41,7 @@ struct microcode_amd {
>   	unsigned int			mpb[];
>   };
>   
> -#define PATCH_MAX_SIZE (3 * PAGE_SIZE)
> +#define PATCH_MAX_SIZE (8 * PAGE_SIZE)
>   
>   #ifdef CONFIG_MICROCODE_AMD
>   extern void __init load_ucode_amd_bsp(unsigned int family);

thanks,
-- 
js
suse labs


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/microcode/AMD: Increase microcode PATCH_MAX_SIZE
  2023-07-21  4:47 ` Jiri Slaby
@ 2023-07-21  7:38   ` Borislav Petkov
  0 siblings, 0 replies; 3+ messages in thread
From: Borislav Petkov @ 2023-07-21  7:38 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: John Allen, linux-kernel, tglx, mingo, hpa, x86, stable

On Fri, Jul 21, 2023 at 06:47:39AM +0200, Jiri Slaby wrote:
> is now 32M instead of 12M. That is a complete waste on my _one_ node system.
> Can we make amd_ucode_patch dynamic first, depending on num_online_nodes()?

I have a small set which gets rid of all those arrays - I just need to
finish it.

:-(

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-21  7:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-20 20:28 [PATCH] x86/microcode/AMD: Increase microcode PATCH_MAX_SIZE John Allen
2023-07-21  4:47 ` Jiri Slaby
2023-07-21  7:38   ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox