qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/3] TPM2 ACPI table support


From: Stefan Berger
Subject: Re: [Qemu-devel] [PATCH 3/3] TPM2 ACPI table support
Date: Mon, 13 Apr 2015 22:29:32 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

On 04/13/2015 02:27 AM, Michael S. Tsirkin wrote:
@@ -1428,12 +1444,22 @@ void acpi_build(PcGuestInfo *guest_info, 
AcpiBuildTables *tables)
          acpi_add_table(table_offsets, tables_blob);
          build_hpet(tables_blob, tables->linker);
      }
-    if (misc.has_tpm) {
+    if (misc.tpm_version != TPMVersion_Unspec) {
          acpi_add_table(table_offsets, tables_blob);
          build_tpm_tcpa(tables_blob, tables->linker, tables->tcpalog);
acpi_add_table(table_offsets, tables_blob);
-        build_tpm_ssdt(tables_blob, tables->linker);
+        switch (misc.tpm_version) {
+        case TPMVersion1_2:
+            build_tpm_ssdt(tables_blob, tables->linker);
+            break;
+        case TPMVersion2_0:
+            build_tpm2(tables_blob, tables->linker);
+            break;
+        case TPMVersion_Unspec:
+            /* not possible */
+            break;
+        }
      }
      if (guest_info->numa_nodes) {
          acpi_add_table(table_offsets, tables_blob);
I think we should fix QEMU coding style violations in TPM code.
In particular, mixing of _ and camel case, enum and define values
not all upper case, local variables not all lower case.
This was less of an issue when the violations were contained
within hw/tpm/, but it's more of an issue now that this affects
other code.


The above enums look like the only violation to me. Fixed.

    Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]