Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3674110rdb; Wed, 27 Dec 2023 16:18:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IFKMXLWETEZmuOhlTS2NYXvsal4PTSE4ARqxVAFYZHzqVwOB0eo483hfkTbO22ZH0ZOdWli X-Received: by 2002:a05:6214:2aab:b0:67a:11bb:50ab with SMTP id js11-20020a0562142aab00b0067a11bb50abmr14575230qvb.23.1703722702074; Wed, 27 Dec 2023 16:18:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703722702; cv=none; d=google.com; s=arc-20160816; b=L8a6OMOhbjdrmKNGBSvS3SXmhTsy2fKjlUIWsxgaPl0d0Y9UOX4aXSpWvVqCnQQ95u aA4hmxKkyRIBh++1JSRdUyg7qnU6eUiRJ1vhM0dno6Loy8ZGcpDFdK6cBa27LqevrjxM 2Tp4t6BYz7fkq5hjg/n5LbOTfd+ROCTCL7i5oFxq2MGPkYb3YOiwvT8HAb9bj5THz7V9 6vdFFWCVFNW8KeEnK33pwjJJelCdHdaNxEtR0IvUbKxBgkNr4EvLecfHS85esArygVH9 uDosRG+bHQMbQ6jtbcM4Zf/O9RvYQR6JQsMPY5CDQ9r8YRjgS8QLUyUqrtlTyAuLSHOp +Acg== 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=e+8/BuLzsD57+lMc61ddX8z8AcfRGULMkgo8cesMgKE=; fh=YNRfRUs9iPq0jHpiRlGJKtCgcQkwY+/cQlWY4pru1qI=; b=F+E/rQ3qJhoVge9DYoYVliSmlPtO/MwBdFobV76OspjdFKzTJzkHqikRqx7/TBpeJj GS1F5X3qFcqf5HnnQeb0u/n8P7AOJf6HysaR8HrNu1Jk+nLz7GPhiqgkjnwc/cm6sTIk sFTbDtWxcfyg+nnDHlZVETR0kw/BBvB+aGf59mFHNEtBMoO172NQ0VTpmkLmxB1mMMki 97HP3OBGeqMdlaQU+34ImLNAuHpj8MXGb/HnD3h293FErqVmsc00AUhjAIi3KaDWL/z+ 3IYdneoZ8L8eZ6/xo3ULPXXOyGpfsqkJ9BobeuEqYg2MDcxui4JqgJQloSBD5t3dVvfD c8dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=H9u8BA4n; spf=pass (google.com: domain of linux-kernel+bounces-12319-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12319-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t2-20020ac85882000000b00427eed70978si2201232qta.537.2023.12.27.16.18.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 16:18:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12319-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=H9u8BA4n; spf=pass (google.com: domain of linux-kernel+bounces-12319-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12319-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id BF6351C22752 for ; Thu, 28 Dec 2023 00:18:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 01EA68820; Thu, 28 Dec 2023 00:17:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="H9u8BA4n" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (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 BDEF18474 for ; Thu, 28 Dec 2023 00:17:47 +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-qt1-f180.google.com with SMTP id d75a77b69052e-427b515c2bbso1142981cf.0 for ; Wed, 27 Dec 2023 16:17:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1703722666; x=1704327466; 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=e+8/BuLzsD57+lMc61ddX8z8AcfRGULMkgo8cesMgKE=; b=H9u8BA4nwUQd/ophw4TcV7WFcb3PkZbHsvJ2rb8i0inSMJ9lzhNkrGXOoS8P5C3tav i9M6NXe9Dh6Uca/ostV3JEj3EWIcmaZNd/h1/ztegkVYHclOScBCd9TSepb546V9l2Iq BGexuRQgZLRCKrTTTWahDuW4O/eB+e/mKypQQHFhczizBmTc3ComGEFZHEI2acC5yBL2 tgECKPaFWH7EmmnAFSiW1G+1noX5rQWN0OtnIYeitzzcKcQLU5v4Q1FqjjYDFvFgZDOr +fYYINDPX/ZJDwOuVtl9ZdLtw5xU+8b8ky1pUrhm+dZy8mrSeliGxC5tgI9l6B3rfxwz Bt2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703722666; x=1704327466; 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=e+8/BuLzsD57+lMc61ddX8z8AcfRGULMkgo8cesMgKE=; b=EZNOI0kSJEg5P2tY0w7MLv47qehfAO2HziLDCS4uu4s9OxBkBg/Cu2yMdKD3D+3zbp ND+cb7/idFUaLiGEn9cpbO23xyriaS7YjdwgB2XBefxYwnVGLpvZnq+KW2Fre7lyHKP8 WOFHNcUJpd/KhSN5CbhXSbK0Z2z2rB1jeGDL/U0zahjXLe8lsdTtUXyaoPnnJZNnHJ6Y o3SmAg6t3gVvcwEmT79r02/3RN8bdz2+HRQ3xRpb3bqK23YfLR2Xn9p1rZQ5K6OTRj/i IL8KRY6aI4fJG+j6XeijOIuAyVXnl6R9KAGqc65Sj+m/Fg36yuhGYtAo64ynr5Duu6Lc D57Q== X-Gm-Message-State: AOJu0YxkuGvQPfoxdFXxEJGlOgtxl5jSmtkKcWpmrKqZ7jFtgEe7xCY6 CTCheZlevN1kVdyheJmH8V3CafNwCExFja4TKBs7AXwgE+Ga X-Received: by 2002:ac8:7d0e:0:b0:41c:e312:cbd2 with SMTP id g14-20020ac87d0e000000b0041ce312cbd2mr915671qtb.29.1703722666556; Wed, 27 Dec 2023 16:17:46 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231227-syscall32-v1-1-9621140d33bd@google.com> <20231227233444.GH1674809@ZenIV> In-Reply-To: <20231227233444.GH1674809@ZenIV> From: Tanzir Hasan Date: Wed, 27 Dec 2023 16:17:34 -0800 Message-ID: Subject: Re: [PATCH] x86/syscalls: shrink entry/syscall_32.i via IWYU To: Al Viro Cc: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, Nick Desaulniers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Dec 27, 2023 at 3:34=E2=80=AFPM Al Viro w= rote: > > On Wed, Dec 27, 2023 at 10:38:41PM +0000, Tanzir Hasan wrote: > > This diff uses an open source tool include-what-you-use (IWYU) to modif= y > > the include list, changing indirect includes to direct includes. IWYU i= s > > implemented using the IWYUScripts github repository which is a tool tha= t > > is currently undergoing development. These changes seek to improve buil= d > > times. > > > > This change to entry/syscall_32.c resulted in a preprocessed size of > > entry/syscall_32.i from 64002 lines to 47986 lines (-25%) for the x86 > > defconfig. > > > > Signed-off-by: Tanzir Hasan > > --- > > arch/x86/entry/syscall_32.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/arch/x86/entry/syscall_32.c b/arch/x86/entry/syscall_32.c > > index 8cfc9bc73e7f..66db11fe8a1c 100644 > > --- a/arch/x86/entry/syscall_32.c > > +++ b/arch/x86/entry/syscall_32.c > > @@ -4,7 +4,7 @@ > > #include > > #include > > #include > > -#include > > +#include > > #include > > Really? What do we need linux/ptrace.h for? Because if it's > struct pt_regs for the generated externs, we might as well have > just said > struct pt_regs; > and that would be it. > > > > As the matter of fact, all you need out of those includes is this: > > 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 I see that only pt_regs is necessary and I understand this approach. I was wondering if using this approach would reduce readability. Once we add the snippet, the file builds even after removing the following lines: #include #include #include #include #include It is possible to remove them all, but do you think any should be kept? Best, Tanzir