[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Discussion of Xenheap problems on AArch64


  • To: Julien Grall <julien@xxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Wed, 21 Apr 2021 09:32:43 +0000
  • Accept-language: zh-CN, en-US
  • 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=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-SenderADCheck; bh=raigjYOT3f3W5c1zbh/O8TBAZlZbVcoLgSBs3z/D2XQ=; b=YIby+ezWgebVOuZJ8xfcJ0WPW3xlrdyPZfcRgo9ipiOrTCE/Gu2fiB4cMY35lH3Pph1EWX/MfMLiB4CKRBZswbbwJFm/ljNl3TNt4f+ejxfm237vwRe4N0IN40D6C3d91VQwOb5f4GI0ULBcHxOvsLOvXNMIXRO+IebCCFZOi1uCbvserg8w2ZW3K9ds3dpVUCgms3iEDxPyrXDR6ZgWKaUKLuuYJyLpZsDmz+DTUfJBKnMpeqB/tipqMlR62NhmPggcojw781cJAPbQcigegKSflQ33PGz8u99XC2Cz3bUCPb7/tlw1rmgy+EGaUcyu5RTVEAlWg81NSUpiI9cS3Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ecl+SlFnHT5ZxETQqPNpmzoJ+GE28olRvPAJ40sqDo115ZN2mFdz2JVulsDEHwlyOsg2jERSXz7DDWha9ixYpqyV2yAr1TV4DEdxW0THPZwpHQ6f72kmeuTRIV2wPv6NUD/3D9rkRrwBI+p+CRfP5IIB6K6+JU4fw53xRMTs7qZCMDjDDUTPnEcSAC3Nui6JwpEk9KGycV2xC6GCmWAlS8ux5OSjtM6yEzzdoQtjV7tz1m+RTFznxpCo94ab5xQN3XBJbHTkVZeqiV8BttXXQ8fwa0XBeE1mhxPy5GRmviGbzA/SXiYXZsTbqIYCKs83vGSpKZJ6BGZ4OE+HSCL+4A==
  • Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: Wei Chen <Wei.Chen@xxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Delivery-date: Wed, 21 Apr 2021 09:33:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: Adc2dyA8lkZGRqbyRiSglHolanVkwQAFhaqAAACgy/A=
  • Thread-topic: Discussion of Xenheap problems on AArch64

Hi Julien,

> -----Original Message-----
> From: Julien Grall <julien@xxxxxxx>
> Sent: Wednesday, April 21, 2021 5:04 PM
> To: Henry Wang <Henry.Wang@xxxxxxx>; sstabellini@xxxxxxxxxx; xen-
> devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Wei Chen <Wei.Chen@xxxxxxx>; Penny Zheng
> <Penny.Zheng@xxxxxxx>; Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
> Subject: Re: Discussion of Xenheap problems on AArch64
> 
> 
> 
> On 21/04/2021 07:28, Henry Wang wrote:
> > Hi,
> 
> Hi Henry,
> 
> >
> > We are trying to implement the static memory allocation on AArch64. Part
> of
> > this feature is the reserved heap memory allocation, where a specific range
> of
> > memory is reserved only for heap. In the development process, we found a
> > pitfall in current AArch64 setup_xenheap_mappings() function.
> >
> > According to a previous discussion in community
> > https://lore.kernel.org/xen-devel/20190216134456.10681-1-
> peng.fan@xxxxxxx/,
> > on AArch64, bootmem is initialized after setup_xenheap_mappings(),
> > setup_xenheap_mappings() may try to allocate memory before memory
> has been
> > handed over to the boot allocator. If the reserved heap memory allocation
> is
> > introduced, either of below 2 cases will trigger a crash:
> >
> > 1. If the reserved heap memory is at the end of the memory block list and
> the
> > gap between reserved and unreserved memory is bigger than 512GB, when
> we setup
> > mappings from the beginning of the memory block list, we will get OOM
> caused
> > by lack of pages in boot allocator. This is because the memory that is
> reserved
> > for heap has not been mapped and added to the boot allocator.
> >
> > 2. If we add the memory that is reserved for heap to boot allocator first,
> and
> > then setup mappings for banks in the memory block list, we may get a page
> which
> > has not been setup mapping, causing a data abort.
> 
> There are a few issues with setup_xenheap_mappings(). I have been
> reworking the code on my spare time and started to upstream bits of it.
> A PoC can be found here:
> 
> https://xenbits.xen.org/gitweb/?p=people/julieng/xen-
> unstable.git;a=shortlog;h=refs/heads/pt/dev
> 

Really great news! Thanks you very much for the information and your hard
work on the PoC :) I will start to go through your PoC code then.

Kind regards,
Henry

> Cheers,
> 
> --
> Julien Grall

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.