From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39011 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PqVCE-0000vV-VE for qemu-devel@nongnu.org; Fri, 18 Feb 2011 13:36:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PqVCD-0006Aa-JW for qemu-devel@nongnu.org; Fri, 18 Feb 2011 13:36:50 -0500 Received: from e2.ny.us.ibm.com ([32.97.182.142]:55033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PqVCD-0006AJ-Gr for qemu-devel@nongnu.org; Fri, 18 Feb 2011 13:36:49 -0500 Received: from d01dlp01.pok.ibm.com (d01dlp01.pok.ibm.com [9.56.224.56]) by e2.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p1IIIfed031133 for ; Fri, 18 Feb 2011 13:18:44 -0500 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 7B1602140A30 for ; Fri, 18 Feb 2011 12:02:21 -0500 (EST) Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p1IH2KEe179498 for ; Fri, 18 Feb 2011 12:02:21 -0500 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p1IH6vB6003106 for ; Fri, 18 Feb 2011 10:06:57 -0700 Message-ID: <4D5EA61B.5030002@linux.vnet.ibm.com> Date: Fri, 18 Feb 2011 12:02:19 -0500 From: Stefan Berger MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 2/5] Provide SSDT for enabled TPM device References: <1298043215-10083-1-git-send-email-andreas.niederl@iaik.tugraz.at> <1298043215-10083-3-git-send-email-andreas.niederl@iaik.tugraz.at> In-Reply-To: <1298043215-10083-3-git-send-email-andreas.niederl@iaik.tugraz.at> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas Niederl Cc: qemu-devel@nongnu.org On 02/18/2011 10:33 AM, Andreas Niederl wrote: > Signed-off-by: Andreas Niederl > --- > Makefile.target | 3 +++ > hw/acpi.c | 28 ++++++++++++++++++++++++++++ > hw/pc.h | 1 + > hw/tpm.h | 2 ++ > hw/tpm_acpi.c | 40 ++++++++++++++++++++++++++++++++++++++++ > hw/tpm_ssdt.dsl | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ > hw/tpm_ssdt.hex | 41 +++++++++++++++++++++++++++++++++++++++++ > hw/tpm_tis.c | 1 + > rules.mak | 7 ++++++- > vl.c | 23 +++++++++++++++++++++++ > 10 files changed, 200 insertions(+), 1 deletions(-) > create mode 100644 hw/tpm_acpi.c > create mode 100644 hw/tpm_ssdt.dsl > create mode 100644 hw/tpm_ssdt.hex > > diff --git a/Makefile.target b/Makefile.target > index 5a0fd40..33ffe19 100644 > --- a/Makefile.target > +++ b/Makefile.target > @@ -211,6 +211,9 @@ obj-$(CONFIG_XEN) += xen_machine_pv.o xen_domainbuild.o > # Inter-VM PCI shared memory > obj-$(CONFIG_KVM) += ivshmem.o > > +# TPM acpi support > +obj-$(CONFIG_TPM) += tpm_acpi.o > + > # Hardware support > obj-i386-y += vga.o > obj-i386-y += mc146818rtc.o i8259.o pc.o > diff --git a/hw/acpi.c b/hw/acpi.c > index 8071e7b..93656c5 100644 > --- a/hw/acpi.c > +++ b/hw/acpi.c > @@ -35,6 +35,34 @@ struct acpi_table_header > char *acpi_tables; > size_t acpi_tables_len; > > + > +/* > + * add a table directly (e.g. iasl C source output) > + */ > +int acpi_table_add_raw(const char *t, uint32_t length) > +{ > + char *p; > + > + if (!acpi_tables) { > + acpi_tables_len = sizeof(uint16_t); > + acpi_tables = qemu_mallocz(acpi_tables_len); > + } > + acpi_tables = qemu_realloc(acpi_tables, > + acpi_tables_len + sizeof(uint16_t) + length); > + p = acpi_tables + acpi_tables_len; > + acpi_tables_len += sizeof(uint16_t) + length; > + > + *(uint16_t*)p = cpu_to_le32(length); > + p += sizeof(uint16_t); > + > + memcpy(p, t, length); > + > + /* increase number of tables */ > + (*(uint16_t*)acpi_tables) = > + cpu_to_le32(le32_to_cpu(*(uint16_t*)acpi_tables) + 1); > + return 0; > +} > + Does it show up in Linux? I am trying to find the code that connects it to the RSDT, but don't see any. Stefan