[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: Tue, 22 Nov 2022 10:47:09 +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=AzNgKsvmxEG7MU2AdrR/ACp7s33x3ImYCR9I6zf4s+0=; b=mWNSPwrhJ7u7VgM0tHQ3hoZuaTofduF/0hLrKagPEaOpVUAJti63p4KSWCxkI/0YIbyw0yj3fNvwU8cUvokrE+MA8aCbnoIxZ1QWtq/3kUMKG06X7ySOTWhAhN84USPJzQXmWTMrQPUyJNbLyKN4g3dzh9f6Xk8p+dYhGJFj0cSxdfNDoGPCMy6RS+8sGMX8ceuFx4kUc5gV60YpUHHa9IoF6UUR9J3j2mn+7/8AlBxkd1dDRuQHnFmt1tU5NZcxJnyi6wz7qYN0YeDmkABMUI/wuZoZqndXiipcPPnbA15N+vLIZyp7SRd2PY2wqI6cYkIhMNJFkfvkT7dv/9IA1w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hyGMiIlr0MJnsiXNxnYlZ0uM2Mk7scfmhLUChBcSyLdViBXHbT1CHj/1wNJCuB4OjI/SZdTANMrkigaU0wqhndX/JLzWHjFcg7r6R6eZGMGb7X0vAScG5qqTNn1k9F4Y5LNsComQM3spBH6kfIqfVAXOWSeeGGZlUz00+cxCWG1Z33Hu9Ikeqxz/iX3tZGkGj9cVP8wnD2zwaeDrAM7lW6BLeetxd3x6JV1Z3x85atc+RKewo3p/Dh+rk5a+KQNEG5kjl5SyfTgqcvbzw1XiSqIhsFvDTCPn/d3ke59c3VxjS8EPRIzL1xOFOtNxukLTvyjXD8jiek94kHwLtkiyOQ==
  • 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: Tue, 22 Nov 2022 09:47:31 +0000
  • Ironport-data: A9a23:Pu4vta6Q99ai+BPtm+gpMQxRtBvGchMFZxGqfqrLsTDasY5as4F+v mQYXGDXM6uOMWv0KN52Pozk90wD6JbUxtM1GVc9rCFjHi5G8cbLO4+Ufxz6V8+wwm8vb2o8t plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRGvynTraBYnoqLeNdYH9JoQp5nOIkiZJfj9G8Agec0 fv/uMSaM1K+s9JOGjt8B5mr9VU+4pwehBtC5gZkPKkR5geH/5UoJMl3yZ+ZfiOQrrZ8RoZWd 86bpJml82XQ+QsaC9/Nut4XpWVTH9Y+lSDX4pZnc/DKbipq/0Te4Y5iXBYoUm9Fii3hojxE4 I4lWapc6+seFvakdOw1C3G0GszlVEFM0OevzXOX6aR/w6BaGpdFLjoH4EweZOUlFuhL7W5m+ c5JJzBcQh25nf+X7IKjaM48md4DM5y+VG8fkikIITDxK98DGMqGZpqQoNhS0XE3m9xEGuvYa 4wBcz1zYR/cYhpJfFAKFJY5m+TujX76G9FagAvN+exrvC6Nkkoti9ABM/KMEjCObd9SkUuC4 HrP4kzyAw0ANczZwj2Amp6prr+SxnqkBd1IfFG+3vtW3wKU9n0tMycHWmH8sMCTjFW+Ut0Kf iT4/QJr98De7neDTNPwQhm5q36spQMHVpxbFOhSwBGAzO/Y7hiUAkAATyVdc5o2uckuXzso2 1SV2dTzClRHsrKPTmmG3qyJtj70Mi8QRVLufgcBRAoBptz8+oc6i0uVSs45SPLuyNroBTv33 jaG6jAkgKkehtIK0KP9+k3bhzWrpd7CSQtdChjrY19JJzhRPOaND7FEI3CBhRqcBO51lmW8g UU=
  • Ironport-hdrordr: A9a23:s4Hml6/A973Hqq98tyJuk+G4dr1zdoMgy1knxilNoENuH/Bwxv rFoB1E73TJYVYqN03IV+rwXZVoZUmsjaKdhrNhRotKPTOWwVdASbsP0WKM+V3d8kHFh41gPO JbAtJD4b7LfCdHZKTBkW6F+r8bqbHokZxAx92uqUuFJTsaF52IhD0JbjpzfHcGJjWvUvECZe ehD4d81kydUEVSSv7+KmgOXuDFqdGOvJX6YSQeDxpixBiSgSiu4LvaFQHd+hsFSTtAzZor7G CAymXCl++emsD+7iWZ+37Y7pxQltek4txfBPaUgsxQBiTwhh2ubIFBXaTHmDwuuumg5Hsjjd GJiRY9OMZY7W/XYwiO0FDQ8jil9Axrx27pyFeej3emicvlRAgiA84EoY5CaBPW52cpodk5ic twriqknqsSKSmFsDX25tDOWR0vvk2ooUA6mepWq3BES4MRZJJYsIRa1kJIF5UrGj789ekcYa BTJfCZwMwTXUKRbnjfsGUq6NuwXk4rFhPDeUQGstz96UkioFlJi28jgOAPlHYJ85wwD7Ne4f 7fD6hunLZSCucLcKNUHo46MIWKI12IZSiJHHOZIFzhGq1CEWnKsYTL7LI84/zvUIAUzaE1hI /KXDpjxCEPknrVeI2zNaBwg1PwqD3XZ0Wu9ige3ek0hlTEfsurDcXZI2pe1vdJoJ0kc7/msr iISdZr6sTYXBvT8LZyrnPDsqZpWAgjue0uy6IGsgG107X2A7yvkNDnW9DuA5eoOQoYewrEcw g+tX7IVYh90nw=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Nov 21, 2022 at 06:01:00PM +0100, Jan Beulich wrote:
> On 21.11.2022 17:48, Roger Pau Monné wrote:
> > 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.
> 
> That's my understanding as well.
> 
> >> 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.
> 
> Guess how we've learned of the issue: Systems may boot fine without
> -mapbs, but they may fail to reboot because of that (in)famous issue of
> firmware writers not properly separating boot services code paths from
> runtime services ones. And there we're dealing with a system where I
> suspect this to be the case, just that - unlike in earlier similar
> cases - there's no "clean" crash proving the issue (the system simply
> hangs). Hence my request that they use -mapbs to try to figure out.
> 
> And yes, "reboot=acpi" helps there, but they insist on knowing what
> component is to blame.

Well, if reboot=acpi fixes it then it's quite clear EFI reboot method
is to blame?

Or they want to know the exact cause that makes EFI reboot fail,
because that's quite difficult to figure out from our end.

But I'm afraid I don't see any solution to make mapbs work with a PVH
dom0 on a system with a memory map like you provided, short of adding
some kind of bodge to not map and mark as reserved memory below 1MB
(but that kind of defeats the purpose of mapbs).

Roger.



 


Rackspace

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