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 2011CC47DAF for ; Thu, 18 Jan 2024 21:10:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5D5216B007D; Thu, 18 Jan 2024 16:10:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 55FB96B0080; Thu, 18 Jan 2024 16:10:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3FEEE6B0082; Thu, 18 Jan 2024 16:10:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 2C9BE6B007D for ; Thu, 18 Jan 2024 16:10:57 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 00E64120630 for ; Thu, 18 Jan 2024 21:10:56 +0000 (UTC) X-FDA: 81693676554.15.0CF9B16 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf29.hostedemail.com (Postfix) with ESMTP id 405F4120018 for ; Thu, 18 Jan 2024 21:10:55 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ZOjcivrW; spf=pass (imf29.hostedemail.com: domain of broonie@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=broonie@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1705612255; 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=VND7jMR8i2EV/Bkv0OIQbmP7AiIjcQ/EK2VGtDtrhQA=; b=yIRZhovYWTNxEApMO6NSE0XzCGsBQMphlqnEVxljW0p0vT7vJlQwhHVcG/aZwilgJy8hMk r/UtObh7ccAdftGlFjvRBWAGbuWKChBmTHj45/1reFBesqjxyjUdqC/bWlbEkO4J6yOktC 2qaffZWzo30tay7AQcjr5HqY0OZpzAQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1705612255; a=rsa-sha256; cv=none; b=hC7MPIn/KF+4weCMFWJvst3Gw6mLjXCHKa1qumIzhzOVQ7Ns07p3vIKf6Rxj6RiI4sLXgg a6pRTeO7V/NkMCJ3FQGxD/PAifdStZXcdtpLFhG9AMXXcze60eVoobfVnmvLm7dINbHisp 31gXZPEgrPyFBAOKRdnHuQgKsdN4AjI= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ZOjcivrW; spf=pass (imf29.hostedemail.com: domain of broonie@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=broonie@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 1514CB818AA; Thu, 18 Jan 2024 21:10:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DF08C433C7; Thu, 18 Jan 2024 21:10:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705612252; bh=f4pgnl8yd020hjFNUjJcTz/Gx6KZT1fbOEGiRHoWS0I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZOjcivrWeVqiQ8DXbRajgXxCSi0AX3o34/4vHt4xY0ZnhzaET53Cz7aexMT8aHn4h M5ArFyBw3UfbVpaf4/Z9R5jHEzG3cMVLydldQ+Gz+dB6E/xbSzGvtvCAhWKP3jTkVs NeVoUXPOeaCC1aJFFLAMZi3JyZP5FBbanivHS3DIiDvoTRmSVlVFrh9gK+zgS4JuPx a2NLXYIWfKGkWvFn23pJBDYEqqiOLFyGNR2wEEAtGQdnKptgaikIvDuNwf3KNWUSCq wP+zvTqLzIH15uhXn7/NUWueHheuyrpj/mKTsg6rzfFSF0P0QejjHhX6c+rmg9EklJ 5GQ+WBkWh5hgQ== Date: Thu, 18 Jan 2024 21:10:43 +0000 From: Mark Brown To: Thiago Jung Bauermann Cc: Catalin Marinas , Will Deacon , Jonathan Corbet , Andrew Morton , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Arnd Bergmann , Oleg Nesterov , Eric Biederman , Kees Cook , Shuah Khan , "Rick P. Edgecombe" , Deepak Gupta , Ard Biesheuvel , Szabolcs Nagy , "H.J. Lu" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Florian Weimer , Christian Brauner , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, kvmarm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH v7 36/39] selftests/arm64: Add GCS signal tests Message-ID: <94263c5c-817f-4dcf-8418-6c7e3c058557@sirena.org.uk> References: <20231122-arm64-gcs-v7-0-201c483bd775@kernel.org> <20231122-arm64-gcs-v7-36-201c483bd775@kernel.org> <875y0x7f1m.fsf@linaro.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="doBW+2ZTusCkWc8M" Content-Disposition: inline In-Reply-To: <875y0x7f1m.fsf@linaro.org> X-Cookie: FEELINGS are cascading over me!!! X-Rspamd-Queue-Id: 405F4120018 X-Rspam-User: X-Stat-Signature: sufpiqjowwi6x8ownp4awhoz41ozae7d X-Rspamd-Server: rspam03 X-HE-Tag: 1705612255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vack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: --doBW+2ZTusCkWc8M Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Dec 16, 2023 at 11:12:37PM -0300, Thiago Jung Bauermann wrote: > Mark Brown writes: > > +/* This should be includable from some standard header, but which? */ > > +#ifndef SEGV_CPERR > > +#define SEGV_CPERR 10 > > +#endif > One suggestion is include/uapi/asm-generic/siginfo.h. It already has > SEGV_MTEAERR and SEGV_MTESERR, as well as si_codes specific to other > arches. Sadly the testsuite is being very clever with redefining siginfo_t which means it conflicts with that header. I'll update the comment. > > + if (!get_current_context(td, &context.uc, sizeof(context))) { > > + fprintf(stderr, "Failed getting context\n"); > > + return 1; > > + } > At this point, before any function call is made, can the test check that > *(gcspr + 8) == 0? This would detect the issue I mentioned in > patch 24 of gcs_restore_signal() not zeroing the location of the cap. Sure. > > + if (gcs->gcspr != gcspr) { > > + fprintf(stderr, "Got GCSPR %llx but expected %lx\n", > > + gcs->gcspr, gcspr); > > + return 1; > > + } > I suggest adding a new check here to ensure that gcs->reserved == 0. This would mean that you couldn't use an old kselftest build to verify a new kernel that starts using the reserved bits. It's niche but it does seem like something that should work. --doBW+2ZTusCkWc8M Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmWpk9IACgkQJNaLcl1U h9D18Qf/dkanHMRcVOLBO0KY2XdPTIfY1GyOkjJY1kaVS8NrmmBXUrDbi21xRyjY hrG/NK4XolQfikIXkTHDmzK4oPapXDow6he4iR1c9zU0DnLSMp4VoXZ7ocIMAoBi tQ10946KiS7b3/zM+TNvOJeQcoToWb8HdVsvesPbs3kMHXTGFOCXIIGP+at5Xn+d jm35bqd8SAcCA57Xci4zNZm6G/40We/QeI3oAQjjrGQuCHeecQQAz1qMinbc5udk 98yjraA9J1Q0v5JAuH1ssAczoXX2hM7H7ZJZFu2x/lXqoq2bvjEDsJUJHybrb4d+ R77h7JGFnnC+PGVQbXKJpz1bueqP8w== =5ri/ -----END PGP SIGNATURE----- --doBW+2ZTusCkWc8M--