@@ -990,6 +990,8 @@ void hvmloader_acpi_build_tables(struct acpi_config *config,
ctxt.mem_ops.free = acpi_mem_free;
ctxt.mem_ops.v2p = acpi_v2p;
+ ctxt.min_alloc_byte_align = 16;
+
acpi_build_tables(&ctxt, config);
hvm_param_set(HVM_PARAM_VM_GENERATION_ID_ADDR, config->vm_gid_addr);
@@ -52,6 +52,8 @@ struct acpi_ctxt {
void (*free)(struct acpi_ctxt *ctxt, void *v, uint32_t size);
unsigned long (*v2p)(struct acpi_ctxt *ctxt, void *v);
} mem_ops;
+
+ uint32_t min_alloc_byte_align; /* minimum alignment used by mem_ops.alloc */
};
struct acpi_config {
@@ -183,6 +183,8 @@ int libxl__dom_load_acpi(libxl__gc *gc,
libxl_ctxt.c.mem_ops.v2p = virt_to_phys;
libxl_ctxt.c.mem_ops.free = acpi_mem_free;
+ libxl_ctxt.c.min_alloc_byte_align = 16;
+
rc = init_acpi_config(gc, dom, b_info, &config);
if (rc) {
LOG(ERROR, "init_acpi_config failed (rc=%d)", rc);
The AML builder added later needs to allocate contiguous memory across multiple calls to mem_ops.alloc(). Therefore, it needs to know the minimal alignment used by mem_ops.alloc(). Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com> --- Cc: Jan Beulich <jbeulich@suse.com> Cc: Andrew Cooper <andrew.cooper3@citrix.com> Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Wei Liu <wei.liu2@citrix.com> --- tools/firmware/hvmloader/util.c | 2 ++ tools/libacpi/libacpi.h | 2 ++ tools/libxl/libxl_x86_acpi.c | 2 ++ 3 files changed, 6 insertions(+)