Re: [Xen-devel] [RFC PATCH v2 06/16] libxl: Load guest ACPI table from file
On Wed, Nov 04, 2015 at 10:57:35AM +, Ian Campbell wrote: > On Mon, 2015-10-26 at 16:03 +, Anthony PERARD wrote: > > The path to the ACPI tables blob can be override by xl's option > > "overridden" > > > acpi_table_override or by acpi_tables_filename in the domain_build_info > > struct for libxl user. > > > This needs the same libxl.h #define and xl.cfg update I mentioned before. > > The code, docs and commit message all need further consideration of the > interactions with the existing acpi_firmware option which exists in libxl > and is exposed in xl. It allows you to specify some extra tables which are > merged (by hvmloader) into the base ones. > > The naming is a bit unfortunate but we are now stuck with those semantics > for the existing option I think. If we can distinguish partial from full > tables in the tools reusing the name and doing so might be the best > approach. > > If we can't tell the difference then the new option needs some suitable > name such that it is clear it is the full or base table or something. We can probably tell the difference between both full and extra tables. I think the full one should be a DSDT table, and the extra tables that can be supplied by acpi_firmware should not be a DSDT. So, if the AML supplied via acpi_firmware match 'DSDT' for it's signature (the first four bytes), then it's a replacement for the full acpi tables. Otherwise, it's probably extra tables, so we would give to hvmloader both the default full acpi tables as well as the extra one from the user. Would that be OK as an extention of the usage of acpi_firmware (in both libxl and xl)? If user wants to supply both the DSDT and extra tables, it would concatenate the extra tables to the DSDT, the DSDT tables should be first. -- Anthony PERARD ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] [RFC PATCH v2 06/16] libxl: Load guest ACPI table from file
On Mon, 2015-10-26 at 16:03 +, Anthony PERARD wrote: > The path to the ACPI tables blob can be override by xl's option "overridden" > acpi_table_override or by acpi_tables_filename in the domain_build_info > struct for libxl user. This needs the same libxl.h #define and xl.cfg update I mentioned before. The code, docs and commit message all need further consideration of the interactions with the existing acpi_firmware option which exists in libxl and is exposed in xl. It allows you to specify some extra tables which are merged (by hvmloader) into the base ones. The naming is a bit unfortunate but we are now stuck with those semantics for the existing option I think. If we can distinguish partial from full tables in the tools reusing the name and doing so might be the best approach. If we can't tell the difference then the new option needs some suitable name such that it is clear it is the full or base table or something. Ian. ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
[Xen-devel] [RFC PATCH v2 06/16] libxl: Load guest ACPI table from file
The path to the ACPI tables blob can be override by xl's option acpi_table_override or by acpi_tables_filename in the domain_build_info struct for libxl user. Signed-off-by: Anthony PERARD --- tools/libxl/libxl_dom.c | 17 + tools/libxl/libxl_types.idl | 1 + tools/libxl/xl_cmdimpl.c| 3 +++ 3 files changed, 21 insertions(+) diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index 27a0021..b340fa4 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -948,6 +948,7 @@ static int libxl__domain_firmware(libxl__gc *gc, if (info->device_model_version != LIBXL_DEVICE_MODEL_VERSION_NONE) { const char *bios_filename; +const char *acpi_tables_filename; // Look for BIOS and load it if (info->u.hvm.bios_filename) { bios_filename = info->u.hvm.bios_filename; @@ -970,10 +971,26 @@ static int libxl__domain_firmware(libxl__gc *gc, goto out; } } +if (info->u.hvm.acpi_tables_filename) { +acpi_tables_filename = info->u.hvm.acpi_tables_filename; +} else { +// this would depend on which machine we emulate +// this is going to be eathier qemu-trad or qemu-xen +// (later, there will be qemu-xen-q35) +acpi_tables_filename = libxl__abs_path(gc, + "dsdt_anycpu_qemu_xen.aml", + libxl__xenfirmwaredir_path()); +} rc = libxl__load_hvm_firmware_module(gc, bios_filename, "BIOS", &dom->bios_module); if (rc) goto out; + +rc = libxl__load_hvm_firmware_module(gc, + acpi_tables_filename, + "ACPI tables", + &dom->acpi_table_module); +if (rc) goto out; } if (info->u.hvm.smbios_firmware) { diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl index a3fbcab..d7eaa8d 100644 --- a/tools/libxl/libxl_types.idl +++ b/tools/libxl/libxl_types.idl @@ -469,6 +469,7 @@ libxl_domain_build_info = Struct("domain_build_info",[ [("hvm", Struct(None, [("firmware", string), ("bios", libxl_bios_type), ("bios_filename",string), + ("acpi_tables_filename", string), ("pae", libxl_defbool), ("apic", libxl_defbool), ("acpi", libxl_defbool), diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 27d7c25..1fb1300 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -1512,6 +1512,9 @@ static void parse_config_data(const char *config_source, fprintf(stderr, "WARNING: " "bios_override given without specific bios name\n"); +xlu_cfg_replace_string(config, "acpi_table_override", + &b_info->u.hvm.acpi_tables_filename, 0); + xlu_cfg_get_defbool(config, "pae", &b_info->u.hvm.pae, 0); xlu_cfg_get_defbool(config, "apic", &b_info->u.hvm.apic, 0); xlu_cfg_get_defbool(config, "acpi", &b_info->u.hvm.acpi, 0); -- Anthony PERARD ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel