x86: acpi: use offset instead of pointer when using build_header()
commitbb9feea43179ef8aba2c0a9cc1e670cb049ba90e
authorIgor Mammedov <imammedo@redhat.com>
Wed, 14 Apr 2021 08:43:56 +0000 (14 04:43 -0400)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 4 May 2021 11:27:37 +0000 (4 07:27 -0400)
treecb2ad6c87277a0ac59057ded733b1bc38d998ad1
parent5d31e1e59a21bafb57842313dd41f0b0ff11a4ff
x86: acpi: use offset instead of pointer when using build_header()

Do the same as in commit
 (4d027afeb3a97 Virt: ACPI: fix qemu assert due to re-assigned table data address)
for remaining tables that happen to use saved at
the beginning pointer to build header to avoid assert
when table_data is relocated due to implicit re-size.

In this case user is trying to start Windows 10 and getting assert at
 hw/acpi/bios-linker-loader.c:239:
  bios_linker_loader_add_checksum: Assertion `start_offset < file->blob->len' failed.

Fixes: https://bugs.launchpad.net/bugs/1923497
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20210414084356.3792113-1-imammedo@redhat.com>
Cc: mst@redhat.com, qemu-stable@nongnu.org
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/acpi/aml-build.c
hw/i386/acpi-build.c