[lfs-support] Booting LFS with systemd

Hazel Russman hazeldebian at googlemail.com
Sat Jul 14 08:45:36 PDT 2018


On Sat, 14 Jul 2018 05:43:55 -0400
Michael Shell <list1 at michaelshell.org> wrote:

> On Sat, 14 Jul 2018 06:44:33 +0100
> Hazel Russman <hazeldebian at googlemail.com> wrote:
> 
> > I gather that some remapping that used to be done isn't done any more
> > and that's what my machine doesn't like.  
> 
> 
>   Hazel,
> 
> Congrats! OK, now note the offending commit has two parts:
>  
> https://patchwork.kernel.org/patch/9847859/
> 
> All the second part does is add a warning message and is very unlikely to
> be the cause of the problem. So, all you have to do to revert to
> isolate down to 1-2 lines is add two lines to arch/x86/mm/ioremap.c:
> 
> if (is_ISA_range(phys_addr, last_addr))
> 	return (__force void __iomem *)phys_to_virt(phys_addr);
> 
> around line 106, just before:
> 
>  /*
>   * Don't allow anybody to remap normal RAM that we're using.. 	 
>   */
>  	pfn      = phys_addr >> PAGE_SHIFT;
> 
That works (hallelujah!) up to a point. The system now boots with acpi on, but I suddenly have mouse problems in X. Some mouse functions work and some don't. So this is not a complete solution yet, though it's a giant step forward. We've certainly identified the locus of the problem. 
> 
> Here was the original way they considered:
> 
> if (is_ISA_range(phys_addr, last_addr) && !sme_active())
> 	return (__force void __iomem *)phys_to_virt(phys_addr);
> 
> 
> The above should also work fine on your system - because the
> (unwanted/problematic on your machine) remapping later on by ioremap.c
> will still be *prevented* as long as secure memory encryption is
> *not* being used.
> That is - the lines above remaps via phys_to_virt() on machines for ISA
> range addresses. The code later on in ioremap.c is supposed to be able
> to handle such re/maps OK with or without SME (without the need to hand
> things off to phys_to_virt()).

No, that doesn't work. The compiler doesn't like the sme_active() function and crashes the build. However istr that there was an sme header that was deleted in the original patch. Maybe that needs to be reinstated to make your condition work. I'll check up on that.

> 
> If you can confirm restoring the line above fixes the problem, then this
> is who to report it to:
> 
>   Thomas Gleixner  tglx (at) linutronix.de 
>   Tom Lendacky     thomas.lendacky (at) amd.com
>   Borislav Petkov  bp (at) suse.de
> 
> Possibly all of them as a CC to a post to the Linux IOMMU support mailing
> list:
> https://lists.linuxfoundation.org/mailman/listinfo/iommu
> 
> When they fix it, they will likely do so with *other* changes later on
> in the ioremap.c code. In other words, the code later in ioremap.c is
> supposed to work OK on all systems even without the "if (is_ISA_range ..."
> line.
> 
> But, since your system is only one that has showed a problem so far,
> they'll probably want you to run some test code before they decide how
> best to fix it. And do let us LFS folks know how it turns out.
> 
Before I go any further, I want to try the same fix on the 4.15 kernel which is the native one for LFS 8.2. If that works (apart from any mouse problems), I'll contact the people you name.

Thanks for all your help.

-- 
Hazel


More information about the lfs-support mailing list