Re: "x86/mm: Introduce the 'no5lvl' kernel parameter" broke SETUP_DTB?

From: Kirill A. Shutemov
Date: Mon Nov 19 2018 - 05:07:36 EST


On Fri, Nov 02, 2018 at 05:59:07PM +0000, Alistair Strachan wrote:
> Hi Kirill,
>
> I noticed that booting 4.19 in qemu while injecting a FDT using the
> "-dtb /path/to/blob" feature might have been broken by your change
> 372fddf70904 ("x86/mm: Introduce the 'no5lvl' kernel parameter").
>
> This manifests either as FDT corruption, which causes the setup code
> to fail to unpack it (i.e. corruption of the device-tree structure),
> or simply bad node data. If I make the below change, the problem goes
> away:
>
> diff --git a/arch/x86/boot/compressed/pgtable_64.c
> b/arch/x86/boot/compressed/pgtable_64.c
> index 8c5107545251..bfe5aca71254 100644
> --- a/arch/x86/boot/compressed/pgtable_64.c
> +++ b/arch/x86/boot/compressed/pgtable_64.c
> @@ -40,7 +40,7 @@ struct paging_config paging_prepare(void *rmode)
> unsigned long bios_start, ebda_start;
>
> /* Initialize boot_params. Required for cmdline_find_option_bool(). */
> - boot_params = rmode;
> + //boot_params = rmode;
>
> /*
> * Check if LA57 is desired and supported.
>
> This can be reproduced with the system-root.dtb file in
> https://android.googlesource.com/device/google/cuttlefish/+archive/master.tar.gz
> using "qemu -dtb system-root.dtb -kernel /path/to/bzImage -drive
> file=root.ext4" on x86_64_defconfig with CONFIG_OF_UNITTEST enabled.
>
> If the FDT is unpacked successfully, the
> /proc/device-tree/firmware/android/compatible file will exist, and
> contain the string "android,firmware" instead of junk.
>
> I'm still looking into the root cause for this, but I just wanted to
> let you know.

[ Sorry for late reply. I was on vacation. ]

I failed to reproduce the issue with my setup. I can see the string
"android,firmware" and all tests seems pass:

[ 2.796657] ### dt-test ### start of unittest - you will see error messages
[ 2.798680] OF: /testcase-data/phandle-tests/consumer-a: could not get #phandle-cells-missing for /testcase-dat1
[ 2.799038] OF: /testcase-data/phandle-tests/consumer-a: could not get #phandle-cells-missing for /testcase-dat1
[ 2.799384] OF: /testcase-data/phandle-tests/consumer-a: could not find phandle
[ 2.799681] OF: /testcase-data/phandle-tests/consumer-a: could not find phandle
[ 2.799915] OF: /testcase-data/phandle-tests/consumer-a: arguments longer than property
[ 2.800135] OF: /testcase-data/phandle-tests/consumer-a: arguments longer than property
[ 2.801191] OF: /testcase-data/phandle-tests/consumer-b: could not get #phandle-missing-cells for /testcase-dat1
[ 2.801606] OF: /testcase-data/phandle-tests/consumer-b: could not find phandle
[ 2.801842] OF: /testcase-data/phandle-tests/consumer-b: arguments longer than property
[ 2.811520] ### dt-test ### end of unittest - 162 passed, 0 failed

I've checked 372fddf70904 and v4.19. I don't see a difference comparing to
v4.17.

Were you able to track down the issue?

--
Kirill A. Shutemov