[v2,2/4] x86/entry: Rename ignore_sysret and compile it unconditionally
Commit Message
Give ignore_sysret a more descriptive name as it's actually used to make
32bit syscalls a noop and return ENOSYS, rather than doing anything
special to sysret. While at it also compile the function unconditinally
as this is going to be used in the patch disabling ia32 syscalls due to
'ia32_disabled' parameter.
Signed-off-by: Nikolay Borisov <nik.borisov@suse.com>
---
arch/x86/entry/entry_64.S | 6 ++----
arch/x86/include/asm/processor.h | 2 +-
arch/x86/kernel/cpu/common.c | 2 +-
3 files changed, 4 insertions(+), 6 deletions(-)
Comments
On Fri, Jun 09 2023 at 14:13, Nikolay Borisov wrote:
> Give ignore_sysret a more descriptive name as it's actually used to make
> 32bit syscalls a noop and return ENOSYS, rather than doing anything
> special to sysret. While at it also compile the function unconditinally
> as this is going to be used in the patch disabling ia32 syscalls due to
> 'ia32_disabled' parameter.
ONE patch does ONE thing. Rename is ONE thing. Make it undonditional is
ANOTHER thing. They are independent and especially the second one is
not 'while at it'.
Thanks,
tglx
@@ -1514,18 +1514,16 @@ SYM_CODE_START(asm_exc_nmi)
iretq
SYM_CODE_END(asm_exc_nmi)
-#ifndef CONFIG_IA32_EMULATION
/*
* This handles SYSCALL from 32-bit code. There is no way to program
* MSRs to fully disable 32-bit SYSCALL.
*/
-SYM_CODE_START(ignore_sysret)
+SYM_CODE_START(entry_SYSCALL32_ignore)
UNWIND_HINT_END_OF_STACK
ENDBR
mov $-ENOSYS, %eax
sysretl
-SYM_CODE_END(ignore_sysret)
-#endif
+SYM_CODE_END(entry_SYSCALL32_ignore)
.pushsection .text, "ax"
__FUNC_ALIGN
@@ -399,7 +399,7 @@ static inline unsigned long cpu_kernelmode_gs_base(int cpu)
return (unsigned long)per_cpu(fixed_percpu_data.gs_base, cpu);
}
-extern asmlinkage void ignore_sysret(void);
+extern asmlinkage void entry_SYSCALL32_ignore(void);
/* Save actual FS/GS selectors and bases to current->thread */
void current_save_fsgs(void);
@@ -2066,7 +2066,7 @@ void syscall_init(void)
(unsigned long)(cpu_entry_stack(smp_processor_id()) + 1));
wrmsrl_safe(MSR_IA32_SYSENTER_EIP, (u64)entry_SYSENTER_compat);
#else
- wrmsrl_cstar((unsigned long)ignore_sysret);
+ wrmsrl_cstar((unsigned long)entry_SYSCALL32_ignore);
wrmsrl_safe(MSR_IA32_SYSENTER_CS, (u64)GDT_ENTRY_INVALID_SEG);
wrmsrl_safe(MSR_IA32_SYSENTER_ESP, 0ULL);
wrmsrl_safe(MSR_IA32_SYSENTER_EIP, 0ULL);