All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hanjun Guo <guohanjun@huawei.com>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	<linux-mm@kvack.org>, <linux-acpi@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <x86@kernel.org>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Bjorn Helgaas <bhelgaas@google.com>, <linux-pci@vger.kernel.org>,
	<martin@geanix.com>, "Ingo Molnar" <mingo@redhat.com>,
	<linux-ia64@vger.kernel.org>, Tony Luck <tony.luck@intel.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>, <linuxarm@huawei.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Song Bao Hua <song.bao.hua@hisilicon.com>
Subject: Re: [PATCH v2 0/6] ACPI: Only create NUMA nodes from entries in SRAT or SRAT emulation.
Date: Mon, 20 Jul 2020 10:02:42 +0800	[thread overview]
Message-ID: <9b679614-083b-cec4-e0de-34e1a66b103a@huawei.com> (raw)
In-Reply-To: <20200717175959.899775-1-Jonathan.Cameron@huawei.com>

On 2020/7/18 1:59, Jonathan Cameron wrote:
> Here, I will use the term Proximity Domains for the ACPI description and
> NUMA Nodes for the in kernel representation.
> 
> ACPI 6.3 included a clarification that only Static Resource Allocation
> Structures in SRAT may define the existence of proximity domains
> (sec 5.2.16). This clarification closed a possible interpretation that
> other parts of ACPI (e.g. DSDT _PXM, NFIT etc) could define new proximity
> domains that were not also mentioned in SRAT structures.
> 
> In practice the kernel has never allowed this alternative interpretation as
> such nodes are only partially initialized. This is architecture specific
> but to take an example, on x86 alloc_node_data has not been called.
> Any use of them for node specific allocation, will result in a crash as the
> infrastructure to fallback to a node with memory is not setup.
> 
> We ran into a problem when enabling _PXM handling for PCI devices and found
> there were boards out there advertising devices in proximity domains that
> didn't exist [2].
> 
> The fix suggested in this series is to replace instances that should not
> 'create' new nodes with pxm_to_node.  This function needs a some additional
> hardening against invalid inputs to make sure it is safe for use in these
> new callers.
> 
> Patch 1 Hardens pxm_to_node() against numa_off, and pxm entry being too large.
> 
> Patch 2-4 change the various callers not related to SRAT entries so that they
> set this parameter to false, so do not attempt to initialize a new NUMA node
> if the relevant one does not already exist.
> 
> Patch 5 is a function rename to reflect change in functionality of
> acpi_map_pxm_to_online_node() as it no longer creates a new map, but just does a
> lookup of existing maps.
> 
> Patch 6 covers the one place we do not allow the full flexibility defined
> in the ACPI spec.  For SRAT GIC Interrupt Translation Service (ITS) Affinity
> Structures, on ARM64, the driver currently makes an additional pass of SRAT
> later in the boot than the one used to identify NUMA domains.
> Note, this currently means that an ITS placed in a proximity domain that is
> not defined by another SRAT structure will result in the a crash.
> 
> To avoid this crash with minimal changes we do not create new NUMA nodes based
> on this particular entry type.  Any current platform trying to do this will not
> boot, so this is an improvement, if perhaps not a perfect solution.

Make sense to me,

Reviewed-by: Hanjun Guo <guohanjun@huawei.com>


WARNING: multiple messages have this Message-ID (diff)
From: Hanjun Guo <guohanjun@huawei.com>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	<linux-mm@kvack.org>, <linux-acpi@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <x86@kernel.org>
Cc: Song Bao Hua <song.bao.hua@hisilicon.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	linux-ia64@vger.kernel.org, Tony Luck <tony.luck@intel.com>,
	linux-pci@vger.kernel.org, linuxarm@huawei.com,
	Ingo Molnar <mingo@redhat.com>,
	martin@geanix.com, Bjorn Helgaas <bhelgaas@google.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Dan Williams <dan.j.williams@intel.com>
Subject: Re: [PATCH v2 0/6] ACPI: Only create NUMA nodes from entries in SRAT or SRAT emulation.
Date: Mon, 20 Jul 2020 10:02:42 +0800	[thread overview]
Message-ID: <9b679614-083b-cec4-e0de-34e1a66b103a@huawei.com> (raw)
In-Reply-To: <20200717175959.899775-1-Jonathan.Cameron@huawei.com>

