[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZMrrG0urnR6BdZcW@liuwe-devbox-debian-v2>
Date: Wed, 2 Aug 2023 23:47:39 +0000
From: Wei Liu <wei.liu@...nel.org>
To: Nuno Das Neves <nunodasneves@...ux.microsoft.com>
Cc: linux-hyperv@...r.kernel.org, linux-kernel@...r.kernel.org,
x86@...nel.org, linux-arm-kernel@...ts.infradead.org,
linux-arch@...r.kernel.org, mikelley@...rosoft.com,
kys@...rosoft.com, wei.liu@...nel.org, haiyangz@...rosoft.com,
decui@...rosoft.com, ssengar@...ux.microsoft.com,
mukeshrathor@...rosoft.com, stanislav.kinsburskiy@...il.com,
jinankjain@...ux.microsoft.com, apais@...ux.microsoft.com,
Tianyu.Lan@...rosoft.com, vkuznets@...hat.com, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com,
hpa@...or.com, will@...nel.org, catalin.marinas@....com,
rafael@...nel.org, lenb@...nel.org
Subject: Re: [PATCH 03/15] mshyperv: Introduce
numa_node_to_proximity_domain_info
On Thu, Jul 27, 2023 at 12:54:38PM -0700, Nuno Das Neves wrote:
> Factor out logic for converting numa node to proximity domain info into
> a helper function, and export it.
>
> Signed-off-by: Nuno Das Neves <nunodasneves@...ux.microsoft.com>
Reviewed-by: Wei Liu <wei.liu@...nel.org>
> ---
> arch/x86/hyperv/hv_proc.c | 8 ++------
> drivers/acpi/numa/srat.c | 1 +
> include/asm-generic/mshyperv.h | 18 ++++++++++++++++++
> 3 files changed, 21 insertions(+), 6 deletions(-)
>
[...]
> diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c
> index 1f4fc5f8a819..0cf9f0574495 100644
> --- a/drivers/acpi/numa/srat.c
> +++ b/drivers/acpi/numa/srat.c
> @@ -48,6 +48,7 @@ int node_to_pxm(int node)
> return PXM_INVAL;
> return node_to_pxm_map[node];
> }
> +EXPORT_SYMBOL(node_to_pxm);
Rafael and Len, I would like to get an ACK from you on this one line
change. I see a lot of other functions in that file are already
exported, so I hope this is okay, too.
It's user is the function below numa_node_to_proximity_domain_info.
Thanks,
Wei.
>
> static void __acpi_map_pxm_to_node(int pxm, int node)
> {
> diff --git a/include/asm-generic/mshyperv.h b/include/asm-generic/mshyperv.h
> index 233c976344e5..447e7ebe67ee 100644
> --- a/include/asm-generic/mshyperv.h
> +++ b/include/asm-generic/mshyperv.h
> @@ -21,6 +21,7 @@
> #include <linux/types.h>
> #include <linux/atomic.h>
> #include <linux/bitops.h>
> +#include <acpi/acpi_numa.h>
> #include <linux/cpumask.h>
> #include <linux/nmi.h>
> #include <asm/ptrace.h>
> @@ -28,6 +29,23 @@
>
> #define VTPM_BASE_ADDRESS 0xfed40000
>
> +static inline union hv_proximity_domain_info
> +numa_node_to_proximity_domain_info(int node)
> +{
> + union hv_proximity_domain_info proximity_domain_info;
> +
> + if (node != NUMA_NO_NODE) {
> + proximity_domain_info.domain_id = node_to_pxm(node);
> + proximity_domain_info.flags.reserved = 0;
> + proximity_domain_info.flags.proximity_info_valid = 1;
> + proximity_domain_info.flags.proximity_preferred = 1;
> + } else {
> + proximity_domain_info.as_uint64 = 0;
> + }
> +
> + return proximity_domain_info;
> +}
> +
> struct ms_hyperv_info {
> u32 features;
> u32 priv_high;
> --
> 2.25.1
>
Powered by blists - more mailing lists