[v3,3/5] x86/entry: Compile entry_SYSCALL32_ignore unconditionally

Message ID 20230616125730.1164989-4-nik.borisov@suse.com
State New
Headers
Series Make IA32_EMULATION boot time overridable |

Commit Message

Nikolay Borisov June 16, 2023, 12:57 p.m. UTC
  In upcomiing patches entry_SYSCALL32_ignore() could be used even if
CONFIG_IA32_EMULATION is selected but IA32 support is disabled either
via CONFIG_IA32_EMULATION_DEFAULT_DISABLED or the runtime override.i

Just compile it unconditionally.

Signed-off-by: Nikolay Borisov <nik.borisov@suse.com>
---
 arch/x86/entry/entry_64.S | 2 --
 1 file changed, 2 deletions(-)
  

Comments

Thomas Gleixner June 18, 2023, 9:11 p.m. UTC | #1
On Fri, Jun 16 2023 at 15:57, Nikolay Borisov wrote:
> In upcomiing patches entry_SYSCALL32_ignore() could be used even if

comiing?

> CONFIG_IA32_EMULATION is selected but IA32 support is disabled either
> via CONFIG_IA32_EMULATION_DEFAULT_DISABLED or the runtime override.i

override.i ?

Aside of the lack of a spell checker, this sentence is not really
well structured and helpful.

You already introduced CONFIG_IA32_EMULATION_DEFAULT_DISABLED in the
first patch, which is questionable to start with because the config
switch is only fully functional when everything is in place.

So up to that point the command line option and the config switch can
create inconsistent state, no?

So the right thing to do is to introduce the global variable which
controls that first. As it is 'false' it won't do anything, but allows
you to build up the code. The last step adds the config option and the
command line parsing.

Then the changelog might read like this:

 "To limit the IA32 exposure on 64bit kernels while keeping the
  flexibility for the user to enable it when required, the compile time
  enable/disable via CONFIG_IA32_EMULATION is not good enough and will
  be complemented with a kernel command line option.

  Right now entry_SYSCALL32_ignore() is only compiled when
  CONFIG_IA32_EMULATION=n, but boot-time enable- / disablement obviously
  requires it to be unconditionally available.

  Remove the #ifndef CONFIG_IA32_EMULATION guard"

The point is that changelogs need to convey enough information on their
own that they make sense without having access to the full context of the
patch series.

Thanks,

        tglx
  

Patch

diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index ccce0ccd8589..7068af44008a 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -1514,7 +1514,6 @@  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.
@@ -1525,7 +1524,6 @@  SYM_CODE_START(entry_SYSCALL32_ignore)
 	mov	$-ENOSYS, %eax
 	sysretl
 SYM_CODE_END(entry_SYSCALL32_ignore)
-#endif
 
 .pushsection .text, "ax"
 	__FUNC_ALIGN