From nobody Mon Dec 06 17:21:24 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DB87918C0B89; Mon, 6 Dec 2021 17:21:31 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4J79Fl0tYzz3NqV; Mon, 6 Dec 2021 17:21:31 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 9C9B43C0199; Mon, 6 Dec 2021 17:21:24 +0000 (UTC) Date: Mon, 6 Dec 2021 17:21:24 +0000 From: Brooks Davis To: Konstantin Belousov Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a4e4132fa3bf - main - swapoff(2): replace special device name argument with a structure Message-ID: <20211206172124.GA40392@spindle.one-eyed-alien.net> References: <202112042221.1B4ML7Ov002151@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="opJtzjQTFsWo+cga" Content-Disposition: inline In-Reply-To: <202112042221.1B4ML7Ov002151@gitrepo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 4J79Fl0tYzz3NqV X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net X-Spamd-Result: default: False [-1.97 / 15.00]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[brooks]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.86)[0.863]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.93)[-0.932]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_ZERO(0.00)[0]; R_SPF_NA(0.00)[no SPF record]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net] X-ThisMailContainsUnwantedMimeParts: N --opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 04, 2021 at 10:21:07PM +0000, Konstantin Belousov wrote: > The branch main has been updated by kib: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3Da4e4132fa3bfadb6047fc0fa5f= 399f4640460300 >=20 > commit a4e4132fa3bfadb6047fc0fa5f399f4640460300 > Author: Konstantin Belousov > AuthorDate: 2021-11-29 16:26:31 +0000 > Commit: Konstantin Belousov > CommitDate: 2021-12-04 22:20:58 +0000 >=20 > swapoff(2): replace special device name argument with a structure > =20 > For compatibility, add a placeholder pointer to the start of the > added struct swapoff_new_args, and use it to distinguish old vs. new > style of syscall invocation. I agree with Jess that this should be a new syscall. The entry in sycalls.master now fails to describe the memory footprint of the name argument. No system call should be created or altered to have a memory footprint not describable with SAL annotations unless an applicable standard such as POSIX requires it. > diff --git a/sys/vm/swap_pager.h b/sys/vm/swap_pager.h > index 395fbc9957c4..469de3e8eaf4 100644 > --- a/sys/vm/swap_pager.h > +++ b/sys/vm/swap_pager.h > @@ -69,6 +69,14 @@ struct swdevt { > #define SW_UNMAPPED 0x01 > #define SW_CLOSING 0x04 > =20 > +struct swapoff_new_args { > + const char *name_old_syscall; > + const char *name; > + u_int flags; > + u_int pad0; > + uintptr_t pad1[8]; > +}; If you're going to attempt to add future-proofing, please pad with the assumption that pointers are 128-bit sized and aligned. In this case, that would mean an uint64_t pad before pad1. If there were done in place, adding the pad and dropping pad1 to 6 elements would be safe. -- Brooks --opJtzjQTFsWo+cga Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJhrkaTAAoJEKzQXbSebgfA0RMH/AhaygTxl8kC4hjJrjjpKwZG pOlX+qdN1yeaTRHmsxa0QMSJ7Zau+QS0vqXQB3RnBZr+QPqrqxuzqh75rJyryzMT TBvEwNcAI7Gk/6Z9wHZf8S8FQXKHLVvkO/HcmtqoPSWFCxUYx/cYV3e4PLcwdFWo lCG1SVsxdv2imiTTdXBl5wTP6DmIvLhVpJfh69DU4Km3kLuj7iwI1l+UKhVgyfij CNwN/jSJI3KQQZDdeswBjPd1KL0lNisHztYZXya2nYPxsLWuIqK7y/GLPjvpDCI7 tjVrcm2RIY+SxVbauKTmoCUqelM3RNbwzS53NASU0/uiKXB4eFrpd+FbwvVcYm8= =ooqx -----END PGP SIGNATURE----- --opJtzjQTFsWo+cga--