linux_dsm_epyc7002/arch/powerpc/platforms/powermac
Finn Thain 20e07af71f powerpc: Adopt nvram module for PPC64
Adopt nvram module to reduce code duplication. This means CONFIG_NVRAM
becomes available to PPC64 builds. Previously it was only available to
PPC32 builds because it depended on CONFIG_GENERIC_NVRAM.

The IOC_NVRAM_GET_OFFSET ioctl as implemented on PPC64 validates the
offset returned by pmac_get_partition(). Do the same in the nvram module.

Note that the old PPC32 generic_nvram module lacked this test.
So when CONFIG_PPC32 && CONFIG_PPC_PMAC, the IOC_NVRAM_GET_OFFSET ioctl
would have returned 0 (always). But when CONFIG_PPC64 && CONFIG_PPC_PMAC,
the IOC_NVRAM_GET_OFFSET ioctl would have returned -1 (which is -EPERM)
when the requested partition was not found.

With this patch, the result is now -EINVAL on both PPC32 and PPC64 when
the requested PowerMac NVRAM partition is not found. This is a userspace-
visible change, in the non-existent partition case, which would be in
an error path for an IOC_NVRAM_GET_OFFSET ioctl syscall.

Tested-by: Stan Johnson <userm57@yahoo.com>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-22 10:21:45 +01:00
..
backlight.c powerpc: Fix old-style function definition 2018-01-21 23:37:44 +11:00
bootx_init.c powerpc: fix spelling mistake: "Usupported" -> "Unsupported" 2018-06-05 11:33:43 +10:00
cache.S powerpc: change CONFIG_6xx to CONFIG_PPC_BOOK3S_32 2018-11-26 22:33:37 +11:00
feature.c powerpc: Use of_node_name_eq for node name comparisons 2018-12-22 21:29:50 +11:00
Kconfig PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
low_i2c.c powerpc: Use of_node_name_eq for node name comparisons 2018-12-22 21:29:50 +11:00
Makefile powerpc: Adopt nvram module for PPC64 2019-01-22 10:21:45 +01:00
nvram.c powerpc: Define missing ppc_md.nvram_size for CHRP and PowerMac 2019-01-22 10:21:45 +01:00
pci.c powerpc: Use of_node_name_eq for node name comparisons 2018-12-22 21:29:50 +11:00
pfunc_base.c powerpc: Use of_node_name_eq for node name comparisons 2018-12-22 21:29:50 +11:00
pfunc_core.c powerpc: Use sizeof(*foo) rather than sizeof(struct foo) 2018-03-20 16:47:53 +11:00
pic.c powerpc: Use of_node_name_eq for node name comparisons 2018-12-22 21:29:50 +11:00
pmac.h powerpc: use time64_t in read_persistent_clock 2018-06-03 20:43:33 +10:00
setup.c powerpc: Adopt nvram module for PPC64 2019-01-22 10:21:45 +01:00
sleep.S powerpc: change CONFIG_6xx to CONFIG_PPC_BOOK3S_32 2018-11-26 22:33:37 +11:00
smp.c powerpc/smp: Use code patching to restore reset vector 2018-12-19 18:56:32 +11:00
time.c powerpc: Adopt nvram module for PPC64 2019-01-22 10:21:45 +01:00
udbg_adb.c powerpc: Use device_type helpers to access the node type 2018-11-26 22:33:37 +11:00
udbg_scc.c powerpc: Use of_node_name_eq for node name comparisons 2018-12-22 21:29:50 +11:00