summaryrefslogtreecommitdiffstats
path: root/arch/x86/purgatory/sha256.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2017-03-10 13:17:18 +0100
committerThomas Gleixner <tglx@linutronix.de>2017-03-10 20:55:09 +0100
commit40c50c1fecdf012a3bf055ec813f0ef2eda2749c (patch)
treeff3b781d968411004fada1618550b4a9dd55136a /arch/x86/purgatory/sha256.h
parentbba8376aea1dcbbe22bbda118c52abee317c7609 (diff)
downloadlinux-40c50c1fecdf012a3bf055ec813f0ef2eda2749c.tar.bz2
kexec, x86/purgatory: Unbreak it and clean it up
The purgatory code defines global variables which are referenced via a symbol lookup in the kexec code (core and arch). A recent commit addressing sparse warnings made these static and thereby broke kexec_file. Why did this happen? Simply because the whole machinery is undocumented and lacks any form of forward declarations. The variable names are unspecific and lack a prefix, so adding forward declarations creates shadow variables in the core code. Aside of that the code relies on magic constants and duplicate struct definitions with no way to ensure that these things stay in sync. The section placement of the purgatory variables happened by chance and not by design. Unbreak kexec and cleanup the mess: - Add proper forward declarations and document the usage - Use common struct definition - Use the proper common defines instead of magic constants - Add a purgatory_ prefix to have a proper name space - Use ARRAY_SIZE() instead of a homebrewn reimplementation - Add proper sections to the purgatory variables [ From Mike ] Fixes: 72042a8c7b01 ("x86/purgatory: Make functions and variables static") Reported-by: Mike Galbraith <<efault@gmx.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Nicholas Mc Guire <der.herr@hofr.at> Cc: Borislav Petkov <bp@alien8.de> Cc: Vivek Goyal <vgoyal@redhat.com> Cc: "Tobin C. Harding" <me@tobin.cc> Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1703101315140.3681@nanos Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/purgatory/sha256.h')
-rw-r--r--arch/x86/purgatory/sha256.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/arch/x86/purgatory/sha256.h b/arch/x86/purgatory/sha256.h
index bd15a4127735..2867d9825a57 100644
--- a/arch/x86/purgatory/sha256.h
+++ b/arch/x86/purgatory/sha256.h
@@ -10,7 +10,6 @@
#ifndef SHA256_H
#define SHA256_H
-
#include <linux/types.h>
#include <crypto/sha.h>