Skip to content

Commit

Permalink
x86/tboot: Mark tboot static
Browse files Browse the repository at this point in the history
This structure is only really used in tboot.c.  The only exception
is a single tboot_enabled check, but for that we don't need an inline
function.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20200428051703.1625952-1-hch@lst.de
  • Loading branch information
Christoph Hellwig authored and Borislav Petkov committed Apr 28, 2020
1 parent 694cfd8 commit 767dea2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 6 additions & 2 deletions arch/x86/kernel/tboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
#include "../realmode/rm/wakeup.h"

/* Global pointer to shared data; NULL means no measured launch. */
struct tboot *tboot __read_mostly;
EXPORT_SYMBOL(tboot);
static struct tboot *tboot __read_mostly;

/* timeout for APs (in secs) to enter wait-for-SIPI state during shutdown */
#define AP_WAIT_TIMEOUT 1
Expand All @@ -46,6 +45,11 @@ EXPORT_SYMBOL(tboot);

static u8 tboot_uuid[16] __initdata = TBOOT_UUID;

bool tboot_enabled(void)
{
return tboot != NULL;
}

void __init tboot_probe(void)
{
/* Look for valid page-aligned address for shared page. */
Expand Down
8 changes: 1 addition & 7 deletions include/linux/tboot.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,7 @@ struct tboot {
#define TBOOT_UUID {0xff, 0x8d, 0x3c, 0x66, 0xb3, 0xe8, 0x82, 0x4b, 0xbf,\
0xaa, 0x19, 0xea, 0x4d, 0x5, 0x7a, 0x8}

extern struct tboot *tboot;

static inline int tboot_enabled(void)
{
return tboot != NULL;
}

bool tboot_enabled(void);
extern void tboot_probe(void);
extern void tboot_shutdown(u32 shutdown_type);
extern struct acpi_table_header *tboot_get_dmar_table(
Expand Down

0 comments on commit 767dea2

Please sign in to comment.