On 2020/7/18 1:59, Jonathan Cameron wrote:
> Here, I will use the term Proximity Domains for the ACPI description and
> NUMA Nodes for the in kernel representation.
> 
> ACPI 6.3 included a clarification that only Static Resource Allocation
> Structures in SRAT may define the existence of proximity domains
> (sec 5.2.16). This clarification closed a possible interpretation that
> other parts of ACPI (e.g. DSDT _PXM, NFIT etc) could define new proximity
> domains that were not also mentioned in SRAT structures.
> 
> In practice the kernel has never allowed this alternative interpretation as
> such nodes are only partially initialized. This is architecture specific
> but to take an example, on x86 alloc_node_data has not been called.
> Any use of them for node specific allocation, will result in a crash as the
> infrastructure to fallback to a node with memory is not setup.
> 
> We ran into a problem when enabling _PXM handling for PCI devices and found
> there were boards out there advertising devices in proximity domains that
> didn't exist [2].
> 
> The fix suggested in this series is to replace instances that should not
> 'create' new nodes with pxm_to_node.  This function needs a some additional
> hardening against invalid inputs to make sure it is safe for use in these
> new callers.
> 
> Patch 1 Hardens pxm_to_node() against numa_off, and pxm entry being too large.
> 
> Patch 2-4 change the various callers not related to SRAT entries so that they
> set this parameter to false, so do not attempt to initialize a new NUMA node
> if the relevant one does not already exist.
> 
> Patch 5 is a function rename to reflect change in functionality of
> acpi_map_pxm_to_online_node() as it no longer creates a new map, but just does a
> lookup of existing maps.
> 
> Patch 6 covers the one place we do not allow the full flexibility defined
> in the ACPI spec.  For SRAT GIC Interrupt Translation Service (ITS) Affinity
> Structures, on ARM64, the driver currently makes an additional pass of SRAT
> later in the boot than the one used to identify NUMA domains.
> Note, this currently means that an ITS placed in a proximity domain that is
> not defined by another SRAT structure will result in the a crash.
> 
> To avoid this crash with minimal changes we do not create new NUMA nodes based
> on this particular entry type.  Any current platform trying to do this will not
> boot, so this is an improvement, if perhaps not a perfect solution.

Make sense to me,

Reviewed-by: Hanjun Guo <guohanjun@huawei.com>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Hanjun Guo <guohanjun@huawei.com>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	linux-mm@kvack.org, linux-acpi@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, x86@kernel.org
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, martin@geanix.com,
	Ingo Molnar <mingo@redhat.com>,
	linux-ia64@vger.kernel.org, Tony Luck <tony.luck@intel.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	linuxarm@huawei.com, Dan Williams <dan.j.williams@intel.com>,
	Song Bao Hua <song.bao.hua@hisilicon.com>
Subject: Re: [PATCH v2 0/6] ACPI: Only create NUMA nodes from entries in SRAT or SRAT emulation.
Date: Mon, 20 Jul 2020 02:02:42 +0000	[thread overview]
Message-ID: <9b679614-083b-cec4-e0de-34e1a66b103a@huawei.com> (raw)
In-Reply-To: <20200717175959.899775-1-Jonathan.Cameron@huawei.com>

On 2020/7/18 1:59, Jonathan Cameron wrote:
> Here, I will use the term Proximity Domains for the ACPI description and
> NUMA Nodes for the in kernel representation.
> 
> ACPI 6.3 included a clarification that only Static Resource Allocation
> Structures in SRAT may define the existence of proximity domains
> (sec 5.2.16). This clarification closed a possible interpretation that
> other parts of ACPI (e.g. DSDT _PXM, NFIT etc) could define new proximity
> domains that were not also mentioned in SRAT structures.
> 
> In practice the kernel has never allowed this alternative interpretation as
> such nodes are only partially initialized. This is architecture specific
> but to take an example, on x86 alloc_node_data has not been called.
> Any use of them for node specific allocation, will result in a crash as the
> infrastructure to fallback to a node with memory is not setup.
> 
> We ran into a problem when enabling _PXM handling for PCI devices and found
> there were boards out there advertising devices in proximity domains that
> didn't exist [2].
> 
> The fix suggested in this series is to replace instances that should not
> 'create' new nodes with pxm_to_node.  This function needs a some additional
> hardening against invalid inputs to make sure it is safe for use in these
> new callers.
> 
> Patch 1 Hardens pxm_to_node() against numa_off, and pxm entry being too large.
> 
> Patch 2-4 change the various callers not related to SRAT entries so that they
> set this parameter to false, so do not attempt to initialize a new NUMA node
> if the relevant one does not already exist.
> 
> Patch 5 is a function rename to reflect change in functionality of
> acpi_map_pxm_to_online_node() as it no longer creates a new map, but just does a
> lookup of existing maps.
> 
> Patch 6 covers the one place we do not allow the full flexibility defined
> in the ACPI spec.  For SRAT GIC Interrupt Translation Service (ITS) Affinity
> Structures, on ARM64, the driver currently makes an additional pass of SRAT
> later in the boot than the one used to identify NUMA domains.
> Note, this currently means that an ITS placed in a proximity domain that is
> not defined by another SRAT structure will result in the a crash.
> 
> To avoid this crash with minimal changes we do not create new NUMA nodes based
> on this particular entry type.  Any current platform trying to do this will not
> boot, so this is an improvement, if perhaps not a perfect solution.

