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

Re: EFI's -mapbs option may cause Linux to panic()


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 21 Nov 2022 17:48:10 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qL8ehkCJaIYXdYnKzFISbnqCkUUCDtOxfQ/QkHU4+28=; b=ANCyyRxuHfIY61b4Q6eBPZLZ8sHtADVUDBDjEsyXkCSXEBItCjCHlsaEo/7MWYh3vixQt/lk+jyC+ckHIyMqIr56bDlQrplJo4Bv3B7yMmjRb18+XmHW9oHdbeR1Pz1zOmo/MYDWblBVaT6mjZ4DbjkQSA7dQfsnSXo+mu2DPEP9+7vUKAgXOj+LxKZjwt9Vw5ZsZihjC76pODle3lmlRS/VCMYbnHBQU/NmtDNcjs1rJSmAAdzvk7fe3fz2L/cWKqYxYYnGm9QGOAKSdndKRCXB+YV1fYhXJec5iJM2wjgHuWaL6FLg4TT4jCdmVK3jQ4AnhTqQS34ziujtcAgzzg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dC0+mc9sSBchedzBzcJtUQh+rKksYpZvYvs8eGLHiBow09lDb0uJbRevVVcvUM3HkAtSOaOPBOPOnedq0mY3W4/JjozJsLYP6IjZ7OqsBs1+fj5qmCwtyVboGJUwNKFy3NZUYeY/Y81TjC2I8FCoUbwfbgkZ/GzL9ELo5CLeejLGimw+YIsJ9IiOI+amewpwRVGu3VdcbKdoJIsXN506hkdMwiI6LggxQcxTfvKvdTuf1bfLkbRnBszbtnTjuowO7XA481rujjqEyg65DCCHD1LKOUDCNznb3tAcOjV/Ysy0AEtV0s1PqFjfwje8BbTM0al35PNmhUl4c99lAF1cfA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Mon, 21 Nov 2022 16:48:36 +0000
  • Ironport-data: A9a23:FBdvmqNQDnT9XqLvrR2HlsFynXyQoLVcMsEvi/4bfWQNrUonhTIFn WdKWDuGaP2DZ2HyfNFzaY6+oR9Tvp+GmtMyGgto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v 63yTvGacajYm1eF/k/F3oDJ9CU6jufQA+KmU4YoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/ Nj/uKUzAnf8s9JPGj9SuvzrRC9H5qyo4mpB5AVmPJingXeF/5UrJMNHTU2OByOQrrl8RoaSW +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0vlpXU9W1 8EcEjo2NheC26WG0aymZ+Y506zPLOGzVG8ekldJ6GiDSNwAEdXESaiM4sJE1jAtgMwIBezZe 8cSdTtoalLHfgFLPVAUTpk5mY9EhFGmK2Ee9A3T+PdxujaDpOBy+OGF3N79YNuFSN8Thk+Fj mnH4374ElcRM9n3JT+toi3837eTx32TtIQ6TeCi+fB63n2qwjIXLgZRdAG1gtWhhRvrMz5YA wlOksY0loAw/kG2Stj2XzWjvWWJ+BUbXrJ4A+A8rQ2A1KfQywKYHXQfCC5MbsQ8s807TiBs0 UWG9/vrCiZoq6a9Um+G+/GfqjbaBMQOBWoLZCtBRw1V5dDm+ds3lkiWEIYlF7OphNroHz222 yqNsCU1m7QUi4gMyrm/+lfExTmro/AlUzII2+keZUr9hisRWWJvT9XABYTzhRqYELukcw==
  • Ironport-hdrordr: A9a23:eP9X86o9BAyLsAvFlAAu0UAaV5tBLNV00zEX/kB9WHVpm5Oj+v xGzc5w6farsl0ssREb9uxo9pPwJE800aQFmbX5XI3SJTUO3VHFEGgM1+vfKlHbak7DH6tmpN xdmstFeaHN5DpB/KHHCWCDer5PoeVvsprY49s2p00dMD2CAJsQizuRZDzrcHGfE2J9dOAE/d enl716jgvlXU5SQtWwB3EDUeSGj9rXlKj+aRpDKw875BKIhTaI7qe/NxSDxB8RXx5G3L9nqA H+4kfEz5Tml8v+5g7X1mfV4ZgTsNz9yuFbDMjJptkJJi7qggOIYp0kf7GZpjg6rMym9V5vut jRpBULOdh19hrqDymIiCqo/zOl/Ccl6nfkx1PdqXz/ofbhTDZ/L8Zan4pWfjbQ9kJl5bhHoe t29lPck6ASIQLLnSz76dSNfxZ2lnCsqX5nteIIlXRQXaYXdbcUh40C+0F+FosGAUvBmfYaOd grKPuZyOddcFucYXyclm5zwOa0VnB2JRuCSlhqgL3m7xFm2FRCi2cIzs0WmXkNsLgnTYNf2u jCOqN00JlTU84/d8tGdag8aPryLlaIbQPHMWqUL1iiProAIWjxp5n+56hwzP22eaYP0IA5lP 36IR9lXFYJCgPT4PC1rd12GkinehT/Yd2t8LAS23FBgMyzeFKxWhfzCmzHkKOb0oYi64PgKr OO0altco7exFvVaPl0NjLFKudvwFklIbgoU4UAKiazi/OODLHWncrmV9uWDIbRMF8fKxPC6z 04LXLOGPk=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Nov 21, 2022 at 05:27:16PM +0100, Jan Beulich wrote:
> Hello,
> 
> on a system with these first two EFI memory map entries
> 
> (XEN)  0000000000000-000000009dfff type=4 attr=000000000000000f
> (XEN)  000000009e000-000000009ffff type=2 attr=000000000000000f
> 
> i.e. except for 2 pages all space below 1M being BootServicesData, the
> -mapbs option has the effect of marking reserved all that space. Then
> Linux fails trying to allocate its lowmem trampoline (which really it
> shouldn't need when running in PV mode), ultimately leading to
> 
>               panic("Real mode trampoline was not allocated");
> 
> in their init_real_mode().
> 
> While for PV I think it is clear that the easiest is to avoid
> trampoline setup in the first place, iirc PVH Dom0 also tries to
> mirror the host memory map to its own address space. Does PVH Linux
> require a lowmem trampoline?

Yes, it does AFAIK.  I guess those two pages won't be enough for
Linux boot trampoline requirements then.

I assume native Linux is fine with this memory map because it reclaims
the EfiBootServicesData region and that's enough.

> While the two pages here are just enough for Xen's trampoline, I still
> wonder whether we want to adjust -mapbs behavior. Since whatever we
> might do leaves a risk of conflicting with true firmware (mis)use of
> that space, the best I can think of right now would be another option
> altering behavior (or providing altered behavior). Yet such an option
> would likely need to be more fine-grained then than covering all of
> the low Mb in one go. Which feels like both going too far and making
> it awkward for people to figure out what value(s) to use ...
> 
> Thoughts anyone?

I'm unsure what to recommend.  The mapbs option is a workaround for
broken firmware, and it's not enabled by default, so we might be lucky
and never find a system with a memory map like you describe that also
requires mapbs in order to boot.

Any native OS would also have problems booting in such system if it
has any option similar to mapbs, so I don't see much solution.

Thanks, Roger.



 


Rackspace

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