Add TPM TIS type of device to ACPI device list
PATCH 1/3 Add TPM TIS type of device to ACPI device list
This patch adds a TPM TIS type of device to the ACPI device list which is supported for example by the Linux TPM TIS driver.
The specification describing this entry can be found here:
https://www.trustedcomputinggroup.org/specs/PCClient/TCG_PCClientImplementationforBIOS_1-20_1-00.pdf
Section 9 in the document describes the device entry.
xen-unstable.hg/tools/firmware/acpi/acpi_dsdt.asl +9 -1
@@ -513,7 +513,15 @@ DefinitionBlock ("DSDT.aml", "DSDT", 1, IO (Decode16, 0x0378, 0x0378, 0x08, 0x08) IRQNoFlags () {7} }) - } + } + + Device (TPM) { + Name (_HID, EisaId ("PNP0C31")) + Name (_CRS, ResourceTemplate () + { + Memory32Fixed (ReadWrite, 0xFED40000, 0x5000,) + }) + } } } }
xen-unstable.hg/tools/firmware/acpi/acpi_dsdt.c +16 -11
@@ -1,22 +1,22 @@/* * * Intel ACPI Component Architecture -* ASL Optimizing Compiler / AML Disassembler version 20050513 [Oct 12 2006] -* Copyright (C) 2000 - 2005 Intel Corporation -* Supports ACPI Specification Revision 3.0 +* ASL Optimizing Compiler version 20060707 [Sep 11 2006] +* Copyright (C) 2000 - 2006 Intel Corporation +* Supports ACPI Specification Revision 3.0a * -* Compilation of "acpi_dsdt.asl" - Thu Oct 12 14:08:49 2006 +* Compilation of "acpi_dsdt.asl" - Thu Oct 12 13:02:24 2006 * * C source code output * */ -unsigned char AmlCode[] = +unsigned char AmlCode[] = { -0x44 ,0x53 ,0x44 ,0x54 ,0xDA ,0x08 ,0x00 ,0x00 ,/* 00000000 "DSDT...." */ -0x01 ,0x26 ,0x49 ,0x4E ,0x54 ,0x45 ,0x4C ,0x00 ,/* 00000008 ".&INTEL." */ +0x44 ,0x53 ,0x44 ,0x54 ,0x02 ,0x09 ,0x00 ,0x00 ,/* 00000000 "DSDT...." */ +0x01 ,0x5A ,0x49 ,0x4E ,0x54 ,0x45 ,0x4C ,0x00 ,/* 00000008 ".ZINTEL." */ 0x69 ,0x6E ,0x74 ,0x2D ,0x78 ,0x65 ,0x6E ,0x00 ,/* 00000010 "int-xen." */ 0xD6 ,0x07 ,0x00 ,0x00 ,0x49 ,0x4E ,0x54 ,0x4C ,/* 00000018 "....INTL" */ -0x13 ,0x05 ,0x05 ,0x20 ,0x08 ,0x50 ,0x4D ,0x42 ,/* 00000020 "... .PMB" */ +0x07 ,0x07 ,0x06 ,0x20 ,0x08 ,0x50 ,0x4D ,0x42 ,/* 00000020 "... .PMB" */ 0x53 ,0x0B ,0x00 ,0x0C ,0x08 ,0x50 ,0x4D ,0x4C ,/* 00000028 "S....PML" */ 0x4E ,0x0A ,0x08 ,0x08 ,0x49 ,0x4F ,0x42 ,0x31 ,/* 00000030 "N...IOB1" */ 0x00 ,0x08 ,0x49 ,0x4F ,0x4C ,0x31 ,0x00 ,0x08 ,/* 00000038 "..IOL1.." */
@@ -34,7 +34,7 @@ unsigned char AmlCode[] =0x12 ,0x08 ,0x04 ,0x0A ,0x07 ,0x0A ,0x07 ,0x00 ,/* 00000098 "........" */ 0x00 ,0x08 ,0x50 ,0x49 ,0x43 ,0x44 ,0x00 ,0x14 ,/* 000000A0 "..PICD.." */ 0x0C ,0x5F ,0x50 ,0x49 ,0x43 ,0x01 ,0x70 ,0x68 ,/* 000000A8 "._PIC.ph" */ -0x50 ,0x49 ,0x43 ,0x44 ,0x10 ,0x45 ,0x82 ,0x5F ,/* 000000B0 "PICD.E._" */ +0x50 ,0x49 ,0x43 ,0x44 ,0x10 ,0x4D ,0x84 ,0x5F ,/* 000000B0 "PICD.M._" */ 0x53 ,0x42 ,0x5F ,0x5B ,0x82 ,0x49 ,0x04 ,0x4D ,/* 000000B8 "SB_[.I.M" */ 0x45 ,0x4D ,0x30 ,0x08 ,0x5F ,0x48 ,0x49 ,0x44 ,/* 000000C0 "EM0._HID" */ 0x0C,0x41,0xD0,0x0C,0x02,0x08,0x5F,0x43, /* 000000C8 ".A...._C" */
@@ -45,7 +45,7 @@ unsigned char AmlCode[] =0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,/* 000000F0 "........" */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x0A ,0x00 ,/* 000000F8 "........" */ 0x00 ,0x00 ,0x00 ,0x00 ,0x79 ,0x00 ,0x5B ,0x82 ,/* 00000100 "....y.[." */ -0x42 ,0x7D ,0x50 ,0x43 ,0x49 ,0x30 ,0x08 ,0x5F ,/* 00000108 "B}PCI0._" */ +0x4A ,0x7F ,0x50 ,0x43 ,0x49 ,0x30 ,0x08 ,0x5F ,/* 00000108 "J.PCI0._" */ 0x48 ,0x49 ,0x44 ,0x0C ,0x41 ,0xD0 ,0x0A ,0x03 ,/* 00000110 "HID.A..." */ 0x08 ,0x5F ,0x55 ,0x49 ,0x44 ,0x00 ,0x08 ,0x5F ,/* 00000118 "._UID.._" */ 0x41,0x44,0x52,0x00,0x08,0x5F,0x42,0x42, /* 00000120 "ADR.._BB" */
@@ -196,7 +196,7 @@ unsigned char AmlCode[] =0x12 ,0x0B ,0x04 ,0x0C ,0xFF ,0xFF ,0x03 ,0x00 ,/* 000005A8 "........" */ 0x00 ,0x00 ,0x0A ,0x0A ,0x12 ,0x0B ,0x04 ,0x0C ,/* 000005B0 "........" */ 0xFF ,0xFF ,0x04 ,0x00 ,0x00 ,0x00 ,0x0A ,0x0B ,/* 000005B8 "........" */ -0x5B ,0x82 ,0x48 ,0x31 ,0x49 ,0x53 ,0x41 ,0x5F ,/* 000005C0 "[.H1ISA_" */ +0x5B ,0x82 ,0x40 ,0x34 ,0x49 ,0x53 ,0x41 ,0x5F ,/* 000005C0 "[.@4ISA_" */ 0x08 ,0x5F ,0x41 ,0x44 ,0x52 ,0x00 ,0x5B ,0x80 ,/* 000005C8 "._ADR.[." */ 0x50 ,0x49 ,0x52 ,0x51 ,0x02 ,0x0A ,0x60 ,0x0A ,/* 000005D0 "PIRQ..`." */ 0x04,0x10,0x2E,0x5C,0x00,0x5B,0x81,0x29, /* 000005D8 "...\.[.)" */
@@ -295,6 +295,11 @@ unsigned char AmlCode[] =0x00 ,0xA4 ,0x0A ,0x0F ,0x08 ,0x5F ,0x43 ,0x52 ,/* 000008C0 "....._CR" */ 0x53 ,0x11 ,0x10 ,0x0A ,0x0D ,0x47 ,0x01 ,0x78 ,/* 000008C8 "S....G.x" */ 0x03 ,0x78 ,0x03 ,0x08 ,0x08 ,0x22 ,0x80 ,0x00 ,/* 000008D0 ".x...".." */ +0x79 ,0x00 ,0x5B ,0x82 ,0x26 ,0x54 ,0x50 ,0x4D ,/* 000008D8 "y.[.&TPM" */ +0x5F ,0x08 ,0x5F ,0x48 ,0x49 ,0x44 ,0x0C ,0x41 ,/* 000008E0 "_._HID.A" */ +0xD0 ,0x0C ,0x31 ,0x08 ,0x5F ,0x43 ,0x52 ,0x53 ,/* 000008E8 "..1._CRS" */ +0x11 ,0x11 ,0x0A ,0x0E ,0x86 ,0x09 ,0x00 ,0x01 ,/* 000008F0 "........" */ +0x00 ,0x00 ,0xD4 ,0xFE ,0x00 ,0x50 ,0x00 ,0x00 ,/* 000008F8 ".....P.." */ 0x79,0x00, };int DsdtLen=sizeof (AmlCode);
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Re: [PATCH] [HVM] [TPM] [1/3] Add TPM TIS type of device toACPI device list
What if the guest isn¹t configured with a TPM device? It seems a bit dodgy to advertise a non-existent device in the BIOS tables.
-- Keir
Quoted 4 lines · Stefan Berger
This patch adds a TPM TIS type of device to the ACPI device list which is supported for example by the Linux TPM TIS driver.
The specification describing this entry can be found here:
Quoted 8 lines
https://www.trustedcomputinggroup.org/specs/PCClient/TCG_PCClientImplementatio
nforBIOS_1-20_1-00.pdfSection 9 in the document describes the device entry.
Signed-off-by Stefan Berger <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Re: [PATCH] [HVM] [TPM] [1/3] Add TPM TIS type of device toACPI device list
Keir Fraser <[email protected]> wrote on 10/27/2006 12:25:30 PM:
Quoted 2 lines
What if the guest isn?t configured with a TPM device? It seems a bit dodgy to advertise a non-existent device in the BIOS tables.
To solve this we would need one of the following
- a BIOS that probes for such devices and dynamically appends the info to the (static) ACPI tables
- a tool that builds and compiles the ACPI tables according to the desired configuration of the HVM VM before the HVM is started
A later version (2.6.18) of the corresponding Linux driver allows you to modprobe the module with a '-force' parameter for platforms where the correct ACPI information is not available. [In that case if the vTPM facility is not available, the /dev/tpm0 won't become available.]
I am not sure what the right solution is.
Stefan
Quoted 9 lines
-- Keir
On 24/10/06 7:48 pm, "Stefan Berger" <[email protected]> wrote:
This patch adds a TPM TIS type of device to the ACPI device list which is supported for example by the Linux TPM TIS driver.
The specification describing this entry can be found here:
Quoted 7 lines
https://www.trustedcomputinggroup.
org/specs/PCClient/TCG_PCClientImplementationforBIOS_1-20_1-00.pdfSection 9 in the document describes the device entry.
Signed-off-by Stefan Berger <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Re: [PATCH] [HVM] [TPM] [1/3] Add TPM TIS type of device toACPI device list
Quoted 6 lines · Stefan Berger
To solve this we would need one of the following
- a BIOS that probes for such devices and dynamically appends the info to the (static) ACPI tables
- a tool that builds and compiles the ACPI tables according to the desired configuration of the HVM VM before the HVM is started
Quoted 6 lines
A later version (2.6.18) of the corresponding Linux driver allows you to modprobe the module with a '-force' parameter for platforms where the correct ACPI information is not available. [In that case if the vTPM facility is not available, the
/dev/tpm0won't become available.]I am not sure what the right solution is.
I think your above proposed solution is correct: either dynamically append info to a static spartan ACPI table, or dynamically trim down a static Œchristmas tree¹ ACPI table. Probably the former is best, and done in hvmloader.
-- Keir
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Re: [PATCH] [HVM] [TPM] [1/3] Add TPM TIS type of device toACPI device list
[email protected] wrote on 10/27/2006 12:57:52 PM:
Quoted 8 lines · Stefan Berger
To solve this we would need one of the following
- a BIOS that probes for such devices and dynamically appends the info to the (static) ACPI tables
- a tool that builds and compiles the ACPI tables according to the desired configuration of the HVM VM before the HVM is started
Quoted 4 lines
A later version (2.6.18) of the corresponding Linux driver allows you to modprobe the module with a '-force' parameter for platforms where the correct ACPI information is not available. [In that case if the vTPM facility is not available, the
/dev/tpm0won't become
available.]
Quoted 7 lines
I am not sure what the right solution is.
I think your above proposed solution is correct: either dynamically append info to a static spartan ACPI table, or dynamically trim down a static ?christmas tree? ACPI table. Probably the former is best, and done in hvmloader.
I am unforunately not an expert on ACPI tables...
Currently the device is part of the DSDT table. Appending this device's entry to it would probably be possible since in the whole compiled ACPI table layout the DSDT is included as the last part and therefore there should be available unused memory after that. To implement this it would require an ACPI DSDT table parser, to change the length of the table and its checksum and if I interpret the diff of the hexadecimal array of the compiled acpi table correctly, other places as well.
Now if I don't want to change that DSDT table, what type of table would it have to create where I can put this device into? Where do I connect this table to?
Would another possibility be to disable or overwrite the existing device entry in the static table if the hvmloader's probing does not find the device?
Stefan
Quoted 5 lines
--
Keir_______________________________________________
Xen-devel mailing list [email protected]
http://lists.xensource.com/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Re: [PATCH] [HVM] [TPM] [1/3] Add TPM TIS type of device toACPI device list
Quoted 2 lines · Stefan Berger
Would another possibility be to disable or overwrite the existing device entry in the static table if the hvmloader's probing does not find the device?
We need some dynamic elements in the table anyway (e.g., currently it¹s hardcoded that there are 4 CPUs!) so we¹ll soon have a framework in hvmloader for doing this kind of thing.
-- Keir
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Re: [PATCH] [HVM] [TPM] [1/3] Add TPM TIS type of device toACPI device list
[email protected] wrote on 10/27/2006 02:07:45 PM:
Quoted 12 lines · Stefan Berger
Would another possibility be to disable or overwrite the existing device entry in the static table if the hvmloader's probing does not find the device?
We need some dynamic elements in the table anyway (e.g., currently it?s hardcoded that there are 4 CPUs!) so we?ll soon have a framework in hvmloader for doing this kind of thing.
I guess for additional devices we will need an SSDT table. Is this type of table also part of the framework or should I look into this?
Stefan
Quoted 5 lines
--
Keir_______________________________________________
Xen-devel mailing list [email protected]
http://lists.xensource.com/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Re: [PATCH] [HVM] [TPM] [1/3] Add TPM TIS type of device toACPI device list
Quoted 6 lines · Stefan Berger
Quoted 3 lines
Quoted 3 lines
We need some dynamic elements in the table anyway (e.g., currently it¹s hardcoded that there are 4 CPUs!) so we¹ll soon have a framework in hvmloader for doing this kind of thing.
I guess for additional devices we will need an SSDT table. Is this type of table also part of the framework or should I look into this?
Well, either hvmloader will extend the DSDT or it will create a new SSDT, whichever turns out to be easiest.
-- Keir
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel