[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH 2/2] xen/arm: Handle reserved heap pages in boot and heap allocator
- To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
- From: Henry Wang <Henry.Wang@xxxxxxx>
- Date: Thu, 1 Sep 2022 00:49:46 +0000
- Accept-language: zh-CN, en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=2; 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=vOmcfg2WB89T/2XD5I94nVy4clbXGlsYiw7qjYX7GvA=; b=cORyBXRM+hVUrDCS9sj9HBNDCqxd7F4+KusV3Ui91XhLAzh8wU4Y4il2TnZ3A0ZOr2huy7/KRb0/dfm4v3nJ8tOuVYeoUDnN+Gv5FJJ0JXxlq1lGuZLwvB8Xo+4s6S7n7EvSwq5Wd3jXqhVMSIrn1jGdXP91FYR7lG/c5/owwmE/ZqQyQQfNYOPLniid9Gn7YxFa/b+JzXj0YbPU7Gg/I7lpqPAr3l9B+aNp67MszROmoiS5WOp2Es/xYv7o3lcQynkFVOnz+6BOUg4u9VJ64vo70FwyGbMs4N1G7mE8BPHmFYU2lBcjURwA3KzYjPiEask+mdMOwy0FYargC0wfTg==
- 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=vOmcfg2WB89T/2XD5I94nVy4clbXGlsYiw7qjYX7GvA=; b=eKI2hADDueQYcWmjeWM5QOIrH9KX2uzKMht52pvj2TeSpoaoNxdEjdKJE5z5qQ5bT+0hH4SacYSZ3AMtX8FSNu+F2+/9zE6vj8H2DGPZPvBidnLmTq8LmewiGuBjMOeWxcprKlJLqtStM8Q/TvH7UyEKalpMuNtT5XRQPYBqqOfS+LA2ATkedlkeA4aulSsuugjGatyS8sr1j6OiHFjS3nBfPxawEYAJAzZf4Xp0CVPWFayGSvveIwzcGsOST643OpRNw97aVE5XK2N2gq81je/Y79z4Zyde/DhgDy1yGj83XtUkq2oIsbFhMOEDCOopBnLSR0dPN8amW/fuyPTfuQ==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=iDGlN40hriIz/ezX+FbsCtw+ZGm3b2S3xF+6slT7cpU5YLnmda5J+i+ZdmHPZTuX4q38mdhwWCrhMj2HOB3tRzx1dEzF9sLxq52jdcPXx0RAnxid9wXAMNm1EgGw+Hf1zYzXpFwlndap4drONvBV4zf89Pk+elRusMxeWBWvhCeRANmu1jGnU/an0npxoHW7xrwoBp5zHfVxjJa/0Qa9tzAxvr1RIfwfDKeS/z4am0BmrpHh68Q7CeTC8zZMhvRJSSGVYhZypSTL9f+lgQ4LouBT5NqVk+pVj2NCpRF1dfyn3/MWneIUDuT/YUiI/Y796x1bksIENCW0mkygXffGEg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XDNg44pY1W+QEFIuWCqqHXS54OMsnn81eeulwjTwgqV7ltNwnTEzJvK+dN5WzhES7KLnIxNV6JhgvUt/uxbDT08hsY3k66yshmEzobl/uZnarf3F5tr4y3l+9bcLRmw4ZwB50m4dAAviBSBpwfnPAGXPbf0Ti+vrpuDnrRS3l0GCfQw5jmSCcnrwQrQfjdapBsyV7ETIW/Vnk+H50Dwbr41yOqqbXm5Qm/SWQ7LeMf6PHr5Wa1mheKFrTUhI5eQuh2Vq22Y30sQ3Y7jg0LSGEUpNhtOuGSzcwGjUjbESNZb0kMpqMM5fVxIcmm/vzbbfDAbT6K2NsK0ucFh+AZCqOg==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Thu, 01 Sep 2022 00:50:24 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHYt4ugTfbCAM/WyEil7pMplK0r3q3GqcQAgABmBoCAAKwSgIAAgPtwgAFuhYCAAB5nAA==
- Thread-topic: [PATCH 2/2] xen/arm: Handle reserved heap pages in boot and heap allocator
Hi Stefano,
> -----Original Message-----
> From: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> > > But also it looks like that on arm32 we have specific requirements for
> > > Xen heap:
> > >
> > > * - must be 32 MiB aligned
> > > * - must not include Xen itself or the boot modules
> > > * - must be at most 1GB or 1/32 the total RAM in the system if less
> > > * - must be at least 32M
> >
> > ...here, with the "1/32 the total RAM" now being "1/32 of the total reserved
> > heap region", since heap_pages is now reserved_heap_pages.
>
> I see. I didn't realize the full implications of the memory being used
> for both xenheap and domheap on arm32. In that case, I would simply do
> the following:
>
>
> heap_pages = !reserved_heap ? ram_pages : reserved_heap_pages;
>
> if ( opt_xenheap_megabytes )
> xenheap_pages = opt_xenheap_megabytes << (20-PAGE_SHIFT);
> else
> {
> xenheap_pages = (heap_pages/32 + 0x1fffUL) & ~0x1fffUL;
> xenheap_pages = max(xenheap_pages, 32UL<<(20-PAGE_SHIFT));
> xenheap_pages = min(xenheap_pages, 1UL<<(30-PAGE_SHIFT));
> }
>
> if ( reserved_heap )
> e = reserved_heap_end;
> else
> {
> do
> {
> e = consider_modules(ram_start, ram_end,
> pfn_to_paddr(xenheap_pages),
> 32<<20, 0);
>
> if ( e )
> break;
>
> xenheap_pages >>= 1;
> } while ( !opt_xenheap_megabytes && xenheap_pages > 32<<(20-
> PAGE_SHIFT) );
> }
>
> if ( ! e ||
> ( reserved_heap && reserved_heap_pages < 32<<(20-PAGE_SHIFT) ) )
> panic("Not enough space for xenheap\n");
>
> domheap_pages = heap_pages - xenheap_pages;
Thanks very much for your time and patience. I will follow this way - with
the comment also updated of course (I didn't realize the comment needs to
be changed until yesterday when I sent the reply to your last comment.)
Kind regards,
Henry
|