linux/arch/powerpc/platforms
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
..
4xx powerpc/4xx/ocm: Fix phys_addr_t printf warnings 2018-12-30 14:00:47 +11:00
8xx powerpc updates for 4.20 2018-10-26 14:36:21 -07:00
40x PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
44x Kconfig file consolidation for v4.21 2018-12-29 13:40:29 -08:00
52xx Kconfig file consolidation for v4.21 2018-12-29 13:40:29 -08:00
82xx powerpc/kconfig: remove CONFIG_6xx 2018-11-26 22:33:37 +11:00
83xx Kconfig file consolidation for v4.21 2018-12-29 13:40:29 -08:00
85xx Kconfig file consolidation for v4.21 2018-12-29 13:40:29 -08:00
86xx Kconfig file consolidation for v4.21 2018-12-29 13:40:29 -08:00
512x Kconfig file consolidation for v4.21 2018-12-29 13:40:29 -08:00
amigaone Kconfig file consolidation for v4.21 2018-12-29 13:40:29 -08:00
cell Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
chrp powerpc: Enable HAVE_ARCH_NVRAM_OPS and disable GENERIC_NVRAM 2019-01-22 10:21:45 +01:00
embedded6xx Kconfig file consolidation for v4.21 2018-12-29 13:40:29 -08:00
maple Kconfig file consolidation for v4.21 2018-12-29 13:40:29 -08:00
pasemi Kconfig file consolidation for v4.21 2018-12-29 13:40:29 -08:00
powermac powerpc: Adopt nvram module for PPC64 2019-01-22 10:21:45 +01:00
powernv jump_label: move 'asm goto' support test to Kconfig 2019-01-06 09:46:51 +09:00
ps3 PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
pseries powerpc: Adopt nvram module for PPC64 2019-01-22 10:21:45 +01:00
fsl_uli1575.c of/irq: Refactor interrupt-map parsing 2013-10-24 11:43:04 +01:00
Kconfig Kconfig file consolidation for v4.21 2018-12-29 13:40:29 -08:00
Kconfig.cputype Kconfig file consolidation for v4.21 2018-12-29 13:40:29 -08:00
Makefile powerpc: Add -Werror at arch/powerpc level 2018-10-19 00:56:17 +11:00