[lfs-support] Booting LFS with systemd

Michael Shell list1 at michaelshell.org
Wed Jul 11 23:17:05 PDT 2018

On Wed, 11 Jul 2018 16:19:17 +0100
Hazel Russman <hazeldebian at googlemail.com> wrote:

> Does the "patchwork" site in your link contain the actual patch files
> that correspond to those weird alphanumeric codes? 


Yes! At the page:


Look at the headers near the top. The link to the patch is labeled
"patch" under the Download section. e.g.,


That will give you the patch that caused those changes which are
identified as "commit 7744ccdbc16f0ac4adae21b3678af93775b3a386":


Now, I have learned that reversing a patch is often not as simple as
just calling patch with the -R option.

Here are the 5 steps to reverse that patch and remove the memory
encrypt changes from your kernel. 

Make a copy of your "bad/recent/4.15" kernel tree (cp -a , etc.) and
then do the following five changes to the copy:

To revert the 

*** 1.
in file arch/x86/Kconfig
delete these lines around 1415:

	def_bool y

	bool "AMD Secure Memory Encryption (SME) support"
	depends on X86_64 && CPU_SUP_AMD
	  Say yes to enable support for the encryption of system memory.
	  This requires an AMD processor that supports Secure Memory
	  Encryption (SME).

	bool "Activate AMD Secure Memory Encryption (SME) by default"
	default y
	depends on AMD_MEM_ENCRYPT
	  Say yes to have system memory encrypted by default if running on
	  an AMD processor that supports Secure Memory Encryption (SME).

	  If set to Y, then the encryption of system memory can be
	  deactivated with the mem_encrypt=off command line option.

	  If set to N, then the encryption of system memory can be
	  activated with the mem_encrypt=on command line option.

*** 2.
delete the file arch/x86/include/asm/mem_encrypt.h

*** 3.
in file arch/x86/mm/Makefile
delete the line around 39:

obj-$(CONFIG_AMD_MEM_ENCRYPT)	+= mem_encrypt.o

*** 4.
delete the file arch/x86/mm/mem_encrypt.c

*** 5.
delete the file include/linux/mem_encrypt.h

You may also want to comment out or delete the lines in your kernel
.config related to:

# CONFIG_NUMA is not set

rerun makeconfig, save your configuration, and then try to build and
install the kernel. Does the modified 4.15 kernel boot OK now?

If so, we are now certain where the problem is.

If not, then the problem is not related to the memory encryption
patch/change after all - tell me as best you can how you came to
determine that the memory encryption change was the one where the
problem first appears.

Here is the info I found on how to biset a kernel problem:


If the reversion of the memory encrypt changes don't fix the
problem, then maybe you were off by one with the bisect and this
is the next likely troublemaker:


to revert that one, edit the arch/x86/mm/ioremap.c file and
*delete* the lines that are labeled with + and *add* those that
labeled with a - (remembering to remove those leading - labels when
you actually add them back in). Watch out to include the
"odd man out" line in between the + and -'s:

(void __force *)addr < phys_to_virt(ISA_END_ADDRESS))

> and it would be better done off-list because after all it's not an
> LFS problem (and certainly nothing to do with systemd!)

When you reply to this message, just reply to the message from my
email address and not the one from/to the LFS list. If we ever find
what the problem is, then we can later post that back to the list
so that others will also know.



More information about the lfs-support mailing list