From: Nicholas Mc Guire <hofrat@osadl.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Vivek Goyal <vgoyal@redhat.com>, Ingo Molnar <mingo@redhat.com>,
"H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, linux-kernel@vger.kernel.org,
Nicholas Mc Guire <hofrat@osadl.org>
Subject: [PATCH RFC V2] purgatory: fix up declarations
Date: Fri, 23 Dec 2016 12:43:07 +0100 [thread overview]
Message-ID: <1482493387-30168-1-git-send-email-hofrat@osadl.org> (raw)
Add the missing declarations of basic purgatory functions and variables
used with kexec_purgatory_get_set_symbol() to allow a clean build.
Fixes: commit 8fc5b4d4121c ("purgatory: core purgatory functionality")
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---
V2: after kbuild test robot <lkp@intel.com> reported a build failure
removed incorrect declaration of copy_backup_region which is static
anyway.
sparse complained about:
CHECK arch/x86/purgatory/purgatory.c
arch/x86/purgatory/purgatory.c:21:15: warning: symbol 'backup_dest' was not declared. Should it be static?
arch/x86/purgatory/purgatory.c:22:15: warning: symbol 'backup_src' was not declared. Should it be static?
arch/x86/purgatory/purgatory.c:23:15: warning: symbol 'backup_sz' was not declared. Should it be static?
arch/x86/purgatory/purgatory.c:25:4: warning: symbol 'sha256_digest' was not declared. Should it be static?
arch/x86/purgatory/purgatory.c:27:19: warning: symbol 'sha_regions' was not declared. Should it be static?
arch/x86/purgatory/purgatory.c:42:5: warning: symbol 'verify_sha256_digest' was not declared. Should it be static?
arch/x86/purgatory/purgatory.c:61:6: warning: symbol 'purgatory' was not declared. Should it be static?
CC arch/x86/purgatory/purgatory.o
Numerous sparse messages regarding functions not being declared, these
functions are resolved via kexec_purgatory_get_set_symbol() and not
directly called anywhere. To resolve the sparse issues appropriate
declarations were added to asm/kexec-bzimage64.h and the appropriate
reference included in purgatory.c. Adding this to kexec-bzimage64.h
was done as setup_purgatory() from machine_kexec_file_64.c uses
these symbols - not sure if this is the proper place to add this.
While at it the initialization of sha_regions to {{0,0}} was added.
Patch was compile tested with: x86_64_defconfig (implies CONFIG_KEXEC=y)
Patch is against 4.9.0 (localversion-next is next-20161223)
arch/x86/include/asm/kexec-bzimage64.h | 16 ++++++++++++++++
arch/x86/purgatory/purgatory.c | 8 ++------
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/arch/x86/include/asm/kexec-bzimage64.h b/arch/x86/include/asm/kexec-bzimage64.h
index d1b5d19..fd7f776 100644
--- a/arch/x86/include/asm/kexec-bzimage64.h
+++ b/arch/x86/include/asm/kexec-bzimage64.h
@@ -1,6 +1,21 @@
#ifndef _ASM_KEXEC_BZIMAGE64_H
#define _ASM_KEXEC_BZIMAGE64_H
+struct sha_region {
+ unsigned long start;
+ unsigned long len;
+};
+
extern struct kexec_file_ops kexec_bzImage64_ops;
+/* needed for kexec_purgatory_get_set_symbol() */
+extern unsigned long backup_dest;
+extern unsigned long backup_src;
+extern unsigned long backup_sz;
+extern u8 sha256_digest[];
+extern struct sha_region sha_regions[];
+
+void purgatory(void);
+int verify_sha256_digest(void);
+
#endif /* _ASM_KEXE_BZIMAGE64_H */
diff --git a/arch/x86/purgatory/purgatory.c b/arch/x86/purgatory/purgatory.c
index 25e068b..26c8367 100644
--- a/arch/x86/purgatory/purgatory.c
+++ b/arch/x86/purgatory/purgatory.c
@@ -12,11 +12,7 @@
#include "sha256.h"
#include "../boot/string.h"
-
-struct sha_region {
- unsigned long start;
- unsigned long len;
-};
+#include <asm/kexec-bzimage64.h>
unsigned long backup_dest = 0;
unsigned long backup_src = 0;
@@ -24,7 +20,7 @@ unsigned long backup_sz = 0;
u8 sha256_digest[SHA256_DIGEST_SIZE] = { 0 };
-struct sha_region sha_regions[16] = {};
+struct sha_region sha_regions[16] = { { 0, 0 } };
/*
* On x86, second kernel requries first 640K of memory to boot. Copy
--
2.1.4
next reply other threads:[~2016-12-23 11:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-23 11:43 Nicholas Mc Guire [this message]
2017-01-03 15:38 ` Vivek Goyal
2017-01-03 16:34 ` Nicholas Mc Guire
2017-01-04 6:16 ` Dave Young
2017-01-04 17:58 ` Nicholas Mc Guire
2017-01-07 16:22 ` Nicholas Mc Guire
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1482493387-30168-1-git-send-email-hofrat@osadl.org \
--to=hofrat@osadl.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=vgoyal@redhat.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®