From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 215C8CCD1A0 for ; Wed, 18 Sep 2024 13:18:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 645096B0082; Wed, 18 Sep 2024 09:18:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5F5156B0083; Wed, 18 Sep 2024 09:18:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4BDE26B0085; Wed, 18 Sep 2024 09:18:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 2E41B6B0082 for ; Wed, 18 Sep 2024 09:18:29 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id AF74B1C4A27 for ; Wed, 18 Sep 2024 13:18:28 +0000 (UTC) X-FDA: 82577913096.24.F9DA340 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf18.hostedemail.com (Postfix) with ESMTP id 068821C0003 for ; Wed, 18 Sep 2024 13:18:26 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="dh/xU5S1"; spf=pass (imf18.hostedemail.com: domain of broonie@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=broonie@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1726665358; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=XMva4lMCfMIQ5TfVgyZpG/U9g9z1ow/UFi+c4+JqcPM=; b=a2YrjsZ51jRCO16sq7mE1KrSsZGCpH+/jPTDWS3VfojAFfsKYWLCssFfJiaaME97UZZVGj duLzTleyuxniKRaFFqN3BnpK52Y3Rut+xJ3Vwr3eG7Zi0cA+ueMF3L55+gkccpj7tViAPz u43RstO1jJuZRT/Hb1Jcx1ULiQCYB68= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="dh/xU5S1"; spf=pass (imf18.hostedemail.com: domain of broonie@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=broonie@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726665358; a=rsa-sha256; cv=none; b=nVrTeXPCClu9cjdUzmC4doYbnGEe4UYNUTjFpCtIh25l1C6uT1OrC0MFjNC+bcdhGW721t TCHeMhblU0xTCYauAx8O8MXF7/9FFyr9hJVL5pB6BrVPTQSVmprxWU6ukbRFjHUitdfFWO 2Eb021uIKsuh1+vPn/HPV3YtsHyxv+U= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 3FD0CA4385D; Wed, 18 Sep 2024 13:18:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D423C4CEC3; Wed, 18 Sep 2024 13:18:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1726665505; bh=KOHe4DkxWPpMPzEVfB3CEawAqwmw6QSxmlJeI52pIoA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dh/xU5S18W8bmrdGiQsgjQDFh4MbnzV/26SPABn5L+f1AudLfNt6FLiTfsMkwixGj j2zyQMnjx5cZFcHyqoZ82ScavkOJmoyuVI7BAbyqsjDBnfmoQyAGO9IfM/2tUVLkSZ w+CtaxZ+UvzYAWq6Jw9AM6Mz4HymaXyBrWwi7b9OQbZk0zkiuFH2RzsXPf52LLXUwz 3F7QjcbmMUgq+HB2OXZUevnlcKG/czdIg4IBj5ys8AHNbdL4a6yYJCscSkNit+DHcO zk6bkd87G2iKnBPDcVJ28BvlOlqQJTZN8uIX/txubNN6KWF+k2pFxcjAfwzphYat2t Mg8jKMjEH0Zag== Date: Wed, 18 Sep 2024 15:18:21 +0200 From: Mark Brown To: Jeff Xu Cc: Lorenzo Stoakes , Muhammad Usama Anjum , akpm@linux-foundation.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, pedro.falcato@gmail.com, willy@infradead.org, vbabka@suse.cz, Liam.Howlett@oracle.com, rientjes@google.com, keescook@chromium.org Subject: Re: [PATCH v3 4/5] selftests/mseal: add more tests for mmap Message-ID: References: <20240830180237.1220027-1-jeffxu@chromium.org> <20240830180237.1220027-5-jeffxu@chromium.org> <4944ce41-9fe1-4e22-8967-f6bd7eafae3f@lucifer.local> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="t9zZ3Q/TxVJgOE8I" Content-Disposition: inline In-Reply-To: X-Cookie: Editing is a rewording activity. X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 068821C0003 X-Stat-Signature: poejs5tgnnb91d4smeqpr5yt8q3aak3k X-Rspam-User: X-HE-Tag: 1726665506-190260 X-HE-Meta: U2FsdGVkX19iA3yJPpvxlaS/tRICjX3VjYGLy1KG4GEe+rA/fTzutGm5JPJCZ5QihoEyCLTB1klOWEU072yivzHekLdktw3qm3FV6v7qArpSGg7J+pfMH0WTDCHROazsW88H0UC5YUdSLLZNAXWGmdfnqodjGNscZ2KERDqzcr26nVIcJG1RAM+3C5tO8JJMVtquzJvkdvqx+YbTm4MxDnJzKghb5tUnJvkMNZ5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Ku3dvfzW9+2GwZP2MzKFCffWQpC898pW7CH6/iQQqqOLhheqarbyqkXjykQrWB3fX7Fp X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: --t9zZ3Q/TxVJgOE8I Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Sep 13, 2024 at 03:50:00PM -0700, Jeff Xu wrote: > Even though the number of lines is large in these patches, its main > intention is to test Pedro's in-place change (from can_modify_mm to > can_modify_vma). Before this patch, the test had a common pattern: > setup memory layout, seal the memory, perform a few mm-api steps, verify > return code (not zero). Because of the nature of out-of-loop, it is > sufficient to just verify the error code in a few cases. > With Pedro's in-loop change, the sealing check happens later in the > stack, thus there are more things and scenarios to verify. And there were > feedback to me during in-loop change that selftest should be extensive > enough to discover all regressions. Even though this viewpoint is subject > to debate. Since none would want to do it, I thought I would just do it. > So the Patch V3 1/5 is dedicated entirely to increasing the verification > for existing scenarios, this including checking return code code, vma-size, > etc after mm api return. > Patch V3 3/5 are for unmap(), during review of V2 of Pedro's in-loop > change, we discovered a bug in unmap(), and unmap() is not atomic. > This leads to 4/5(mmap), 5/5(mremap), which calls munmap(). > In addition, I add scenarios to cover cross-multiple-vma cases. > The high-level goal of mseal test are two folds: > 1> make sure sealing is working correctly under different scenarios, > i.e. sealed mapping are not modified. > 2> For unsealed memory, added mseal code doesn't regress on regular mm API. > The goal 2 is as important as 1, that is why tests usually are done in > two phases, one with sealing, the other without. That's vastly more detail than is in the changelogs for the actual patches (which are just a few lines each) or the cover letter of the series. I don't have the MM knowledge to assess the detail of what you're saying but I can't help but think that it'd help a lot with review if all this detail were part of the actual submission. --t9zZ3Q/TxVJgOE8I Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmbq0xwACgkQJNaLcl1U h9Bb5gf9HvuDNv8AbcGEzO+8ZQVVGlBGUXahiFFNylLhIRpt0rJ+ZSpxamPviKMX Z8Ab8ByYPhR6dkRdKHPFdKf1oe2EVQ2vEZjygtPbrrKHmV6oVj3syK69kTvacQUC Q9+6cm1vsKi5BgaTB3JFrqVbVce5h9hB5++WnLtz/B4Eg+d9Phvbk/YS9nzfN0wS MbB8DV5Xg2UOnV22hDua2WGQ48IY0pY8RUKgnZxpOwSSXDNJDJ3RJIkXF6s/RqC/ ck4M9EcxicevWhGI6TnO5k5enDRPLMPstK94jpbamYSswPTOZLrzaZPha8H6euES h7L14up0NhGMSHaZAXsuAVP3yb0lCw== =n6h7 -----END PGP SIGNATURE----- --t9zZ3Q/TxVJgOE8I--