@@ -11,7 +11,7 @@
#include "biosvar.h" // GET_EBDA
#include "pci_ids.h" // PCI_VENDOR_ID_INTEL
#include "pci_regs.h" // PCI_INTERRUPT_LINE
-
+#include "paravirt.h"
/****************************************************/
/* ACPI tables init */
@@ -444,6 +444,22 @@ acpi_bios_init(void)
ACPI_INIT_TABLE(build_ssdt());
ACPI_INIT_TABLE(build_madt());
+ u16 i, external_tables = qemu_cfg_acpi_additional_tables();
+
+ for(i = 0; i < external_tables; i++) {
+ u16 len = qemu_cfg_next_acpi_table_len();
+ void *addr = malloc_high(len);
+ if (!addr) {
+ dprintf(1, "Not enogh memory of ext acpi table of size %d!\n", len);
+ continue;
+ }
+ ACPI_INIT_TABLE(qemu_cfg_next_acpi_table_load(addr, len));
+ if (tbl_idx == MAX_ACPI_TABLES) {
+ dprintf(1, "To many external table!\n");
+ break;
+ }
+ }
+
struct rsdt_descriptor_rev1 *rsdt;
size_t rsdt_len = sizeof(*rsdt) + sizeof(u32) * tbl_idx;
rsdt = malloc_high(rsdt_len);
@@ -72,3 +72,30 @@ int qemu_cfg_show_boot_menu(void)
return v;
}
+u16 qemu_cfg_acpi_additional_tables(void)
+{
+ u16 cnt;
+
+ if (!qemu_cfg_present)
+ return 0;
+
+ qemu_cfg_read_entry(&cnt, QEMU_CFG_ACPI_TABLES, sizeof(cnt));
+
+ return cnt;
+}
+
+u16 qemu_cfg_next_acpi_table_len(void)
+{
+ u16 len;
+
+ qemu_cfg_read((u8*)&len, sizeof(len));
+
+ return len;
+}
+
+void* qemu_cfg_next_acpi_table_load(void *addr, u16 len)
+{
+ qemu_cfg_read(addr, len);
+ return addr;
+}
+
@@ -40,5 +40,8 @@ extern int qemu_cfg_present;
void qemu_cfg_port_probe(void);
int qemu_cfg_show_boot_menu(void);
void qemu_cfg_get_uuid(u8 *uuid);
+u16 qemu_cfg_acpi_additional_tables(void);
+u16 qemu_cfg_next_acpi_table_len(void);
+void *qemu_cfg_next_acpi_table_load(void *addr, u16 len);
#endif
Signed-off-by: Gleb Natapov <gleb@redhat.com> --- v1->v2 - drop CONFIG_KVM change. That was unintentional src/acpi.c | 18 +++++++++++++++++- src/paravirt.c | 27 +++++++++++++++++++++++++++ src/paravirt.h | 3 +++ 3 files changed, 47 insertions(+), 1 deletions(-)