thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
902636
From 7cb1c5e1416de9a09180f0930d2a216c77e8cdbd Mon Sep 17 00:00:00 2001
902636
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
902636
Date: Thu, 30 Jan 2020 16:01:10 +0000
902636
Subject: [PATCH 07/15] tpm-ppi: page-align PPI RAM
902636
MIME-Version: 1.0
902636
Content-Type: text/plain; charset=UTF-8
902636
Content-Transfer-Encoding: 8bit
902636
902636
RH-Author: Marc-André Lureau <marcandre.lureau@redhat.com>
902636
Message-id: <20200130160110.126086-1-marcandre.lureau@redhat.com>
902636
Patchwork-id: 93600
902636
O-Subject: [RHEL-AV-8.2.0 qemu-kvm PATCH] tpm-ppi: page-align PPI RAM
902636
Bugzilla: 1787444
902636
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
902636
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
902636
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
902636
902636
post-copy migration fails on destination with error such as:
902636
2019-12-26T10:22:44.714644Z qemu-kvm: ram_block_discard_range:
902636
Unaligned start address: 0x559d2afae9a0
902636
902636
Use qemu_memalign() to constrain the PPI RAM memory alignment.
902636
902636
Cc: qemu-stable@nongnu.org
902636
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
902636
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
902636
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
902636
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
902636
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
902636
Message-id: 20200103074000.1006389-3-marcandre.lureau@redhat.com
902636
902636
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1787444
902636
Brew: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=26122940
902636
902636
(cherry picked from commit 71e415c8a75c130875f14d6b2136825789feb297)
902636
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
902636
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
902636
---
902636
 hw/tpm/tpm_ppi.c | 3 ++-
902636
 1 file changed, 2 insertions(+), 1 deletion(-)
902636
902636
diff --git a/hw/tpm/tpm_ppi.c b/hw/tpm/tpm_ppi.c
902636
index ff31459..6d9c1a3 100644
902636
--- a/hw/tpm/tpm_ppi.c
902636
+++ b/hw/tpm/tpm_ppi.c
902636
@@ -43,7 +43,8 @@ void tpm_ppi_reset(TPMPPI *tpmppi)
902636
 void tpm_ppi_init(TPMPPI *tpmppi, struct MemoryRegion *m,
902636
                   hwaddr addr, Object *obj)
902636
 {
902636
-    tpmppi->buf = g_malloc0(HOST_PAGE_ALIGN(TPM_PPI_ADDR_SIZE));
902636
+    tpmppi->buf = qemu_memalign(qemu_real_host_page_size,
902636
+                                HOST_PAGE_ALIGN(TPM_PPI_ADDR_SIZE));
902636
     memory_region_init_ram_device_ptr(&tpmppi->ram, obj, "tpm-ppi",
902636
                                       TPM_PPI_ADDR_SIZE, tpmppi->buf);
902636
     vmstate_register_ram(&tpmppi->ram, DEVICE(obj));
902636
-- 
902636
1.8.3.1
902636