+ tpm-update-bios-log-code-for-12.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     tpm: update bios log code for 1.2

has been added to the -mm tree.  Its filename is

     tpm-update-bios-log-code-for-12.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this


From: Kylene Jo Hall <kjhall@xxxxxxxxxx>

The acpi table which contains the BIOS log events was updated for 1.2. 
There are now client and server modes as defined in the specifications with
slightly different formats.  Additionally, the start field was even too
small for the 1.1 version but had been working anyway.  This patch updates
the code to deal with any of the three types of headers probperly (1.1, 1.2
client and 1.2 server).

Signed-off-by: Kylie Hall <kjhall@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/char/tpm/tpm_bios.c |   49 +++++++++++++++++++++++++---------
 1 files changed, 37 insertions(+), 12 deletions(-)

diff -puN drivers/char/tpm/tpm_bios.c~tpm-update-bios-log-code-for-12 drivers/char/tpm/tpm_bios.c
--- 25/drivers/char/tpm/tpm_bios.c~tpm-update-bios-log-code-for-12	Thu Apr 13 16:14:58 2006
+++ 25-akpm/drivers/char/tpm/tpm_bios.c	Thu Apr 13 16:14:58 2006
@@ -29,6 +29,11 @@
 #define MAX_TEXT_EVENT		1000	/* Max event string length */
 #define ACPI_TCPA_SIG		"TCPA"	/* 0x41504354 /'TCPA' */
 
+enum bios_platform_class {
+	BIOS_CLIENT = 0x00,
+	BIOS_SERVER = 0x01,
+};
+
 struct tpm_bios_log {
 	void *bios_event_log;
 	void *bios_event_log_end;
@@ -36,9 +41,18 @@ struct tpm_bios_log {
 
 struct acpi_tcpa {
 	struct acpi_table_header hdr;
-	u16 reserved;
-	u32 log_max_len __attribute__ ((packed));
-	u32 log_start_addr __attribute__ ((packed));
+	u16 platform_class;
+	union {
+		struct client_hdr {
+			u32 log_max_len __attribute__ ((packed));
+			u64 log_start_addr __attribute__ ((packed));
+		} client;
+		struct server_hdr {
+			u16 reserved;
+			u64 log_max_len __attribute__ ((packed));
+			u64 log_start_addr __attribute__ ((packed));
+		} server;
+	};
 };
 
 struct tcpa_event {
@@ -376,6 +390,7 @@ static int read_log(struct tpm_bios_log 
 	struct acpi_tcpa *buff;
 	acpi_status status;
 	struct acpi_table_header *virt;
+	u64 len, start;
 
 	if (log->bios_event_log != NULL) {
 		printk(KERN_ERR
@@ -396,27 +411,37 @@ static int read_log(struct tpm_bios_log 
 		return -EIO;
 	}
 
-	if (buff->log_max_len == 0) {
+	switch(buff->platform_class) {
+	case BIOS_SERVER:
+		len = buff->server.log_max_len;
+		start = buff->server.log_start_addr;
+		break;
+	case BIOS_CLIENT:
+	default:
+		len = buff->client.log_max_len;
+		start = buff->client.log_start_addr;
+		break;
+	}
+	if (!len) {
 		printk(KERN_ERR "%s: ERROR - TCPA log area empty\n", __func__);
 		return -EIO;
 	}
 
 	/* malloc EventLog space */
-	log->bios_event_log = kmalloc(buff->log_max_len, GFP_KERNEL);
+	log->bios_event_log = kmalloc(len, GFP_KERNEL);
 	if (!log->bios_event_log) {
-		printk
-		    ("%s: ERROR - Not enough  Memory for BIOS measurements\n",
-		     __func__);
+		printk("%s: ERROR - Not enough  Memory for BIOS measurements\n",
+			__func__);
 		return -ENOMEM;
 	}
 
-	log->bios_event_log_end = log->bios_event_log + buff->log_max_len;
+	log->bios_event_log_end = log->bios_event_log + len;
 
-	acpi_os_map_memory(buff->log_start_addr, buff->log_max_len, (void *) &virt);
+	acpi_os_map_memory(start, len, (void *) &virt);
 
-	memcpy(log->bios_event_log, virt, buff->log_max_len);
+	memcpy(log->bios_event_log, virt, len);
 
-	acpi_os_unmap_memory(virt, buff->log_max_len);
+	acpi_os_unmap_memory(virt, len);
 	return 0;
 }
 
_

Patches currently in -mm which might be from kjhall@xxxxxxxxxx are

tpm-spacing-cleanups.patch
tpm-reorganize-sysfs-files.patch
tpm-chip-struct-update.patch
tpm-return-chip-from-tpm_register_hardware.patch
tpm-command-duration-update.patch
tpm-new-12-sysfs-files.patch
tpm-new-12-sysfs-files-fix.patch
tpm-new-12-sysfs-files-fix-fix.patch
tpm-tpm-new-12-sysfs-files-fix-fix-fix.patch
tpm-driver-for-next-generation-tpm-chips.patch
tpm-driver-for-next-generation-tpm-chips-fix.patch
tpm-driver-for-next-generation-tpm-chips-fix-fix.patch
tpm-msecs_to_jiffies-cleanups.patch
tpm-use-clear_bit.patch
tpm-use-clear_bit-fix.patch
tpm-use-clear_bit-fix-fix.patch
tpm-use-clear_bit-fix-fix-fix.patch
tpm-use-clear_bit-fix-fix-fix-fix.patch
tpm-tpm_infineon-updated-to-latest-interface-changes.patch
tpm-check-mem-start-and-len.patch
tpm-update-bios-log-code-for-12.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux