Re: kexec, x86/purgatory: Cleanup the unholy mess

From: Thomas Gleixner
Date: Fri Mar 10 2017 - 09:56:22 EST


On Fri, 10 Mar 2017, Mike Galbraith wrote:
> Stuffing the lot into .kexec-purgatory worked.

You beat me to it :)

And that's how that whole thing should have been done in the very beginning
instead of relying on uncomprehensible compile/link magics.

Thanks,

tglx

> ---
> arch/x86/purgatory/purgatory.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> --- a/arch/x86/purgatory/purgatory.c
> +++ b/arch/x86/purgatory/purgatory.c
> @@ -16,13 +16,13 @@
> #include "sha256.h"
> #include "../boot/string.h"
>
> -unsigned long purgatory_backup_dest;
> -unsigned long purgatory_backup_src;
> -unsigned long purgatory_backup_sz;
> +unsigned long purgatory_backup_dest __section(.kexec-purgatory);
> +unsigned long purgatory_backup_src __section(.kexec-purgatory);
> +unsigned long purgatory_backup_sz __section(.kexec-purgatory);
>
> -u8 purgatory_sha256_digest[SHA256_DIGEST_SIZE];
> +u8 purgatory_sha256_digest[SHA256_DIGEST_SIZE] __section(.kexec-purgatory);
>
> -struct kexec_sha_region purgatory_sha_regions[KEXEC_SEGMENT_MAX];
> +struct kexec_sha_region purgatory_sha_regions[KEXEC_SEGMENT_MAX] __section(.kexec-purgatory);
>
> /*
> * On x86, second kernel requries first 640K of memory to boot. Copy
>