linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: "H. Peter Anvin" <hpa@zytor.com>,
	"Jason A. Donenfeld" <Jason@zx2c4.com>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	"Theodore Ts'o" <tytso@mit.edu>,
	"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
	"Xin Li" <xin@zytor.com>, "Andy Lutomirski" <luto@kernel.org>,
	"Ard Biesheuvel" <ardb@kernel.org>,
	"Borislav Petkov" <bp@alien8.de>,
	"Brian Gerst" <brgerst@gmail.com>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	"Ingo Molnar" <mingo@redhat.com>,
	"James Morse" <james.morse@arm.com>,
	"Jarkko Sakkinen" <jarkko@kernel.org>,
	"Josh Poimboeuf" <jpoimboe@kernel.org>,
	"Kees Cook" <kees@kernel.org>, "Nam Cao" <namcao@linutronix.de>,
	"Oleg Nesterov" <oleg@redhat.com>,
	"Perry Yuan" <perry.yuan@amd.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Thomas Huth" <thuth@redhat.com>,
	"Uros Bizjak" <ubizjak@gmail.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	linux-sgx@vger.kernel.org, x86@kernel.org
Subject: Re: [PATCH v3 6/9] x86/entry/vdso: include GNU_PROPERTY and GNU_STACK PHDRs
Date: Thu, 13 Nov 2025 19:09:24 +0000	[thread overview]
Message-ID: <55128481-71e2-489e-a669-25b60dabb407@citrix.com> (raw)
In-Reply-To: <20251112202258.1310754-7-hpa@zytor.com>

On 12/11/2025 8:22 pm, H. Peter Anvin wrote:
>  arch/x86/entry/vdso/common/vdso-layout.lds.S | 51 +++++++++++---------
>  1 file changed, 28 insertions(+), 23 deletions(-)
>
> diff --git a/arch/x86/entry/vdso/common/vdso-layout.lds.S b/arch/x86/entry/vdso/common/vdso-layout.lds.S
> index ec1ac191a057..696bacb99ed8 100644
> --- a/arch/x86/entry/vdso/common/vdso-layout.lds.S
> +++ b/arch/x86/entry/vdso/common/vdso-layout.lds.S
> @@ -26,7 +26,7 @@ SECTIONS
>  
>  	. = SIZEOF_HEADERS;
>  
> -	.hash		: { *(.hash) }			:text
> +	.hash		: { *(.hash) }		:text
>  	.gnu.hash	: { *(.gnu.hash) }
>  	.dynsym		: { *(.dynsym) }
>  	.dynstr		: { *(.dynstr) }
> @@ -34,7 +34,7 @@ SECTIONS
>  	.gnu.version_d	: { *(.gnu.version_d) }
>  	.gnu.version_r	: { *(.gnu.version_r) }
>  
> -	.dynamic	: { *(.dynamic) }		:text	:dynamic
> +	.dynamic	: { *(.dynamic) }	:text :dynamic
>  
>  	.rodata		: {
>  		*(.rodata*)
> @@ -45,31 +45,28 @@ SECTIONS
>  		*(.bss*)
>  		*(.dynbss*)
>  		*(.gnu.linkonce.b.*)
> -	}						:text
> +	}					:text
>  
> -	/*
> -	 * Discard .note.gnu.property sections which are unused and have
> -	 * different alignment requirement from vDSO note sections.
> -	 */
> -	/DISCARD/ : {
> +	.note.gnu.property : {
>  		*(.note.gnu.property)
> -	}
> -	.note		: { *(.note.*) }		:text	:note
> -
> -	.eh_frame_hdr	: { *(.eh_frame_hdr) }		:text	:eh_frame_hdr
> -	.eh_frame	: { KEEP (*(.eh_frame)) }	:text
> +	}					:text :note :gnu_property
> +	.note		: {
> +		*(.note*)
> +	}					:text :note
>  
> +	.eh_frame_hdr	: { *(.eh_frame_hdr) }	:text :eh_frame_hdr
> +	.eh_frame	: {
> +		KEEP (*(.eh_frame))
> +		*(.eh_frame.*)
> +	}					:text
>  
>  	/*
>  	 * Text is well-separated from actual data: there's plenty of
>  	 * stuff that isn't used at runtime in between.
> -	 */
> -
> +	*/
>  	.text		: {
>  		*(.text*)
> -	}						:text	=0x90909090,
> -
> -
> +	}					:text	=0x90909090
>  

