* [PATCH] x86: don't reserve SETUP_RNG_SEED in e820
@ 2024-01-31 0:04 Jiri Bohac
2024-02-20 13:55 ` [PATCH RESEND] " Jiri Bohac
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Jiri Bohac @ 2024-01-31 0:04 UTC (permalink / raw)
To: x86, Jason A. Donenfeld, Borislav Petkov, H. Peter Anvin
Cc: Thomas Gleixner, Ingo Molnar, Dave Hansen, linux-kernel
SETUP_RNG_SEED in setup_data is supplied by kexec and should
not be reserved in the e820 map.
Doing so reserves 16 bytes of RAM when booting with kexec.
(16 bytes because data->len is zeroed by parse_setup_data so only
sizeof(setup_data) is reserved.)
When kexec is used repeatedly, each boot adds two entries in the
kexec-provided e820 map as the 16-byte range splits a larger
range of usable memory. Eventually all of the 128 available entries
get used up. The next split will result in losing usable memory
as the new entries cannot be added to the e820 map.
Fixes: 68b8e9713c8e ("x86/setup: Use rng seeds from setup_data")
Signed-off-by: Jiri Bohac <jbohac@suse.cz>
---
arch/x86/kernel/e820.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 91ade749f184..7be1362a31aa 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -1018,10 +1018,12 @@ void __init e820__reserve_setup_data(void)
e820__range_update(pa_data, sizeof(*data)+data->len, E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
/*
- * SETUP_EFI and SETUP_IMA are supplied by kexec and do not need
- * to be reserved.
+ * SETUP_EFI, SETUP_IMA and SETUP_RNG_SEED are supplied by
+ * kexec and do not need to be reserved.
*/
- if (data->type != SETUP_EFI && data->type != SETUP_IMA)
+ if (data->type != SETUP_EFI &&
+ data->type != SETUP_IMA &&
+ data->type != SETUP_RNG_SEED)
e820__range_update_kexec(pa_data,
sizeof(*data) + data->len,
E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
--
Jiri Bohac <jbohac@suse.cz>
SUSE Labs, Prague, Czechia
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH RESEND] x86: don't reserve SETUP_RNG_SEED in e820
2024-01-31 0:04 [PATCH] x86: don't reserve SETUP_RNG_SEED in e820 Jiri Bohac
@ 2024-02-20 13:55 ` Jiri Bohac
2024-02-28 9:45 ` Jiri Bohac
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Jiri Bohac @ 2024-02-20 13:55 UTC (permalink / raw)
To: x86, Jason A. Donenfeld, Borislav Petkov, H. Peter Anvin
Cc: Thomas Gleixner, Ingo Molnar, Dave Hansen, linux-kernel
SETUP_RNG_SEED in setup_data is supplied by kexec and should
not be reserved in the e820 map.
Doing so reserves 16 bytes of RAM when booting with kexec.
(16 bytes because data->len is zeroed by parse_setup_data so only
sizeof(setup_data) is reserved.)
When kexec is used repeatedly, each boot adds two entries in the
kexec-provided e820 map as the 16-byte range splits a larger
range of usable memory. Eventually all of the 128 available entries
get used up. The next split will result in losing usable memory
as the new entries cannot be added to the e820 map.
Fixes: 68b8e9713c8e ("x86/setup: Use rng seeds from setup_data")
Signed-off-by: Jiri Bohac <jbohac@suse.cz>
---
arch/x86/kernel/e820.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 91ade749f184..7be1362a31aa 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -1018,10 +1018,12 @@ void __init e820__reserve_setup_data(void)
e820__range_update(pa_data, sizeof(*data)+data->len, E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
/*
- * SETUP_EFI and SETUP_IMA are supplied by kexec and do not need
- * to be reserved.
+ * SETUP_EFI, SETUP_IMA and SETUP_RNG_SEED are supplied by
+ * kexec and do not need to be reserved.
*/
- if (data->type != SETUP_EFI && data->type != SETUP_IMA)
+ if (data->type != SETUP_EFI &&
+ data->type != SETUP_IMA &&
+ data->type != SETUP_RNG_SEED)
e820__range_update_kexec(pa_data,
sizeof(*data) + data->len,
E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
--
Jiri Bohac <jbohac@suse.cz>
SUSE Labs, Prague, Czechia
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RESEND] x86: don't reserve SETUP_RNG_SEED in e820
2024-01-31 0:04 [PATCH] x86: don't reserve SETUP_RNG_SEED in e820 Jiri Bohac
2024-02-20 13:55 ` [PATCH RESEND] " Jiri Bohac
@ 2024-02-28 9:45 ` Jiri Bohac
2024-02-28 10:43 ` Borislav Petkov
2024-02-28 10:28 ` [tip: x86/urgent] x86/e820: Don't " tip-bot2 for Jiri Bohac
` (2 subsequent siblings)
4 siblings, 1 reply; 7+ messages in thread
From: Jiri Bohac @ 2024-02-28 9:45 UTC (permalink / raw)
To: x86, Jason A. Donenfeld, Borislav Petkov, H. Peter Anvin, akpm
Cc: Thomas Gleixner, Ingo Molnar, Dave Hansen, linux-kernel
Adding Andrew Morton - have I been sending this to the wrong people/lists?
On Tue, Feb 20, 2024 at 02:55:27PM +0100, Jiri Bohac wrote:
> SETUP_RNG_SEED in setup_data is supplied by kexec and should
> not be reserved in the e820 map.
>
> Doing so reserves 16 bytes of RAM when booting with kexec.
> (16 bytes because data->len is zeroed by parse_setup_data so only
> sizeof(setup_data) is reserved.)
>
> When kexec is used repeatedly, each boot adds two entries in the
> kexec-provided e820 map as the 16-byte range splits a larger
> range of usable memory. Eventually all of the 128 available entries
> get used up. The next split will result in losing usable memory
> as the new entries cannot be added to the e820 map.
>
> Fixes: 68b8e9713c8e ("x86/setup: Use rng seeds from setup_data")
> Signed-off-by: Jiri Bohac <jbohac@suse.cz>
> ---
> arch/x86/kernel/e820.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
> index 91ade749f184..7be1362a31aa 100644
> --- a/arch/x86/kernel/e820.c
> +++ b/arch/x86/kernel/e820.c
> @@ -1018,10 +1018,12 @@ void __init e820__reserve_setup_data(void)
> e820__range_update(pa_data, sizeof(*data)+data->len, E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
>
> /*
> - * SETUP_EFI and SETUP_IMA are supplied by kexec and do not need
> - * to be reserved.
> + * SETUP_EFI, SETUP_IMA and SETUP_RNG_SEED are supplied by
> + * kexec and do not need to be reserved.
> */
> - if (data->type != SETUP_EFI && data->type != SETUP_IMA)
> + if (data->type != SETUP_EFI &&
> + data->type != SETUP_IMA &&
> + data->type != SETUP_RNG_SEED)
> e820__range_update_kexec(pa_data,
> sizeof(*data) + data->len,
> E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
--
Jiri Bohac <jbohac@suse.cz>
SUSE Labs, Prague, Czechia
^ permalink raw reply [flat|nested] 7+ messages in thread
* [tip: x86/urgent] x86/e820: Don't reserve SETUP_RNG_SEED in e820
2024-01-31 0:04 [PATCH] x86: don't reserve SETUP_RNG_SEED in e820 Jiri Bohac
2024-02-20 13:55 ` [PATCH RESEND] " Jiri Bohac
2024-02-28 9:45 ` Jiri Bohac
@ 2024-02-28 10:28 ` tip-bot2 for Jiri Bohac
2024-03-01 18:12 ` tip-bot2 for Jiri Bohac
2024-03-01 18:37 ` tip-bot2 for Jiri Bohac
4 siblings, 0 replies; 7+ messages in thread
From: tip-bot2 for Jiri Bohac @ 2024-02-28 10:28 UTC (permalink / raw)
To: linux-tip-commits
Cc: Jiri Bohac, Borislav Petkov (AMD), stable, x86, linux-kernel
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: 9e1daa3bfcccf79ee368061d807ff541d6e2d909
Gitweb: https://git.kernel.org/tip/9e1daa3bfcccf79ee368061d807ff541d6e2d909
Author: Jiri Bohac <jbohac@suse.cz>
AuthorDate: Wed, 31 Jan 2024 01:04:28 +01:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Wed, 28 Feb 2024 11:10:31 +01:00
x86/e820: Don't reserve SETUP_RNG_SEED in e820
SETUP_RNG_SEED in setup_data is supplied by kexec and should
not be reserved in the e820 map.
Doing so reserves 16 bytes of RAM when booting with kexec.
(16 bytes because data->len is zeroed by parse_setup_data so only
sizeof(setup_data) is reserved.)
When kexec is used repeatedly, each boot adds two entries in the
kexec-provided e820 map as the 16-byte range splits a larger
range of usable memory. Eventually all of the 128 available entries
get used up. The next split will result in losing usable memory
as the new entries cannot be added to the e820 map.
Fixes: 68b8e9713c8e ("x86/setup: Use rng seeds from setup_data")
Signed-off-by: Jiri Bohac <jbohac@suse.cz>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: <stable@kernel.org>
Link: https://lore.kernel.org/r/ZbmOjKnARGiaYBd5@dwarf.suse.cz
---
arch/x86/kernel/e820.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index fb8cf95..b66f540 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -1017,10 +1017,12 @@ void __init e820__reserve_setup_data(void)
e820__range_update(pa_data, sizeof(*data)+data->len, E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
/*
- * SETUP_EFI and SETUP_IMA are supplied by kexec and do not need
- * to be reserved.
+ * SETUP_EFI, SETUP_IMA and SETUP_RNG_SEED are supplied by
+ * kexec and do not need to be reserved.
*/
- if (data->type != SETUP_EFI && data->type != SETUP_IMA)
+ if (data->type != SETUP_EFI &&
+ data->type != SETUP_IMA &&
+ data->type != SETUP_RNG_SEED)
e820__range_update_kexec(pa_data,
sizeof(*data) + data->len,
E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RESEND] x86: don't reserve SETUP_RNG_SEED in e820
2024-02-28 9:45 ` Jiri Bohac
@ 2024-02-28 10:43 ` Borislav Petkov
0 siblings, 0 replies; 7+ messages in thread
From: Borislav Petkov @ 2024-02-28 10:43 UTC (permalink / raw)
To: Jiri Bohac
Cc: x86, Jason A. Donenfeld, H. Peter Anvin, akpm, Thomas Gleixner,
Ingo Molnar, Dave Hansen, linux-kernel
On Wed, Feb 28, 2024 at 10:45:02AM +0100, Jiri Bohac wrote:
> Adding Andrew Morton - have I been sending this to the wrong people/lists?
You're experiencing people trying to drink from the water hose...
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 7+ messages in thread
* [tip: x86/urgent] x86/e820: Don't reserve SETUP_RNG_SEED in e820
2024-01-31 0:04 [PATCH] x86: don't reserve SETUP_RNG_SEED in e820 Jiri Bohac
` (2 preceding siblings ...)
2024-02-28 10:28 ` [tip: x86/urgent] x86/e820: Don't " tip-bot2 for Jiri Bohac
@ 2024-03-01 18:12 ` tip-bot2 for Jiri Bohac
2024-03-01 18:37 ` tip-bot2 for Jiri Bohac
4 siblings, 0 replies; 7+ messages in thread
From: tip-bot2 for Jiri Bohac @ 2024-03-01 18:12 UTC (permalink / raw)
To: linux-tip-commits
Cc: Jiri Bohac, Borislav Petkov (AMD), stable, x86, linux-kernel
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: 1a2cbc38b74f10c11837f88475d683c69c8503f6
Gitweb: https://git.kernel.org/tip/1a2cbc38b74f10c11837f88475d683c69c8503f6
Author: Jiri Bohac <jbohac@suse.cz>
AuthorDate: Wed, 31 Jan 2024 01:04:28 +01:00
Committer: Dave Hansen <dave.hansen@linux.intel.com>
CommitterDate: Fri, 01 Mar 2024 08:34:25 -08:00
x86/e820: Don't reserve SETUP_RNG_SEED in e820
SETUP_RNG_SEED in setup_data is supplied by kexec and should
not be reserved in the e820 map.
Doing so reserves 16 bytes of RAM when booting with kexec.
(16 bytes because data->len is zeroed by parse_setup_data so only
sizeof(setup_data) is reserved.)
When kexec is used repeatedly, each boot adds two entries in the
kexec-provided e820 map as the 16-byte range splits a larger
range of usable memory. Eventually all of the 128 available entries
get used up. The next split will result in losing usable memory
as the new entries cannot be added to the e820 map.
Fixes: 68b8e9713c8e ("x86/setup: Use rng seeds from setup_data")
Signed-off-by: Jiri Bohac <jbohac@suse.cz>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: <stable@kernel.org>
Link: https://lore.kernel.org/r/ZbmOjKnARGiaYBd5@dwarf.suse.cz
---
arch/x86/kernel/e820.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index fb8cf95..b66f540 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -1017,10 +1017,12 @@ void __init e820__reserve_setup_data(void)
e820__range_update(pa_data, sizeof(*data)+data->len, E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
/*
- * SETUP_EFI and SETUP_IMA are supplied by kexec and do not need
- * to be reserved.
+ * SETUP_EFI, SETUP_IMA and SETUP_RNG_SEED are supplied by
+ * kexec and do not need to be reserved.
*/
- if (data->type != SETUP_EFI && data->type != SETUP_IMA)
+ if (data->type != SETUP_EFI &&
+ data->type != SETUP_IMA &&
+ data->type != SETUP_RNG_SEED)
e820__range_update_kexec(pa_data,
sizeof(*data) + data->len,
E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
^ permalink raw reply [flat|nested] 7+ messages in thread
* [tip: x86/urgent] x86/e820: Don't reserve SETUP_RNG_SEED in e820
2024-01-31 0:04 [PATCH] x86: don't reserve SETUP_RNG_SEED in e820 Jiri Bohac
` (3 preceding siblings ...)
2024-03-01 18:12 ` tip-bot2 for Jiri Bohac
@ 2024-03-01 18:37 ` tip-bot2 for Jiri Bohac
4 siblings, 0 replies; 7+ messages in thread
From: tip-bot2 for Jiri Bohac @ 2024-03-01 18:37 UTC (permalink / raw)
To: linux-tip-commits
Cc: Jiri Bohac, Borislav Petkov (AMD),
Dave Hansen, stable, x86, linux-kernel
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: 7fd817c906503b6813ea3b41f5fdf4192449a707
Gitweb: https://git.kernel.org/tip/7fd817c906503b6813ea3b41f5fdf4192449a707
Author: Jiri Bohac <jbohac@suse.cz>
AuthorDate: Wed, 31 Jan 2024 01:04:28 +01:00
Committer: Dave Hansen <dave.hansen@linux.intel.com>
CommitterDate: Fri, 01 Mar 2024 10:27:20 -08:00
x86/e820: Don't reserve SETUP_RNG_SEED in e820
SETUP_RNG_SEED in setup_data is supplied by kexec and should
not be reserved in the e820 map.
Doing so reserves 16 bytes of RAM when booting with kexec.
(16 bytes because data->len is zeroed by parse_setup_data so only
sizeof(setup_data) is reserved.)
When kexec is used repeatedly, each boot adds two entries in the
kexec-provided e820 map as the 16-byte range splits a larger
range of usable memory. Eventually all of the 128 available entries
get used up. The next split will result in losing usable memory
as the new entries cannot be added to the e820 map.
Fixes: 68b8e9713c8e ("x86/setup: Use rng seeds from setup_data")
Signed-off-by: Jiri Bohac <jbohac@suse.cz>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: <stable@kernel.org>
Link: https://lore.kernel.org/r/ZbmOjKnARGiaYBd5@dwarf.suse.cz
---
arch/x86/kernel/e820.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index fb8cf95..b66f540 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -1017,10 +1017,12 @@ void __init e820__reserve_setup_data(void)
e820__range_update(pa_data, sizeof(*data)+data->len, E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
/*
- * SETUP_EFI and SETUP_IMA are supplied by kexec and do not need
- * to be reserved.
+ * SETUP_EFI, SETUP_IMA and SETUP_RNG_SEED are supplied by
+ * kexec and do not need to be reserved.
*/
- if (data->type != SETUP_EFI && data->type != SETUP_IMA)
+ if (data->type != SETUP_EFI &&
+ data->type != SETUP_IMA &&
+ data->type != SETUP_RNG_SEED)
e820__range_update_kexec(pa_data,
sizeof(*data) + data->len,
E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-03-01 18:37 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-31 0:04 [PATCH] x86: don't reserve SETUP_RNG_SEED in e820 Jiri Bohac
2024-02-20 13:55 ` [PATCH RESEND] " Jiri Bohac
2024-02-28 9:45 ` Jiri Bohac
2024-02-28 10:43 ` Borislav Petkov
2024-02-28 10:28 ` [tip: x86/urgent] x86/e820: Don't " tip-bot2 for Jiri Bohac
2024-03-01 18:12 ` tip-bot2 for Jiri Bohac
2024-03-01 18:37 ` tip-bot2 for Jiri Bohac
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®