Make sense to me,

Reviewed-by: Hanjun Guo <guohanjun@huawei.com>

  parent reply	other threads:[~2020-07-20  2:02 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17 17:59 [PATCH v2 0/6] ACPI: Only create NUMA nodes from entries in SRAT or SRAT emulation Jonathan Cameron
2020-07-17 17:59 ` Jonathan Cameron
2020-07-17 17:59 ` Jonathan Cameron
2020-07-17 17:59 ` [PATCH v2 1/6] ACPI: Add out of bounds and numa_off protections to pxm_to_node Jonathan Cameron
2020-07-17 17:59   ` Jonathan Cameron
2020-07-17 17:59   ` Jonathan Cameron
2020-07-18  5:09   ` Song Bao Hua (Barry Song)
2020-07-18  5:09     ` Song Bao Hua (Barry Song)
2020-07-18  5:09     ` Song Bao Hua (Barry Song)
2020-07-17 17:59 ` [PATCH v2 2/6] ACPI: Do not create new NUMA domains from ACPI static tables that are not SRAT Jonathan Cameron
2020-07-17 17:59   ` Jonathan Cameron
2020-07-17 17:59   ` Jonathan Cameron
2020-07-18  5:14   ` Song Bao Hua (Barry Song)
2020-07-18  5:14     ` Song Bao Hua (Barry Song)
2020-07-18  5:14     ` Song Bao Hua (Barry Song)
2020-07-18  5:14     ` Song Bao Hua (Barry Song)
2020-07-17 17:59 ` [PATCH v2 3/6] ACPI: Remove side effect of partly creating a node in acpi_map_pxm_to_online_node Jonathan Cameron
2020-07-17 17:59   ` Jonathan Cameron
2020-07-17 17:59   ` Jonathan Cameron
2020-07-17 17:59 ` [PATCH v2 4/6] ACPI: Rename acpi_map_pxm_to_online_node to pxm_to_online_node Jonathan Cameron
2020-07-17 17:59   ` Jonathan Cameron
2020-07-17 17:59   ` Jonathan Cameron
2020-07-17 17:59 ` [PATCH v2 5/6] ACPI: Remove side effect of partly creating a node in acpi_get_node Jonathan Cameron
2020-07-17 17:59   ` Jonathan Cameron
2020-07-17 17:59   ` Jonathan Cameron
2020-07-18  5:17   ` Song Bao Hua (Barry Song)
2020-07-18  5:17     ` Song Bao Hua (Barry Song)
2020-07-18  5:17     ` Song Bao Hua (Barry Song)
2020-07-17 17:59 ` [PATCH v2 6/6] irq-chip/gic-v3-its: Fix crash if ITS is in a proximity domain without processor or memory Jonathan Cameron
2020-07-17 17:59   ` [PATCH v2 6/6] irq-chip/gic-v3-its: Fix crash if ITS is in a proximity domain without processor or m Jonathan Cameron
2020-07-17 17:59   ` [PATCH v2 6/6] irq-chip/gic-v3-its: Fix crash if ITS is in a proximity domain without processor or memory Jonathan Cameron
2020-07-20  2:02 ` Hanjun Guo [this message]
2020-07-20  2:02   ` [PATCH v2 0/6] ACPI: Only create NUMA nodes from entries in SRAT or SRAT emulation Hanjun Guo
2020-07-20  2:02   ` Hanjun Guo
2020-07-28 16:20 ` Jonathan Cameron
2020-07-28 16:20   ` Jonathan Cameron
2020-07-28 16:20   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9b679614-083b-cec4-e0de-34e1a66b103a@huawei.com \
    --to=guohanjun@huawei.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=bhelgaas@google.com \
    --cc=dan.j.williams@intel.com \
    --cc=fenghua.yu@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=martin@geanix.com \
    --cc=mingo@redhat.com \
    --cc=song.bao.hua@hisilicon.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.