All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] x86: fix brk area initialization
@ 2022-06-23  9:46 Juergen Gross
  2022-06-23  9:46 ` [PATCH v2 1/3] x86/xen: use clear_bss() for Xen PV guests Juergen Gross
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Juergen Gross @ 2022-06-23  9:46 UTC (permalink / raw)
  To: xen-devel, x86, linux-kernel
  Cc: Juergen Gross, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, H. Peter Anvin, Boris Ostrovsky

The brk area needs to be zeroed initially, like the .bss section.
At the same time its memory should be covered by the ELF program
headers.

Juergen Gross (3):
  x86/xen: use clear_bss() for Xen PV guests
  x86: fix setup of brk area
  x86: fix .brk attribute in linker script

 arch/x86/include/asm/setup.h  |  3 +++
 arch/x86/kernel/head64.c      |  4 +++-
 arch/x86/kernel/vmlinux.lds.S |  2 +-
 arch/x86/xen/enlighten_pv.c   |  8 ++++++--
 arch/x86/xen/xen-head.S       | 10 +---------
 5 files changed, 14 insertions(+), 13 deletions(-)

-- 
2.35.3


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

* [PATCH v2 1/3] x86/xen: use clear_bss() for Xen PV guests
  2022-06-23  9:46 [PATCH v2 0/3] x86: fix brk area initialization Juergen Gross
@ 2022-06-23  9:46 ` Juergen Gross
  2022-06-23  9:51   ` Jan Beulich
  2022-06-23  9:46 ` [PATCH v2 2/3] x86: fix setup of brk area Juergen Gross
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Juergen Gross @ 2022-06-23  9:46 UTC (permalink / raw)
  To: xen-devel, x86, linux-kernel
  Cc: Juergen Gross, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, H. Peter Anvin, Boris Ostrovsky, Jan Beulich

Instead of clearing the bss area in assembly code, use the clear_bss()
function.

This requires to pass the start_info address as parameter to
xen_start_kernel() in order to avoid the xen_start_info being zeroed
again.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 arch/x86/include/asm/setup.h |  3 +++
 arch/x86/kernel/head64.c     |  2 +-
 arch/x86/xen/enlighten_pv.c  |  8 ++++++--
 arch/x86/xen/xen-head.S      | 10 +---------
 4 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h
index f8b9ee97a891..f37cbff7354c 100644
--- a/arch/x86/include/asm/setup.h
+++ b/arch/x86/include/asm/setup.h
@@ -120,6 +120,9 @@ void *extend_brk(size_t size, size_t align);
 	static char __brk_##name[size]
 
 extern void probe_roms(void);
+
+void clear_bss(void);
+
 #ifdef __i386__
 
 asmlinkage void __init i386_start_kernel(void);
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index bd4a34100ed0..e7e233209a8c 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -426,7 +426,7 @@ void __init do_early_exception(struct pt_regs *regs, int trapnr)
 
 /* Don't add a printk in there. printk relies on the PDA which is not initialized 
    yet. */
