Re: [PATCH v12 1/5] x86/boot: Add get_acpi_rsdp() to parse RSDP in cmdline from KEXEC

From: Borislav Petkov
Date: Tue Dec 04 2018 - 13:42:24 EST


On Sat, Dec 01, 2018 at 02:05:39PM +0800, Chao Fan wrote:
> >I built your whole patchset and got the error.
> >The error depends on CONFIG_MODVERSIONS.
> >If CONFIG_MODVERSIONS=y, you will get the build error.
>
> Hi Masa,
>
> Thanks, after that, I got the error.
> About your solution, it can fix the error. But I am not sure whether
> it's good.

What does CONFIG_MODVERSIONS=y have to do with this? I don't see the
connection.

Also, your patch triggers another build error:

ld -m elf_x86_64 -z noreloc-overflow -pie --no-dynamic-linker -T arch/x86/boot/compressed/vmlinux.lds arch/x86/boot/compressed/head_64.o arch/x86/boot/compressed/misc.o arch/x86/boot/compressed/string.o arch/x86/boot/compressed/cmdline.o arch/x86/boot/compressed/error.o arch/x86/boot/compressed/piggy.o arch/x86/boot/compressed/cpuflags.o arch/x86/boot/compressed/early_serial_console.o arch/x86/boot/compressed/mem_encrypt.o arch/x86/boot/compressed/pgtable_64.o arch/x86/boot/compressed/eboot.o arch/x86/boot/compressed/efi_stub_64.o drivers/firmware/efi/libstub/lib.a arch/x86/boot/compressed/efi_thunk_64.o -o arch/x86/boot/compressed/vmlinux
ld: arch/x86/boot/compressed/misc.o: in function `_parse_integer_fixup_radix':
misc.c:(.text+0x3057): undefined reference to `_ctype'
make[2]: *** [arch/x86/boot/compressed/Makefile:116: arch/x86/boot/compressed/vmlinux] Error 1
make[1]: *** [arch/x86/boot/Makefile:112: arch/x86/boot/compressed/vmlinux] Error 2
make: *** [arch/x86/Makefile:289: bzImage] Error 2
make: *** Waiting for unfinished jobs....

due to misc.o not seeing _ctype.

Looks like this is going to become too hairy and perhaps it would
be easier and cleaner if you copy all the functions needed into
arch/x86/boot/cmdline.c and this way get rid of the crazy ifdeffery and
the subtle build issues.

I mean, we do this already in other places like perf tool is copying
stuff selectively from kernel proper and since compressed/ is a
completely separate stage, we probably should do that for the sake of
keeping our sanity. :)

Thx.

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.