[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 1/2] xen/x86: move domain_clamp_alloc_bitsize() into pv32 code
- To: Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
- Date: Wed, 17 Dec 2025 14:05:51 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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=6K3l6d0MF1Q8SFLre9eWjfBSFP8P6q4fUhQfNI1Zr1s=; b=SrOoUzKtAZQTqDsGctJ1hrUMLFOytoi5PDfRn80SMVYnjocrDlJszBGEuC0AB/RhCKBjMw2PZ/ujClsHLb9f8C56xdhUazQ08iRSLF19Ztw0G78B/7scb1qP+RyS6hZs/OMJBB4zaYu+U4EXp7e6JPsDJz6+2Qzr7pN+tlC3ObYOzBo4lZsTj7o1VcKEcV5lGWZzWs0qUHyAb+kQ3w2uUPEeLDP2RicZDZb8gPTAut1crx+mUZIRyXRS7S+TKP6sh7U2+yIZOMwRzqkURheesCkwXlh/PK7jl0DPA+ScIYDgaIoBff8A7c3cQLIo5urzVAu5trexq+93ApiQ7/tDRQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Up3EEPEnttvw9YiUu2oP0U0r9PzGstk0Th64En2t2C58A2EvKK4vkgfAu2JEWc+GTu3AqLleiNFdl/clb6G6MN5hIgXYBY/bxFXWubpoYFUfFc08kQh66lIZ7TzHOzLN+Cp2GB1357FkRr8pTnO47gHiBdcYDPZUjr9GVvhMzcZ9ndfx+IQB4vbWr2Q13Ecx6j7cgutxicWlApdMRDaeJCk2c7i1kiHBRcNel/dXD2bIruid6e6BRT1jQ7S2xInoK7LAZvwjiuHbK3Sd9s60dTqFdL0Y55Phhu6rxAyYW32Bh98XLsKRU+EFAA1j6EXQIze3nhuEp5mgLdAQkzMZug==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
- Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Wed, 17 Dec 2025 12:06:11 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 17.12.25 09:56, Jan Beulich wrote:
On 17.12.2025 00:13, Grygorii Strashko wrote:
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -619,8 +619,16 @@ void __iomem *ioremap_wc(paddr_t pa, size_t len);
extern int memory_add(unsigned long spfn, unsigned long epfn, unsigned int pxm);
-unsigned int domain_clamp_alloc_bitsize(struct domain *d, unsigned int bits);
-#define domain_clamp_alloc_bitsize(d, bits) domain_clamp_alloc_bitsize(d, bits)
+#ifdef CONFIG_PV32
+#define domain_clamp_alloc_bitsize(d, bits) ({
\
+ struct domain *_d = (d);
\
This imo wants to be pointer-to-const. Question is whether then I'm upsetting
you
again, Andrew?
+ ((_d &&
\
+ _d->arch.physaddr_bitsize)
\
+ ? min_t(unsigned int, _d->arch.physaddr_bitsize, bits)
\
+ : bits);
\
This imo wants to look more like
((_d && _d->arch.physaddr_bitsize) \
? min_t(unsigned int, _d->arch.physaddr_bitsize, bits) \
: (bits)); \
The parenthesization of the latter use of "bits" is a must.
I'm ok with above adjustments, thank you.
With the adjustments (happy to carry out while committing, so long as there's
agreement):
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
Albeit, as indicated before, I'm not quite happy with the use of min_t(). Maybe
another macro-local variable _bits should be introduced?
--
Best regards,
-grygorii
|