From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FE2C2FFDDB; Sun, 26 Oct 2025 22:13:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.136 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761516792; cv=none; b=rDIg7emuv1ganSr5N0k2A5nBM7YaMZScF/gyLwZ5s2f80iH5e7cSj6tKg6+YxNOuLZh5G2Uu1aJS8jQDBuPymjohtWGesz9rpoh44EHH3fhYluno2zEntwWurek68a7ygIwf0EJPSRdMJuhK1oVp19F+BEjJj77aKTS+fovRUPQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761516792; c=relaxed/simple; bh=+3MHllPtkDlO+i7Q0aTwO0Ol0PB1Jxkj/Fyjjy8PSZo=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=mYgu9GRC8JmE1L08b5bK0shLt+6zBd3Qj3tZ9VgFahLgbdwpoaRwXqbiZVuMO33lbivBUIc7nfbR2YXLjvAkLC/8VK/GCY4Rnb1kP5r2z4GcXLKZaANQuhqONuMV/Mcz9ttRyHSCr8uxuCTF5rCRNRYnknUDBL71JAKyD07g4I4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=YwrHTdFG; arc=none smtp.client-ip=198.137.202.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="YwrHTdFG" Received: from mail.zytor.com ([IPv6:2601:646:8081:9484:8257:f1ab:878e:498b]) (authenticated bits=0) by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 59QMCFpK548264 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 26 Oct 2025 15:12:16 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 59QMCFpK548264 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2025102301; t=1761516739; bh=hARM3PE/fySirCrpK2SHSPeP8s1QBdwnxki1irso0xA=; h=From:To:Subject:Date:From; b=YwrHTdFGutRUx90/3B5amccAgoA86Ywn5oKY2a1/73I9q4dCtNWFpC///grkBBBxf fgsWQgWkkv2/Q3gDhTPmHrU2jzuQx8pq6uKG9SFrRzNfT1FsHEgyxW85HPHYWdfIET C9VaH9oK1F21V3W0/hUugRafKf9tjZA6lfEdCXEnLMYSJwNnVFU+FSWuAyCW05WESS Noicu5hfJsZ2/Ykff7opO6FrSS+zEXQcwBAAR7ep4LzvOmkiHd9TRtv7nrICWwA+NH TH7PqxsZqtWWfBktxeNH7IAqn3p7mDcr8sm7OEQNZWlj0Ur/+Opwdu6u8iXyMK7v8l Ag/gWl1LqsFCw== From: "H. Peter Anvin" To: "H. Peter Anvin" , "Jason A. Donenfeld" , "Peter Zijlstra (Intel)" , "Theodore Ts'o" , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Xin Li , Andrew Cooper , Andy Lutomirski , Ard Biesheuvel , Borislav Petkov , Brian Gerst , Dave Hansen , Ingo Molnar , James Morse , Jarkko Sakkinen , Josh Poimboeuf , Kees Cook , Nam Cao , Oleg Nesterov , Perry Yuan , Thomas Gleixner , Thomas Huth , Uros Bizjak , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-sgx@vger.kernel.org, x86@kernel.org Subject: [PATCH 0/6] x86/entry/vdso: cleanups for vdso build and 32-bit vdso Date: Sun, 26 Oct 2025 15:12:00 -0700 Message-ID: <20251026221208.1938173-1-hpa@zytor.com> X-Mailer: git-send-email 2.51.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "H. Peter Anvin" (Intel) This patchset cleans up the vdso build by building the 32- and 64-bit vdsos in separate directories, moving the vdso2c tool to arch/x86/tools, and by merging common code and especially Makefile rules between the 32- and 64-bit vdsos to the greatest extent possible. Be more strict about sanitizing and standardizing the vdso build options. If the vdso is build with CET endbr support, add an endbr32 instruction to system_call.S. x86/entry/vdso: rename vdso_image_* to vdso*_image x86/entry/vdso: refactor the vdso build x86/entry/vdso32: remove int80_landing_pad x86/entry/vdso32: remove SYSCALL_ENTER_KERNEL macro in sigreturn.S x86/entry/vdso32: remove open-coded DWARF in sigreturn.S x86/entry/vdso32: add endbr32 to system_call.S Overall, the patchset removes 90 lines of code. Although it touches a lot of files, the vast majority is just code movement and/or deduplication. -hpa --- arch/x86/Makefile | 2 +- arch/x86/entry/syscall_32.c | 2 +- arch/x86/entry/vdso/.gitignore | 11 +- arch/x86/entry/vdso/Makefile | 162 +-------------------- arch/x86/entry/vdso/common/Makefile.include | 83 +++++++++++ arch/x86/entry/vdso/{vdso-note.S => common/note.S} | 5 +- arch/x86/entry/vdso/{ => common}/vclock_gettime.c | 0 arch/x86/entry/vdso/{ => common}/vdso-layout.lds.S | 0 arch/x86/entry/vdso/{ => common}/vgetcpu.c | 0 arch/x86/entry/vdso/vdso32/Makefile | 24 +++ arch/x86/entry/vdso/vdso32/note.S | 19 +-- arch/x86/entry/vdso/vdso32/sigreturn.S | 152 +++++-------------- arch/x86/entry/vdso/vdso32/system_call.S | 10 +- arch/x86/entry/vdso/vdso32/vclock_gettime.c | 5 +- arch/x86/entry/vdso/vdso32/vdso32.lds.S | 2 +- arch/x86/entry/vdso/vdso32/vgetcpu.c | 4 +- arch/x86/entry/vdso/vdso64/Makefile | 45 ++++++ arch/x86/entry/vdso/vdso64/note.S | 1 + arch/x86/entry/vdso/vdso64/vclock_gettime.c | 1 + .../entry/vdso/{vdso.lds.S => vdso64/vdso64.lds.S} | 2 +- arch/x86/entry/vdso/{ => vdso64}/vdsox32.lds.S | 2 +- arch/x86/entry/vdso/vdso64/vgetcpu.c | 1 + .../entry/vdso/{ => vdso64}/vgetrandom-chacha.S | 0 arch/x86/entry/vdso/{ => vdso64}/vgetrandom.c | 2 +- arch/x86/entry/vdso/{ => vdso64}/vsgx.S | 0 arch/x86/entry/vdso/vma.c | 24 ++- arch/x86/include/asm/dwarf2.h | 1 + arch/x86/include/asm/elf.h | 2 +- arch/x86/include/asm/vdso.h | 6 +- arch/x86/kernel/asm-offsets.c | 6 + arch/x86/kernel/process_64.c | 6 +- arch/x86/kernel/signal_32.c | 4 +- arch/x86/tools/Makefile | 15 +- arch/x86/{entry/vdso => tools}/vdso2c.c | 1 - arch/x86/{entry/vdso => tools}/vdso2c.h | 0 35 files changed, 255 insertions(+), 345 deletions(-)