Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1635029lqp; Mon, 15 Apr 2024 12:07:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUFCJmYxQtyROsjx9br5otBUFFhIICdigKJB/YwqrJJR+N/Qoh1hlLSXXfrtgYdwUQdRKi7jWYndfJ2Lb6PTaLpeSxtC1WczX+A5sCCSQ== X-Google-Smtp-Source: AGHT+IFHCMgbHMIcrlHTk9DDsvDX+kRIKprzVTDU/OW9qSCQgl+RuuPvdZ5iOmBxcFN4n2KA2ns5 X-Received: by 2002:a50:ab59:0:b0:56e:6e0:9f39 with SMTP id t25-20020a50ab59000000b0056e06e09f39mr7508821edc.17.1713208031603; Mon, 15 Apr 2024 12:07:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713208031; cv=pass; d=google.com; s=arc-20160816; b=NTXN9McyN+akKt79EI0LSD2iGzlR0Fh8Uh8yN1udGdx0VgcRuTo8m2pDh2Qwcp3XiE iVP8r8EbHQ6GlCTDINzoLbcdcChMEUDSG1TaoG7eF62RebVUdxSVtKhyGDxeGnmAN0+d AXVELZkG6lvgRd+ahbropilOQj9QxpH7+VH5/getUeKg9WpbHBuVVwWU9KmfXAoE2NFV sXY66eOLjh0wCV16h4CyW7H8PGIzJeBIhzV4NOUsIchB/eDhYtbmyYo5vrAxHGdOao3q tOdNiD7/h80Ig6gPQO1dxcQhNAxxXJ53qtfCsQG7y49PnBgGT9b6iDGk8oJU6aQWMnm+ RJDw== ARC-Message-Signature: i=2; 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=5+R/ybS65h0q9J8q+4GnE188fVdCairXnx6GTX1PC9g=; fh=fGJTjZ5xodDBNITeKDnk+dhmM6683tH7vYzWdpCMSVA=; b=DMQWR9UOJDGJeNjKLotrYn7XwA9b8DvqQAgyH8I46synDz+5i/e0kz0EvzOuV6qcVS pJxi+naErGwhe6WoLdGqhUX/xneqQv+WfvE1LqUHHNkJl/fpiaNpHgk/Cd3Rkg45RRae /5mVXPdBBpKxYsu6UplUD3/6uop/l9j7y5MAdKAA9bwiYyS6HVTW/jlAkI/2+HQiurMu t5iASIt/n4j6Qc2zoDcP2N2Ib24NJOPoKkbuiZInrMm8ybFthU8wogSlskiCfBiVUOIk rvhVPoPZvRD0cPdXUmnt8jY5elJl30IhQvIT9Oi9zqF3v0OTsUDiB4eraBIBpxkIjlSX b7Xg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=f7WPDdUE; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-145750-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145750-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ev6-20020a056402540600b00568d7509819si4874402edb.197.2024.04.15.12.07.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:07:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145750-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=f7WPDdUE; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-145750-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145750-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 54BCC1F23054 for ; Mon, 15 Apr 2024 19:06:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 22C0B156223; Mon, 15 Apr 2024 19:06:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="f7WPDdUE" Received: from mail-oo1-f51.google.com (mail-oo1-f51.google.com [209.85.161.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 EEB9C155A37 for ; Mon, 15 Apr 2024 19:06:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713207997; cv=none; b=UxH4cXDp+dgLfBO1k/XwJ2CHY4YiIrJhxpl5i0TK4XZvwt2Ybnf7l3GHnp9U/BaRenJXQcNorxSweLw4G+k70t73W3iFKi5Vx4Lq9GP5MB/UZ6sGPTtJM0wQbE1eGIjVBppI6hYb48H9oziaDEwFLAg4joxbObNT1NpiOxFTsq0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713207997; c=relaxed/simple; bh=m0cv+vQ4FxsfF8+H/JsI6f1Z4BEinsqnnKmlS1cGG5c=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=RE2v6Z62jK2bf13uBS2O2GHPgKQ3rKgp2jeFQ0QbjN9h1NW3Aum5HLywAA2UcfKeTXW7dhBAs9TrUnVDNhQ7PCwLULtgJRVLROsuecYtWWs5yO7HbMsx/+oaRqwhCZML4pKzH8r1yvcY6jCCMffeR4bGYvyxfHH8hehwS7FbkoI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=f7WPDdUE; arc=none smtp.client-ip=209.85.161.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-oo1-f51.google.com with SMTP id 006d021491bc7-5aa22ebd048so2695476eaf.1 for ; Mon, 15 Apr 2024 12:06:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713207995; x=1713812795; 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=5+R/ybS65h0q9J8q+4GnE188fVdCairXnx6GTX1PC9g=; b=f7WPDdUEMQ9/mrxAdxUVprhRElk7OuaHb0kE6X3Fs8T/bRw0Rn6tlLGxDeYlZSt/hs 5cU55log9yZMPbz+Cbaa6sMVjhO3xmYIjvsZd+5slrUk9sqZDxTvkh0e8T42E33Y7/SM LgTrBQ48Zs1nHvc4sSPvD8Ay9/Bv7b66EvyyQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713207995; x=1713812795; 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=5+R/ybS65h0q9J8q+4GnE188fVdCairXnx6GTX1PC9g=; b=H3Ksh939KAb2NXKdyfg0Myyn5ce7HBANCDdYdn2toZ3wm9x9iufZ3txnZsUaA1W8gb vx75Uv8lA9/A4+po+tP0FhREaGZ82hBWFqkqgIoPoSaHrc/T2fNdlWodzJRvCIHCgbvN NWOv3SK5JX0l7RU6mE/iXAebGXec80Zrah1EX/p8QNZyL/tM7QAdJOLwYeyMuNueFgEG aGYfVq0AIgPPnQcLyYr0b0SNPpoio3Ia/Tsdr17Ltcwq5tn0v0e7sh2BFvhoO825ivVG +0yNSOvi6BlhtLefQiyZyxpGs9J+M5ahwSjTlMFm7iuYOYwoEHM5iQWPifH/W7xgYD69 B6dw== X-Forwarded-Encrypted: i=1; AJvYcCXg/chxX9ckKt0+zm93NOtbJWI1VKvgJxBCVglzv+QO4FpJFXZ637fyFaT4gxCIjTg+vZHdzocNpMKO5Pw7hE/n5+8CJ5ILrYE5ctPe X-Gm-Message-State: AOJu0YxL3euNZ/HrKhTqHJXq5sO23/oy9R3sHkOPwvSRxnvsazHDVGH7 7vvm4I2miHnhceyQqrILYBmuNCDMU6ABplwXI1a36R0BI3md9xxb0ocsA2gHCKaxt/IhjQ/pkcW hE4EezHdJg0Remxag6e2Ya8hkgb33tC01E7N6 X-Received: by 2002:a05:6871:58aa:b0:222:8943:df2b with SMTP id ok42-20020a05687158aa00b002228943df2bmr12366733oac.16.1713207995078; Mon, 15 Apr 2024 12:06:35 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240415163527.626541-1-jeffxu@chromium.org> <20240415163527.626541-2-jeffxu@chromium.org> In-Reply-To: From: Jeff Xu Date: Mon, 15 Apr 2024 12:06:24 -0700 Message-ID: Subject: Re: [PATCH v10 1/5] mseal: Wire up mseal syscall To: Linus Torvalds Cc: Muhammad Usama Anjum , akpm@linux-foundation.org, keescook@chromium.org, jannh@google.com, sroettger@google.com, willy@infradead.org, gregkh@linuxfoundation.org, corbet@lwn.net, Liam.Howlett@oracle.com, surenb@google.com, merimus@google.com, rdunlap@infradead.org, jeffxu@google.com, jorgelo@chromium.org, groeck@chromium.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, pedro.falcato@gmail.com, dave.hansen@intel.com, linux-hardening@vger.kernel.org, deraadt@openbsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Apr 15, 2024 at 11:21=E2=80=AFAM Linus Torvalds wrote: > > On Mon, 15 Apr 2024 at 11:11, Muhammad Usama Anjum > wrote: > > > > It isn't logical to wire up something which isn't present > > Actually, with system calls, the rules end up being almost opposite. > > There's no point in adding the code if it's not reachable. So adding > the system call code before adding the wiring makes no sense. > > So you have two cases: add the stubs first, or add the code first. > Neither does anything without the other. > > So then you go "add both in the same commit" option, which ends up > being horrible from a "review the code" standpoint. The two parts are > entirely different and mixing them up makes the patch very unclear > (and has very different target audiences for reviewing it - the MM > people really shouldn't have to look at the architecture wiring > parts). > > End result: there are no "this is the logical ordering" cases. > > But the "wire up system calls" part actually has some reasons to be first= : > > - it reserves the system call number > > - it adds the "when system call isn't enabled, return -ENOSYS" > conditional system call logic > > so I actually tend prefer this ordering when it comes to system calls. > I confirm that the wire up change can be merged by its own, i.e. build will pass, and -ENOSYS will be returned at runtime. Thanks Linus for clarifying this. -Jeff > Linus