|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [RFC PATCH v1 13/21] ACPI: Refactor acpi SRAT and SLIT table handling code
Hello Vijay, On 09/02/17 15:57, vijay.kilari@xxxxxxxxx wrote: From: Vijaya Kumar K <Vijaya.Kumar@xxxxxxxxxx> Move SRAT handling code which is common across architecture is moved to new file xen/commom/srat.c from xen/arch/x86/srat.c file. New header file srat.h is introduced. Signed-off-by: Vijaya Kumar <Vijaya.Kumar@xxxxxxxxxx> --- xen/arch/x86/domain_build.c | 1 + xen/arch/x86/numa.c | 1 + xen/arch/x86/physdev.c | 1 + xen/arch/x86/setup.c | 1 + xen/arch/x86/smpboot.c | 1 + xen/arch/x86/srat.c | 129 +------------------------------ xen/arch/x86/x86_64/mm.c | 1 + xen/common/Makefile | 1 + xen/common/srat.c | 150 ++++++++++++++++++++++++++++++++++++ This new file should be created in xen/drivers/acpi/ xen/drivers/passthrough/vtd/iommu.c | 1 + xen/include/asm-x86/numa.h | 2 - xen/include/xen/numa.h | 1 - xen/include/xen/srat.h | 13 ++++ This new file should be created in xen/include/acpi/ [...] diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index 58dee09..af12e26 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -18,91 +18,20 @@ #include <xen/acpi.h> #include <xen/numa.h> #include <xen/pfn.h> +#include <xen/srat.h> #include <asm/e820.h> #include <asm/page.h> -static struct acpi_table_slit *__read_mostly acpi_slit; +extern struct acpi_table_slit *__read_mostly acpi_slit; This should be defined in the header. However, I don't like the idea of exposing acpi_slit. Looking at the usage it is only to parse the distance that can be common. [...] The code of acpi_numa_memory_affinity_init looks pretty generic. Why didn't you move it in the common code? [...] diff --git a/xen/common/Makefile b/xen/common/Makefile index c1bd2ff..a668094 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -64,6 +64,7 @@ obj-bin-y += warning.init.o obj-$(CONFIG_XENOPROF) += xenoprof.o obj-y += xmalloc_tlsf.o obj-y += numa.o +obj-y += srat.o This should be only compiled when CONFIG_ACPI is enabled. obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma unlzo unlz4 earlycpio,$(n).init.o) diff --git a/xen/common/srat.c b/xen/common/srat.c new file mode 100644 index 0000000..cf50c78 --- /dev/null +++ b/xen/common/srat.c @@ -0,0 +1,150 @@ +/* + * ACPI 3.0 based NUMA setup + * Copyright 2004 Andi Kleen, SuSE Labs. + * + * Reads the ACPI SRAT table to figure out what memory belongs to which CPUs. + * + * Called from acpi_numa_init while reading the SRAT and SLIT tables. + * Assumes all memory regions belonging to a single proximity domain + * are in one chunk. Holes between them will be included in the node. + * + * Adapted for Xen: Ryan Harper <ryanh@xxxxxxxxxx> + * + * Moved this generic code from xen/arch/x86/srat.c for other arch usage + * by Vijaya Kumar K <Vijaya.Kumar@xxxxxxxxxx> + */ + +#include <xen/init.h> +#include <xen/mm.h> +#include <xen/inttypes.h> +#include <xen/nodemask.h> +#include <xen/acpi.h> +#include <xen/numa.h> +#include <xen/pfn.h> +#include <xen/srat.h> +#include <asm/page.h> + +struct acpi_table_slit *__read_mostly acpi_slit; This should really be static. So this is not only exposed because of bad_srat(). The code should be reworked to avoid that. This name is too generic. The name of the function should make clear it is an ACPI only function. [...] Missing emacs magic here. Missing emacs magic. 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 |