[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] x86/P2M: correct type use in p2m_put_gfn()
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Wed, 4 Feb 2026 08:35:38 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JCuPzVhmIQA4R9yXsSRCBeP/o1eGAWXwnmLxQpdbBuw=; b=kIfNNs95kdiIgpWn9m3K2Ie9FQE3cIcFbYO2EyILnbLFoJddu3Pczth8NHH3GzWbIvoKw5F7RZGsLNbpApGApPQ0jmrPU9XgpBFIxZUmPPYv+aauN4GLwGLF5Cd7PKRWd+HP1HimJK9n8mrgKg9ephIaohqbvxmLEtb6hvYTlotc3/hh9A7E2Rhmrzqg80AfvpJmezzM9Q8UulkEOjI/ff6hUx864gWNEvxqQBpHjwG19S+Hit6bwguMvBeUgTyw6f6USuiD5N/iaBVZutXA++EuAyiu1w/848rsMRlXrnvxfFzlK4GbeGC/Bnw97qTnuEYmWGRD0D8YQQawHAnaOg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GQDEgY5ZuNXNCxiZ+Aqc0HvfurGChnVK6eqHpOuhGQN+bttlF62XfxSklXFQwSxajQ1SEaFRDRjQ9lrNM43ui2itevK2vgqyKHgigMvrj0uPpgMf3Go9Ab4aHyPJRZjnJmfnR+X7b5IdscWRjOEy5JjboFITUvVqr8Q7UUvXFCGpCBbXIWr3om8I8dRWx2CPvpmBDOXGUSYMT1Jj5DK47DS/Dof3YUmCPibC7lQgBrUefSI/rLtOcA1foty8DmbvpqE7ojM4wOWObbNhws81qAhZu4jRcEDBeQWCMi9xlXDebFiW9qO3OyV9u6t2Hh+4iw2pnlAnCP+qHzqWtQHT8Q==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Delivery-date: Wed, 04 Feb 2026 07:35:54 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Tue, Feb 03, 2026 at 03:01:27PM +0100, Jan Beulich wrote:
> Everywhere else gfn_t are passed into respective GFN locking macros: Do so
> here as well.
>
> Amends: 819cdc5a7301 ("x86/p2m: re-arrange {,__}put_gfn()")
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> ---
> Easy to spot by adding ASSERT(!gfn_eq(g, INVALID_GFN)) to the respective
> macros. While imo that should be a correct thing to do (as with
> hypothetical split locks a valid GFN would really need passing in, in
> order to be able to figure out which lock to use), we can't do so right
> now: The lock is acquired ahead of respective checking in a number of
> places, e.g. in p2m_get_gfn_type_access().
Could we convert those macros into static inlines? It's dangerous to
use macros like those when the parameters are dropped, as the
parameter is not evaluated at all.
Thanks, Roger.
|