From: Jan Beulich <jbeulich@suse.com>
To: Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v4 1/3] x86: Put trampoline in separate .init.trampoline section
Date: Mon, 23 Sep 2024 17:17:23 +0200 [thread overview]
Message-ID: <47fc5e0d-e249-4e69-b19d-bb2c4edd1abd@suse.com> (raw)
In-Reply-To: <20240919080021.20155-2-frediano.ziglio@cloud.com>
On 19.09.2024 10:00, Frediano Ziglio wrote:
> This change put the trampoline in a separate, not executable section.
> The trampoline contains a mix of code and data (data which
> is modified from C code during early start so must be writable).
> This is in preparation for W^X patch in order to satisfy UEFI CA
> memory mitigation requirements.
> At the moment .init.text and .init.data in EFI mode are put together
> so they will be in the same final section as before this patch.
> Putting in a separate section (even in final executables) allows
> to easily disassembly that section. As we need to have a writable
> section and as we can't have code and data together to satisfy W^X
> requirement we need to have a data section. However tools like objdump
> by default do not disassemble data sections. Forcing disassembly of
> data sections would result in a very large output and possibly crash
> of tools. Putting in a separate section allows to selectively
> disassemble that part of code using a command like
>
> objdump -m i386 -j .init.trampoline -d xen-syms
For xen.efi it won't be quite as neat. One of the reason all .init.*
are folded into a single section there is that the longer section names
aren't properly represented, because of the linker apparently preferring
to truncate them instead of using the "long section names" extension. To
disassemble there one will need to remember to use "-j .init.tr". I'll
have to check if there's a linker option we fail to enable, but in the
absence of that we may want to consider to name the output section just
".trampoline" there, abbreviating to ".trampol" (i.e. at least a little
more descriptive).
> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -882,8 +882,9 @@ cmdline_parse_early:
> reloc:
> .incbin "reloc.bin"
>
> +#include "x86_64.S"
> +
> + .section .init.trampoline, "aw", @progbits
I think the lack of x here requires a comment.
Also did I miss any reply by you to Andrew's suggestion to move the
trampoline to its own translation unit?
Jan
next prev parent reply other threads:[~2024-09-23 15:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-19 8:00 [PATCH v4 0/3] x86: Satisfy requirements for UEFI CA memory mitigation requirements Frediano Ziglio
2024-09-19 8:00 ` [PATCH v4 1/3] x86: Put trampoline in separate .init.trampoline section Frediano Ziglio
2024-09-23 15:17 ` Jan Beulich [this message]
2024-09-23 15:31 ` Frediano Ziglio
2024-09-23 15:42 ` Jan Beulich
2024-09-19 8:00 ` [PATCH v4 2/3] x86: Split output sections for UEFI CA memory mitigation requirements Frediano Ziglio
2024-09-23 15:45 ` Jan Beulich
2024-09-19 8:00 ` [PATCH v4 3/3] x86: Align " Frediano Ziglio
2024-09-23 15:54 ` Jan Beulich
2024-09-23 16:06 ` Frediano Ziglio
2024-09-24 8:14 ` Jan Beulich
2024-09-24 10:22 ` Frediano Ziglio
2024-09-24 11:09 ` Jan Beulich
2024-09-24 12:17 ` Jan Beulich
2024-09-24 12:22 ` Frediano Ziglio
2024-09-24 13:27 ` Jan Beulich
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=47fc5e0d-e249-4e69-b19d-bb2c4edd1abd@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=frediano.ziglio@cloud.com \
--cc=roger.pau@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/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 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.