From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
George Dunlap <george.dunlap@citrix.com>
Subject: Re: [PATCH v5 2/8] x86: annotate entry points with type and size
Date: Thu, 18 Jan 2024 18:45:12 +0100 [thread overview]
Message-ID: <ZaljqHduUIvsdbqm@macbook> (raw)
In-Reply-To: <9096ad1a-5d86-4dd1-a7c3-6ad2f7e5a623@suse.com>
On Mon, Jan 15, 2024 at 03:34:56PM +0100, Jan Beulich wrote:
> @@ -625,7 +627,7 @@ ENTRY(dom_crash_sync_extable)
>
> /* No special register assumptions. */
> #ifdef CONFIG_PV
> -ENTRY(continue_pv_domain)
> +FUNC(continue_pv_domain)
> ENDBR64
> call check_wakeup_from_wait
> ret_from_intr:
> @@ -640,26 +642,28 @@ ret_from_intr:
> #else
> jmp test_all_events
> #endif
> +END(continue_pv_domain)
> #else
> -ret_from_intr:
> +FUNC_LOCAL(ret_from_intr, 0)
Why does this need to have an alignment of 0? There's no fallthrough
of previous code AFAICT.
> ASSERT_CONTEXT_IS_XEN
> jmp restore_all_xen
> +END(ret_from_intr)
> #endif
>
> .section .init.text, "ax", @progbits
> -ENTRY(early_page_fault)
> +FUNC(early_page_fault)
> ENDBR64
> movl $X86_EXC_PF, 4(%rsp)
> SAVE_ALL
> movq %rsp, %rdi
> call do_early_page_fault
> jmp restore_all_xen
> +END(early_page_fault)
>
> .section .text.entry, "ax", @progbits
>
> - ALIGN
> /* %r12=ist_exit */
> -restore_all_xen:
> +FUNC_LOCAL(restore_all_xen)
>
> #ifdef CONFIG_DEBUG
> mov %rsp, %rdi
> @@ -683,8 +687,9 @@ UNLIKELY_END(exit_cr3)
>
> RESTORE_ALL adj=8
> iretq
> +END(restore_all_xen)
>
> -ENTRY(common_interrupt)
> +FUNC(common_interrupt)
> ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP
> SAVE_ALL
>
> @@ -713,12 +718,14 @@ ENTRY(common_interrupt)
> mov %r15, STACK_CPUINFO_FIELD(xen_cr3)(%r14)
> mov %bl, STACK_CPUINFO_FIELD(use_pv_cr3)(%r14)
> jmp ret_from_intr
> +END(common_interrupt)
>
> -ENTRY(entry_PF)
> +FUNC(entry_PF)
> ENDBR64
> movl $X86_EXC_PF, 4(%rsp)
> +END(entry_PF)
> /* No special register assumptions. */
> -GLOBAL(handle_exception)
> +FUNC(handle_exception, 0)
Given patch 8/8 that enables support for placing FUNC() into separate
sections, the fallthrough arrangement here with entry_PF is no longer
guaranteed, as the linker could re-order the sections and thus
entry_PF could fallthrough into another text section?
IOW: entry_PF needs a "jmp handle_exception", and then
handle_exception itself can be padded as required by the default
alignment?
> ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP
> SAVE_ALL
>
> @@ -886,92 +893,108 @@ FATAL_exception_with_ints_disabled:
> xorl %esi,%esi
> movq %rsp,%rdi
> tailcall fatal_trap
> +END(handle_exception)
>
> -ENTRY(entry_DE)
> +FUNC(entry_DE)
> ENDBR64
> pushq $0
> movl $X86_EXC_DE, 4(%rsp)
> jmp handle_exception
> +END(entry_DE)
>
> -ENTRY(entry_MF)
> +FUNC(entry_MF)
> ENDBR64
> pushq $0
> movl $X86_EXC_MF, 4(%rsp)
> jmp handle_exception
> +END(entry_MF)
>
> -ENTRY(entry_XM)
> +FUNC(entry_XM)
> ENDBR64
> pushq $0
> movl $X86_EXC_XM, 4(%rsp)
> jmp handle_exception
> +END(entry_XM)
>
> -ENTRY(entry_NM)
> +FUNC(entry_NM)
> ENDBR64
> pushq $0
> movl $X86_EXC_NM, 4(%rsp)
> jmp handle_exception
> +END(entry_NM)
>
> -ENTRY(entry_DB)
> +FUNC(entry_DB)
> ENDBR64
> pushq $0
> movl $X86_EXC_DB, 4(%rsp)
> jmp handle_ist_exception
> +END(entry_DB)
>
> -ENTRY(entry_BP)
> +FUNC(entry_BP)
> ENDBR64
> pushq $0
> movl $X86_EXC_BP, 4(%rsp)
> jmp handle_exception
> +END(entry_BP)
>
> -ENTRY(entry_OF)
> +FUNC(entry_OF)
> ENDBR64
> pushq $0
> movl $X86_EXC_OF, 4(%rsp)
> jmp handle_exception
> +END(entry_OF)
>
> -ENTRY(entry_BR)
> +FUNC(entry_BR)
> ENDBR64
> pushq $0
> movl $X86_EXC_BR, 4(%rsp)
> jmp handle_exception
> +END(entry_BR)
>
> -ENTRY(entry_UD)
> +FUNC(entry_UD)
> ENDBR64
> pushq $0
> movl $X86_EXC_UD, 4(%rsp)
> jmp handle_exception
> +END(entry_UD)
>
> -ENTRY(entry_TS)
> +FUNC(entry_TS)
> ENDBR64
> movl $X86_EXC_TS, 4(%rsp)
> jmp handle_exception
> +END(entry_TS)
>
> -ENTRY(entry_NP)
> +FUNC(entry_NP)
> ENDBR64
> movl $X86_EXC_NP, 4(%rsp)
> jmp handle_exception
> +END(entry_NP)
>
> -ENTRY(entry_SS)
> +FUNC(entry_SS)
> ENDBR64
> movl $X86_EXC_SS, 4(%rsp)
> jmp handle_exception
> +END(entry_SS)
>
> -ENTRY(entry_GP)
> +FUNC(entry_GP)
> ENDBR64
> movl $X86_EXC_GP, 4(%rsp)
> jmp handle_exception
> +END(entry_GP)
>
> -ENTRY(entry_AC)
> +FUNC(entry_AC)
> ENDBR64
> movl $X86_EXC_AC, 4(%rsp)
> jmp handle_exception
> +END(entry_AC)
>
> -ENTRY(entry_CP)
> +FUNC(entry_CP)
> ENDBR64
> movl $X86_EXC_CP, 4(%rsp)
> jmp handle_exception
> +END(entry_CP)
>
> -ENTRY(entry_DF)
> +FUNC(entry_DF)
> ENDBR64
> movl $X86_EXC_DF, 4(%rsp)
> /* Set AC to reduce chance of further SMAP faults */
> @@ -994,8 +1017,9 @@ ENTRY(entry_DF)
>
> movq %rsp,%rdi
> tailcall do_double_fault
> +END(entry_DF)
>
> -ENTRY(entry_NMI)
> +FUNC(entry_NMI)
> ENDBR64
> pushq $0
> movl $X86_EXC_NMI, 4(%rsp)
> @@ -1126,21 +1150,24 @@ handle_ist_exception:
> ASSERT_CONTEXT_IS_XEN
> jmp restore_all_xen
> #endif
> +END(entry_NMI)
>
> -ENTRY(entry_MC)
> +FUNC(entry_MC)
> ENDBR64
> pushq $0
> movl $X86_EXC_MC, 4(%rsp)
> jmp handle_ist_exception
> +END(entry_MC)
>
> /* No op trap handler. Required for kexec crash path. */
> -GLOBAL(trap_nop)
> +FUNC(trap_nop, 0)
Could this use the default alignment?
> ENDBR64
> iretq
> +END(trap_nop)
>
> /* Table of automatically generated entry points. One per vector. */
> .pushsection .init.rodata, "a", @progbits
> -GLOBAL(autogen_entrypoints)
> +DATA(autogen_entrypoints, 8)
> /* pop into the .init.rodata section and record an entry point. */
> .macro entrypoint ent
> .pushsection .init.rodata, "a", @progbits
> @@ -1149,7 +1176,7 @@ GLOBAL(autogen_entrypoints)
> .endm
>
> .popsection
> -autogen_stubs: /* Automatically generated stubs. */
> +FUNC_LOCAL(autogen_stubs, 0) /* Automatically generated stubs. */
Won't it be good to align the stubs? As that's possible to make them
faster?
Thanks, Roger.
next prev parent reply other threads:[~2024-01-18 17:45 UTC|newest]
Thread overview: 150+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-12 10:25 [PATCH 0/2] x86: aid debug info generation in assembly files Jan Beulich
2022-04-12 10:27 ` [PATCH 1/2] x86: improve .debug_line contents for assembly sources Jan Beulich
2022-04-14 12:40 ` Roger Pau Monné
2022-04-14 12:52 ` Jan Beulich
2022-04-14 13:31 ` Roger Pau Monné
2022-04-14 13:36 ` Roger Pau Monné
2022-04-14 14:15 ` Jan Beulich
2022-04-14 16:02 ` Roger Pau Monné
2022-04-14 16:34 ` Jan Beulich
2022-04-26 9:26 ` Jan Beulich
2022-04-12 10:28 ` [PATCH 2/2] x86: annotate entry points with type and size Jan Beulich
2022-04-14 12:49 ` Andrew Cooper
2022-04-14 12:59 ` Jan Beulich
2022-06-23 11:47 ` Jan Beulich
2023-05-23 11:30 ` [PATCH v2 0/2] " Jan Beulich
2023-05-23 11:30 ` [PATCH v2 1/2] " Jan Beulich
2023-05-29 13:34 ` Roger Pau Monné
2023-05-30 8:06 ` Jan Beulich
2023-05-30 13:21 ` Roger Pau Monné
2023-05-30 14:23 ` Jan Beulich
2023-05-30 15:15 ` Roger Pau Monné
2023-05-23 11:31 ` [PATCH v2 2/2] x86: also mark assembler globals hidden Jan Beulich
2023-05-29 13:38 ` Roger Pau Monné
2023-07-10 8:50 ` [PATCH v3 0/8] annotate entry points with type and size Jan Beulich
2023-07-10 8:51 ` [PATCH v3 1/8] common: move a few macros out of xen/lib.h Jan Beulich
2023-07-18 15:40 ` Oleksii
2023-07-18 19:49 ` Shawn Anastasio
2023-07-19 6:28 ` Jan Beulich
2023-07-10 8:52 ` [PATCH v3 2/8] common: assembly entry point type/size annotations Jan Beulich
2023-07-10 9:28 ` Jan Beulich
2023-07-10 8:53 ` [PATCH v3 3/8] x86: annotate entry points with type and size Jan Beulich
2023-07-10 8:54 ` [PATCH v3 4/8] x86: also mark assembler globals hidden Jan Beulich
2023-07-10 8:55 ` [PATCH v3 5/8] Arm: annotate entry points with type and size Jan Beulich
2023-07-10 8:56 ` [PATCH v3 6/8] RISC-V: " Jan Beulich
2023-07-10 8:58 ` Jan Beulich
2023-07-26 15:28 ` Oleksii
2023-07-26 15:43 ` Jan Beulich
2023-07-26 16:55 ` Oleksii
2023-07-10 8:56 ` [PATCH v3 7/8] PPC: switch entry point annotations to common model Jan Beulich
2023-07-10 8:57 ` [PATCH v3 8/8] tools/binfile: switch to common annotations model Jan Beulich
2023-07-17 14:18 ` [PATCH v3 9/8] common: honor CONFIG_CC_SPLIT_SECTIONS also for assembly functions Jan Beulich
2023-07-18 12:28 ` Jan Beulich
2023-08-04 6:24 ` [PATCH v4 0/8] annotate entry points with type and size Jan Beulich
2023-08-04 6:26 ` [PATCH v4 1/8] common: assembly entry point type/size annotations Jan Beulich
2023-09-14 21:06 ` Julien Grall
2023-09-18 10:24 ` Jan Beulich
2023-09-18 10:34 ` Julien Grall
2023-09-18 10:51 ` Jan Beulich
2023-08-04 6:26 ` [PATCH v4 2/8] x86: annotate entry points with type and size Jan Beulich
2023-08-04 6:27 ` [PATCH v4 3/8] x86: also mark assembler globals hidden Jan Beulich
2023-08-04 6:28 ` [PATCH v4 4/8] Arm: annotate entry points with type and size Jan Beulich
2023-09-14 21:25 ` Julien Grall
2023-09-15 7:00 ` Jan Beulich
2023-08-04 6:29 ` [PATCH v4 5/8] RISC-V: " Jan Beulich
2023-08-04 6:30 ` [PATCH v4 5/8] PPC: switch entry point annotations to common model Jan Beulich
2023-08-04 6:30 ` [PATCH v4 6/8] tools/binfile: switch to common annotations model Jan Beulich
2023-09-14 21:30 ` Julien Grall
2023-08-04 6:31 ` [PATCH v4 8/8] common: honor CONFIG_CC_SPLIT_SECTIONS also for assembly functions Jan Beulich
2023-08-04 6:32 ` [PATCH v4 0/8] annotate entry points with type and size Jan Beulich
2024-01-15 14:30 ` [PATCH v5 " Jan Beulich
2024-01-15 14:34 ` [PATCH v5 1/8] common: assembly entry point type/size annotations Jan Beulich
2024-01-17 17:02 ` Roger Pau Monné
2024-01-18 15:48 ` Jan Beulich
2024-01-18 14:52 ` Roger Pau Monné
2024-01-18 16:00 ` Jan Beulich
2024-01-15 14:34 ` [PATCH v5 2/8] x86: annotate entry points with type and size Jan Beulich
2024-01-18 17:45 ` Roger Pau Monné [this message]
2024-01-19 8:06 ` Jan Beulich
2024-01-19 9:48 ` Roger Pau Monné
2024-01-15 14:35 ` [PATCH v5 3/8] x86: also mark assembler globals hidden Jan Beulich
2024-01-15 14:36 ` [PATCH v5 4/8] Arm: annotate entry points with type and size Jan Beulich
2024-01-22 13:22 ` Jan Beulich
2024-03-15 19:09 ` Julien Grall
2024-01-15 14:37 ` [PATCH v5 5/8] RISC-V: " Jan Beulich
2024-01-16 12:15 ` Oleksii
2024-01-15 14:38 ` [PATCH v5 6/8] PPC: switch entry point annotations to common model Jan Beulich
2024-01-22 13:20 ` Ping: " Jan Beulich
2024-01-23 3:00 ` Shawn Anastasio
2024-01-15 14:39 ` [PATCH v5 7/8] tools/binfile: switch to common annotations model Jan Beulich
2024-01-15 14:40 ` [PATCH v5 8/8] common: honor CONFIG_CC_SPLIT_SECTIONS also for assembly functions Jan Beulich
2024-01-19 10:36 ` Roger Pau Monné
2024-01-22 10:50 ` Jan Beulich
2024-01-22 17:40 ` Roger Pau Monné
2024-02-07 13:34 ` [PATCH v6 7/7] (mostly) x86: add/convert entry point annotations Jan Beulich
2024-02-07 13:35 ` [PATCH v6 0/7] " Jan Beulich
2024-02-07 13:36 ` [PATCH v6 1/7] common: honor CONFIG_CC_SPLIT_SECTIONS also for assembly functions Jan Beulich
2024-02-07 13:37 ` [PATCH v6 2/7] SVM: convert entry point annotations Jan Beulich
2024-02-07 13:48 ` Andrew Cooper
2024-02-07 13:37 ` [PATCH v6 3/7] VMX: " Jan Beulich
2024-02-07 13:55 ` Andrew Cooper
2024-02-07 14:25 ` Jan Beulich
2024-02-08 16:20 ` Jan Beulich
2024-02-07 13:37 ` [PATCH v6 4/7] x86/ACPI: annotate assembly functions with type and size Jan Beulich
2024-02-07 14:00 ` Andrew Cooper
2024-02-07 13:38 ` [PATCH v6 5/7] x86/kexec: convert entry point annotations Jan Beulich
2024-02-07 14:05 ` Andrew Cooper
2024-02-07 13:38 ` [PATCH v6 6/7] x86: convert misc assembly function annotations Jan Beulich
2024-02-07 14:11 ` Andrew Cooper
2024-02-07 13:39 ` [PATCH v6 7/7] x86: move ENTRY(), GLOBAL(), and ALIGN Jan Beulich
2024-02-07 14:27 ` Andrew Cooper
2024-10-01 15:11 ` [PATCH v7 00/11] (mostly) x86+Arm32: add/convert entry point annotations Jan Beulich
2024-10-01 15:13 ` [PATCH v7 01/11] common: honor CONFIG_CC_SPLIT_SECTIONS also for assembly functions Jan Beulich
2024-10-01 15:13 ` [PATCH v7 02/11] VMX: convert entry point annotations Jan Beulich
2024-10-01 17:03 ` Andrew Cooper
2024-10-01 15:14 ` [PATCH v7 03/11] x86/ACPI: annotate assembly function/data with type and size Jan Beulich
2024-10-01 16:51 ` Andrew Cooper
2024-10-02 5:56 ` Jan Beulich
2024-10-01 15:15 ` [PATCH v7 04/11] x86/kexec: convert entry point annotations Jan Beulich
2024-10-01 17:19 ` Andrew Cooper
2024-10-01 15:15 ` [PATCH v7 05/11] x86: convert dom_crash_sync_extable() annotation Jan Beulich
2024-10-01 17:05 ` Andrew Cooper
2024-10-01 15:15 ` [PATCH v7 06/11] x86: move ENTRY(), GLOBAL(), and ALIGN Jan Beulich
2024-10-01 15:16 ` [PATCH v7 07/11] Arm32: use new-style entry annotations for library code Jan Beulich
2024-11-25 20:15 ` Julien Grall
2024-11-26 8:41 ` Jan Beulich
2024-11-27 10:57 ` Julien Grall
2024-10-01 15:16 ` [PATCH v7 08/11] Arm32: use new-style entry annotations for MMU code Jan Beulich
2024-10-01 15:19 ` Jan Beulich
2024-10-01 15:17 ` [PATCH v7 09/11] Arm32: use new-style entry annotations for entry code Jan Beulich
2024-11-25 20:25 ` Julien Grall
2024-11-26 8:53 ` Jan Beulich
2024-10-01 15:17 ` [PATCH v7 10/11] Arm32: use new-style entry annotations in head.S Jan Beulich
2024-11-25 20:28 ` Julien Grall
2024-11-26 9:02 ` Jan Beulich
2024-10-01 15:18 ` [PATCH v7 11/11] Arm: purge ENTRY(), ENDPROC(), and ALIGN Jan Beulich
2024-11-25 20:29 ` Julien Grall
2024-11-04 9:45 ` Ping: [PATCH v7 00/11] (mostly) x86+Arm32: add/convert entry point annotations Jan Beulich
2025-02-26 15:58 ` [PATCH v8 0/6] (mostly) Arm32: " Jan Beulich
2025-02-26 16:00 ` [PATCH v8 1/6] Arm32: use new-style entry annotations for library code Jan Beulich
2025-02-26 16:00 ` [PATCH v8 2/6] Arm32: use new-style entry annotations for MMU code Jan Beulich
2025-02-26 16:01 ` [PATCH v8 3/6] Arm32: use new-style entry annotations for entry code Jan Beulich
2025-02-26 16:01 ` [PATCH v8 4/6] Arm32: use new-style entry annotations in head.S Jan Beulich
2025-02-26 16:01 ` [PATCH v8 5/6] Arm: purge ENTRY(), ENDPROC(), and ALIGN Jan Beulich
2025-02-26 16:02 ` [PATCH v8 6/6] common: honor CONFIG_CC_SPLIT_SECTIONS also for assembly functions Jan Beulich
2025-03-04 10:34 ` [PATCH v8 0/6] (mostly) Arm32: add/convert entry point annotations Luca Fancellu
2025-03-13 8:04 ` [PATCH v8 RESEND " Jan Beulich
2025-03-13 8:06 ` [PATCH v8 RESEND 1/6] Arm32: use new-style entry annotations for library code Jan Beulich
2025-03-28 18:33 ` Julien Grall
2025-03-13 8:07 ` [PATCH v8 RESEND 2/6] Arm32: use new-style entry annotations for MMU code Jan Beulich
2025-03-28 18:39 ` Julien Grall
2025-03-31 6:50 ` Jan Beulich
2025-03-13 8:07 ` [PATCH v8 RESEND 3/6] Arm32: use new-style entry annotations for entry code Jan Beulich
2025-03-28 18:46 ` Julien Grall
2025-03-31 6:52 ` Jan Beulich
2025-03-13 8:08 ` [PATCH v8 RESEND 4/6] Arm32: use new-style entry annotations in head.S Jan Beulich
2025-03-28 18:48 ` Julien Grall
2025-03-28 18:48 ` Julien Grall
2025-03-13 8:08 ` [PATCH v8 RESEND 5/6] Arm: purge ENTRY(), ENDPROC(), and ALIGN Jan Beulich
2025-03-13 8:10 ` [PATCH v8 RESEND 6/6] common: honor CONFIG_CC_SPLIT_SECTIONS also for assembly functions Jan Beulich
2025-03-28 18:53 ` Julien Grall
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=ZaljqHduUIvsdbqm@macbook \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=jbeulich@suse.com \
--cc=wl@xen.org \
--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.