[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [RFC XEN PATCH v4 34/41] tools/libacpi: probe QEMU ACPI ROMs via fw_cfg interface
On 02/27/18 17:56 +0000, Anthony PERARD wrote: > On Thu, Dec 07, 2017 at 06:10:23PM +0800, Haozhong Zhang wrote: > > Probe following QEMU ACPI ROMs: > > * etc/acpi/rsdp: QEMU RSDP, which is used to iterate other > > QEMU ACPI tables in etc/acpi/tables > > > > * etc/acpi/tables: other QEMU ACPI tables > > > > * etc/table-loader: QEMU BIOSLinkerLoader ROM, which can be > > executed to load QEMU ACPI tables > > > > * etc/acpi/nvdimm-mem: RAM which is used as NVDIMM ACPI DSM buffer, > > the exact location will be allocated during > > the execution of /etc/table-loader > > > > Signed-off-by: Haozhong Zhang <haozhong.zhang@xxxxxxxxx> > > --- > > > diff --git a/tools/libacpi/qemu_loader.c b/tools/libacpi/qemu_loader.c > > new file mode 100644 > > index 0000000000..c0ed3b0ad0 > > --- /dev/null > > +++ b/tools/libacpi/qemu_loader.c > > @@ -0,0 +1,82 @@ > > +/* > > + * libacpi/qemu_loader.c > > + * > > + * Driver of QEMU BIOSLinkerLoader interface. The reference document > > + * can be found at > > + * https://github.com/qemu/qemu/blob/master/hw/acpi/bios-linker-loader.c. > > That's only a mirror, the official QEMU tree is on git.qemu.org. So I > think the URL should read: > https://git.qemu.org/?p=qemu.git;a=blob;f=hw/acpi/bios-linker-loader.c;hb=HEAD will fix the url > > > + * > > + * Copyright (C) 2017, Intel Corporation > > + * > > + * This library is free software; you can redistribute it and/or > > + * modify it under the terms of the GNU Lesser General Public > > + * License, version 2.1, as published by the Free Software Foundation. > > + * > > + * This library is distributed in the hope that it will be useful, > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > > + * Lesser General Public License for more details. > > + * > > + * You should have received a copy of the GNU Lesser General Public > > + * License along with this library; If not, see > > <http://www.gnu.org/licenses/>. > > + */ > > + > > +#include LIBACPI_STDUTILS > > +#include "libacpi.h" > > +#include "qemu.h" > > + > > +struct rom { > > + struct fw_cfg_file file; > > + struct rom *next; > > +}; > > + > > +static struct rom *roms = NULL; > > +static struct rom *bios_loader = NULL; > > + > > +static bool rom_needed(const char *file_name) > > +{ > > + return > > + !strncmp(file_name, "etc/acpi/rsdp", FW_CFG_FILE_PATH_MAX_LENGTH) > > || > > + !strncmp(file_name, "etc/acpi/tables", > > FW_CFG_FILE_PATH_MAX_LENGTH) || > > + !strncmp(file_name, "etc/table-loader", > > FW_CFG_FILE_PATH_MAX_LENGTH) || > > + !strncmp(file_name, "etc/acpi/nvdimm-mem", > > FW_CFG_FILE_PATH_MAX_LENGTH); > > Is it necessary to filter the "files" that are available via fw_cfg? Is > there enough memory for hvmloader to just alocate the "struct rom" for > every available files? Other solution might be to filter base on > "etc/acpi/*" + "etc/table-loader". > The filter here is primarily to avoid loading unused roms in case that their presence may have harmful side-effects (though I can't image what side-effects could be). Haozhong _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |