[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 5/5] xen/memory, tools: Make init-dom0less consume XEN_DOMCTL_get_mem_map
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Henry Wang <xin.wang2@xxxxxxx>
- Date: Fri, 29 Mar 2024 13:11:35 +0800
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=G7+PLlvFg7Nofnqolse5PAMGywO21EmhjtEznZSwR/k=; b=LdoBlqHx0v06WsDYLg9UIaHYXxQA0+Gx1xRTfmoYNTKRW4gxAwlTp/d7SSE2BOkbi0DRPp8O7jh1FvsDRicMII8FbpJnx499+GxBJhdWYm1xoDoNVuc+juN8mbKYlhkDzuLSnG1UHNyrdncBoq2qVYN6qQrStyHgKkYFD5trCekncPdhN+YdPKYmZE0NzegFmtI3I2cPaqTy4bb5V23/ho92jqm4SpMetfA1qYYdc1LhhWK6suksUdKLYj9RqTsf1Mezcd2QFH7YsJhJhG2ie2fIhfbT8FxtwoYlY1dQRSbrVo/86TJwV1tjyzcsTRtLoEqXWMnJhC3xGIerW4MsLA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BYOJoTKfmJEVvdXpIzRlr8oS675lSe6INAgk5mM4X54ltLXpA122OQ0/3m/uOtVjM7aczJsir9kYYWGqlDi0kpOAf3M+GH06lL9XiJsMgJGnykuGC7KzGvrADIsd+gUtql42gvHW0bweqrPablzwy2mQxBX2nWnFJrc7Kt1ezNYVZYC7tMU4XbUJQTguxn3kBnC0UmP+dfVSOZ1nM+KPrgjlSYPD8MOoNPrILUQQgLkE5nP06IJGuPmvxYg7ktWjEmpIbp+2A4jpG8W8cfhD9i3mLGN3CgakO/j7/P7sdZ7H8kD0kD9b7xv7A4lfIVMibp2Ks407urN31c8cHIM+ow==
- Cc: Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Alec Kwapis <alec.kwapis@xxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Fri, 29 Mar 2024 05:12:01 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Hi Jan,
On 3/12/2024 1:07 AM, Jan Beulich wrote:
+/*
+ * Flag to force populate physmap to use pages from domheap instead of 1:1
+ * or static allocation.
+ */
+#define XENMEMF_force_heap_alloc (1<<19)
#endif
If this is for populate_physmap only, then other sub-ops need to reject
its use.
I have to admit I'm a little wary of allocating another flag here and ...
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -205,6 +205,8 @@ struct npfec {
#define MEMF_no_icache_flush (1U<<_MEMF_no_icache_flush)
#define _MEMF_no_scrub 8
#define MEMF_no_scrub (1U<<_MEMF_no_scrub)
+#define _MEMF_force_heap_alloc 9
+#define MEMF_force_heap_alloc (1U<<_MEMF_force_heap_alloc)
#define _MEMF_node 16
#define MEMF_node_mask ((1U << (8 * sizeof(nodeid_t))) - 1)
#define MEMF_node(n) ((((n) + 1) & MEMF_node_mask) << _MEMF_node)
... here - we don't have that many left. Since other sub-ops aren't
intended to support this flag, did you consider adding another (perhaps
even arch-specific) sub-op instead?
While revisiting this comment when trying to come up with a V3, I
realized adding a sub-op here in the same level as
XENMEM_populate_physmap will basically duplicate the function
populate_physmap() with just the "else" (the non-1:1 allocation) part,
also a similar xc_domain_populate_physmap_exact() & co will be needed
from the toolstack side to call the new sub-op. So I am having the
concern of the duplication of code and not sure if I understand you
correctly. Would you please elaborate a bit more or clarify if I
understand you correctly? Thanks!
Kind regards,
Henry
Jan
|