|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v4 02/16] libxl/arm: prepare for constructing ACPI tables
On 16/08/16 11:24, Shannon Zhao wrote: From: Shannon Zhao <shannon.zhao@xxxxxxxxxx> It only constructs the ACPI tables for 64-bit ARM DomU when user enables acpi because 32-bit DomU doesn't support ACPI. It would be worth to mention that the code is only built for 64-bit toolstack. Signed-off-by: Shannon Zhao <shannon.zhao@xxxxxxxxxx> --- tools/libxl/Makefile | 4 +++ tools/libxl/libxl_arm.c | 23 +++++++++++++++- tools/libxl/libxl_arm.h | 44 +++++++++++++++++++++++++++++++ tools/libxl/libxl_arm_acpi.c | 61 +++++++++++++++++++++++++++++++++++++++++++ xen/include/public/arch-arm.h | 4 +++ 5 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 tools/libxl/libxl_arm.h create mode 100644 tools/libxl/libxl_arm_acpi.c diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile index a148374..6139bed 100644 --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -90,6 +90,10 @@ acpi: LIBXL_OBJS-$(CONFIG_X86) += libxl_cpuid.o libxl_x86.o libxl_psr.o libxl_x86_acpi.o LIBXL_OBJS-$(CONFIG_ARM) += libxl_nocpuid.o libxl_arm.o libxl_libfdt_compat.o +LIBXL_OBJS-$(CONFIG_ARM_64) += libxl_arm_acpi.o As mentioned above this will only enable ACPI when the toolstack is built for 64-bit. Although it might be possible to have 32-bit toolstack. I guess it is fine for now, however I would like to avoid the #if defined(__aarch64__) in the code by introduce a libxl_arm_no_acpi.c similar to how it is done for other options (see in the Makefile). Can you add a comment in the code explaining that ACPI is only supported for 64-bit guest for now. + LOG(ERROR, "Can not enable libxl option 'acpi' for %s", dom->guest_type); + rc = ERROR_FAIL; + goto out; + } + + rc = libxl__prepare_acpi(gc, info, state, dom); + +out: + return rc; } static void finalise_one_memory_node(libxl__gc *gc, void *fdt, diff --git a/tools/libxl/libxl_arm.h b/tools/libxl/libxl_arm.h new file mode 100644 index 0000000..fe1c05f --- /dev/null +++ b/tools/libxl/libxl_arm.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2016 Linaro Ltd. + * + * Author: Shannon Zhao <shannon.zhao@xxxxxxxxxx> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; version 2.1 only. with the special + * exception on linking described in file LICENSE. + * + * This program 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. + */ + +#include "libxl_internal.h" +#include "libxl_arch.h" + +#include <xc_dom.h> + +#if defined(__aarch64__) +_hidden +int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info, + libxl__domain_build_state *state, + struct xc_dom_image *dom); +#else +_hidden +static inline int libxl__prepare_acpi(libxl__gc *gc, + libxl_domain_build_info *info, Can y this should be either an ASSERT or return an error value to avoid any mis-usage. +} +#endif + +/* + * Local variables: + * mode: C + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/tools/libxl/libxl_arm_acpi.c b/tools/libxl/libxl_arm_acpi.c new file mode 100644 index 0000000..ec6cf08 --- /dev/null +++ b/tools/libxl/libxl_arm_acpi.c @@ -0,0 +1,61 @@ +/* + * ARM DomU ACPI generation + * + * Copyright (C) 2016 Linaro Ltd. + * + * Author: Shannon Zhao <shannon.zhao@xxxxxxxxxx> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; version 2.1 only. with the special + * exception on linking described in file LICENSE. + * + * This program 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. + */ + +#include "libxl_arm.h" + +#include <stdint.h> + It might to add a comment explaining why you add those typedef because they are only use for acpi/*.h. Regards, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |