From 93073357470ec76aa1e07672934719d5542b24ad Mon Sep 17 00:00:00 2001 From: Paul Durrant Date: Fri, 18 Nov 2011 13:31:43 +0000 Subject: [PATCH] hvmloader: Move acpi_enabled out of hvm_info_table into xenstore Since hvmloader has a xentore client, use a platform key in xenstore to indicate whether ACPI is enabled or not rather than the shared hvm_info_table structure. Signed-off-by: Paul Durrant Committed-by: Keir Fraser --- tools/firmware/hvmloader/hvmloader.c | 5 ++++- tools/libxc/xc_hvm_build.c | 1 - tools/libxl/libxl_create.c | 5 +++++ tools/libxl/libxl_dom.c | 1 - tools/python/xen/lowlevel/xc/xc.c | 1 - xen/include/public/hvm/hvm_info_table.h | 3 --- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c index f5817b31ff..f120ffea1b 100644 --- a/tools/firmware/hvmloader/hvmloader.c +++ b/tools/firmware/hvmloader/hvmloader.c @@ -423,6 +423,7 @@ int main(void) const struct bios_config *bios; int option_rom_sz = 0, vgabios_sz = 0, etherboot_sz = 0; uint32_t etherboot_phys_addr = 0, option_rom_phys_addr = 0; + int acpi_enabled; /* Initialise hypercall stubs with RET, rendering them no-ops. */ memset((void *)HYPERCALL_PHYSICAL_ADDRESS, 0xc3 /* RET */, PAGE_SIZE); @@ -506,7 +507,9 @@ int main(void) option_rom_phys_addr); } - if ( hvm_info->acpi_enabled ) + acpi_enabled = !strncmp(xenstore_read("platform/acpi", "1"), "1", 1); + + if ( acpi_enabled ) { struct xen_hvm_param p = { .domid = DOMID_SELF, diff --git a/tools/libxc/xc_hvm_build.c b/tools/libxc/xc_hvm_build.c index c32be4e91c..9831bab192 100644 --- a/tools/libxc/xc_hvm_build.c +++ b/tools/libxc/xc_hvm_build.c @@ -67,7 +67,6 @@ static void build_hvm_info(void *hvm_info_page, uint64_t mem_size) hvm_info->length = sizeof(struct hvm_info_table); /* Sensible defaults: these can be overridden by the caller. */ - hvm_info->acpi_enabled = 1; hvm_info->apic_mode = 1; hvm_info->nr_vcpus = 1; memset(hvm_info->vcpu_online, 0xff, sizeof(hvm_info->vcpu_online)); diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 6413cbebe9..1b94f4b4cf 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -188,6 +188,11 @@ int libxl__domain_build(libxl__gc *gc, vments[3] = "hvm"; vments[4] = "start_time"; vments[5] = libxl__sprintf(gc, "%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000); + + localents = libxl__calloc(gc, 3, sizeof(char *)); + localents[0] = "platform/acpi"; + localents[1] = (info->u.hvm.acpi) ? "1" : "0"; + break; case LIBXL_DOMAIN_TYPE_PV: ret = libxl__build_pv(gc, domid, info, state); diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index 718281a7d9..d810655d9c 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -248,7 +248,6 @@ static int hvm_build_set_params(xc_interface *handle, uint32_t domid, return -1; va_hvm = (struct hvm_info_table *)(va_map + HVM_INFO_OFFSET); - va_hvm->acpi_enabled = info->u.hvm.acpi; va_hvm->apic_mode = info->u.hvm.apic; va_hvm->nr_vcpus = info->max_vcpus; memcpy(va_hvm->vcpu_online, &info->cur_vcpus, sizeof(info->cur_vcpus)); diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c index c9e54b957c..5f8f711e40 100644 --- a/tools/python/xen/lowlevel/xc/xc.c +++ b/tools/python/xen/lowlevel/xc/xc.c @@ -996,7 +996,6 @@ static PyObject *pyxc_hvm_build(XcObject *self, if ( va_map == NULL ) return PyErr_SetFromErrno(xc_error_obj); va_hvm = (struct hvm_info_table *)(va_map + HVM_INFO_OFFSET); - va_hvm->acpi_enabled = acpi; va_hvm->apic_mode = apic; va_hvm->nr_vcpus = vcpus; memcpy(va_hvm->vcpu_online, vcpu_avail, sizeof(vcpu_avail)); diff --git a/xen/include/public/hvm/hvm_info_table.h b/xen/include/public/hvm/hvm_info_table.h index bdb5995e71..36085fa5cf 100644 --- a/xen/include/public/hvm/hvm_info_table.h +++ b/xen/include/public/hvm/hvm_info_table.h @@ -37,9 +37,6 @@ struct hvm_info_table { uint32_t length; uint8_t checksum; - /* Should firmware build ACPI tables? */ - uint8_t acpi_enabled; - /* Should firmware build APIC descriptors (APIC MADT / MP BIOS)? */ uint8_t apic_mode; -- 2.30.2