Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1123452ybf; Thu, 27 Feb 2020 05:28:53 -0800 (PST) X-Google-Smtp-Source: APXvYqzjeyjL/dRl3Sr9B1r4BRaidmbeglMaf4xE3Z+bhVZ6zEkjVGAoWjZqDe31Nukag5kVi31n X-Received: by 2002:aca:5746:: with SMTP id l67mr3326801oib.60.1582810133045; Thu, 27 Feb 2020 05:28:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582810133; cv=none; d=google.com; s=arc-20160816; b=oO+JYXmhCrf+8FRz1ZVYogHs9BOR/UBfixMBzzIgjLc6N1ZunN0YYJZEnhAEeyYnbj yK9Vx84TGo5iuXFo6bGdKEppHSRSLfQuFV0QSPSnahYP47gns00z1XpuyQ7PLN66dK61 o5JbOvf2A5zeT9fvV5YPBly4NlY5d3yzlXbh72tXhXSHcYk848a5kt+WqGDYcfFOa1EA voTW6n3VVAx/BBr8Rj03Qq3dP9CyPZ4UVOpXapgPiCsGeMA27SEhnH5GrHBtBLHpr4WF /sFVkuqNAujcyAxYZeq69KlQr6qAvQNv/cUVZ20awu+x0P3c6ryzlQE2HBM6A+QeQRxY Sx7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=naAstPuQL5iUK964foSh5Uac6wX9+5/VEhQHKY9iq2E=; b=RObKhiR0v4GbirvEWjBVPBGe+6Bldr/wEF25HedRmdFHznT5FEPf153oLbsQs9CH+g UL4ph/ca3jYb4076RfODDtxq9bAlcy3uW4fP5xz3wg+emY/I9k6Ndxi7fDGrUMcxE8jC 5Q5M++sdXQit3luPx7Hh24bZL7yKXnDtb1PItwHranPsQJKyK5JLd9e6ANY6DeVCINVw 6bPSq2ge8Dh2kpxkeuGzx0jafqsEFGd6cjW7Vua5U4JscU5lvm5ukQdGIu6vtt8jQAqc wSStsmNnvNE40+ZpJ/ozTlCSbbJqNVoDVEL1QUvOZd1FobVt9Kb30Xf/25DIf1w9SI4J 9QWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Y9Z/1Qb4"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h203si1323168oif.3.2020.02.27.05.28.40; Thu, 27 Feb 2020 05:28:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Y9Z/1Qb4"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729114AbgB0N2g (ORCPT + 99 others); Thu, 27 Feb 2020 08:28:36 -0500 Received: from mail-yw1-f68.google.com ([209.85.161.68]:45250 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729056AbgB0N2g (ORCPT ); Thu, 27 Feb 2020 08:28:36 -0500 Received: by mail-yw1-f68.google.com with SMTP id a125so2926678ywe.12 for ; Thu, 27 Feb 2020 05:28:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=naAstPuQL5iUK964foSh5Uac6wX9+5/VEhQHKY9iq2E=; b=Y9Z/1Qb4BjI1V+c4JxO5HAl2rcILVPiBiysFRw7NZ0DeyLClP2mGebcAP+oIuIQJV1 au01WUCTRJ395q4s1HWIG481NqSMISkrNQb+nChhMak/6Tf0KtScKjdqib9OCImTiXQI LQlVjDY7i6VenDi3ntBAvtIjb/8yms/IXGo1/7xJ7G7aTleIBKkHGBx0xYHPlWNhqN/e NSOYsoXzyxa1OPDtJZpuP9Qh+u1nA9PDdABJJbsML9rWR/rc3hOPAKLg44xFyrjjT9es d1yqnwVIXOplH2fgPgu9o5kUe7vyDRSMgZ/bSOQkESETlRD1U+eVVQmieVaSBGrxdEuK Pe6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=naAstPuQL5iUK964foSh5Uac6wX9+5/VEhQHKY9iq2E=; b=cUS/6uFU4TLlQHrO29DJqmMMxTbb4Lmj1Hi0UWdf70znJI0W4RqpaDOimWO3oXPr9Y 1/S+CNYWneKd0P7HVgS6Cx2pWP4ApWBCiUvcc7gXE8xsnvOgpF5qUvlSebJrJIErRV8u OOnizoWUvSrzh44e21jod6srT5zem+NpTuNYYAvJ4nE9TCI6b1BAoxCfoCT/+qxUuI7l +BS3iebwkyaZzblQD7hKKa+tC0AU7DLIbQnMrMq26k9+oTIrdlEQCHKnYF6W3f8sEcKW jtBmFP0b98NdXEo6XRJRvHYE5XNhGRredywnAEtxBuwAnUP9NXO5dwkrEM2EnBWv3wqh NhAg== X-Gm-Message-State: APjAAAUCBOgVDw5cr1kn+IorOP/OqICK+vm7faDrg5DzMZDXCPXtPire onaVkOxDmL4rvEL5imGQSDkl8v4= X-Received: by 2002:a25:7355:: with SMTP id o82mr3768881ybc.140.1582810114548; Thu, 27 Feb 2020 05:28:34 -0800 (PST) Received: from localhost.localdomain (174-084-153-250.res.spectrum.com. [174.84.153.250]) by smtp.gmail.com with ESMTPSA id j23sm2442759ywb.93.2020.02.27.05.28.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 05:28:33 -0800 (PST) From: Brian Gerst To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Andy Lutomirski , Dominik Brodowski , Brian Gerst Subject: [PATCH v3 0/8] Enable pt_regs based syscalls for x86-32 native Date: Thu, 27 Feb 2020 08:28:18 -0500 Message-Id: <20200227132826.195669-1-brgerst@gmail.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series cleans up the x86 syscall wrapper code and converts the 32-bit native kernel over to pt_regs based syscalls. This makes the 32-bit syscall interface consistent with 64-bit, and a bit more effecient by not blindly pushing all 6 potential arguments onto the stack. Changes since v2: - Moved adding the [compat_]sys_ prefix to the ABI-level macros Changes since v1: - Split patch 1 into multiple patches - Updated comments and patch notes to clarify changes Brian Gerst (8): x86, syscalls: Refactor SYSCALL_DEFINEx macros x86, syscalls: Refactor SYSCALL_DEFINE0 macros x86, syscalls: Refactor COND_SYSCALL macros x86, syscalls: Refactor SYS_NI macros x86: Move 32-bit compat syscalls to common location x86-32: Enable syscall wrappers x86-64: Use syscall wrappers for x32_rt_sigreturn x86: Drop asmlinkage from syscalls arch/x86/Kconfig | 2 +- arch/x86/entry/common.c | 20 +- arch/x86/entry/syscall_32.c | 13 +- arch/x86/entry/syscall_64.c | 9 +- arch/x86/entry/syscalls/syscall_32.tbl | 818 ++++++++++++------------- arch/x86/entry/syscalls/syscall_64.tbl | 2 +- arch/x86/entry/syscalls/syscalltbl.sh | 33 +- arch/x86/ia32/Makefile | 2 +- arch/x86/include/asm/sighandling.h | 5 - arch/x86/include/asm/syscall.h | 8 +- arch/x86/include/asm/syscall_wrapper.h | 310 +++++----- arch/x86/include/asm/syscalls.h | 29 - arch/x86/kernel/Makefile | 2 + arch/x86/kernel/signal.c | 2 +- arch/x86/{ia32 => kernel}/sys_ia32.c | 130 ++-- arch/x86/um/sys_call_table_32.c | 10 + 16 files changed, 691 insertions(+), 704 deletions(-) rename arch/x86/{ia32 => kernel}/sys_ia32.c (83%) -- 2.24.1