Almost all of these hunks look to be whitespace changes only.  Was that
intentional?  It certainly makes it harder to read.

>  	.altinstructions	: { *(.altinstructions) }	:text
>  	.altinstr_replacement	: { *(.altinstr_replacement) }	:text
> @@ -87,15 +84,23 @@ SECTIONS
>   * Very old versions of ld do not recognize this name token; use the constant.
>   */
>  #define PT_GNU_EH_FRAME	0x6474e550
> +#define PT_GNU_STACK	0x6474e551
> +#define PT_GNU_PROPERTY	0x6474e553
>  
>  /*
>   * We must supply the ELF program headers explicitly to get just one
>   * PT_LOAD segment, and set the flags explicitly to make segments read-only.
> - */
> +*/

This looks like it wants undoing too.

That said, I do strongly agree with the reasoning behind this patch.

~Andrew


  reply	other threads:[~2025-11-13 19:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-12 20:22 [PATCH v3 0/9] x86/entry/vdso: clean up the vdso build, vdso updates H. Peter Anvin
2025-11-12 20:22 ` [PATCH v3 1/9] x86/entry/vdso: rename vdso_image_* to vdso*_image H. Peter Anvin
2025-11-13 19:31   ` Andrew Cooper
2025-11-12 20:22 ` [PATCH v3 2/9] x86/entry/vdso: refactor the vdso build H. Peter Anvin
2025-11-13 18:38   ` Brian Gerst
2025-11-13 21:11     ` H. Peter Anvin
2025-11-13 22:41       ` Brian Gerst
2025-11-12 20:22 ` [PATCH v3 3/9] x86/entry/vdso32: don't rely on int80_landing_pad for adjusting ip H. Peter Anvin
2025-11-12 20:22 ` [PATCH v3 4/9] x86/entry/vdso32: remove SYSCALL_ENTER_KERNEL macro in sigreturn.S H. Peter Anvin
2025-11-12 20:22 ` [PATCH v3 5/9] x86/entry/vdso32: remove open-coded DWARF " H. Peter Anvin
2025-11-12 20:22 ` [PATCH v3 6/9] x86/entry/vdso: include GNU_PROPERTY and GNU_STACK PHDRs H. Peter Anvin
2025-11-13 19:09   ` Andrew Cooper [this message]
2025-11-13 21:13     ` H. Peter Anvin
2025-11-12 20:22 ` [PATCH v3 7/9] x86/vdso: abstract out vdso system call internals H. Peter Anvin
2025-11-12 20:22 ` [PATCH v3 8/9] x86/cpufeature: replace X86_FEATURE_SYSENTER32 with X86_FEATURE_SYSFAST32 H. Peter Anvin
2025-11-12 20:22 ` [PATCH v3 9/9] x86/entry/vdso32: when using int $0x80, use it directly H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55128481-71e2-489e-a669-25b60dabb407@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Jason@zx2c4.com \
    --cc=ardb@kernel.org \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=james.morse@arm.com \
    --cc=jarkko@kernel.org \
    --cc=jpoimboe@kernel.org \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-sgx@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=namcao@linutronix.de \
    --cc=oleg@redhat.com \
    --cc=perry.yuan@amd.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=thuth@redhat.com \
    --cc=tytso@mit.edu \
    --cc=ubizjak@gmail.com \
    --cc=x86@kernel.org \
    --cc=xin@zytor.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox