From 0178c3a2b43cb2033903dbf6ea7f2b70cd39a677 Mon Sep 17 00:00:00 2001 From: jiangfangjie Date: Tue, 4 Aug 2020 08:40:21 +0800 Subject: [PATCH] libvirt: support aarch64 vtpm Signed-off-by: jiangfangjie --- ...aarch64-vtpm-with-parameter-tpm-tis-.patch | 102 ++++++++++++++++++ libvirt.spec | 5 +- 2 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 libvirt-support-aarch64-vtpm-with-parameter-tpm-tis-.patch diff --git a/libvirt-support-aarch64-vtpm-with-parameter-tpm-tis-.patch b/libvirt-support-aarch64-vtpm-with-parameter-tpm-tis-.patch new file mode 100644 index 0000000..3f2f1c3 --- /dev/null +++ b/libvirt-support-aarch64-vtpm-with-parameter-tpm-tis-.patch @@ -0,0 +1,102 @@ +From 3cac402f4b40d1ee9eb74556231308114df617d9 Mon Sep 17 00:00:00 2001 +From: jiangfangjie +Date: Fri, 31 Jul 2020 10:58:31 +0800 +Subject: [PATCH] Libvirt: support aarch64 vtpm with parameter tpm-tis-device + +Signed-off-by: jiangfangjie +--- + src/conf/domain_conf.c | 1 + + src/conf/domain_conf.h | 1 + + src/qemu/qemu_capabilities.c | 8 ++++++++ + src/qemu/qemu_capabilities.h | 3 +++ + src/qemu/qemu_domain.c | 3 +++ + 5 files changed, 16 insertions(+) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 914e03c..aac37fa 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -1140,6 +1140,7 @@ VIR_ENUM_IMPL(virDomainTPMModel, + "tpm-tis", + "tpm-crb", + "tpm-spapr", ++ "tpm-tis-device", + ); + + VIR_ENUM_IMPL(virDomainTPMBackend, +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index 33875d9..a70d11e 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -1274,6 +1274,7 @@ typedef enum { + VIR_DOMAIN_TPM_MODEL_TIS, + VIR_DOMAIN_TPM_MODEL_CRB, + VIR_DOMAIN_TPM_MODEL_SPAPR, ++ VIR_DOMAIN_TPM_MODEL_TIS_DEVICE, + + VIR_DOMAIN_TPM_MODEL_LAST + } virDomainTPMModel; +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index 73a8856..7eab61f 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -568,6 +568,9 @@ VIR_ENUM_IMPL(virQEMUCaps, + "blockdev-snapshot.allow-write-only-overlay", + "blockdev-reopen", + "storage.werror", ++ ++ /* 360 */ ++ "tpm-tis-device", + ); + + +@@ -1285,6 +1288,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { + { "rng-builtin", QEMU_CAPS_OBJECT_RNG_BUILTIN }, + { "tpm-spapr", QEMU_CAPS_DEVICE_TPM_SPAPR }, + { "vhost-user-fs-device", QEMU_CAPS_DEVICE_VHOST_USER_FS }, ++ { "tpm-tis-device", QEMU_CAPS_DEVICE_TPM_TIS_DEVICE }, + }; + + static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBalloon[] = { +@@ -3065,6 +3069,10 @@ const struct tpmTypeToCaps virQEMUCapsTPMModelsToCaps[] = { + .type = VIR_DOMAIN_TPM_MODEL_SPAPR, + .caps = QEMU_CAPS_DEVICE_TPM_SPAPR, + }, ++ { ++ .type = VIR_DOMAIN_TPM_MODEL_TIS_DEVICE, ++ .caps = QEMU_CAPS_DEVICE_TPM_TIS_DEVICE, ++ }, + }; + + static int +diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h +index 51ec1a5..3cc52fc 100644 +--- a/src/qemu/qemu_capabilities.h ++++ b/src/qemu/qemu_capabilities.h +@@ -550,6 +550,9 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ + QEMU_CAPS_BLOCKDEV_REOPEN, /* 'blockdev-reopen' qmp command is supported */ + QEMU_CAPS_STORAGE_WERROR, /* virtio-blk,scsi-hd.werror */ + ++ /* 360 */ ++ QEMU_CAPS_DEVICE_TPM_TIS_DEVICE, /* -device tpm-tis-device */ ++ + QEMU_CAPS_LAST /* this must always be the last item */ + } virQEMUCapsFlags; + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index dd48b6f..fc6e966 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -8118,6 +8118,9 @@ qemuDomainDeviceDefValidateTPM(virDomainTPMDef *tpm, + case VIR_DOMAIN_TPM_MODEL_SPAPR: + flag = QEMU_CAPS_DEVICE_TPM_SPAPR; + break; ++ case VIR_DOMAIN_TPM_MODEL_TIS_DEVICE: ++ flag = QEMU_CAPS_DEVICE_TPM_TIS_DEVICE; ++ break; + case VIR_DOMAIN_TPM_MODEL_LAST: + default: + virReportEnumRangeError(virDomainTPMModel, tpm->model); +-- +1.8.3.1 + diff --git a/libvirt.spec b/libvirt.spec index ce888a3..43309c6 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -99,7 +99,7 @@ Summary: Library providing a simple virtualization API Name: libvirt Version: 6.2.0 -Release: 6 +Release: 7 License: LGPLv2+ URL: https://libvirt.org/ @@ -128,6 +128,7 @@ Patch0017: libvirt-virsh-Fix-return-code-for-dump-and-migrate.patch Patch0018: libvirt-virsh-Fix-return-code-for-dump.patch Patch0019: libvirt-cpu-aarch64-enable-host-model-cpu-for-AArch64-archit.patch Patch0020: libvirt-cpu_map-add-kunpeng-920-features-as-known-features.patch +Patch0021: libvirt-support-aarch64-vtpm-with-parameter-tpm-tis-.patch Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-daemon-config-network = %{version}-%{release} @@ -1860,6 +1861,8 @@ exit 0 %changelog +* Fri Jul 31 2020 Jiang Fangjie - 6.2.0-7 +- Support aarch64 vtpm with parameter tpm-tis-device * Tue May 26 2020 Xu Yandong - 6.2.0-6 - Introduce Kunpeng-920 cpu features. * Wed May 20 2020 Xu Yandong - 6.2.0-5 -- Gitee