public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] x86: Enable LASS support with vsyscall emulation
@ 2026-02-19 23:35 Sohil Mehta
  2026-02-19 23:35 ` [PATCH 1/5] x86/vsyscall: Reorganize the page fault emulation code Sohil Mehta
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Sohil Mehta @ 2026-02-19 23:35 UTC (permalink / raw)
  To: Dave Hansen, x86, Andy Lutomirski, Borislav Petkov
  Cc: Jonathan Corbet, Shuah Khan, Thomas Gleixner, Ingo Molnar,
	H . Peter Anvin, Peter Zijlstra, Sohil Mehta, Kiryl Shutsemau,
	Brendan Jackman, Sean Christopherson, Nam Cao, Cedric Xing,
	Rick Edgecombe, Andrew Cooper, Tony Luck, Alexander Shishkin,
	Maciej Wieczor-Retman, linux-doc, linux-kernel

Linear Address Space Separation (LASS) is currently disabled [1] when
support for EFI or vsyscall emulation is enabled. This series extends
LASS support to vsyscall-enabled configurations.

Patches
-------
These patches were posted earlier as part of the v10 LASS series [2]
before being split out into a smaller series to make it easier to merge.
The overall approach to enable vsyscall support was okayed by Andy
Lutomirski [3].

This series is based on the LASS-EFI series which enables LASS for EFI
configurations.
https://lore.kernel.org/lkml/20260120234730.2215498-1-sohil.mehta@intel.com/

The motivation for this series is to show the combined picture as well
as seek reviews on either series. The combined patches can also be viewed at:
https://github.com/sohilmeh/linux-dev/tree/lass-vsyscall

Issue
-----
Userspace attempts to access any kernel address generate a #GP when LASS
is enabled. Legacy vsyscall functions are located in the address range
0xffffffffff600000 - 0xffffffffff601000. Prior to LASS, default access
(XONLY) to the vsyscall page would generate a page fault and the access
would be emulated in the kernel. Currently, as the #GP handler lacks any
emulation support, LASS is disabled when config X86_VSYSCALL_EMULATION
is set.

Solution
--------
These patches primarily update the #GP handler to reuse the existing
vsyscall emulation code for #PF. In XONLY mode, the faulting RIP is
readily available and can be used to determine if the #GP was triggered
due to a vsyscall access.

In contrast, the vsyscall EMULATE mode is deprecated and not expected to
be used by anyone. Supporting EMULATE mode with LASS would require
complex instruction decoding in the #GP fault handler, which is not
worth the effort. So, LASS is disabled in the rare case when someone
absolutely needs to enable vsyscall=emulate via the command line.

Links
-----
[1]: https://lore.kernel.org/lkml/20251118182911.2983253-1-sohil.mehta@intel.com/
[2]: https://lore.kernel.org/lkml/20251007065119.148605-1-sohil.mehta@intel.com/
[3]: https://lore.kernel.org/lkml/f4ae0030-9bc2-4675-ae43-e477cd894750@app.fastmail.com/

Sohil Mehta (5):
  x86/vsyscall: Reorganize the page fault emulation code
  x86/traps: Consolidate user fixups in the #GP handler
  x86/vsyscall: Add vsyscall emulation for #GP
  x86/vsyscall: Disable LASS if vsyscall mode is set to EMULATE
  x86/cpu: Remove LASS restriction on vsyscall emulation

 .../admin-guide/kernel-parameters.txt         |  4 +-
 arch/x86/entry/vsyscall/vsyscall_64.c         | 90 +++++++++++--------
 arch/x86/include/asm/vsyscall.h               | 13 ++-
 arch/x86/kernel/cpu/common.c                  | 15 ----
 arch/x86/kernel/traps.c                       | 12 +--
 arch/x86/kernel/umip.c                        |  3 +
 arch/x86/mm/fault.c                           |  2 +-
 7 files changed, 78 insertions(+), 61 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2026-03-05  7:56 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-19 23:35 [PATCH 0/5] x86: Enable LASS support with vsyscall emulation Sohil Mehta
2026-02-19 23:35 ` [PATCH 1/5] x86/vsyscall: Reorganize the page fault emulation code Sohil Mehta
2026-02-19 23:35 ` [PATCH 2/5] x86/traps: Consolidate user fixups in the #GP handler Sohil Mehta
2026-02-19 23:35 ` [PATCH 3/5] x86/vsyscall: Add vsyscall emulation for #GP Sohil Mehta
2026-03-03 15:51   ` Dave Hansen
2026-03-03 21:20     ` Sohil Mehta
2026-03-03 22:35       ` H. Peter Anvin
2026-03-05  0:10         ` Sohil Mehta
2026-03-05  1:45           ` Dave Hansen
2026-03-05  6:31             ` H. Peter Anvin
2026-03-05  7:56               ` Sohil Mehta
2026-03-05  6:32           ` H. Peter Anvin
2026-02-19 23:35 ` [PATCH 4/5] x86/vsyscall: Disable LASS if vsyscall mode is set to EMULATE Sohil Mehta
2026-03-03 16:33   ` Dave Hansen
2026-02-19 23:36 ` [PATCH 5/5] x86/cpu: Remove LASS restriction on vsyscall emulation Sohil Mehta
2026-03-03 16:37   ` Dave Hansen
2026-03-03 16:27 ` [PATCH 0/5] x86: Enable LASS support with " Dave Hansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox