[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: Anthony PERARD <anthony.perard@xxxxxxxxx>
- From: Henry Wang <xin.wang2@xxxxxxx>
- Date: Tue, 26 Mar 2024 09:21:14 +0800
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=cloud.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=56rv5jIdsX1029ySILFkHJT6Sgd+/aGmIVOaS3UsWYg=; b=Z0gPc+tyYECXTLGyDAkiooRkmLoKSUo33ZjJbY6ODmrPLUr8ZlSIAJMmFFqQDKjtQihblSY19LuNJ8cpAyHvt+nO7/5mMKmu1Q8h14SZuEq5II0sBYOmHfMbKPyNL2EX+xsc93eA93XI7SNmgFJl3YDZRCuahwh07vwGBBxT0VHTbOR4EG5Q0KlcY3RtAV7sq8dPT5WS3jAHusQZr8X+st/zPt5mL+rM2+qp0RLsl+nFD8cpSP2qp3lV/hBgRvkIEpbgHPPo36tevJrVkp/iDBlzvndS4PLW5LHB1wvyAZQvOPB+l8ja4452wWoaplXYX+qd4hSvr6CPpM1o2H/jWg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FzBQVSc2HlodjdFf5ivch/0919EResrLKWfLwR1XPZS9UiN4nALXkMf7uU7nUf0SBZb3smrIeI2Aa0+/NA6vttQCFGpyIyHSfo2WwU0aqSeDU359Nfc1WZf+sZwTDJMnagajo8/krA2xvB8pQoX1gO3nrPTQCpZ9yYgNDwOQEkHIRJxbROe2wFQ97QfDNIhY/O7rD5Q+Sf3IDWANFOHy8uqoJp0iBPp95guXD+f9ohPBnUUlm2H4rFP3YYiHxU7k27kzgqIDUBuXRb3BBbxvf2eSj1a2ssNkodvgYKP73XjyhInrczppF5+9jAkOMyidqm7RelJBJEUIzTpIMXmA6A==
- Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Alec Kwapis <alec.kwapis@xxxxxxxxxxxxx>
- Delivery-date: Tue, 26 Mar 2024 01:21:39 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Hi Anthony,
On 3/25/2024 11:35 PM, Anthony PERARD wrote:
On Fri, Mar 08, 2024 at 09:54:35AM +0800, Henry Wang wrote:
diff --git a/tools/helpers/init-dom0less.c b/tools/helpers/init-dom0less.c
index fee93459c4..92c612f6da 100644
--- a/tools/helpers/init-dom0less.c
+++ b/tools/helpers/init-dom0less.c
@@ -23,16 +23,30 @@ static int alloc_xs_page(struct xc_interface_core *xch,
libxl_dominfo *info,
uint64_t *xenstore_pfn)
{
- int rc;
- const xen_pfn_t base = GUEST_MAGIC_BASE >> XC_PAGE_SHIFT;
- xen_pfn_t p2m = (GUEST_MAGIC_BASE >> XC_PAGE_SHIFT) + XENSTORE_PFN_OFFSET;
+ int rc, i;
+ xen_pfn_t base = ((xen_pfn_t)-1);
+ xen_pfn_t p2m = ((xen_pfn_t)-1);
+ uint32_t nr_regions = XEN_MAX_MEM_REGIONS;
+ struct xen_mem_region mem_regions[XEN_MAX_MEM_REGIONS] = {0};
+
+ rc = xc_get_domain_mem_map(xch, info->domid, mem_regions, &nr_regions);
Shouldn't you check the value of in `rc`?
Yes I should have done so. I will do that in the next version. Thanks!
Kind regards, Henry
|