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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8991AC3DA64 for ; Fri, 26 Jul 2024 01:01:34 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.765196.1175784 (Exim 4.92) (envelope-from ) id 1sX9Kg-0008BI-HT; Fri, 26 Jul 2024 01:01:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 765196.1175784; Fri, 26 Jul 2024 01:01:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sX9Kg-0008AP-C9; Fri, 26 Jul 2024 01:01:18 +0000 Received: by outflank-mailman (input) for mailman id 765196; Fri, 26 Jul 2024 01:01:17 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sX9Ke-00059r-Qa for xen-devel@lists.xenproject.org; Fri, 26 Jul 2024 01:01:17 +0000 Received: from fout6-smtp.messagingengine.com (fout6-smtp.messagingengine.com [103.168.172.149]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 8a080a2b-4aea-11ef-8776-851b0ebba9a2; Fri, 26 Jul 2024 03:01:07 +0200 (CEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id 45F371380351; Thu, 25 Jul 2024 21:01:06 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 25 Jul 2024 21:01:06 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 25 Jul 2024 21:01:04 -0400 (EDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 8a080a2b-4aea-11ef-8776-851b0ebba9a2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1721955666; x=1722042066; bh=vMEFVFOBmxb1HtF7SEeR9nke0slxYCkVy8bbPz/CgoQ=; b= KQ2WtaqQrcn9tMX9La5NeuV5zz9y8a/L0veU9nefTcxUl41189n1jVcBKx2a7v8W YcsNFgKXN+zL7Lg1z9sXxEigVkl/4ppe7pq3YS25BI5yP9H+NvIQT3XR8hCL40Mu ONFPeFuH06rSQOESQBNPXJK5pDDweiExyo0TTArW3sIhzxC8kCX0dGtC7c6A1GsZ 9uR4Qxl1uneAXJA13TGblN+fm7Jh+JHfWiUco3LySGGMt2O78NY+EUOe6XpQnryE b/zuvkIn/j/sFMM0KsdU3dJuU/jCQZ7FpWTvQGdg2mqvotGgnm744ijWkmAtwkWb LwES+y20Ne6MlKSTzReGpA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1721955666; x=1722042066; bh=vMEFVFOBmxb1HtF7SEeR9nke0slx YCkVy8bbPz/CgoQ=; b=R65c60C5newhRbf30/1qG6FAHZmdGGi63FDU39ycfWKm uycRwgIzZPrqfEN0OHljJTKUzwtgXrAZAEkgNsCgiKzJC5wKkvPbU4HpXDyKNbfO rTktcQlu+6iOFL6r1/1yMtpSlJSMHKgMQx6nAGwIAXcJlUUHm5kSY2B1Fxlus0sB dkUymfW7QZtJtYEGkzKD3EP983C8IyZ8tIBb5uUF3SBGzWlD1fSbISMGgCiAce7m Wf9cMVm4520nvqsvS05rh0pH2jn/vqTHOFCusa+0kSDIQ1lXnF93An2lp7U9mkkF bNuCepEmD5Tkek/oWVvHGJb3eNrA8+kBxND+hlp1Cw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrieeggdegtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehgtderredttdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpefgudel teefvefhfeehieetleeihfejhfeludevteetkeevtedtvdegueetfeejudenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgvkhes ihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhmpdhnsggprhgtphhtthhopedt X-ME-Proxy: Feedback-ID: i1568416f:Fastmail Date: Fri, 26 Jul 2024 03:01:00 +0200 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: Jan Beulich Cc: Andrew Cooper , Roger Pau =?utf-8?B?TW9ubsOp?= , xen-devel@lists.xenproject.org Subject: Re: [PATCH v6 2/3] x86/mm: add API for marking only part of a MMIO page read only Message-ID: References: <4bea5034cda37f35cd04115bebcccb52e3ea719e.1721704980.git-series.marmarek@invisiblethingslab.com> <7588feb4-dc42-4bf3-85db-7aaac201a2ff@suse.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1j2XPxvC1isC58oq" Content-Disposition: inline In-Reply-To: <7588feb4-dc42-4bf3-85db-7aaac201a2ff@suse.com> --1j2XPxvC1isC58oq Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Fri, 26 Jul 2024 03:01:00 +0200 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: Jan Beulich Cc: Andrew Cooper , Roger Pau =?utf-8?B?TW9ubsOp?= , xen-devel@lists.xenproject.org Subject: Re: [PATCH v6 2/3] x86/mm: add API for marking only part of a MMIO page read only On Thu, Jul 25, 2024 at 11:26:31AM +0200, Jan Beulich wrote: > On 23.07.2024 05:24, Marek Marczykowski-G=C3=B3recki wrote: > > + * so tolerate it. > > + * But unaligned size would result in smaller area, so deny it. > > + */ > > + ASSERT(IS_ALIGNED(start, MMIO_RO_SUBPAGE_GRAN)); > > + ASSERT(IS_ALIGNED(size, MMIO_RO_SUBPAGE_GRAN)); > > + if ( !IS_ALIGNED(size, MMIO_RO_SUBPAGE_GRAN) ) > > + return -EINVAL; >=20 > I hoped you would, when adding the comment, recall an earlier comment of > mine: If you want to tolerate mis-aligned start in release builds, you > need to make further adjustments to the subsequent logic (at which > point the respective assertion may become pointless); see below. While > things may work okay without (I didn't fully convince myself either way), > the main point here is that you want to make sure we test in debug builds > what's actually used in release one. Hence subtleties like this would > better be dealt with uniformly between release and debug builds. Right, and I think this is a good argument to not try to accept unaligned size either, even if it would be possible here. --=20 Best Regards, Marek Marczykowski-G=C3=B3recki Invisible Things Lab --1j2XPxvC1isC58oq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmai9UwACgkQ24/THMrX 1yytbQf/ZvSfv6BxnYZLGS6L0Gjx1bhRO5xzwkGEXbcQgLdzhEsGFi3TcpNXJmGA Mq46erMm2EFMkHSeHwiyboXay3F0tYLrEelRuWvJV5kTZ6V94Ws1bPhbwPZJ9VqG Uig8ESaQr7XzNX98MxRm6rQtSfFbAJxSLmV8Qd1bGHQFhP+HA26P4gbVb4YIwFOC b68C2+IJOIjsFMzsuXg6CvlQMXppSwBowce+cnT49oMVq/8YFTBfAlkb3bevyIkj HLc/Bs7/NtKaZNP1L2ojeQGk9DQPxMQirYKeE2BKPLZBIj3nTXy+OlGDyE95dt2B CzD1Y/QG5Mp/ok8KmA/P43zf5QR45w== =sydp -----END PGP SIGNATURE----- --1j2XPxvC1isC58oq--