提交 fd3ec366 编写于 作者: T Thiebaud Weksteen 提交者: Jarkko Sakkinen

tpm: move tpm_eventlog.h outside of drivers folder

The generic definitions of data structures in tpm_eventlog.h are
required by other part of the kernel (namely, the EFI stub).
Signed-off-by: NThiebaud Weksteen <tweek@google.com>
Reviewed-by: NJavier Martinez Canillas <javierm@redhat.com>
Tested-by: NJavier Martinez Canillas <javierm@redhat.com>
Tested-by: NJarkko Sakkinen  <jarkko.sakkinen@linux.intel.com>
Reviewed-by: NJarkko Sakkinen  <jarkko.sakkinen@linux.intel.com>
Signed-off-by: NJarkko Sakkinen  <jarkko.sakkinen@linux.intel.com>
上级 5ef924d9
...@@ -26,8 +26,9 @@ ...@@ -26,8 +26,9 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/freezer.h> #include <linux/freezer.h>
#include <linux/major.h> #include <linux/major.h>
#include <linux/tpm_eventlog.h>
#include "tpm.h" #include "tpm.h"
#include "tpm_eventlog.h"
DEFINE_IDR(dev_nums_idr); DEFINE_IDR(dev_nums_idr);
static DEFINE_MUTEX(idr_lock); static DEFINE_MUTEX(idr_lock);
......
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/freezer.h> #include <linux/freezer.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/tpm_eventlog.h>
#include "tpm.h" #include "tpm.h"
#include "tpm_eventlog.h"
#define TPM_MAX_ORDINAL 243 #define TPM_MAX_ORDINAL 243
#define TSC_MAX_ORDINAL 12 #define TSC_MAX_ORDINAL 12
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/cdev.h> #include <linux/cdev.h>
#include <linux/highmem.h> #include <linux/highmem.h>
#include <linux/tpm_eventlog.h>
#include <crypto/hash_info.h> #include <crypto/hash_info.h>
#ifdef CONFIG_X86 #ifdef CONFIG_X86
...@@ -385,10 +386,6 @@ struct tpm_cmd_t { ...@@ -385,10 +386,6 @@ struct tpm_cmd_t {
tpm_cmd_params params; tpm_cmd_params params;
} __packed; } __packed;
struct tpm2_digest {
u16 alg_id;
u8 digest[SHA512_DIGEST_SIZE];
} __packed;
/* A string buffer type for constructing TPM commands. This is based on the /* A string buffer type for constructing TPM commands. This is based on the
* ideas of string buffer code in security/keys/trusted.h but is heap based * ideas of string buffer code in security/keys/trusted.h but is heap based
...@@ -573,4 +570,26 @@ int tpm2_prepare_space(struct tpm_chip *chip, struct tpm_space *space, u32 cc, ...@@ -573,4 +570,26 @@ int tpm2_prepare_space(struct tpm_chip *chip, struct tpm_space *space, u32 cc,
u8 *cmd); u8 *cmd);
int tpm2_commit_space(struct tpm_chip *chip, struct tpm_space *space, int tpm2_commit_space(struct tpm_chip *chip, struct tpm_space *space,
u32 cc, u8 *buf, size_t *bufsiz); u32 cc, u8 *buf, size_t *bufsiz);
extern const struct seq_operations tpm2_binary_b_measurements_seqops;
#if defined(CONFIG_ACPI)
int tpm_read_log_acpi(struct tpm_chip *chip);
#else
static inline int tpm_read_log_acpi(struct tpm_chip *chip)
{
return -ENODEV;
}
#endif
#if defined(CONFIG_OF)
int tpm_read_log_of(struct tpm_chip *chip);
#else
static inline int tpm_read_log_of(struct tpm_chip *chip)
{
return -ENODEV;
}
#endif
int tpm_bios_log_setup(struct tpm_chip *chip);
void tpm_bios_log_teardown(struct tpm_chip *chip);
#endif #endif
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
#include <linux/security.h> #include <linux/security.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/tpm_eventlog.h>
#include "tpm.h" #include "tpm.h"
#include "tpm_eventlog.h"
static const char* tcpa_event_type_strings[] = { static const char* tcpa_event_type_strings[] = {
......
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
#include <linux/security.h> #include <linux/security.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/tpm_eventlog.h>
#include "tpm.h" #include "tpm.h"
#include "tpm_eventlog.h"
/* /*
* calc_tpm2_event_size() - calculate the event size, where event * calc_tpm2_event_size() - calculate the event size, where event
......
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/tpm_eventlog.h>
#include "tpm.h" #include "tpm.h"
#include "tpm_eventlog.h"
struct acpi_tcpa { struct acpi_tcpa {
struct acpi_table_header hdr; struct acpi_table_header hdr;
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/tpm_eventlog.h>
#include "tpm.h" #include "tpm.h"
#include "tpm_eventlog.h"
int tpm_read_log_of(struct tpm_chip *chip) int tpm_read_log_of(struct tpm_chip *chip)
{ {
......
/* SPDX-License-Identifier: GPL-2.0 */ /* SPDX-License-Identifier: GPL-2.0 */
#ifndef __TPM_EVENTLOG_H__ #ifndef __LINUX_TPM_EVENTLOG_H__
#define __TPM_EVENTLOG_H__ #define __LINUX_TPM_EVENTLOG_H__
#include <crypto/hash_info.h> #include <crypto/hash_info.h>
...@@ -105,6 +105,11 @@ struct tcg_event_field { ...@@ -105,6 +105,11 @@ struct tcg_event_field {
u8 event[0]; u8 event[0];
} __packed; } __packed;
struct tpm2_digest {
u16 alg_id;
u8 digest[SHA512_DIGEST_SIZE];
} __packed;
struct tcg_pcr_event2 { struct tcg_pcr_event2 {
u32 pcr_idx; u32 pcr_idx;
u32 event_type; u32 event_type;
...@@ -113,26 +118,4 @@ struct tcg_pcr_event2 { ...@@ -113,26 +118,4 @@ struct tcg_pcr_event2 {
struct tcg_event_field event; struct tcg_event_field event;
} __packed; } __packed;
extern const struct seq_operations tpm2_binary_b_measurements_seqops;
#if defined(CONFIG_ACPI)
int tpm_read_log_acpi(struct tpm_chip *chip);
#else
static inline int tpm_read_log_acpi(struct tpm_chip *chip)
{
return -ENODEV;
}
#endif
#if defined(CONFIG_OF)
int tpm_read_log_of(struct tpm_chip *chip);
#else
static inline int tpm_read_log_of(struct tpm_chip *chip)
{
return -ENODEV;
}
#endif
int tpm_bios_log_setup(struct tpm_chip *chip);
void tpm_bios_log_teardown(struct tpm_chip *chip);
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册