diff options
-rw-r--r-- | meta/recipes-devtools/qemu/qemu.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/qemu/qemu/0001-acpi-tpm-Add-missing-device-identification-objects.patch | 83 |
2 files changed, 84 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index 94190b52f4..cbbb99f611 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
@@ -27,6 +27,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | |||
27 | file://determinism.patch \ | 27 | file://determinism.patch \ |
28 | file://0001-tests-meson.build-use-relative-path-to-refer-to-file.patch \ | 28 | file://0001-tests-meson.build-use-relative-path-to-refer-to-file.patch \ |
29 | file://0001-riscv-Set-5.4-as-minimum-kernel-version-for-riscv32.patch \ | 29 | file://0001-riscv-Set-5.4-as-minimum-kernel-version-for-riscv32.patch \ |
30 | file://0001-acpi-tpm-Add-missing-device-identification-objects.patch \ | ||
30 | " | 31 | " |
31 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" | 32 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" |
32 | 33 | ||
diff --git a/meta/recipes-devtools/qemu/qemu/0001-acpi-tpm-Add-missing-device-identification-objects.patch b/meta/recipes-devtools/qemu/qemu/0001-acpi-tpm-Add-missing-device-identification-objects.patch new file mode 100644 index 0000000000..ff91674879 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/0001-acpi-tpm-Add-missing-device-identification-objects.patch | |||
@@ -0,0 +1,83 @@ | |||
1 | From 5903646d3913af6544680f6645fcb7296d0b3a1c Mon Sep 17 00:00:00 2001 | ||
2 | From: Stefan Berger <stefanb@linux.ibm.com> | ||
3 | Date: Tue, 4 Jan 2022 12:58:05 -0500 | ||
4 | Subject: [PATCH] acpi: tpm: Add missing device identification objects | ||
5 | |||
6 | Add missing TPM device identification objects _STR and _UID. They will | ||
7 | appear as files 'description' and 'uid' under Linux sysfs. | ||
8 | |||
9 | Following inspection of sysfs entries for hardware TPMs we chose | ||
10 | uid '1'. | ||
11 | |||
12 | Upstream-Status: Backport [5903646d3913af6544680f6645fcb7296d0b3a1c] | ||
13 | |||
14 | Cc: Shannon Zhao <shannon.zhaosl@gmail.com> | ||
15 | Cc: Michael S. Tsirkin <mst@redhat.com> | ||
16 | Cc: Igor Mammedov <imammedo@redhat.com> | ||
17 | Cc: Ani Sinha <ani@anisinha.ca> | ||
18 | Resolves: https://gitlab.com/qemu-project/qemu/-/issues/708 | ||
19 | Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> | ||
20 | Reviewed-by: Ani Sinha <ani@anisinha.ca> | ||
21 | Reviewed-by: Shannon Zhao <shannon.zhaosl@gmail.com> | ||
22 | Message-id: 20211223022310.575496-3-stefanb@linux.ibm.com | ||
23 | Message-Id: <20220104175806.872996-3-stefanb@linux.ibm.com> | ||
24 | Reviewed-by: Michael S. Tsirkin <mst@redhat.com> | ||
25 | Signed-off-by: Michael S. Tsirkin <mst@redhat.com> | ||
26 | Reviewed-by: Igor Mammedov <imammedo@redhat.com> | ||
27 | Signed-off-by: Liwei Song <liwei.song@windriver.com> | ||
28 | --- | ||
29 | hw/arm/virt-acpi-build.c | 1 + | ||
30 | hw/i386/acpi-build.c | 7 +++++++ | ||
31 | 2 files changed, 8 insertions(+) | ||
32 | |||
33 | diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c | ||
34 | index d0f4867fdfe5..f2514ce77c0b 100644 | ||
35 | --- a/hw/arm/virt-acpi-build.c | ||
36 | +++ b/hw/arm/virt-acpi-build.c | ||
37 | @@ -229,6 +229,7 @@ static void acpi_dsdt_add_tpm(Aml *scope, VirtMachineState *vms) | ||
38 | |||
39 | Aml *dev = aml_device("TPM0"); | ||
40 | aml_append(dev, aml_name_decl("_HID", aml_string("MSFT0101"))); | ||
41 | + aml_append(dev, aml_name_decl("_STR", aml_string("TPM 2.0 Device"))); | ||
42 | aml_append(dev, aml_name_decl("_UID", aml_int(0))); | ||
43 | |||
44 | Aml *crs = aml_resource_template(); | ||
45 | diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c | ||
46 | index 0234fe7588b7..ce823e8fcb97 100644 | ||
47 | --- a/hw/i386/acpi-build.c | ||
48 | +++ b/hw/i386/acpi-build.c | ||
49 | @@ -1812,11 +1812,15 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, | ||
50 | dev = aml_device("TPM"); | ||
51 | aml_append(dev, aml_name_decl("_HID", | ||
52 | aml_string("MSFT0101"))); | ||
53 | + aml_append(dev, | ||
54 | + aml_name_decl("_STR", | ||
55 | + aml_string("TPM 2.0 Device"))); | ||
56 | } else { | ||
57 | dev = aml_device("ISA.TPM"); | ||
58 | aml_append(dev, aml_name_decl("_HID", | ||
59 | aml_eisaid("PNP0C31"))); | ||
60 | } | ||
61 | + aml_append(dev, aml_name_decl("_UID", aml_int(1))); | ||
62 | |||
63 | aml_append(dev, aml_name_decl("_STA", aml_int(0xF))); | ||
64 | crs = aml_resource_template(); | ||
65 | @@ -1844,12 +1848,15 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, | ||
66 | if (TPM_IS_CRB(tpm)) { | ||
67 | dev = aml_device("TPM"); | ||
68 | aml_append(dev, aml_name_decl("_HID", aml_string("MSFT0101"))); | ||
69 | + aml_append(dev, aml_name_decl("_STR", | ||
70 | + aml_string("TPM 2.0 Device"))); | ||
71 | crs = aml_resource_template(); | ||
72 | aml_append(crs, aml_memory32_fixed(TPM_CRB_ADDR_BASE, | ||
73 | TPM_CRB_ADDR_SIZE, AML_READ_WRITE)); | ||
74 | aml_append(dev, aml_name_decl("_CRS", crs)); | ||
75 | |||
76 | aml_append(dev, aml_name_decl("_STA", aml_int(0xf))); | ||
77 | + aml_append(dev, aml_name_decl("_UID", aml_int(1))); | ||
78 | |||
79 | tpm_build_ppi_acpi(tpm, dev); | ||
80 | |||
81 | -- | ||
82 | 2.17.1 | ||
83 | |||