[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>, Julien Grall <julien@xxxxxxx>
- From: Wei Chen <Wei.Chen@xxxxxxx>
- Date: Fri, 2 Sep 2022 03:02:46 +0000
- Accept-language: 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=y2YK5W2c0+o6jMVXpn2NDPqx4MigGfzXG59s+OIzKNk=; b=WsTUgEuGixDe7tfEPhaymkpv68dvUR/X+HhNkKvp37hqu1oDP2BYz/DOkoHxHn0irP8avQwMsj5uGyq/VMlt5i4za5dz80lgil2jtUVrj4atSyGyKHDWoYAMY8wvEnwfkk8yZHpZoXk1ASCSilvT0XzJnEISbnJGAC5395PK7vM+O6ojWKURrjW2iSMBErSKmve21BiuP4xs1jyDvROVU9EXry9iiJtzedMdlBUCeOdiouJteowYN/u5OcciUD6+hpgzhH6HWjxA0SUtud8TFG4ntytxJ3m+w6WFylz0JE4CHX56BKSZCxtfOdT7yvkC3b9Yn9reJ1Xsb17weNjhtw==
- 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=y2YK5W2c0+o6jMVXpn2NDPqx4MigGfzXG59s+OIzKNk=; b=XczaPO0uxioQJ+2JFXfnQN7A3y39JQzEtCwj8C0GuncyhthNb6DpruV66t2atIvPRMDzKOlDsFb3rTPhE8xUt2qbsCRGfKpg2Zmsw8N+H64j9xmtuxisSOYI5IF9w5JtO/oXvo8j+ZrjoAfsy7eqtXC84Cre2ootWZrccfyCKzzRIrhGMY6cBmyebfp99R5xpSiFSbdf1VWsx76fN99mxUKJHPE1JlXFzCbyXrRfcIoAMOCHbQ7Xk5NQGDbv1eAO+KJJWivybpa6Wa5uep+AEGmKCKI+6K1+lZ+MCB6NQAmI7K88xotvocNiNzHPLOqwoNRD+IOquMies2/BcS6jKQ==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Qfh6K46Gp6JhQJDaR6jXyMB1CqOyf++EfiUUI/GLWYQaOmRId4FmBIphqwWzSa7+N2cpu9OgXFAYJPleszUAFRz64mkUw69Nn04Nil1v3vnEkc28PLoaa9zUja01Ry9q0OSvRKO/zHblp9zhwxRoafheYYVjkKeu7W0GRqRXtZzIDcIKAXFwo2HvggGE9Yb1w88+RuUHITNoxcaCl9o9EuEfGIYO2ekZ11f2WIq7LQaGVtJCfG4Jo10K9mQDsSJjd7GMtBtA9xdq5rDE1NdCZGpUXhOunH+2ufAi/lgCaCJxytU2SNeSlaljzTyVWq5yNNPpGfTpeGduY7JjGNPhDw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mr1mvuaIECnte4B48EQDAAxrcz1EqDP4WVtsWhK6lemNQLNg3z7KeuVMginJE1Q+q1zHoRg5eW87iDo52JgCXcxfyt8pSShT+NCYFAxeOz9Q5EmBV4JYJ8J7qjZEWBg/gHs8pdbZbq3CVGg5d4hIVEUlA/ubgsrR+mYvH4WgEq0niktfIxItbeuetugZvRtDeubfvLk+TpwetSbSt75sHi9DNDRq3C+JoFG6qTdnYwA+tfcFHLsuZ9EcAcSRlk9TIP29abTDsLlD3q6Pc0ffKMcNWTQa4n8/9H9SYP0qzxxxE8at1n4GZgm20pc+FYR+vocdOLgy+udvJOvnyiZalg==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Henry Wang <Henry.Wang@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Fri, 02 Sep 2022 03:03:13 +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: AQHYt4ugxTCtO4LgrkGJKD3tY8acia3KwCgAgAAJ8YCAABHIAIAABy8AgACKuYCAAA6DsA==
- Thread-topic: [PATCH 2/2] xen/arm: Handle reserved heap pages in boot and heap allocator
Hi Julien and Stefano,
> -----Original Message-----
> From: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> Sent: 2022年9月2日 9:51
> To: Julien Grall <julien@xxxxxxx>
> Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>; Henry Wang
> <Henry.Wang@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx; Bertrand Marquis
> <Bertrand.Marquis@xxxxxxx>; Wei Chen <Wei.Chen@xxxxxxx>; Volodymyr Babchuk
> <Volodymyr_Babchuk@xxxxxxxx>
> Subject: Re: [PATCH 2/2] xen/arm: Handle reserved heap pages in boot and
> heap allocator
>
> On Thu, 1 Sep 2022, Julien Grall wrote:
> > Hi Stefano,
> >
> > On 01/09/2022 18:08, Stefano Stabellini wrote:
> > > > > Also, what happen with UEFI? Is it easy to guarantee the region
> will not
> > > > > be used?
> > > >
> > > > For now I think it is not easy to guarantee that, do you have some
> ideas
> > > > in mind? I think I can follow this in above follow-up series to
> improve
> > > > things.
> > >
> > > For clarity, are we worried that the region is used by the bootloader
> > > for other things? For instance U-Boot or Tianocore placing some
> > > firmware tables inside the range specified for xenheap?
> >
> > Yes. I think it would be difficult for an admin to figure out which
> regions
> > are used. Although they are likely (?) going to be static for a given
> > UEFI/U-boot build.
> >
> > My major concern is such bug can be very difficult to root cause because
> we
> > have no safety in Xen. The most likely symptom would be random
> corruption.
>
> Thanks for the clarification. Yeah, I think we'll have to do some
> "creative thinking" to figure out a solution to this issue. I wonder if
> U-boot or Tianocore have some sort of API (or build-time data) to know
> the unavailable ranges.
>
When Xen is booted through EFI, all the memory statically defined in the
Device tree has a certain probability of conflicting with the memory occupied
by EFI. This is difficult to avoid without the EFI bootloader intervening,
but it is possible to detect such a conflict.
For EFI reserved memory regions (like runtime service), they will not be
reported as usable memory to Xen. The usable memory regions will be added
to bootinfo.memblk as device tree boot. So I think all static defined memory
regions would be check with bootinfo.memblk to find the conflict.
For EFI relocate Xen and DTB, I think Xen itself can know these addresses
easily and easy to check.
But if we don't add code to uboot or EDK2, what can we do are just check,
print error and panic. But starting from the actual usage scenario, because
the scenarios using static heap are normally highly customized, their EFI
firmware will bypass the static memory we defined in device tree when
customizing. So maybe check conflict is enough?
Cheers,
Wei Chen
> In any case, I think we can postpone to after the release.
|