All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Jan Beulich" <JBeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>
Subject: [PATCH] x86/traps: More use of nocall
Date: Mon, 20 Nov 2023 19:45:37 +0000	[thread overview]
Message-ID: <20231120194537.1341452-1-andrew.cooper3@citrix.com> (raw)

sysenter_eflags_saved() and int80_direct_trap() are now only used by a single
translation unit.  Move the declarations into the respective traps.c, renaming
int80_direct_trap() to entry_int80() to match the style elsewhere.

Annotate all 3 with nocall like all other entry paths.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>

Followup from XSA-446
---
 xen/arch/x86/include/asm/processor.h | 4 +---
 xen/arch/x86/pv/traps.c              | 3 ++-
 xen/arch/x86/traps.c                 | 2 ++
 xen/arch/x86/x86_64/entry.S          | 2 +-
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/include/asm/processor.h b/xen/arch/x86/include/asm/processor.h
index b0d2a62c075f..ff62b080afbf 100644
--- a/xen/arch/x86/include/asm/processor.h
+++ b/xen/arch/x86/include/asm/processor.h
@@ -457,9 +457,7 @@ static inline void enable_nmis(void)
                      [cs] "r" (__HYPERVISOR_CS) );
 }
 
-void sysenter_entry(void);
-void sysenter_eflags_saved(void);
-void int80_direct_trap(void);
+void nocall sysenter_entry(void);
 
 struct stubs {
     union {
diff --git a/xen/arch/x86/pv/traps.c b/xen/arch/x86/pv/traps.c
index 240d1a2db7a3..83e84e276233 100644
--- a/xen/arch/x86/pv/traps.c
+++ b/xen/arch/x86/pv/traps.c
@@ -132,6 +132,7 @@ static void cf_check nmi_softirq(void)
     *v_ptr = NULL;
 }
 
+void nocall entry_int80(void);
 void nocall entry_int82(void);
 
 void __init pv_trap_init(void)
@@ -144,7 +145,7 @@ void __init pv_trap_init(void)
 
     /* Fast trap for int80 (faster than taking the #GP-fixup path). */
     _set_gate(idt_table + LEGACY_SYSCALL_VECTOR, SYS_DESC_irq_gate, 3,
-              &int80_direct_trap);
+              &entry_int80);
 
     open_softirq(NMI_SOFTIRQ, nmi_softirq);
 }
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index e1356f696aba..9a6d29f24ae1 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1884,6 +1884,8 @@ void do_device_not_available(struct cpu_user_regs *regs)
 #endif
 }
 
+void nocall sysenter_eflags_saved(void);
+
 /* SAF-1-safe */
 void do_debug(struct cpu_user_regs *regs)
 {
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 9a7b129aa7e4..bf654fe27ec3 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -385,7 +385,7 @@ UNLIKELY_END(sysenter_gpf)
 #endif
         jmp   .Lbounce_exception
 
-ENTRY(int80_direct_trap)
+ENTRY(entry_int80)
         ENDBR64
         ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP
         pushq $0
-- 
2.30.2



             reply	other threads:[~2023-11-20 19:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20 19:45 Andrew Cooper [this message]
2023-11-21  8:52 ` [PATCH] x86/traps: More use of nocall Jan Beulich
2023-11-21 12:39   ` Andrew Cooper

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=20231120194537.1341452-1-andrew.cooper3@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=roger.pau@citrix.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.