Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7949888rdb; Thu, 4 Jan 2024 13:02:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IEo2jRUnoOGPhIm/oXJYHMjs4GGFvjBFmtXsXUEROpI5uY4naBLTVJQzvLjXT6EYh5V704i X-Received: by 2002:a17:902:d304:b0:1d4:a6c5:ca51 with SMTP id b4-20020a170902d30400b001d4a6c5ca51mr1124165plc.72.1704402146780; Thu, 04 Jan 2024 13:02:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704402146; cv=none; d=google.com; s=arc-20160816; b=Pq+VU2mLu5IvxYvfX2z7lxCzz++q4ARnhpDNZrJ3F1owTPdCiOFtLba9ROWIzrgktQ c9bXJ4zCBaE67V2bV9eqPDbrrv+6Oc7mXgLqt6Oi3bObRwVPvk8xXo423yPwm9h/pZXD IWUA0xSWwZIMjMJKnYDM9KpV8ecCzyDZO66sNhKSNo0DSlywPt/UDu6ZREnn+ciuXYw0 +/hDpTlYsvFvjTgwIeDP7Swhvva1sOQpCdtkcgw2s4cEaKfym27QrTob7GAjnHXx9A3z 9HA4/cXLcgOnSOJ6/MXtEk73/v03nOqAsM4suIRKQ95KL5yN6VTbzcIlrgljsUIZY/3r Tx3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=aEAMqcwvVp1DhUld3ZPVwdQv2+1sf5VUPmdEsVkdBtY=; fh=F5etyKr0go+LgjZd3BUlpsHJLLpISVbcXQudHtTe2K4=; b=KcMZjSARfJX6n07x4YAJgF7M7PCZviFy+eih3wUaAYqOxFFvH8vr4ZwytH6OrGPMID YgQIvr57noNDUoRX+ErsDn3Umn/v+qshF6dcNK/FN5mloUVt5qJX2D+IHDEJ2TZLDqlG LmmoTjer62nY8DAOoxqCkpzX1o9RW/6AxtZn60ekRsrSZNz2ccwB7+BGK/wsUWODWWwk FOc76jY2u8+9D6kky6wSy5d0mzQ6sITqSPZl4gfNGe9puhwepWB6EJjqXi30JY8YN6iP 5ylC0t0+4l8TgEYj3SYXp8mH30WuRXL1fvTQhAb/cM8JGKG2nr8VY5HyRj6v9WuvoZ41 jZ/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=SpnWjdwu; spf=pass (google.com: domain of linux-kernel+bounces-17218-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17218-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id l18-20020a170902d35200b001d45090a764si84281plk.186.2024.01.04.13.02.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 13:02:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17218-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=SpnWjdwu; spf=pass (google.com: domain of linux-kernel+bounces-17218-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17218-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B9C81287EEC for ; Thu, 4 Jan 2024 21:02:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F0A682C6BE; Thu, 4 Jan 2024 21:01:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="SpnWjdwu" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 81FE52C6B1 for ; Thu, 4 Jan 2024 21:00:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-3367601a301so741157f8f.2 for ; Thu, 04 Jan 2024 13:00:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1704402058; x=1705006858; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=aEAMqcwvVp1DhUld3ZPVwdQv2+1sf5VUPmdEsVkdBtY=; b=SpnWjdwux3KkzMWGFkYybFhMKn+c8ALj5w7SSaR/Itfwums/YjWQKCXlGLANwmvIln cJj/rW3XmXVQJOsJvWDCcz/d0kkOniu2DHDOGxDhMqEY3+9m1taqH5qvVzUsmFTRGbqc 5nPA9o8WHTqDnoy200N99Y7bqNm43yLpLJ35RPKVhILaPmewLFgA0gvzFrygGmVSTn+V h5aMxNkl8iHdtoU1XM+DUAcByFgtzqntMwBO2JSsmKwlhZrJUIdTPoyWMC2ZiOrUg9H/ QgfWsIxOZWyyylUXeDGeNYwk4p9/6QlFKKMBV1dJGRhWfCWqXZb02O5I5VM36BRVcu9w SfMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704402058; x=1705006858; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aEAMqcwvVp1DhUld3ZPVwdQv2+1sf5VUPmdEsVkdBtY=; b=UUguN/YYe5jZICRE/AQNqKFqvEU6phCwM+kNSpouP3NcRDgwWzo9OJvnX+T8Yj/CRC SPYQeARBWm1iKlj3lMtLjpeU67Bi8zEKxOfbdEyL84B+kRbWWiaft84A1X/vooOd/GTn 3iGTqTIAsIwUaKRv8FFuQeK1VsLoG8Sj4SkomVcH523xuE2LBwnrItn56oBOWOg9wc6s NXbeZVdGc2B+A1KEub0nUP+FW3yt97lT0uY8EJtJBFpk184x+IyYMFGRpxspifl6YSTw fnZT2aMyJNRjMBL9f9sMTuFROg0xUjTO4q2ENo0QS5Lso3HiwfHEz1IE2MbAFTcOWmfV +O+A== X-Gm-Message-State: AOJu0Yw+0oR/CmnBpihtXDzxcNmvh6/Bn2fqFpdOimKFSirAFg8Rs4Bw R42dZtQ40DsFlYOvJw9/5DIuz/NPILXL5u0/tZ+ne+hwFjpv X-Received: by 2002:adf:a450:0:b0:336:ddca:4824 with SMTP id e16-20020adfa450000000b00336ddca4824mr404049wra.122.1704402057523; Thu, 04 Jan 2024 13:00:57 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240104-syscall_64-v1-1-57fe392ef565@google.com> In-Reply-To: <20240104-syscall_64-v1-1-57fe392ef565@google.com> From: Nick Desaulniers Date: Thu, 4 Jan 2024 13:00:42 -0800 Message-ID: Subject: Re: [PATCH] x86/syscalls: shrink entry/syscall_64.i via IWYU To: Tanzir Hasan Cc: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, Nick Desaulniers , Al Viro Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jan 3, 2024 at 4:13=E2=80=AFPM Tanzir Hasan wr= ote: > > This diff uses an open source tool include-what-you-use (IWYU) to modify > the include list, changing indirect includes to direct includes. IWYU is > implemented using the IWYUScripts github repository which is a tool that > is currently undergoing development. These changes seek to improve build > times. > > This change to entry/syscall_64.c resulted in a preprocessed size of > entry/syscall_64.i from 64003 lines to 24509 lines (-62%) for the x86 > defconfig. > > Suggested-by: Al Viro > Signed-off-by: Tanzir Hasan > --- > arch/x86/entry/syscall_64.c | 18 ++++++++++++++---- > 1 file changed, 14 insertions(+), 4 deletions(-) > > diff --git a/arch/x86/entry/syscall_64.c b/arch/x86/entry/syscall_64.c > index be120eec1fc9..9e4a3d8957f3 100644 > --- a/arch/x86/entry/syscall_64.c > +++ b/arch/x86/entry/syscall_64.c > @@ -1,12 +1,22 @@ > // SPDX-License-Identifier: GPL-2.0 > /* System call table for x86-64. */ > > -#include > -#include > -#include > -#include > #include > > +struct pt_regs; > +typedef long (*sys_call_ptr_t)(const struct pt_regs *); > +extern const sys_call_ptr_t sys_call_table[]; > +#if defined(CONFIG_X86_32) > +#define ia32_sys_call_table sys_call_table > +#else > +/* > + * These may not exist, but still put the prototypes in so we > + * can use IS_ENABLED(). > + */ > +extern const sys_call_ptr_t ia32_sys_call_table[]; > +extern const sys_call_ptr_t x32_sys_call_table[]; > +#endif > + arch/x86/include/asm/syscall.h (which you retained) already includes the typedef for sys_call_ptr_t, and the declaration of sys_call_table, and everything else. Was there some additional refactoring that Al mentioned or intended for you to do here? Perhaps as part of a series so it's more obvious to reviewers? You can include a Link: tag (see `git log` for examples) in a commit message to link back to discussions on lore.kernel.org. Doing so can help provide more context to reviewers as to //why// or justification for a change. Otherwise I'm not sure you need any of these additions (other than maybe pt_regs). > #define __SYSCALL(nr, sym) extern long __x64_##sym(const struct pt_regs = *); > #include > #undef __SYSCALL > > --- > base-commit: f5837722ffecbbedf1b1dbab072a063565f0dad1 > change-id: 20231228-syscall_64-30ba68440a85 > > Best regards, > -- > Tanzir Hasan > --=20 Thanks, ~Nick Desaulniers