From: Shane Wang <shane.wang@intel.com>
To: hpa@zytor.com
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, joseph.cihula@intel.com
Subject: [RESEND][PATCH] intel_txt: fix section warning messages from tboot (v2)
Date: Tue, 16 Mar 2010 07:26:12 -0700 [thread overview]
Message-ID: <1268749572-2454-1-git-send-email-shane.wang@intel.com> (raw)
This patch is to fix the warning messages related to tboot when "allyesconfig"
is set on i386.
Signed-off-by: Shane Wang <shane.wang@intel.com>
Acked-by: Joseph Cihula <joseph.cihula@intel.com>
---
arch/x86/kernel/tboot.c | 108 +++++++++++++++++---------------------
1 file changed, 49 insertions(+), 59 deletions(-)
diff -r d5d64753146c arch/x86/kernel/tboot.c
--- a/arch/x86/kernel/tboot.c Mon Mar 01 09:47:50 2010 -0500
+++ b/arch/x86/kernel/tboot.c Thu Mar 04 09:36:37 2010 -0500
@@ -54,51 +54,6 @@ struct tboot *tboot __read_mostly;
#define pr_fmt(fmt) "tboot: " fmt
static u8 tboot_uuid[16] __initdata = TBOOT_UUID;
-
-void __init tboot_probe(void)
-{
- /* Look for valid page-aligned address for shared page. */
- if (!boot_params.tboot_addr)
- return;
- /*
- * also verify that it is mapped as we expect it before calling
- * set_fixmap(), to reduce chance of garbage value causing crash
- */
- if (!e820_any_mapped(boot_params.tboot_addr,
- boot_params.tboot_addr, E820_RESERVED)) {
- pr_warning("non-0 tboot_addr but it is not of type E820_RESERVED\n");
- return;
- }
-
- /* only a natively booted kernel should be using TXT */
- if (paravirt_enabled()) {
- pr_warning("non-0 tboot_addr but pv_ops is enabled\n");
- return;
- }
-
- /* Map and check for tboot UUID. */
- set_fixmap(FIX_TBOOT_BASE, boot_params.tboot_addr);
- tboot = (struct tboot *)fix_to_virt(FIX_TBOOT_BASE);
- if (memcmp(&tboot_uuid, &tboot->uuid, sizeof(tboot->uuid))) {
- pr_warning("tboot at 0x%llx is invalid\n",
- boot_params.tboot_addr);
- tboot = NULL;
- return;
- }
- if (tboot->version < 5) {
- pr_warning("tboot version is invalid: %u\n", tboot->version);
- tboot = NULL;
- return;
- }
-
- pr_info("found shared page at phys addr 0x%llx:\n",
- boot_params.tboot_addr);
- pr_debug("version: %d\n", tboot->version);
- pr_debug("log_addr: 0x%08x\n", tboot->log_addr);
- pr_debug("shutdown_entry: 0x%x\n", tboot->shutdown_entry);
- pr_debug("tboot_base: 0x%08x\n", tboot->tboot_base);
- pr_debug("tboot_size: 0x%x\n", tboot->tboot_size);
-}
static pgd_t *tboot_pg_dir;
static struct mm_struct tboot_mm = {
@@ -182,7 +137,7 @@ static void add_mac_region(phys_addr_t s
}
}
-static int tboot_setup_sleep(void)
+static void __init tboot_setup_sleep(void)
{
tboot->num_mac_regions = 0;
@@ -198,20 +153,60 @@ static int tboot_setup_sleep(void)
add_mac_region(virt_to_phys(_text), _end - _text);
tboot->acpi_sinfo.kernel_s3_resume_vector = acpi_wakeup_address;
-
- return 0;
}
#else /* no CONFIG_ACPI_SLEEP */
-static int tboot_setup_sleep(void)
-{
- /* S3 shutdown requested, but S3 not supported by the kernel... */
- BUG();
- return -1;
-}
+static void tboot_setup_sleep(void) {}
#endif
+
+void __init tboot_probe(void)
+{
+ /* Look for valid page-aligned address for shared page. */
+ if (!boot_params.tboot_addr)
+ return;
+ /*
+ * also verify that it is mapped as we expect it before calling
+ * set_fixmap(), to reduce chance of garbage value causing crash
+ */
+ if (!e820_any_mapped(boot_params.tboot_addr,
+ boot_params.tboot_addr, E820_RESERVED)) {
+ pr_warning("non-0 tboot_addr but it is not of type E820_RESERVED\n");
+ return;
+ }
+
+ /* only a natively booted kernel should be using TXT */
+ if (paravirt_enabled()) {
+ pr_warning("non-0 tboot_addr but pv_ops is enabled\n");
+ return;
+ }
+
+ /* Map and check for tboot UUID. */
+ set_fixmap(FIX_TBOOT_BASE, boot_params.tboot_addr);
+ tboot = (struct tboot *)fix_to_virt(FIX_TBOOT_BASE);
+ if (memcmp(&tboot_uuid, &tboot->uuid, sizeof(tboot->uuid))) {
+ pr_warning("tboot at 0x%llx is invalid\n",
+ boot_params.tboot_addr);
+ tboot = NULL;
+ return;
+ }
+ if (tboot->version < 5) {
+ pr_warning("tboot version is invalid: %u\n", tboot->version);
+ tboot = NULL;
+ return;
+ }
+
+ pr_info("found shared page at phys addr 0x%llx:\n",
+ boot_params.tboot_addr);
+ pr_debug("version: %d\n", tboot->version);
+ pr_debug("log_addr: 0x%08x\n", tboot->log_addr);
+ pr_debug("shutdown_entry: 0x%x\n", tboot->shutdown_entry);
+ pr_debug("tboot_base: 0x%08x\n", tboot->tboot_base);
+ pr_debug("tboot_size: 0x%x\n", tboot->tboot_size);
+
+ tboot_setup_sleep();
+}
void tboot_shutdown(u32 shutdown_type)
{
@@ -227,11 +222,6 @@ void tboot_shutdown(u32 shutdown_type)
*/
if (!tboot_pg_dir)
return;
-
- /* if this is S3 then set regions to MAC */
- if (shutdown_type == TB_SHUTDOWN_S3)
- if (tboot_setup_sleep())
- return;
tboot->shutdown_type = shutdown_type;
reply other threads:[~2010-03-16 6:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1268749572-2454-1-git-send-email-shane.wang@intel.com \
--to=shane.wang@intel.com \
--cc=hpa@zytor.com \
--cc=joseph.cihula@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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®