From: Sohil Mehta <sohil.mehta@intel.com>
To: Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, Andy Lutomirski <luto@kernel.org>,
Borislav Petkov <bp@alien8.de>
Cc: Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
"H . Peter Anvin" <hpa@zytor.com>,
Peter Zijlstra <peterz@infradead.org>,
Sohil Mehta <sohil.mehta@intel.com>,
Kiryl Shutsemau <kas@kernel.org>,
Brendan Jackman <jackmanb@google.com>,
Sean Christopherson <seanjc@google.com>,
Nam Cao <namcao@linutronix.de>,
Cedric Xing <cedric.xing@intel.com>,
Rick Edgecombe <rick.p.edgecombe@intel.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Tony Luck <tony.luck@intel.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Maciej Wieczor-Retman <m.wieczorretman@pm.me>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v3 0/5] x86: Enable LASS support with vsyscall=xonly mode
Date: Mon, 9 Mar 2026 11:10:24 -0700 [thread overview]
Message-ID: <20260309181029.398498-1-sohil.mehta@intel.com> (raw)
Linear Address Space Separation (LASS) is currently disabled [1] when
support for vsyscall emulation is configured. This series extends LASS
support specifically to the default mode (vsyscall=xonly).
Changes in v3
-------------
- Pick up review tags from Peter Anvin.
- Pick up tested-by tags from Maciej.
- Minor change in patch 1 to make the reorganized code flow similar to
the original.
Note, Peter suggested a few more changes to tighten the #PF vsyscall
emulation code. I'll post those separately as they are beyond the scope
of this series.
v2: https://lore.kernel.org/lkml/20260305214026.3887452-1-sohil.mehta@intel.com/
Patches
-------
These patches were originally part of the v10 LASS series [2] before
being split out into a smaller series to make it easier to review and
merge. The overall approach to enable vsyscall support was okayed by
Andy Lutomirski [3].
The patches are based on the tip x86/cpu branch which has the recently
merged LASS-EFI series [4].
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.
Please find more details in the individual commit messages.
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/
[4]: https://lore.kernel.org/lkml/20260120234730.2215498-1-sohil.mehta@intel.com/
Sohil Mehta (5):
x86/vsyscall: Reorganize the page fault emulation code
x86/traps: Consolidate user fixups in the #GP handler
x86/vsyscall: Restore vsyscall=xonly mode under LASS
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 | 91 ++++++++++++-------
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, 79 insertions(+), 61 deletions(-)
base-commit: 68400c1aaf02636a97c45ba198110b66feb270a9
--
2.43.0
next reply other threads:[~2026-03-09 18:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-09 18:10 Sohil Mehta [this message]
2026-03-09 18:10 ` [PATCH v3 1/5] x86/vsyscall: Reorganize the page fault emulation code Sohil Mehta
2026-03-09 18:10 ` [PATCH v3 2/5] x86/traps: Consolidate user fixups in the #GP handler Sohil Mehta
2026-03-09 18:10 ` [PATCH v3 3/5] x86/vsyscall: Restore vsyscall=xonly mode under LASS Sohil Mehta
2026-03-09 18:10 ` [PATCH v3 4/5] x86/vsyscall: Disable LASS if vsyscall mode is set to EMULATE Sohil Mehta
2026-03-09 18:10 ` [PATCH v3 5/5] x86/cpu: Remove LASS restriction on vsyscall emulation Sohil Mehta
2026-03-19 18:46 ` [PATCH v3 0/5] x86: Enable LASS support with vsyscall=xonly mode Sohil Mehta
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=20260309181029.398498-1-sohil.mehta@intel.com \
--to=sohil.mehta@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=andrew.cooper3@citrix.com \
--cc=bp@alien8.de \
--cc=cedric.xing@intel.com \
--cc=corbet@lwn.net \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jackmanb@google.com \
--cc=kas@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=m.wieczorretman@pm.me \
--cc=mingo@redhat.com \
--cc=namcao@linutronix.de \
--cc=peterz@infradead.org \
--cc=rick.p.edgecombe@intel.com \
--cc=seanjc@google.com \
--cc=skhan@linuxfoundation.org \
--cc=tglx@kernel.org \
--cc=tony.luck@intel.com \
--cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox