kernel_optimize_test/drivers
Dan Williams a927bd6ba9 mm: fix phys_to_target_node() and memory_add_physaddr_to_nid() exports
The core-mm has a default __weak implementation of phys_to_target_node()
to mirror the weak definition of memory_add_physaddr_to_nid().  That
symbol is exported for modules.  However, while the export in
mm/memory_hotplug.c exported the symbol in the configuration cases of:

	CONFIG_NUMA_KEEP_MEMINFO=y
	CONFIG_MEMORY_HOTPLUG=y

...and:

	CONFIG_NUMA_KEEP_MEMINFO=n
	CONFIG_MEMORY_HOTPLUG=y

...it failed to export the symbol in the case of:

	CONFIG_NUMA_KEEP_MEMINFO=y
	CONFIG_MEMORY_HOTPLUG=n

Not only is that broken, but Christoph points out that the kernel should
not be exporting any __weak symbol, which means that
memory_add_physaddr_to_nid() example that phys_to_target_node() copied
is broken too.

Rework the definition of phys_to_target_node() and
memory_add_physaddr_to_nid() to not require weak symbols.  Move to the
common arch override design-pattern of an asm header defining a symbol
to replace the default implementation.

The only common header that all memory_add_physaddr_to_nid() producing
architectures implement is asm/sparsemem.h.  In fact, powerpc already
defines its memory_add_physaddr_to_nid() helper in sparsemem.h.
Double-down on that observation and define phys_to_target_node() where
necessary in asm/sparsemem.h.  An alternate consideration that was
discarded was to put this override in asm/numa.h, but that entangles
with the definition of MAX_NUMNODES relative to the inclusion of
linux/nodemask.h, and requires powerpc to grow a new header.

The dependency on NUMA_KEEP_MEMINFO for DEV_DAX_HMEM_DEVICES is invalid
now that the symbol is properly exported / stubbed in all combinations
of CONFIG_NUMA_KEEP_MEMINFO and CONFIG_MEMORY_HOTPLUG.

[dan.j.williams@intel.com: v4]
  Link: https://lkml.kernel.org/r/160461461867.1505359.5301571728749534585.stgit@dwillia2-desk3.amr.corp.intel.com
[dan.j.williams@intel.com: powerpc: fix create_section_mapping compile warning]
  Link: https://lkml.kernel.org/r/160558386174.2948926.2740149041249041764.stgit@dwillia2-desk3.amr.corp.intel.com

Fixes: a035b6bf86 ("mm/memory_hotplug: introduce default phys_to_target_node() implementation")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: Thomas Gleixner <tglx@linutronix.de>
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Joao Martins <joao.m.martins@oracle.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Link: https://lkml.kernel.org/r/160447639846.1133764.7044090803980177548.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-11-22 10:48:22 -08:00
..
accessibility speakup ttyio: Do not schedule() in ttyio_in_nowait 2020-11-09 18:14:29 +01:00
acpi Merge branch 'acpi-fan' 2020-11-19 14:03:52 +01:00
amba
android
ata libata-5.10-2020-10-30 2020-10-30 14:51:01 -07:00
atm atm: nicstar: Unmap DMA on send error 2020-11-18 16:42:07 -08:00
auxdisplay
base PM: runtime: Resume the device earlier in __device_release_driver() 2020-11-02 18:14:07 +01:00
bcma
block loop: Fix occasional uevent drop 2020-11-12 13:59:04 -07:00
bluetooth Bluetooth: btintel: Replace zero-length array with flexible-array member 2020-10-30 16:57:41 -05:00
bus
cdrom
char Char/Misc driver fixes for 5.10-rc4 2020-11-15 10:15:17 -08:00
clk clk: imx8m: fix bus critical clk registration 2020-11-04 17:13:12 -08:00
clocksource treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
connector
counter
cpufreq Merge branch 'cpufreq/arm/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm 2020-11-17 13:25:06 +01:00
cpuidle cpuidle: tegra: Annotate tegra_pm_set_cpu_in_lp2() with RCU_NONIDLE 2020-11-16 13:24:32 +01:00
crypto crypto: sun8x-ce*: update entries to its documentation 2020-10-28 11:41:15 -06:00
dax mm: fix phys_to_target_node() and memory_add_physaddr_to_nid() exports 2020-11-22 10:48:22 -08:00
dca
devfreq
dio
dma dmaengine fixes for v5.10-rc5 2020-11-20 10:23:49 -08:00
dma-buf
edac
eisa
extcon
firewire
firmware firmware: xilinx: fix out-of-bounds access 2020-11-09 18:35:35 +01:00
fpga
fsi
gnss
gpio gpio: sifive: Fix SiFive gpio probe 2020-11-11 09:53:09 +01:00
gpu - Fix tgl power gating issue (Rodrigo) 2020-11-20 11:21:54 +10:00
greybus
hid
hsi
hv hyperv-fixes for 5.10-rc5 2020-11-16 15:02:33 -08:00
hwmon hwmon: (amd_energy) modify the visibility of the counters 2020-11-13 06:46:20 -08:00
hwspinlock
hwtracing coresight: cti: Initialize dynamic sysfs attributes 2020-10-29 20:10:25 +01:00
i2c i2c: designware: slave should do WRITE_REQUESTED before WRITE_RECEIVED 2020-11-06 16:02:00 +01:00
i3c
ide
idle intel_idle: Fix max_cstate for processor models without C-state tables 2020-10-27 19:03:53 +01:00
iio
infiniband IB/hfi1: Fix error return code in hfi1_init_dd() 2020-11-13 12:25:21 -04:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2020-11-17 12:00:40 -08:00
interconnect interconnect: qcom: use icc_sync state for sm8[12]50 2020-10-27 16:01:22 +02:00
iommu iommu fixes for -rc5 2020-11-20 10:20:16 -08:00
ipack
irqchip A set of fixes for interrupt chip drivers: 2020-11-08 09:52:57 -08:00
isdn
leds
lightnvm
macintosh
mailbox
mcb
md
media
memory
memstick
message scsi: mptfusion: Fix null pointer dereferences in mptscsih_remove() 2020-10-26 16:57:18 -04:00
mfd
misc habanalabs/gaudi: mask WDT error in QMAN 2020-11-04 08:56:07 +02:00
mmc mmc: sdhci-of-arasan: Issue DLL reset explicitly 2020-11-17 12:44:44 +01:00
most
mtd mtd: rawnand: stm32_fmc2: fix broken ECC 2020-10-30 18:24:51 +01:00
mux
net linux-can-fixes-for-5.10-20201118 2020-11-18 17:49:24 -08:00
nfc
ntb Bug fixes for v5.10 2020-10-25 11:12:31 -07:00
nubus
nvdimm
nvme nvme: fix memory leak freeing command effects 2020-11-14 09:57:55 +01:00
nvmem
of of/address: Fix of_node memory leak in of_dma_is_coherent 2020-11-11 17:10:16 -06:00
opp opp: Reduce the size of critical section in _opp_table_kref_release() 2020-10-27 13:21:03 +05:30
oprofile
parisc
parport
pci PCI: mvebu: Fix duplicate resource requests 2020-11-04 13:55:30 -06:00
pcmcia
perf
phy
pinctrl intel-pinctrl for v5.10-2 2020-11-10 15:35:41 +01:00
platform
pnp PNP: fix kernel-doc markups 2020-10-27 19:23:04 +01:00
power
powercap Merge branch 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux 2020-11-10 10:02:31 -08:00
pps
ps3
ptp
pwm
rapidio
ras
regulator regulator: ti-abb: Fix array out of bound read access on the first transition 2020-11-18 17:59:24 +00:00
remoteproc
reset
rpmsg
rtc
s390 block-5.10-2020-11-20 2020-11-20 12:03:40 -08:00
sbus
scsi SCSI fixes on 20201120 2020-11-20 16:24:28 -08:00
sfi
sh
siox
slimbus
soc soc: ti: ti_sci_pm_domains: check for proper args count in xlate 2020-10-29 22:13:38 +01:00
soundwire
spi spi: npcm-fiu: Don't leak SPI master in probe error path 2020-11-17 17:08:39 +00:00
spmi
ssb
staging This pull contains a series of warning fixes from Mauro; once applied, the 2020-11-03 13:14:14 -08:00
target SCSI fixes on 20201120 2020-11-20 16:24:28 -08:00
tc
tee AMD-TEE driver bug fixes 2020-11-13 13:44:05 +01:00
thermal thermal: ti-soc-thermal: Disable the CPU PM notifier for OMAP4430 2020-11-12 12:30:29 +01:00
thunderbolt thunderbolt: Add support for Intel Tiger Lake-H 2020-11-06 16:39:11 +03:00
tty TTY/Serial fixes for 5.10-rc3 2020-11-08 11:28:08 -08:00
uio uio: Fix use-after-free in uio_unregister_device() 2020-11-09 18:54:30 +01:00
usb usb: cdc-acm: Add DISABLE_ECHO for Renesas USB Download mode 2020-11-13 15:26:49 +01:00
vdpa vhost,vdpa: fixes 2020-11-16 14:58:23 -08:00
vfio vfio/pci: Bypass IGD init in case of -ENODEV 2020-11-03 11:07:40 -07:00
vhost vhost scsi: Add support for LUN resets. 2020-11-15 17:30:55 -05:00
video video: hyperv_fb: include vmalloc.h 2020-11-09 08:17:46 +01:00
virt nitro_enclaves: Fixup type and simplify logic of the poll mask setup 2020-11-09 18:20:36 +01:00
virtio
visorbus
vlynq
vme
w1
watchdog
xen swiotlb: remove the tbl_dma_addr argument to swiotlb_tbl_map_single 2020-11-02 10:10:39 -05:00
zorro
Kconfig
Makefile