-static void __init clear_bss(void)
+void __init clear_bss(void)
 {
 	memset(__bss_start, 0,
 	       (unsigned long) __bss_stop - (unsigned long) __bss_start);
diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
index e3297b15701c..70fb2ea85e90 100644
--- a/arch/x86/xen/enlighten_pv.c
+++ b/arch/x86/xen/enlighten_pv.c
@@ -1183,15 +1183,19 @@ static void __init xen_domu_set_legacy_features(void)
 extern void early_xen_iret_patch(void);
 
 /* First C function to be called on Xen boot */
-asmlinkage __visible void __init xen_start_kernel(void)
+asmlinkage __visible void __init xen_start_kernel(struct start_info *si)
 {
 	struct physdev_set_iopl set_iopl;
 	unsigned long initrd_start = 0;
 	int rc;
 
-	if (!xen_start_info)
+	if (!si)
 		return;
 
+	clear_bss();
+
+	xen_start_info = si;
+
 	__text_gen_insn(&early_xen_iret_patch,
 			JMP32_INSN_OPCODE, &early_xen_iret_patch, &xen_iret,
 			JMP32_INSN_SIZE);
diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
index 3a2cd93bf059..13af6fe453e3 100644
--- a/arch/x86/xen/xen-head.S
+++ b/arch/x86/xen/xen-head.S
@@ -48,15 +48,6 @@ SYM_CODE_START(startup_xen)
 	ANNOTATE_NOENDBR
 	cld
 
-	/* Clear .bss */
-	xor %eax,%eax
-	mov $__bss_start, %rdi
-	mov $__bss_stop, %rcx
-	sub %rdi, %rcx
-	shr $3, %rcx
-	rep stosq
-
-	mov %rsi, xen_start_info
 	mov initial_stack(%rip), %rsp
 
 	/* Set up %gs.
@@ -71,6 +62,7 @@ SYM_CODE_START(startup_xen)
 	cdq
 	wrmsr
 
+	mov	%rsi, %rdi
 	call xen_start_kernel
 SYM_CODE_END(startup_xen)
 	__FINIT
-- 
2.35.3


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

* [PATCH v2 2/3] x86: fix setup of brk area
  2022-06-23  9:46 [PATCH v2 0/3] x86: fix brk area initialization Juergen Gross
  2022-06-23  9:46 ` [PATCH v2 1/3] x86/xen: use clear_bss() for Xen PV guests Juergen Gross
@ 2022-06-23  9:46 ` Juergen Gross
  2022-06-29 17:14   ` Josh Poimboeuf
  2022-06-23  9:46 ` [PATCH v2 3/3] x86: fix .brk attribute in linker script Juergen Gross
  2022-06-29 14:10 ` [PATCH v2 0/3] x86: fix brk area initialization Juergen Gross
  3 siblings, 1 reply; 12+ messages in thread
From: Juergen Gross @ 2022-06-23  9:46 UTC (permalink / raw)
  To: xen-devel, x86, linux-kernel
  Cc: Juergen Gross, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, H. Peter Anvin

Commit e32683c6f7d2 ("x86/mm: Fix RESERVE_BRK() for older binutils")
put the brk area into the .bss..brk section (placed directly behind
.bss), causing it not to be cleared initially. As the brk area is used
to allocate early page tables, these might contain garbage in not
explicitly written entries.

This is especially a problem for Xen PV guests, as the hypervisor will
validate page tables (check for writable page tables and hypervisor
private bits) before accepting them to be used. There have been reports
of early crashes of PV guests due to illegal page table contents.

Fix that by letting clear_bss() clear the brk area, too.

Fixes: e32683c6f7d2 ("x86/mm: Fix RESERVE_BRK() for older binutils")
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/kernel/head64.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index e7e233209a8c..6a3cfaf6b72a 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -430,6 +430,8 @@ void __init clear_bss(void)
 {
 	memset(__bss_start, 0,
 	       (unsigned long) __bss_stop - (unsigned long) __bss_start);
+	memset(__brk_base, 0,
+	       (unsigned long) __brk_limit - (unsigned long) __brk_base);
 }
 
 static unsigned long get_cmd_line_ptr(void)
-- 
2.35.3


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

* [PATCH v2 3/3] x86: fix .brk attribute in linker script
  2022-06-23  9:46 [PATCH v2 0/3] x86: fix brk area initialization Juergen Gross
  2022-06-23  9:46 ` [PATCH v2 1/3] x86/xen: use clear_bss() for Xen PV guests Juergen Gross
  2022-06-23  9:46 ` [PATCH v2 2/3] x86: fix setup of brk area Juergen Gross
@ 2022-06-23  9:46 ` Juergen Gross
  2022-06-29 17:18   ` Josh Poimboeuf
  2022-06-29 14:10 ` [PATCH v2 0/3] x86: fix brk area initialization Juergen Gross
  3 siblings, 1 reply; 12+ messages in thread
From: Juergen Gross @ 2022-06-23  9:46 UTC (permalink / raw)
  To: xen-devel, x86, linux-kernel
  Cc: Juergen Gross, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, H. Peter Anvin

Commit e32683c6f7d2 ("x86/mm: Fix RESERVE_BRK() for older binutils")
added the "NOLOAD" attribute to the .brk section as a "failsafe"
measure.

Unfortunately this leads to the linker no longer covering the .brk
section in a program header, resulting in the kernel loader not knowing
that the memory for the .brk section must be reserved.

This has led to crashes when loading the kernel as PV dom0 under Xen,
but other scenarios could be hit by the same problem (e.g. in case an
uncompressed kernel is used and the initrd is placed directly behind
it).

So drop the "NOLOAD" attribute. This has been verified to correctly
cover the .brk section by a program header of the resulting ELF file.

Fixes: e32683c6f7d2 ("x86/mm: Fix RESERVE_BRK() for older binutils")
Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- new patch
---
 arch/x86/kernel/vmlinux.lds.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index 81aba718ecd5..9487ce8c13ee 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -385,7 +385,7 @@ SECTIONS
 	__end_of_kernel_reserve = .;
 
 	. = ALIGN(PAGE_SIZE);
-	.brk (NOLOAD) : AT(ADDR(.brk) - LOAD_OFFSET) {
+	.brk : AT(ADDR(.brk) - LOAD_OFFSET) {
 		__brk_base = .;
 		. += 64 * 1024;		/* 64k alignment slop space */
 		*(.bss..brk)		/* areas brk users have reserved */
-- 
2.35.3


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

* Re: [PATCH v2 1/3] x86/xen: use clear_bss() for Xen PV guests
  2022-06-23  9:46 ` [PATCH v2 1/3] x86/xen: use clear_bss() for Xen PV guests Juergen Gross
@ 2022-06-23  9:51   ` Jan Beulich
  2022-06-28 12:03     ` Juergen Gross
  0 siblings, 1 reply; 12+ messages in thread
From: Jan Beulich @ 2022-06-23  9:51 UTC (permalink / raw)
  To: Juergen Gross
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
	H. Peter Anvin, Boris Ostrovsky, xen-devel, x86, linux-kernel

On 23.06.2022 11:46, Juergen Gross wrote:
> --- a/arch/x86/xen/enlighten_pv.c
> +++ b/arch/x86/xen/enlighten_pv.c
> @@ -1183,15 +1183,19 @@ static void __init xen_domu_set_legacy_features(void)
>  extern void early_xen_iret_patch(void);
>  
>  /* First C function to be called on Xen boot */
> -asmlinkage __visible void __init xen_start_kernel(void)
> +asmlinkage __visible void __init xen_start_kernel(struct start_info *si)
>  {
>  	struct physdev_set_iopl set_iopl;
>  	unsigned long initrd_start = 0;
>  	int rc;
>  
> -	if (!xen_start_info)
> +	if (!si)
>  		return;
>  
> +	clear_bss();

As per subsequent observation, this shouldn't really be needed: The
hypervisor (or tool stack for DomU-s) already does so. While I guess
we want to keep it to be on the safe side, maybe worth a comment?

Jan

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

* Re: [PATCH v2 1/3] x86/xen: use clear_bss() for Xen PV guests
  2022-06-23  9:51   ` Jan Beulich
@ 2022-06-28 12:03     ` Juergen Gross
  0 siblings, 0 replies; 12+ messages in thread
From: Juergen Gross @ 2022-06-28 12:03 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
	H. Peter Anvin, Boris Ostrovsky, xen-devel, x86, linux-kernel


[-- Attachment #1.1.1: Type: text/plain, Size: 1049 bytes --]

On 23.06.22 11:51, Jan Beulich wrote:
> On 23.06.2022 11:46, Juergen Gross wrote:
>> --- a/arch/x86/xen/enlighten_pv.c
>> +++ b/arch/x86/xen/enlighten_pv.c
>> @@ -1183,15 +1183,19 @@ static void __init xen_domu_set_legacy_features(void)
>>   extern void early_xen_iret_patch(void);
>>   
>>   /* First C function to be called on Xen boot */
>> -asmlinkage __visible void __init xen_start_kernel(void)
>> +asmlinkage __visible void __init xen_start_kernel(struct start_info *si)
>>   {
>>   	struct physdev_set_iopl set_iopl;
>>   	unsigned long initrd_start = 0;
>>   	int rc;
>>   
>> -	if (!xen_start_info)
>> +	if (!si)
>>   		return;
>>   
>> +	clear_bss();
> 
> As per subsequent observation, this shouldn't really be needed: The
> hypervisor (or tool stack for DomU-s) already does so. While I guess
> we want to keep it to be on the safe side, maybe worth a comment?

Are you sure all possible boot loaders are clearing alloc-only sections?

I'd rather not count on e.g. grub doing this in all cases.


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3149 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [PATCH v2 0/3] x86: fix brk area initialization
  2022-06-23  9:46 [PATCH v2 0/3] x86: fix brk area initialization Juergen Gross
                   ` (2 preceding siblings ...)
  2022-06-23  9:46 ` [PATCH v2 3/3] x86: fix .brk attribute in linker script Juergen Gross
@ 2022-06-29 14:10 ` Juergen Gross
  2022-06-29 17:17   ` Boris Ostrovsky
  2022-07-05 11:14   ` Thorsten Leemhuis
  3 siblings, 2 replies; 12+ messages in thread
From: Juergen Gross @ 2022-06-29 14:10 UTC (permalink / raw)
  To: xen-devel, x86, linux-kernel
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
	H. Peter Anvin, Boris Ostrovsky, regressions


[-- Attachment #1.1.1: Type: text/plain, Size: 872 bytes --]

On 23.06.22 11:46, Juergen Gross wrote:
> The brk area needs to be zeroed initially, like the .bss section.
> At the same time its memory should be covered by the ELF program
> headers.
> 
> Juergen Gross (3):
>    x86/xen: use clear_bss() for Xen PV guests
>    x86: fix setup of brk area
>    x86: fix .brk attribute in linker script
> 
>   arch/x86/include/asm/setup.h  |  3 +++
>   arch/x86/kernel/head64.c      |  4 +++-
>   arch/x86/kernel/vmlinux.lds.S |  2 +-
>   arch/x86/xen/enlighten_pv.c   |  8 ++++++--
>   arch/x86/xen/xen-head.S       | 10 +---------
>   5 files changed, 14 insertions(+), 13 deletions(-)
> 

Could I please have some feedback? This series is fixing a major
regression regarding running as Xen PV guest (depending on kernel
configuration system will crash very early).

#regzbot ^introduced e32683c6f7d2


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3149 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [PATCH v2 2/3] x86: fix setup of brk area
  2022-06-23  9:46 ` [PATCH v2 2/3] x86: fix setup of brk area Juergen Gross
@ 2022-06-29 17:14   ` Josh Poimboeuf
  2022-06-30  6:55     ` Juergen Gross
  0 siblings, 1 reply; 12+ messages in thread
From: Josh Poimboeuf @ 2022-06-29 17:14 UTC (permalink / raw)
  To: Juergen Gross
  Cc: xen-devel, x86, linux-kernel, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, H. Peter Anvin

Hi Juergen,

It helps to actually Cc the person who broke it ;-)

On Thu, Jun 23, 2022 at 11:46:07AM +0200, Juergen Gross wrote:
> Commit e32683c6f7d2 ("x86/mm: Fix RESERVE_BRK() for older binutils")
> put the brk area into the .bss..brk section (placed directly behind
> .bss),

Hm? It didn't actually do that.

For individual translation units, it did rename the section from
".brk_reservation" to ".bss..brk".  But then during linking it's still
placed in .brk in vmlinux, just like before.

> causing it not to be cleared initially. As the brk area is used
> to allocate early page tables, these might contain garbage in not
> explicitly written entries.
> 
> This is especially a problem for Xen PV guests, as the hypervisor will
> validate page tables (check for writable page tables and hypervisor
> private bits) before accepting them to be used. There have been reports
> of early crashes of PV guests due to illegal page table contents.
> 
> Fix that by letting clear_bss() clear the brk area, too.

While it does make sense to clear the brk area, I don't understand how
my patch broke this.  How was it getting cleared before?

-- 
Josh

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

* Re: [PATCH v2 0/3] x86: fix brk area initialization
  2022-06-29 14:10 ` [PATCH v2 0/3] x86: fix brk area initialization Juergen Gross
@ 2022-06-29 17:17   ` Boris Ostrovsky
  2022-07-05 11:14   ` Thorsten Leemhuis
  1 sibling, 0 replies; 12+ messages in thread
From: Boris Ostrovsky @ 2022-06-29 17:17 UTC (permalink / raw)
  To: Juergen Gross, xen-devel, x86, linux-kernel
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
	H. Peter Anvin, regressions


On 6/29/22 10:10 AM, Juergen Gross wrote:
> On 23.06.22 11:46, Juergen Gross wrote:
>> The brk area needs to be zeroed initially, like the .bss section.
>> At the same time its memory should be covered by the ELF program
>> headers.
>>
>> Juergen Gross (3):
>>    x86/xen: use clear_bss() for Xen PV guests
>>    x86: fix setup of brk area
>>    x86: fix .brk attribute in linker script
>>
>>   arch/x86/include/asm/setup.h  |  3 +++
>>   arch/x86/kernel/head64.c      |  4 +++-
>>   arch/x86/kernel/vmlinux.lds.S |  2 +-
>>   arch/x86/xen/enlighten_pv.c   |  8 ++++++--
>>   arch/x86/xen/xen-head.S       | 10 +---------
>>   5 files changed, 14 insertions(+), 13 deletions(-)
>>
>
> Could I please have some feedback? This series is fixing a major
> regression regarding running as Xen PV guest (depending on kernel
> configuration system will crash very early).
>
> #regzbot ^introduced e32683c6f7d2
>


I don't think you need this for Xen bits as Jan had already reviewed it but in case you do


Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>


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

* Re: [PATCH v2 3/3] x86: fix .brk attribute in linker script
  2022-06-23  9:46 ` [PATCH v2 3/3] x86: fix .brk attribute in linker script Juergen Gross
@ 2022-06-29 17:18   ` Josh Poimboeuf
  0 siblings, 0 replies; 12+ messages in thread
From: Josh Poimboeuf @ 2022-06-29 17:18 UTC (permalink / raw)
  To: Juergen Gross
  Cc: xen-devel, x86, linux-kernel, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, H. Peter Anvin

On Thu, Jun 23, 2022 at 11:46:08AM +0200, Juergen Gross wrote:
> Commit e32683c6f7d2 ("x86/mm: Fix RESERVE_BRK() for older binutils")
> added the "NOLOAD" attribute to the .brk section as a "failsafe"
> measure.
> 
> Unfortunately this leads to the linker no longer covering the .brk
> section in a program header, resulting in the kernel loader not knowing
> that the memory for the .brk section must be reserved.
> 
> This has led to crashes when loading the kernel as PV dom0 under Xen,
> but other scenarios could be hit by the same problem (e.g. in case an
> uncompressed kernel is used and the initrd is placed directly behind
> it).
> 
> So drop the "NOLOAD" attribute. This has been verified to correctly
> cover the .brk section by a program header of the resulting ELF file.
> 
> Fixes: e32683c6f7d2 ("x86/mm: Fix RESERVE_BRK() for older binutils")
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Josh Poimboeuf <jpoimboe@kernel.org>

-- 
Josh

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

* Re: [PATCH v2 2/3] x86: fix setup of brk area
  2022-06-29 17:14   ` Josh Poimboeuf
@ 2022-06-30  6:55     ` Juergen Gross
  0 siblings, 0 replies; 12+ messages in thread
From: Juergen Gross @ 2022-06-30  6:55 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: xen-devel, x86, linux-kernel, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, H. Peter Anvin


[-- Attachment #1.1.1: Type: text/plain, Size: 1828 bytes --]

On 29.06.22 19:14, Josh Poimboeuf wrote:
> Hi Juergen,
> 
> It helps to actually Cc the person who broke it ;-)
> 
> On Thu, Jun 23, 2022 at 11:46:07AM +0200, Juergen Gross wrote:
>> Commit e32683c6f7d2 ("x86/mm: Fix RESERVE_BRK() for older binutils")
>> put the brk area into the .bss..brk section (placed directly behind
>> .bss),
> 
> Hm? It didn't actually do that.
> 
> For individual translation units, it did rename the section from
> ".brk_reservation" to ".bss..brk".  But then during linking it's still
> placed in .brk in vmlinux, just like before.

Sorry, I misread the patch commit message and was fooled by the fact that
bisection clearly pointed at this patch to have introduced the problem.

I only discovered later that the main issue was the added "NOLOAD"
attribute.

>> causing it not to be cleared initially. As the brk area is used
>> to allocate early page tables, these might contain garbage in not
>> explicitly written entries.
>>
>> This is especially a problem for Xen PV guests, as the hypervisor will
>> validate page tables (check for writable page tables and hypervisor
>> private bits) before accepting them to be used. There have been reports
>> of early crashes of PV guests due to illegal page table contents.
>>
>> Fix that by letting clear_bss() clear the brk area, too.
> 
> While it does make sense to clear the brk area, I don't understand how
> my patch broke this.  How was it getting cleared before?

It seemed to have worked by chance. The Xen hypervisor is clearing all
alloc-only sections when loading a kernel (this will "fix" the dom0
case reliably together with patch 3 of this series).

Grub might do the clearing, too (for the PV domU case), but I haven't
verified that by code inspection.

I'll drop the "Fixes:" tag.


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3149 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [PATCH v2 0/3] x86: fix brk area initialization
  2022-06-29 14:10 ` [PATCH v2 0/3] x86: fix brk area initialization Juergen Gross
  2022-06-29 17:17   ` Boris Ostrovsky
@ 2022-07-05 11:14   ` Thorsten Leemhuis
  1 sibling, 0 replies; 12+ messages in thread
From: Thorsten Leemhuis @ 2022-07-05 11:14 UTC (permalink / raw)
  To: regressions



On 29.06.22 16:10, Juergen Gross wrote:
> On 23.06.22 11:46, Juergen Gross wrote:
>> The brk area needs to be zeroed initially, like the .bss section.
>> At the same time its memory should be covered by the ELF program
>> headers.
>>
>> Juergen Gross (3):
>>    x86/xen: use clear_bss() for Xen PV guests
>>    x86: fix setup of brk area
>>    x86: fix .brk attribute in linker script
>>
>>   arch/x86/include/asm/setup.h  |  3 +++
>>   arch/x86/kernel/head64.c      |  4 +++-
>>   arch/x86/kernel/vmlinux.lds.S |  2 +-
>>   arch/x86/xen/enlighten_pv.c   |  8 ++++++--
>>   arch/x86/xen/xen-head.S       | 10 +---------
>>   5 files changed, 14 insertions(+), 13 deletions(-)
>>
> 
> Could I please have some feedback? This series is fixing a major
> regression regarding running as Xen PV guest (depending on kernel
> configuration system will crash very early).
> 
> #regzbot ^introduced e32683c6f7d2

#regzbot fixed-by: 7e09ac27f43b382


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

end of thread, other threads:[~2022-07-05 11:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-23  9:46 [PATCH v2 0/3] x86: fix brk area initialization Juergen Gross
2022-06-23  9:46 ` [PATCH v2 1/3] x86/xen: use clear_bss() for Xen PV guests Juergen Gross
2022-06-23  9:51   ` Jan Beulich
2022-06-28 12:03     ` Juergen Gross
2022-06-23  9:46 ` [PATCH v2 2/3] x86: fix setup of brk area Juergen Gross
2022-06-29 17:14   ` Josh Poimboeuf
2022-06-30  6:55     ` Juergen Gross
2022-06-23  9:46 ` [PATCH v2 3/3] x86: fix .brk attribute in linker script Juergen Gross
2022-06-29 17:18   ` Josh Poimboeuf
2022-06-29 14:10 ` [PATCH v2 0/3] x86: fix brk area initialization Juergen Gross
2022-06-29 17:17   ` Boris Ostrovsky
2022-07-05 11:14   ` Thorsten Leemhuis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.