* Re: [PATCH v2 10/12] powerpc/entry32: Blacklist exception entry points for kprobe.
From: Naveen N. Rao @ 2020-03-31 17:05 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Christophe Leroy, Michael Ellerman,
Paul Mackerras
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <f61ac599855e674ebb592464d0ea32a3ba9c6644.1585670437.git.christophe.leroy@c-s.fr>
Christophe Leroy wrote:
> kprobe does not handle events happening in real mode.
>
> As exception entry points are running with MMU disabled,
> blacklist them.
>
> The handling of TLF_NAPPING and TLF_SLEEPING is moved before the
> CONFIG_TRACE_IRQFLAGS which contains 'reenable_mmu' because from there
> kprobe will be possible as the kernel will run with MMU enabled.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> Acked-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> ---
> v2: Moved TLF_NAPPING and TLF_SLEEPING handling
> ---
> arch/powerpc/kernel/entry_32.S | 37 ++++++++++++++++++++--------------
> 1 file changed, 22 insertions(+), 15 deletions(-)
>
> diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
> index 94f78c03cb79..215aa3a6d4f7 100644
> --- a/arch/powerpc/kernel/entry_32.S
> +++ b/arch/powerpc/kernel/entry_32.S
> @@ -51,6 +51,7 @@ mcheck_transfer_to_handler:
> mfspr r0,SPRN_DSRR1
> stw r0,_DSRR1(r11)
> /* fall through */
> +_ASM_NOKPROBE_SYMBOL(mcheck_transfer_to_handler)
>
> .globl debug_transfer_to_handler
> debug_transfer_to_handler:
> @@ -59,6 +60,7 @@ debug_transfer_to_handler:
> mfspr r0,SPRN_CSRR1
> stw r0,_CSRR1(r11)
> /* fall through */
> +_ASM_NOKPROBE_SYMBOL(debug_transfer_to_handler)
>
> .globl crit_transfer_to_handler
> crit_transfer_to_handler:
> @@ -94,6 +96,7 @@ crit_transfer_to_handler:
> rlwinm r0,r1,0,0,(31 - THREAD_SHIFT)
> stw r0,KSP_LIMIT(r8)
> /* fall through */
> +_ASM_NOKPROBE_SYMBOL(crit_transfer_to_handler)
> #endif
>
> #ifdef CONFIG_40x
> @@ -115,6 +118,7 @@ crit_transfer_to_handler:
> rlwinm r0,r1,0,0,(31 - THREAD_SHIFT)
> stw r0,KSP_LIMIT(r8)
> /* fall through */
> +_ASM_NOKPROBE_SYMBOL(crit_transfer_to_handler)
> #endif
>
> /*
> @@ -127,6 +131,7 @@ crit_transfer_to_handler:
> .globl transfer_to_handler_full
> transfer_to_handler_full:
> SAVE_NVGPRS(r11)
> +_ASM_NOKPROBE_SYMBOL(transfer_to_handler_full)
> /* fall through */
>
> .globl transfer_to_handler
> @@ -227,6 +232,23 @@ transfer_to_handler_cont:
> SYNC
> RFI /* jump to handler, enable MMU */
>
> +#if defined (CONFIG_PPC_BOOK3S_32) || defined(CONFIG_E500)
> +4: rlwinm r12,r12,0,~_TLF_NAPPING
> + stw r12,TI_LOCAL_FLAGS(r2)
> + b power_save_ppc32_restore
> +
> +7: rlwinm r12,r12,0,~_TLF_SLEEPING
> + stw r12,TI_LOCAL_FLAGS(r2)
> + lwz r9,_MSR(r11) /* if sleeping, clear MSR.EE */
> + rlwinm r9,r9,0,~MSR_EE
> + lwz r12,_LINK(r11) /* and return to address in LR */
> + kuap_restore r11, r2, r3, r4, r5
> + lwz r2, GPR2(r11)
> + b fast_exception_return
> +#endif
> +_ASM_NOKPROBE_SYMBOL(transfer_to_handler)
> +_ASM_NOKPROBE_SYMBOL(transfer_to_handler_cont)
> +
A very minor nit is that the above NOKPROBE annotation actually covers
the block of code below between the label '1:' till 'reenable_mmu', but
isn't obvious from the code. Splitting off 'reenable_mmu' would have
made that clear.
You don't have to fix that though -- a kprobe still won't be allowed
there and anyone interested should be able to look up this mail chain.
- Naveen
^ permalink raw reply
* Re: [PATCH 0/2] powerpc: Remove support for ppc405/440 Xilinx platforms
From: Segher Boessenkool @ 2020-03-31 17:51 UTC (permalink / raw)
To: Christophe Leroy
Cc: Kate Stewart, Mark Rutland, Desnes A. Nunes do Rosario,
Geert Uytterhoeven, open list:DOCUMENTATION,
ALSA Development Mailing List, dri-devel, Jaroslav Kysela,
Richard Fontana, Paul Mackerras, Miquel Raynal,
Mauro Carvalho Chehab, Fabio Estevam, Sasha Levin,
Stephen Rothwell, Jonathan Corbet, Masahiro Yamada, YueHaibing,
Michal Simek, Krzysztof Kozlowski, Allison Randal, Leonardo Bras,
DTML, Andrew Donnellan, Arnd Bergmann, Bartlomiej Zolnierkiewicz,
Marc Zyngier, Alistair Popple, Nicholas Piggin, Alexios Zavras,
Mark Brown, git, Linux Fbdev development list, Jonathan Cameron,
Thomas Gleixner, Andy Shevchenko, Linux ARM, Enrico Weigelt,
Michal Simek, Wei Hu, Christian Lamparter, Greg Kroah-Hartman,
Nick Desaulniers, Takashi Iwai, linux-kernel@vger.kernel.org,
Armijn Hemel, Rob Herring, linuxppc-dev, David S. Miller,
Thiago Jung Bauermann
In-Reply-To: <11765c82-bf1a-466c-760d-f9a4c4d1d5f1@c-s.fr>
On Tue, Mar 31, 2020 at 08:56:23AM +0200, Christophe Leroy wrote:
> While we are at it, can we also remove the 601 ? This one is also full
> of workarounds and diverges a bit from other 6xx.
>
> I'm unable to find its end of life date, but it was on the market in
> 1994, so I guess it must be outdated by more than 10-15 yr old now ?
There probably are still some people running Linux on 601 powermacs.
Segher
^ permalink raw reply
* Re: [PATCH v2 09/11] powerpc/platforms: Move files from 4xx to 44x
From: Arnd Bergmann @ 2020-03-31 18:38 UTC (permalink / raw)
To: Christophe Leroy
Cc: Michal Simek, linux-kernel@vger.kernel.org, Paul Mackerras,
linuxppc-dev
In-Reply-To: <74e76b4e-5e4f-f3de-96a8-f6a451b3243a@c-s.fr>
On Tue, Mar 31, 2020 at 6:19 PM Christophe Leroy
<christophe.leroy@c-s.fr> wrote:
> Le 31/03/2020 à 18:04, Arnd Bergmann a écrit :
> > That has the risk of breaking user's defconfig files, but given the
> > small number of users, it may be nicer for consistency. In either
> > case, the two symbols should probably hang around as synonyms,
> > the question is just which one is user visible.
> >
>
> Not sure it is a good idea to keep two synonyms. In the past we made our
> best to remove synonyms (We had CONFIG_8xx and CONFIG_PPC_8xx being
> synonyms, we had CONFIG_6xx and CONFIG_BOOK3S_32 and
> CONFIG_PPC_STD_MMU_32 being synonyms).
> I think it is a lot cleaner when we can avoid synonyms.
Ok, fair enough.
> By the way I already dropped CONFIG_4xx in previous patch (8/11). It was
> not many 4xx changed to 44x. It would be a lot more in the other way
> round I'm afraid.
Right. Maybe stay with 44x for both then (as in your current patches), as it
means changing less in a part of the code that has few users anyway.
Arnd
^ permalink raw reply
* Re: [PATCH v2 2/2] powerpc: Remove Xilinx PPC405/PPC440 support
From: Nick Desaulniers @ 2020-03-31 19:36 UTC (permalink / raw)
To: Michal Simek
Cc: Kate Stewart, Mark Rutland, Desnes A. Nunes do Rosario,
Geert Uytterhoeven, Linux Doc Mailing List, linux-fbdev,
dri-devel, Paul Mackerras, Miquel Raynal, Mauro Carvalho Chehab,
Fabio Estevam, Sasha Levin, Stephen Rothwell, Jonathan Corbet,
Marc Zyngier, Masahiro Yamada, YueHaibing, Krzysztof Kozlowski,
clang-built-linux, Allison Randal, Linux ARM, devicetree,
Andrew Donnellan, Arnd Bergmann, Bartlomiej Zolnierkiewicz,
Alistair Popple, linuxppc-dev, Nicholas Piggin, Alexios Zavras,
Rob Herring, git, Jonathan Cameron, Thomas Gleixner,
Andy Shevchenko, Dmitry Vyukov, Michal Simek, Wei Hu,
Greg Kroah-Hartman, LKML, Enrico Weigelt, David S. Miller,
Thiago Jung Bauermann
In-Reply-To: <9c3e02ffa9812c6f046708b45932d40f33e8817a.1585575111.git.michal.simek@xilinx.com>
On Mon, Mar 30, 2020 at 6:32 AM Michal Simek <michal.simek@xilinx.com> wrote:
>
> The latest Xilinx design tools called ISE and EDK has been released in
> October 2013. New tool doesn't support any PPC405/PPC440 new designs.
> These platforms are no longer supported and tested.
>
> PowerPC 405/440 port is orphan from 2013 by
> commit cdeb89943bfc ("MAINTAINERS: Fix incorrect status tag") and
> commit 19624236cce1 ("MAINTAINERS: Update Grant's email address and maintainership")
> that's why it is time to remove the support fot these platforms.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
Is this per chance related to:
https://lore.kernel.org/linux-next/1e0a9c45-e525-a3ac-b352-e236d8427e0b@xilinx.com/
We just hit that error today without our CI on ppc32 builds:
https://travis-ci.com/github/ClangBuiltLinux/continuous-integration/builds/157031633
> ---
>
> Changes in v2:
> - Based on my chat with Arnd I removed arch/powerpc/xmon/ changes done in
> v1 to keep them the same as before. (kbuild reported some issues with it
> too)
>
> Documentation/devicetree/bindings/xilinx.txt | 143 ------
> Documentation/powerpc/bootwrapper.rst | 28 +-
> MAINTAINERS | 6 -
> arch/powerpc/Kconfig.debug | 2 +-
> arch/powerpc/boot/Makefile | 7 +-
> arch/powerpc/boot/dts/Makefile | 1 -
> arch/powerpc/boot/dts/virtex440-ml507.dts | 406 ----------------
> arch/powerpc/boot/dts/virtex440-ml510.dts | 466 -------------------
> arch/powerpc/boot/ops.h | 1 -
> arch/powerpc/boot/serial.c | 5 -
> arch/powerpc/boot/uartlite.c | 79 ----
> arch/powerpc/boot/virtex.c | 97 ----
> arch/powerpc/boot/virtex405-head.S | 31 --
> arch/powerpc/boot/wrapper | 8 -
> arch/powerpc/configs/40x/virtex_defconfig | 75 ---
> arch/powerpc/configs/44x/virtex5_defconfig | 74 ---
> arch/powerpc/configs/ppc40x_defconfig | 8 -
> arch/powerpc/configs/ppc44x_defconfig | 8 -
> arch/powerpc/include/asm/xilinx_intc.h | 16 -
> arch/powerpc/include/asm/xilinx_pci.h | 21 -
> arch/powerpc/kernel/cputable.c | 39 --
> arch/powerpc/platforms/40x/Kconfig | 31 --
> arch/powerpc/platforms/40x/Makefile | 1 -
> arch/powerpc/platforms/40x/virtex.c | 54 ---
> arch/powerpc/platforms/44x/Kconfig | 37 --
> arch/powerpc/platforms/44x/Makefile | 2 -
> arch/powerpc/platforms/44x/virtex.c | 60 ---
> arch/powerpc/platforms/44x/virtex_ml510.c | 30 --
> arch/powerpc/platforms/Kconfig | 4 -
> arch/powerpc/sysdev/Makefile | 2 -
> arch/powerpc/sysdev/xilinx_intc.c | 88 ----
> arch/powerpc/sysdev/xilinx_pci.c | 132 ------
> drivers/char/Kconfig | 2 +-
> drivers/video/fbdev/Kconfig | 2 +-
> 34 files changed, 7 insertions(+), 1959 deletions(-)
> delete mode 100644 arch/powerpc/boot/dts/virtex440-ml507.dts
> delete mode 100644 arch/powerpc/boot/dts/virtex440-ml510.dts
> delete mode 100644 arch/powerpc/boot/uartlite.c
> delete mode 100644 arch/powerpc/boot/virtex.c
> delete mode 100644 arch/powerpc/boot/virtex405-head.S
> delete mode 100644 arch/powerpc/configs/40x/virtex_defconfig
> delete mode 100644 arch/powerpc/configs/44x/virtex5_defconfig
> delete mode 100644 arch/powerpc/include/asm/xilinx_intc.h
> delete mode 100644 arch/powerpc/include/asm/xilinx_pci.h
> delete mode 100644 arch/powerpc/platforms/40x/virtex.c
> delete mode 100644 arch/powerpc/platforms/44x/virtex.c
> delete mode 100644 arch/powerpc/platforms/44x/virtex_ml510.c
> delete mode 100644 arch/powerpc/sysdev/xilinx_intc.c
> delete mode 100644 arch/powerpc/sysdev/xilinx_pci.c
>
> diff --git a/Documentation/devicetree/bindings/xilinx.txt b/Documentation/devicetree/bindings/xilinx.txt
> index d058ace29345..28199b31fe5e 100644
> --- a/Documentation/devicetree/bindings/xilinx.txt
> +++ b/Documentation/devicetree/bindings/xilinx.txt
> @@ -86,149 +86,6 @@
> xlnx,use-parity = <0>;
> };
>
> - Some IP cores actually implement 2 or more logical devices. In
> - this case, the device should still describe the whole IP core with
> - a single node and add a child node for each logical device. The
> - ranges property can be used to translate from parent IP-core to the
> - registers of each device. In addition, the parent node should be
> - compatible with the bus type 'xlnx,compound', and should contain
> - #address-cells and #size-cells, as with any other bus. (Note: this
> - makes the assumption that both logical devices have the same bus
> - binding. If this is not true, then separate nodes should be used
> - for each logical device). The 'cell-index' property can be used to
> - enumerate logical devices within an IP core. For example, the
> - following is the system.mhs entry for the dual ps2 controller found
> - on the ml403 reference design.
> -
> - BEGIN opb_ps2_dual_ref
> - PARAMETER INSTANCE = opb_ps2_dual_ref_0
> - PARAMETER HW_VER = 1.00.a
> - PARAMETER C_BASEADDR = 0xA9000000
> - PARAMETER C_HIGHADDR = 0xA9001FFF
> - BUS_INTERFACE SOPB = opb_v20_0
> - PORT Sys_Intr1 = ps2_1_intr
> - PORT Sys_Intr2 = ps2_2_intr
> - PORT Clkin1 = ps2_clk_rx_1
> - PORT Clkin2 = ps2_clk_rx_2
> - PORT Clkpd1 = ps2_clk_tx_1
> - PORT Clkpd2 = ps2_clk_tx_2
> - PORT Rx1 = ps2_d_rx_1
> - PORT Rx2 = ps2_d_rx_2
> - PORT Txpd1 = ps2_d_tx_1
> - PORT Txpd2 = ps2_d_tx_2
> - END
> -
> - It would result in the following device tree nodes:
> -
> - opb_ps2_dual_ref_0: opb-ps2-dual-ref@a9000000 {
> - #address-cells = <1>;
> - #size-cells = <1>;
> - compatible = "xlnx,compound";
> - ranges = <0 a9000000 2000>;
> - // If this device had extra parameters, then they would
> - // go here.
> - ps2@0 {
> - compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
> - reg = <0 40>;
> - interrupt-parent = <&opb_intc_0>;
> - interrupts = <3 0>;
> - cell-index = <0>;
> - };
> - ps2@1000 {
> - compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
> - reg = <1000 40>;
> - interrupt-parent = <&opb_intc_0>;
> - interrupts = <3 0>;
> - cell-index = <0>;
> - };
> - };
> -
> - Also, the system.mhs file defines bus attachments from the processor
> - to the devices. The device tree structure should reflect the bus
> - attachments. Again an example; this system.mhs fragment:
> -
> - BEGIN ppc405_virtex4
> - PARAMETER INSTANCE = ppc405_0
> - PARAMETER HW_VER = 1.01.a
> - BUS_INTERFACE DPLB = plb_v34_0
> - BUS_INTERFACE IPLB = plb_v34_0
> - END
> -
> - BEGIN opb_intc
> - PARAMETER INSTANCE = opb_intc_0
> - PARAMETER HW_VER = 1.00.c
> - PARAMETER C_BASEADDR = 0xD1000FC0
> - PARAMETER C_HIGHADDR = 0xD1000FDF
> - BUS_INTERFACE SOPB = opb_v20_0
> - END
> -
> - BEGIN opb_uart16550
> - PARAMETER INSTANCE = opb_uart16550_0
> - PARAMETER HW_VER = 1.00.d
> - PARAMETER C_BASEADDR = 0xa0000000
> - PARAMETER C_HIGHADDR = 0xa0001FFF
> - BUS_INTERFACE SOPB = opb_v20_0
> - END
> -
> - BEGIN plb_v34
> - PARAMETER INSTANCE = plb_v34_0
> - PARAMETER HW_VER = 1.02.a
> - END
> -
> - BEGIN plb_bram_if_cntlr
> - PARAMETER INSTANCE = plb_bram_if_cntlr_0
> - PARAMETER HW_VER = 1.00.b
> - PARAMETER C_BASEADDR = 0xFFFF0000
> - PARAMETER C_HIGHADDR = 0xFFFFFFFF
> - BUS_INTERFACE SPLB = plb_v34_0
> - END
> -
> - BEGIN plb2opb_bridge
> - PARAMETER INSTANCE = plb2opb_bridge_0
> - PARAMETER HW_VER = 1.01.a
> - PARAMETER C_RNG0_BASEADDR = 0x20000000
> - PARAMETER C_RNG0_HIGHADDR = 0x3FFFFFFF
> - PARAMETER C_RNG1_BASEADDR = 0x60000000
> - PARAMETER C_RNG1_HIGHADDR = 0x7FFFFFFF
> - PARAMETER C_RNG2_BASEADDR = 0x80000000
> - PARAMETER C_RNG2_HIGHADDR = 0xBFFFFFFF
> - PARAMETER C_RNG3_BASEADDR = 0xC0000000
> - PARAMETER C_RNG3_HIGHADDR = 0xDFFFFFFF
> - BUS_INTERFACE SPLB = plb_v34_0
> - BUS_INTERFACE MOPB = opb_v20_0
> - END
> -
> - Gives this device tree (some properties removed for clarity):
> -
> - plb@0 {
> - #address-cells = <1>;
> - #size-cells = <1>;
> - compatible = "xlnx,plb-v34-1.02.a";
> - device_type = "ibm,plb";
> - ranges; // 1:1 translation
> -
> - plb_bram_if_cntrl_0: bram@ffff0000 {
> - reg = <ffff0000 10000>;
> - }
> -
> - opb@20000000 {
> - #address-cells = <1>;
> - #size-cells = <1>;
> - ranges = <20000000 20000000 20000000
> - 60000000 60000000 20000000
> - 80000000 80000000 40000000
> - c0000000 c0000000 20000000>;
> -
> - opb_uart16550_0: serial@a0000000 {
> - reg = <a00000000 2000>;
> - };
> -
> - opb_intc_0: interrupt-controller@d1000fc0 {
> - reg = <d1000fc0 20>;
> - };
> - };
> - };
> -
> That covers the general approach to binding xilinx IP cores into the
> device tree. The following are bindings for specific devices:
>
> diff --git a/Documentation/powerpc/bootwrapper.rst b/Documentation/powerpc/bootwrapper.rst
> index a6292afba573..cdfa2bc8425f 100644
> --- a/Documentation/powerpc/bootwrapper.rst
> +++ b/Documentation/powerpc/bootwrapper.rst
> @@ -70,28 +70,6 @@ Currently, the following image format targets exist:
> kernel with this image type and it depends entirely on
> the embedded device tree for all information.
>
> - The simpleImage is useful for booting systems with
> - an unknown firmware interface or for booting from
> - a debugger when no firmware is present (such as on
> - the Xilinx Virtex platform). The only assumption that
> - simpleImage makes is that RAM is correctly initialized
> - and that the MMU is either off or has RAM mapped to
> - base address 0.
> -
> - simpleImage also supports inserting special platform
> - specific initialization code to the start of the bootup
> - sequence. The virtex405 platform uses this feature to
> - ensure that the cache is invalidated before caching
> - is enabled. Platform specific initialization code is
> - added as part of the wrapper script and is keyed on
> - the image target name. For example, all
> - simpleImage.virtex405-* targets will add the
> - virtex405-head.S initialization code (This also means
> - that the dts file for virtex405 targets should be
> - named (virtex405-<board>.dts). Search the wrapper
> - script for 'virtex405' and see the file
> - arch/powerpc/boot/virtex405-head.S for details.
> -
> treeImage.%; Image format for used with OpenBIOS firmware found
> on some ppc4xx hardware. This image embeds a device
> tree blob inside the image.
> @@ -116,10 +94,8 @@ Image types which embed a device tree blob (simpleImage, dtbImage, treeImage,
> and cuImage) all generate the device tree blob from a file in the
> arch/powerpc/boot/dts/ directory. The Makefile selects the correct device
> tree source based on the name of the target. Therefore, if the kernel is
> -built with 'make treeImage.walnut simpleImage.virtex405-ml403', then the
> -build system will use arch/powerpc/boot/dts/walnut.dts to build
> -treeImage.walnut and arch/powerpc/boot/dts/virtex405-ml403.dts to build
> -the simpleImage.virtex405-ml403.
> +built with 'make treeImage.walnut', then the build system will use
> +arch/powerpc/boot/dts/walnut.dts to build treeImage.walnut.
>
> Two special targets called 'zImage' and 'zImage.initrd' also exist. These
> targets build all the default images as selected by the kernel configuration.
> diff --git a/MAINTAINERS b/MAINTAINERS
> index a0d86490c2c6..842a9bbc2013 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -9668,12 +9668,6 @@ L: linuxppc-dev@lists.ozlabs.org
> S: Maintained
> F: arch/powerpc/platforms/8xx/
>
> -LINUX FOR POWERPC EMBEDDED XILINX VIRTEX
> -L: linuxppc-dev@lists.ozlabs.org
> -S: Orphan
> -F: arch/powerpc/*/*virtex*
> -F: arch/powerpc/*/*/*virtex*
> -
> LINUX FOR POWERPC PA SEMI PWRFICIENT
> L: linuxppc-dev@lists.ozlabs.org
> S: Orphan
> diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
> index 0b063830eea8..b88900f4832f 100644
> --- a/arch/powerpc/Kconfig.debug
> +++ b/arch/powerpc/Kconfig.debug
> @@ -230,7 +230,7 @@ config PPC_EARLY_DEBUG_40x
> help
> Select this to enable early debugging for IBM 40x chips via the
> inbuilt serial port. This works on chips with a 16550 compatible
> - UART. Xilinx chips with uartlite cannot use this option.
> + UART.
>
> config PPC_EARLY_DEBUG_CPM
> bool "Early serial debugging for Freescale CPM-based serial ports"
> diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
> index c53a1b8bba8b..d8077b7071dd 100644
> --- a/arch/powerpc/boot/Makefile
> +++ b/arch/powerpc/boot/Makefile
> @@ -79,7 +79,6 @@ $(obj)/treeboot-walnut.o: BOOTCFLAGS += -mcpu=405
> $(obj)/treeboot-iss4xx.o: BOOTCFLAGS += -mcpu=405
> $(obj)/treeboot-currituck.o: BOOTCFLAGS += -mcpu=405
> $(obj)/treeboot-akebono.o: BOOTCFLAGS += -mcpu=405
> -$(obj)/virtex405-head.o: BOOTAFLAGS += -mcpu=405
>
> # The pre-boot decompressors pull in a lot of kernel headers and other source
> # files. This creates a bit of a dependency headache since we need to copy
> @@ -129,14 +128,12 @@ src-wlib-$(CONFIG_44x) += 4xx.c ebony.c bamboo.c
> src-wlib-$(CONFIG_PPC_8xx) += mpc8xx.c planetcore.c fsl-soc.c
> src-wlib-$(CONFIG_PPC_82xx) += pq2.c fsl-soc.c planetcore.c
> src-wlib-$(CONFIG_EMBEDDED6xx) += ugecon.c fsl-soc.c
> -src-wlib-$(CONFIG_XILINX_VIRTEX) += uartlite.c
> src-wlib-$(CONFIG_CPM) += cpm-serial.c
>
> src-plat-y := of.c epapr.c
> src-plat-$(CONFIG_40x) += fixed-head.S ep405.c cuboot-hotfoot.c \
> treeboot-walnut.c cuboot-acadia.c \
> - cuboot-kilauea.c simpleboot.c \
> - virtex405-head.S virtex.c
> + cuboot-kilauea.c simpleboot.c
> src-plat-$(CONFIG_44x) += treeboot-ebony.c cuboot-ebony.c treeboot-bamboo.c \
> cuboot-bamboo.c cuboot-sam440ep.c \
> cuboot-sequoia.c cuboot-rainier.c \
> @@ -144,7 +141,7 @@ src-plat-$(CONFIG_44x) += treeboot-ebony.c cuboot-ebony.c treeboot-bamboo.c \
> cuboot-warp.c cuboot-yosemite.c \
> treeboot-iss4xx.c treeboot-currituck.c \
> treeboot-akebono.c \
> - simpleboot.c fixed-head.S virtex.c
> + simpleboot.c fixed-head.S
> src-plat-$(CONFIG_PPC_8xx) += cuboot-8xx.c fixed-head.S ep88xc.c redboot-8xx.c
> src-plat-$(CONFIG_PPC_MPC52xx) += cuboot-52xx.c
> src-plat-$(CONFIG_PPC_82xx) += cuboot-pq2.c fixed-head.S ep8248e.c cuboot-824x.c
> diff --git a/arch/powerpc/boot/dts/Makefile b/arch/powerpc/boot/dts/Makefile
> index 1cbc0e4ce857..fb335d05aae8 100644
> --- a/arch/powerpc/boot/dts/Makefile
> +++ b/arch/powerpc/boot/dts/Makefile
> @@ -4,4 +4,3 @@ subdir-y += fsl
>
> dtstree := $(srctree)/$(src)
> dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts))
> -dtb-$(CONFIG_XILINX_VIRTEX440_GENERIC_BOARD) += virtex440-ml507.dtb virtex440-ml510.dtb
> diff --git a/arch/powerpc/boot/dts/virtex440-ml507.dts b/arch/powerpc/boot/dts/virtex440-ml507.dts
> deleted file mode 100644
> index 66f1c6312de6..000000000000
> --- a/arch/powerpc/boot/dts/virtex440-ml507.dts
> +++ /dev/null
> @@ -1,406 +0,0 @@
> -/*
> - * This file supports the Xilinx ML507 board with the 440 processor.
> - * A reference design for the FPGA is provided at http://git.xilinx.com.
> - *
> - * (C) Copyright 2008 Xilinx, Inc.
> - *
> - * This file is licensed under the terms of the GNU General Public License
> - * version 2. This program is licensed "as is" without any warranty of any
> - * kind, whether express or implied.
> - *
> - * ---
> - *
> - * Device Tree Generator version: 1.1
> - *
> - * CAUTION: This file is automatically generated by libgen.
> - * Version: Xilinx EDK 10.1.03 EDK_K_SP3.6
> - *
> - * XPS project directory: ml507_ppc440_emb_ref
> - */
> -
> -/dts-v1/;
> -
> -/ {
> - #address-cells = <1>;
> - #size-cells = <1>;
> - compatible = "xlnx,virtex440";
> - dcr-parent = <&ppc440_0>;
> - model = "testing";
> - DDR2_SDRAM: memory@0 {
> - device_type = "memory";
> - reg = < 0 0x10000000 >;
> - } ;
> - chosen {
> - bootargs = "console=ttyS0 root=/dev/ram";
> - stdout-path = &RS232_Uart_1;
> - } ;
> - cpus {
> - #address-cells = <1>;
> - #cpus = <1>;
> - #size-cells = <0>;
> - ppc440_0: cpu@0 {
> - clock-frequency = <400000000>;
> - compatible = "PowerPC,440", "ibm,ppc440";
> - d-cache-line-size = <0x20>;
> - d-cache-size = <0x8000>;
> - dcr-access-method = "native";
> - dcr-controller ;
> - device_type = "cpu";
> - i-cache-line-size = <0x20>;
> - i-cache-size = <0x8000>;
> - model = "PowerPC,440";
> - reg = <0>;
> - timebase-frequency = <400000000>;
> - xlnx,apu-control = <1>;
> - xlnx,apu-udi-0 = <0>;
> - xlnx,apu-udi-1 = <0>;
> - xlnx,apu-udi-10 = <0>;
> - xlnx,apu-udi-11 = <0>;
> - xlnx,apu-udi-12 = <0>;
> - xlnx,apu-udi-13 = <0>;
> - xlnx,apu-udi-14 = <0>;
> - xlnx,apu-udi-15 = <0>;
> - xlnx,apu-udi-2 = <0>;
> - xlnx,apu-udi-3 = <0>;
> - xlnx,apu-udi-4 = <0>;
> - xlnx,apu-udi-5 = <0>;
> - xlnx,apu-udi-6 = <0>;
> - xlnx,apu-udi-7 = <0>;
> - xlnx,apu-udi-8 = <0>;
> - xlnx,apu-udi-9 = <0>;
> - xlnx,dcr-autolock-enable = <1>;
> - xlnx,dcu-rd-ld-cache-plb-prio = <0>;
> - xlnx,dcu-rd-noncache-plb-prio = <0>;
> - xlnx,dcu-rd-touch-plb-prio = <0>;
> - xlnx,dcu-rd-urgent-plb-prio = <0>;
> - xlnx,dcu-wr-flush-plb-prio = <0>;
> - xlnx,dcu-wr-store-plb-prio = <0>;
> - xlnx,dcu-wr-urgent-plb-prio = <0>;
> - xlnx,dma0-control = <0>;
> - xlnx,dma0-plb-prio = <0>;
> - xlnx,dma0-rxchannelctrl = <0x1010000>;
> - xlnx,dma0-rxirqtimer = <0x3ff>;
> - xlnx,dma0-txchannelctrl = <0x1010000>;
> - xlnx,dma0-txirqtimer = <0x3ff>;
> - xlnx,dma1-control = <0>;
> - xlnx,dma1-plb-prio = <0>;
> - xlnx,dma1-rxchannelctrl = <0x1010000>;
> - xlnx,dma1-rxirqtimer = <0x3ff>;
> - xlnx,dma1-txchannelctrl = <0x1010000>;
> - xlnx,dma1-txirqtimer = <0x3ff>;
> - xlnx,dma2-control = <0>;
> - xlnx,dma2-plb-prio = <0>;
> - xlnx,dma2-rxchannelctrl = <0x1010000>;
> - xlnx,dma2-rxirqtimer = <0x3ff>;
> - xlnx,dma2-txchannelctrl = <0x1010000>;
> - xlnx,dma2-txirqtimer = <0x3ff>;
> - xlnx,dma3-control = <0>;
> - xlnx,dma3-plb-prio = <0>;
> - xlnx,dma3-rxchannelctrl = <0x1010000>;
> - xlnx,dma3-rxirqtimer = <0x3ff>;
> - xlnx,dma3-txchannelctrl = <0x1010000>;
> - xlnx,dma3-txirqtimer = <0x3ff>;
> - xlnx,endian-reset = <0>;
> - xlnx,generate-plb-timespecs = <1>;
> - xlnx,icu-rd-fetch-plb-prio = <0>;
> - xlnx,icu-rd-spec-plb-prio = <0>;
> - xlnx,icu-rd-touch-plb-prio = <0>;
> - xlnx,interconnect-imask = <0xffffffff>;
> - xlnx,mplb-allow-lock-xfer = <1>;
> - xlnx,mplb-arb-mode = <0>;
> - xlnx,mplb-awidth = <0x20>;
> - xlnx,mplb-counter = <0x500>;
> - xlnx,mplb-dwidth = <0x80>;
> - xlnx,mplb-max-burst = <8>;
> - xlnx,mplb-native-dwidth = <0x80>;
> - xlnx,mplb-p2p = <0>;
> - xlnx,mplb-prio-dcur = <2>;
> - xlnx,mplb-prio-dcuw = <3>;
> - xlnx,mplb-prio-icu = <4>;
> - xlnx,mplb-prio-splb0 = <1>;
> - xlnx,mplb-prio-splb1 = <0>;
> - xlnx,mplb-read-pipe-enable = <1>;
> - xlnx,mplb-sync-tattribute = <0>;
> - xlnx,mplb-wdog-enable = <1>;
> - xlnx,mplb-write-pipe-enable = <1>;
> - xlnx,mplb-write-post-enable = <1>;
> - xlnx,num-dma = <1>;
> - xlnx,pir = <0xf>;
> - xlnx,ppc440mc-addr-base = <0>;
> - xlnx,ppc440mc-addr-high = <0xfffffff>;
> - xlnx,ppc440mc-arb-mode = <0>;
> - xlnx,ppc440mc-bank-conflict-mask = <0xc00000>;
> - xlnx,ppc440mc-control = <0xf810008f>;
> - xlnx,ppc440mc-max-burst = <8>;
> - xlnx,ppc440mc-prio-dcur = <2>;
> - xlnx,ppc440mc-prio-dcuw = <3>;
> - xlnx,ppc440mc-prio-icu = <4>;
> - xlnx,ppc440mc-prio-splb0 = <1>;
> - xlnx,ppc440mc-prio-splb1 = <0>;
> - xlnx,ppc440mc-row-conflict-mask = <0x3ffe00>;
> - xlnx,ppcdm-asyncmode = <0>;
> - xlnx,ppcds-asyncmode = <0>;
> - xlnx,user-reset = <0>;
> - DMA0: sdma@80 {
> - compatible = "xlnx,ll-dma-1.00.a";
> - dcr-reg = < 0x80 0x11 >;
> - interrupt-parent = <&xps_intc_0>;
> - interrupts = < 10 2 11 2 >;
> - } ;
> - } ;
> - } ;
> - plb_v46_0: plb@0 {
> - #address-cells = <1>;
> - #size-cells = <1>;
> - compatible = "xlnx,plb-v46-1.03.a", "simple-bus";
> - ranges ;
> - DIP_Switches_8Bit: gpio@81460000 {
> - compatible = "xlnx,xps-gpio-1.00.a";
> - interrupt-parent = <&xps_intc_0>;
> - interrupts = < 7 2 >;
> - reg = < 0x81460000 0x10000 >;
> - xlnx,all-inputs = <1>;
> - xlnx,all-inputs-2 = <0>;
> - xlnx,dout-default = <0>;
> - xlnx,dout-default-2 = <0>;
> - xlnx,family = "virtex5";
> - xlnx,gpio-width = <8>;
> - xlnx,interrupt-present = <1>;
> - xlnx,is-bidir = <1>;
> - xlnx,is-bidir-2 = <1>;
> - xlnx,is-dual = <0>;
> - xlnx,tri-default = <0xffffffff>;
> - xlnx,tri-default-2 = <0xffffffff>;
> - } ;
> - FLASH: flash@fc000000 {
> - bank-width = <2>;
> - compatible = "xlnx,xps-mch-emc-2.00.a", "cfi-flash";
> - reg = < 0xfc000000 0x2000000 >;
> - xlnx,family = "virtex5";
> - xlnx,include-datawidth-matching-0 = <0x1>;
> - xlnx,include-datawidth-matching-1 = <0x0>;
> - xlnx,include-datawidth-matching-2 = <0x0>;
> - xlnx,include-datawidth-matching-3 = <0x0>;
> - xlnx,include-negedge-ioregs = <0x0>;
> - xlnx,include-plb-ipif = <0x1>;
> - xlnx,include-wrbuf = <0x1>;
> - xlnx,max-mem-width = <0x10>;
> - xlnx,mch-native-dwidth = <0x20>;
> - xlnx,mch-plb-clk-period-ps = <0x2710>;
> - xlnx,mch-splb-awidth = <0x20>;
> - xlnx,mch0-accessbuf-depth = <0x10>;
> - xlnx,mch0-protocol = <0x0>;
> - xlnx,mch0-rddatabuf-depth = <0x10>;
> - xlnx,mch1-accessbuf-depth = <0x10>;
> - xlnx,mch1-protocol = <0x0>;
> - xlnx,mch1-rddatabuf-depth = <0x10>;
> - xlnx,mch2-accessbuf-depth = <0x10>;
> - xlnx,mch2-protocol = <0x0>;
> - xlnx,mch2-rddatabuf-depth = <0x10>;
> - xlnx,mch3-accessbuf-depth = <0x10>;
> - xlnx,mch3-protocol = <0x0>;
> - xlnx,mch3-rddatabuf-depth = <0x10>;
> - xlnx,mem0-width = <0x10>;
> - xlnx,mem1-width = <0x20>;
> - xlnx,mem2-width = <0x20>;
> - xlnx,mem3-width = <0x20>;
> - xlnx,num-banks-mem = <0x1>;
> - xlnx,num-channels = <0x2>;
> - xlnx,priority-mode = <0x0>;
> - xlnx,synch-mem-0 = <0x0>;
> - xlnx,synch-mem-1 = <0x0>;
> - xlnx,synch-mem-2 = <0x0>;
> - xlnx,synch-mem-3 = <0x0>;
> - xlnx,synch-pipedelay-0 = <0x2>;
> - xlnx,synch-pipedelay-1 = <0x2>;
> - xlnx,synch-pipedelay-2 = <0x2>;
> - xlnx,synch-pipedelay-3 = <0x2>;
> - xlnx,tavdv-ps-mem-0 = <0x1adb0>;
> - xlnx,tavdv-ps-mem-1 = <0x3a98>;
> - xlnx,tavdv-ps-mem-2 = <0x3a98>;
> - xlnx,tavdv-ps-mem-3 = <0x3a98>;
> - xlnx,tcedv-ps-mem-0 = <0x1adb0>;
> - xlnx,tcedv-ps-mem-1 = <0x3a98>;
> - xlnx,tcedv-ps-mem-2 = <0x3a98>;
> - xlnx,tcedv-ps-mem-3 = <0x3a98>;
> - xlnx,thzce-ps-mem-0 = <0x88b8>;
> - xlnx,thzce-ps-mem-1 = <0x1b58>;
> - xlnx,thzce-ps-mem-2 = <0x1b58>;
> - xlnx,thzce-ps-mem-3 = <0x1b58>;
> - xlnx,thzoe-ps-mem-0 = <0x1b58>;
> - xlnx,thzoe-ps-mem-1 = <0x1b58>;
> - xlnx,thzoe-ps-mem-2 = <0x1b58>;
> - xlnx,thzoe-ps-mem-3 = <0x1b58>;
> - xlnx,tlzwe-ps-mem-0 = <0x88b8>;
> - xlnx,tlzwe-ps-mem-1 = <0x0>;
> - xlnx,tlzwe-ps-mem-2 = <0x0>;
> - xlnx,tlzwe-ps-mem-3 = <0x0>;
> - xlnx,twc-ps-mem-0 = <0x2af8>;
> - xlnx,twc-ps-mem-1 = <0x3a98>;
> - xlnx,twc-ps-mem-2 = <0x3a98>;
> - xlnx,twc-ps-mem-3 = <0x3a98>;
> - xlnx,twp-ps-mem-0 = <0x11170>;
> - xlnx,twp-ps-mem-1 = <0x2ee0>;
> - xlnx,twp-ps-mem-2 = <0x2ee0>;
> - xlnx,twp-ps-mem-3 = <0x2ee0>;
> - xlnx,xcl0-linesize = <0x4>;
> - xlnx,xcl0-writexfer = <0x1>;
> - xlnx,xcl1-linesize = <0x4>;
> - xlnx,xcl1-writexfer = <0x1>;
> - xlnx,xcl2-linesize = <0x4>;
> - xlnx,xcl2-writexfer = <0x1>;
> - xlnx,xcl3-linesize = <0x4>;
> - xlnx,xcl3-writexfer = <0x1>;
> - } ;
> - Hard_Ethernet_MAC: xps-ll-temac@81c00000 {
> - #address-cells = <1>;
> - #size-cells = <1>;
> - compatible = "xlnx,compound";
> - ethernet@81c00000 {
> - #address-cells = <1>;
> - #size-cells = <0>;
> - compatible = "xlnx,xps-ll-temac-1.01.b";
> - device_type = "network";
> - interrupt-parent = <&xps_intc_0>;
> - interrupts = < 5 2 >;
> - llink-connected = <&DMA0>;
> - local-mac-address = [ 02 00 00 00 00 00 ];
> - reg = < 0x81c00000 0x40 >;
> - xlnx,bus2core-clk-ratio = <1>;
> - xlnx,phy-type = <1>;
> - xlnx,phyaddr = <1>;
> - xlnx,rxcsum = <1>;
> - xlnx,rxfifo = <0x1000>;
> - xlnx,temac-type = <0>;
> - xlnx,txcsum = <1>;
> - xlnx,txfifo = <0x1000>;
> - phy-handle = <&phy7>;
> - clock-frequency = <100000000>;
> - phy7: phy@7 {
> - compatible = "marvell,88e1111";
> - reg = <7>;
> - } ;
> - } ;
> - } ;
> - IIC_EEPROM: i2c@81600000 {
> - compatible = "xlnx,xps-iic-2.00.a";
> - interrupt-parent = <&xps_intc_0>;
> - interrupts = < 6 2 >;
> - reg = < 0x81600000 0x10000 >;
> - xlnx,clk-freq = <0x5f5e100>;
> - xlnx,family = "virtex5";
> - xlnx,gpo-width = <0x1>;
> - xlnx,iic-freq = <0x186a0>;
> - xlnx,scl-inertial-delay = <0x0>;
> - xlnx,sda-inertial-delay = <0x0>;
> - xlnx,ten-bit-adr = <0x0>;
> - } ;
> - LEDs_8Bit: gpio@81400000 {
> - compatible = "xlnx,xps-gpio-1.00.a";
> - reg = < 0x81400000 0x10000 >;
> - xlnx,all-inputs = <0>;
> - xlnx,all-inputs-2 = <0>;
> - xlnx,dout-default = <0>;
> - xlnx,dout-default-2 = <0>;
> - xlnx,family = "virtex5";
> - xlnx,gpio-width = <8>;
> - xlnx,interrupt-present = <0>;
> - xlnx,is-bidir = <1>;
> - xlnx,is-bidir-2 = <1>;
> - xlnx,is-dual = <0>;
> - xlnx,tri-default = <0xffffffff>;
> - xlnx,tri-default-2 = <0xffffffff>;
> - } ;
> - LEDs_Positions: gpio@81420000 {
> - compatible = "xlnx,xps-gpio-1.00.a";
> - reg = < 0x81420000 0x10000 >;
> - xlnx,all-inputs = <0>;
> - xlnx,all-inputs-2 = <0>;
> - xlnx,dout-default = <0>;
> - xlnx,dout-default-2 = <0>;
> - xlnx,family = "virtex5";
> - xlnx,gpio-width = <5>;
> - xlnx,interrupt-present = <0>;
> - xlnx,is-bidir = <1>;
> - xlnx,is-bidir-2 = <1>;
> - xlnx,is-dual = <0>;
> - xlnx,tri-default = <0xffffffff>;
> - xlnx,tri-default-2 = <0xffffffff>;
> - } ;
> - Push_Buttons_5Bit: gpio@81440000 {
> - compatible = "xlnx,xps-gpio-1.00.a";
> - interrupt-parent = <&xps_intc_0>;
> - interrupts = < 8 2 >;
> - reg = < 0x81440000 0x10000 >;
> - xlnx,all-inputs = <1>;
> - xlnx,all-inputs-2 = <0>;
> - xlnx,dout-default = <0>;
> - xlnx,dout-default-2 = <0>;
> - xlnx,family = "virtex5";
> - xlnx,gpio-width = <5>;
> - xlnx,interrupt-present = <1>;
> - xlnx,is-bidir = <1>;
> - xlnx,is-bidir-2 = <1>;
> - xlnx,is-dual = <0>;
> - xlnx,tri-default = <0xffffffff>;
> - xlnx,tri-default-2 = <0xffffffff>;
> - } ;
> - RS232_Uart_1: serial@83e00000 {
> - clock-frequency = <100000000>;
> - compatible = "xlnx,xps-uart16550-2.00.b", "ns16550";
> - current-speed = <9600>;
> - device_type = "serial";
> - interrupt-parent = <&xps_intc_0>;
> - interrupts = < 9 2 >;
> - reg = < 0x83e00000 0x10000 >;
> - reg-offset = <0x1003>;
> - reg-shift = <2>;
> - xlnx,family = "virtex5";
> - xlnx,has-external-rclk = <0>;
> - xlnx,has-external-xin = <0>;
> - xlnx,is-a-16550 = <1>;
> - } ;
> - SysACE_CompactFlash: sysace@83600000 {
> - compatible = "xlnx,xps-sysace-1.00.a";
> - interrupt-parent = <&xps_intc_0>;
> - interrupts = < 4 2 >;
> - reg = < 0x83600000 0x10000 >;
> - xlnx,family = "virtex5";
> - xlnx,mem-width = <0x10>;
> - } ;
> - xps_bram_if_cntlr_1: xps-bram-if-cntlr@ffff0000 {
> - compatible = "xlnx,xps-bram-if-cntlr-1.00.a";
> - reg = < 0xffff0000 0x10000 >;
> - xlnx,family = "virtex5";
> - } ;
> - xps_intc_0: interrupt-controller@81800000 {
> - #interrupt-cells = <2>;
> - compatible = "xlnx,xps-intc-1.00.a";
> - interrupt-controller ;
> - reg = < 0x81800000 0x10000 >;
> - xlnx,num-intr-inputs = <0xc>;
> - } ;
> - xps_timebase_wdt_1: xps-timebase-wdt@83a00000 {
> - compatible = "xlnx,xps-timebase-wdt-1.00.b";
> - interrupt-parent = <&xps_intc_0>;
> - interrupts = < 2 0 1 2 >;
> - reg = < 0x83a00000 0x10000 >;
> - xlnx,family = "virtex5";
> - xlnx,wdt-enable-once = <0>;
> - xlnx,wdt-interval = <0x1e>;
> - } ;
> - xps_timer_1: timer@83c00000 {
> - compatible = "xlnx,xps-timer-1.00.a";
> - interrupt-parent = <&xps_intc_0>;
> - interrupts = < 3 2 >;
> - reg = < 0x83c00000 0x10000 >;
> - xlnx,count-width = <0x20>;
> - xlnx,family = "virtex5";
> - xlnx,gen0-assert = <1>;
> - xlnx,gen1-assert = <1>;
> - xlnx,one-timer-only = <1>;
> - xlnx,trig0-assert = <1>;
> - xlnx,trig1-assert = <1>;
> - } ;
> - } ;
> -} ;
> diff --git a/arch/powerpc/boot/dts/virtex440-ml510.dts b/arch/powerpc/boot/dts/virtex440-ml510.dts
> deleted file mode 100644
> index 3b736ca26ddc..000000000000
> --- a/arch/powerpc/boot/dts/virtex440-ml510.dts
> +++ /dev/null
> @@ -1,466 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0
> -/*
> - * Xilinx ML510 Reference Design support
> - *
> - * This DTS file was created for the ml510_bsb1_pcores_ppc440 reference design.
> - * The reference design contains a bug which prevent PCI DMA from working
> - * properly. A description of the bug is given in the plbv46_pci section. It
> - * needs to be fixed by the user until Xilinx updates their reference design.
> - *
> - * Copyright 2009, Roderick Colenbrander
> - */
> -
> -/dts-v1/;
> -/ {
> - #address-cells = <1>;
> - #size-cells = <1>;
> - compatible = "xlnx,ml510-ref-design", "xlnx,virtex440";
> - dcr-parent = <&ppc440_0>;
> - DDR2_SDRAM_DIMM0: memory@0 {
> - device_type = "memory";
> - reg = < 0x0 0x20000000 >;
> - } ;
> - alias {
> - ethernet0 = &Hard_Ethernet_MAC;
> - serial0 = &RS232_Uart_1;
> - } ;
> - chosen {
> - bootargs = "console=ttyS0 root=/dev/ram";
> - stdout-path = "/plb@0/serial@83e00000";
> - } ;
> - cpus {
> - #address-cells = <1>;
> - #cpus = <0x1>;
> - #size-cells = <0>;
> - ppc440_0: cpu@0 {
> - #address-cells = <1>;
> - #size-cells = <1>;
> - clock-frequency = <300000000>;
> - compatible = "PowerPC,440", "ibm,ppc440";
> - d-cache-line-size = <0x20>;
> - d-cache-size = <0x8000>;
> - dcr-access-method = "native";
> - dcr-controller ;
> - device_type = "cpu";
> - i-cache-line-size = <0x20>;
> - i-cache-size = <0x8000>;
> - model = "PowerPC,440";
> - reg = <0>;
> - timebase-frequency = <300000000>;
> - xlnx,apu-control = <0x2000>;
> - xlnx,apu-udi-0 = <0x0>;
> - xlnx,apu-udi-1 = <0x0>;
> - xlnx,apu-udi-10 = <0x0>;
> - xlnx,apu-udi-11 = <0x0>;
> - xlnx,apu-udi-12 = <0x0>;
> - xlnx,apu-udi-13 = <0x0>;
> - xlnx,apu-udi-14 = <0x0>;
> - xlnx,apu-udi-15 = <0x0>;
> - xlnx,apu-udi-2 = <0x0>;
> - xlnx,apu-udi-3 = <0x0>;
> - xlnx,apu-udi-4 = <0x0>;
> - xlnx,apu-udi-5 = <0x0>;
> - xlnx,apu-udi-6 = <0x0>;
> - xlnx,apu-udi-7 = <0x0>;
> - xlnx,apu-udi-8 = <0x0>;
> - xlnx,apu-udi-9 = <0x0>;
> - xlnx,dcr-autolock-enable = <0x1>;
> - xlnx,dcu-rd-ld-cache-plb-prio = <0x0>;
> - xlnx,dcu-rd-noncache-plb-prio = <0x0>;
> - xlnx,dcu-rd-touch-plb-prio = <0x0>;
> - xlnx,dcu-rd-urgent-plb-prio = <0x0>;
> - xlnx,dcu-wr-flush-plb-prio = <0x0>;
> - xlnx,dcu-wr-store-plb-prio = <0x0>;
> - xlnx,dcu-wr-urgent-plb-prio = <0x0>;
> - xlnx,dma0-control = <0x0>;
> - xlnx,dma0-plb-prio = <0x0>;
> - xlnx,dma0-rxchannelctrl = <0x1010000>;
> - xlnx,dma0-rxirqtimer = <0x3ff>;
> - xlnx,dma0-txchannelctrl = <0x1010000>;
> - xlnx,dma0-txirqtimer = <0x3ff>;
> - xlnx,dma1-control = <0x0>;
> - xlnx,dma1-plb-prio = <0x0>;
> - xlnx,dma1-rxchannelctrl = <0x1010000>;
> - xlnx,dma1-rxirqtimer = <0x3ff>;
> - xlnx,dma1-txchannelctrl = <0x1010000>;
> - xlnx,dma1-txirqtimer = <0x3ff>;
> - xlnx,dma2-control = <0x0>;
> - xlnx,dma2-plb-prio = <0x0>;
> - xlnx,dma2-rxchannelctrl = <0x1010000>;
> - xlnx,dma2-rxirqtimer = <0x3ff>;
> - xlnx,dma2-txchannelctrl = <0x1010000>;
> - xlnx,dma2-txirqtimer = <0x3ff>;
> - xlnx,dma3-control = <0x0>;
> - xlnx,dma3-plb-prio = <0x0>;
> - xlnx,dma3-rxchannelctrl = <0x1010000>;
> - xlnx,dma3-rxirqtimer = <0x3ff>;
> - xlnx,dma3-txchannelctrl = <0x1010000>;
> - xlnx,dma3-txirqtimer = <0x3ff>;
> - xlnx,endian-reset = <0x0>;
> - xlnx,generate-plb-timespecs = <0x1>;
> - xlnx,icu-rd-fetch-plb-prio = <0x0>;
> - xlnx,icu-rd-spec-plb-prio = <0x0>;
> - xlnx,icu-rd-touch-plb-prio = <0x0>;
> - xlnx,interconnect-imask = <0xffffffff>;
> - xlnx,mplb-allow-lock-xfer = <0x1>;
> - xlnx,mplb-arb-mode = <0x0>;
> - xlnx,mplb-awidth = <0x20>;
> - xlnx,mplb-counter = <0x500>;
> - xlnx,mplb-dwidth = <0x80>;
> - xlnx,mplb-max-burst = <0x8>;
> - xlnx,mplb-native-dwidth = <0x80>;
> - xlnx,mplb-p2p = <0x0>;
> - xlnx,mplb-prio-dcur = <0x2>;
> - xlnx,mplb-prio-dcuw = <0x3>;
> - xlnx,mplb-prio-icu = <0x4>;
> - xlnx,mplb-prio-splb0 = <0x1>;
> - xlnx,mplb-prio-splb1 = <0x0>;
> - xlnx,mplb-read-pipe-enable = <0x1>;
> - xlnx,mplb-sync-tattribute = <0x0>;
> - xlnx,mplb-wdog-enable = <0x1>;
> - xlnx,mplb-write-pipe-enable = <0x1>;
> - xlnx,mplb-write-post-enable = <0x1>;
> - xlnx,num-dma = <0x0>;
> - xlnx,pir = <0xf>;
> - xlnx,ppc440mc-addr-base = <0x0>;
> - xlnx,ppc440mc-addr-high = <0x1fffffff>;
> - xlnx,ppc440mc-arb-mode = <0x0>;
> - xlnx,ppc440mc-bank-conflict-mask = <0x1800000>;
> - xlnx,ppc440mc-control = <0xf810008f>;
> - xlnx,ppc440mc-max-burst = <0x8>;
> - xlnx,ppc440mc-prio-dcur = <0x2>;
> - xlnx,ppc440mc-prio-dcuw = <0x3>;
> - xlnx,ppc440mc-prio-icu = <0x4>;
> - xlnx,ppc440mc-prio-splb0 = <0x1>;
> - xlnx,ppc440mc-prio-splb1 = <0x0>;
> - xlnx,ppc440mc-row-conflict-mask = <0x7ffe00>;
> - xlnx,ppcdm-asyncmode = <0x0>;
> - xlnx,ppcds-asyncmode = <0x0>;
> - xlnx,user-reset = <0x0>;
> - } ;
> - } ;
> - plb_v46_0: plb@0 {
> - #address-cells = <1>;
> - #size-cells = <1>;
> - compatible = "xlnx,plb-v46-1.03.a", "simple-bus";
> - ranges ;
> - FLASH: flash@fc000000 {
> - bank-width = <2>;
> - compatible = "xlnx,xps-mch-emc-2.00.a", "cfi-flash";
> - reg = < 0xfc000000 0x2000000 >;
> - xlnx,family = "virtex5";
> - xlnx,include-datawidth-matching-0 = <0x1>;
> - xlnx,include-datawidth-matching-1 = <0x0>;
> - xlnx,include-datawidth-matching-2 = <0x0>;
> - xlnx,include-datawidth-matching-3 = <0x0>;
> - xlnx,include-negedge-ioregs = <0x0>;
> - xlnx,include-plb-ipif = <0x1>;
> - xlnx,include-wrbuf = <0x1>;
> - xlnx,max-mem-width = <0x10>;
> - xlnx,mch-native-dwidth = <0x20>;
> - xlnx,mch-plb-clk-period-ps = <0x2710>;
> - xlnx,mch-splb-awidth = <0x20>;
> - xlnx,mch0-accessbuf-depth = <0x10>;
> - xlnx,mch0-protocol = <0x0>;
> - xlnx,mch0-rddatabuf-depth = <0x10>;
> - xlnx,mch1-accessbuf-depth = <0x10>;
> - xlnx,mch1-protocol = <0x0>;
> - xlnx,mch1-rddatabuf-depth = <0x10>;
> - xlnx,mch2-accessbuf-depth = <0x10>;
> - xlnx,mch2-protocol = <0x0>;
> - xlnx,mch2-rddatabuf-depth = <0x10>;
> - xlnx,mch3-accessbuf-depth = <0x10>;
> - xlnx,mch3-protocol = <0x0>;
> - xlnx,mch3-rddatabuf-depth = <0x10>;
> - xlnx,mem0-width = <0x10>;
> - xlnx,mem1-width = <0x20>;
> - xlnx,mem2-width = <0x20>;
> - xlnx,mem3-width = <0x20>;
> - xlnx,num-banks-mem = <0x1>;
> - xlnx,num-channels = <0x2>;
> - xlnx,priority-mode = <0x0>;
> - xlnx,synch-mem-0 = <0x0>;
> - xlnx,synch-mem-1 = <0x0>;
> - xlnx,synch-mem-2 = <0x0>;
> - xlnx,synch-mem-3 = <0x0>;
> - xlnx,synch-pipedelay-0 = <0x2>;
> - xlnx,synch-pipedelay-1 = <0x2>;
> - xlnx,synch-pipedelay-2 = <0x2>;
> - xlnx,synch-pipedelay-3 = <0x2>;
> - xlnx,tavdv-ps-mem-0 = <0x1adb0>;
> - xlnx,tavdv-ps-mem-1 = <0x3a98>;
> - xlnx,tavdv-ps-mem-2 = <0x3a98>;
> - xlnx,tavdv-ps-mem-3 = <0x3a98>;
> - xlnx,tcedv-ps-mem-0 = <0x1adb0>;
> - xlnx,tcedv-ps-mem-1 = <0x3a98>;
> - xlnx,tcedv-ps-mem-2 = <0x3a98>;
> - xlnx,tcedv-ps-mem-3 = <0x3a98>;
> - xlnx,thzce-ps-mem-0 = <0x88b8>;
> - xlnx,thzce-ps-mem-1 = <0x1b58>;
> - xlnx,thzce-ps-mem-2 = <0x1b58>;
> - xlnx,thzce-ps-mem-3 = <0x1b58>;
> - xlnx,thzoe-ps-mem-0 = <0x1b58>;
> - xlnx,thzoe-ps-mem-1 = <0x1b58>;
> - xlnx,thzoe-ps-mem-2 = <0x1b58>;
> - xlnx,thzoe-ps-mem-3 = <0x1b58>;
> - xlnx,tlzwe-ps-mem-0 = <0x88b8>;
> - xlnx,tlzwe-ps-mem-1 = <0x0>;
> - xlnx,tlzwe-ps-mem-2 = <0x0>;
> - xlnx,tlzwe-ps-mem-3 = <0x0>;
> - xlnx,twc-ps-mem-0 = <0x1adb0>;
> - xlnx,twc-ps-mem-1 = <0x3a98>;
> - xlnx,twc-ps-mem-2 = <0x3a98>;
> - xlnx,twc-ps-mem-3 = <0x3a98>;
> - xlnx,twp-ps-mem-0 = <0x11170>;
> - xlnx,twp-ps-mem-1 = <0x2ee0>;
> - xlnx,twp-ps-mem-2 = <0x2ee0>;
> - xlnx,twp-ps-mem-3 = <0x2ee0>;
> - xlnx,xcl0-linesize = <0x4>;
> - xlnx,xcl0-writexfer = <0x1>;
> - xlnx,xcl1-linesize = <0x4>;
> - xlnx,xcl1-writexfer = <0x1>;
> - xlnx,xcl2-linesize = <0x4>;
> - xlnx,xcl2-writexfer = <0x1>;
> - xlnx,xcl3-linesize = <0x4>;
> - xlnx,xcl3-writexfer = <0x1>;
> - } ;
> - Hard_Ethernet_MAC: xps-ll-temac@81c00000 {
> - #address-cells = <1>;
> - #size-cells = <1>;
> - compatible = "xlnx,compound";
> - ethernet@81c00000 {
> - compatible = "xlnx,xps-ll-temac-1.01.b";
> - device_type = "network";
> - interrupt-parent = <&xps_intc_0>;
> - interrupts = < 8 2 >;
> - llink-connected = <&Hard_Ethernet_MAC_fifo>;
> - local-mac-address = [ 02 00 00 00 00 00 ];
> - reg = < 0x81c00000 0x40 >;
> - xlnx,bus2core-clk-ratio = <0x1>;
> - xlnx,phy-type = <0x3>;
> - xlnx,phyaddr = <0x1>;
> - xlnx,rxcsum = <0x0>;
> - xlnx,rxfifo = <0x8000>;
> - xlnx,temac-type = <0x0>;
> - xlnx,txcsum = <0x0>;
> - xlnx,txfifo = <0x8000>;
> - } ;
> - } ;
> - Hard_Ethernet_MAC_fifo: xps-ll-fifo@81a00000 {
> - compatible = "xlnx,xps-ll-fifo-1.01.a";
> - interrupt-parent = <&xps_intc_0>;
> - interrupts = < 6 2 >;
> - reg = < 0x81a00000 0x10000 >;
> - xlnx,family = "virtex5";
> - } ;
> - IIC_EEPROM: i2c@81600000 {
> - compatible = "xlnx,xps-iic-2.00.a";
> - interrupt-parent = <&xps_intc_0>;
> - interrupts = < 9 2 >;
> - reg = < 0x81600000 0x10000 >;
> - xlnx,clk-freq = <0x5f5e100>;
> - xlnx,family = "virtex5";
> - xlnx,gpo-width = <0x1>;
> - xlnx,iic-freq = <0x186a0>;
> - xlnx,scl-inertial-delay = <0x5>;
> - xlnx,sda-inertial-delay = <0x5>;
> - xlnx,ten-bit-adr = <0x0>;
> - } ;
> - LCD_OPTIONAL: gpio@81420000 {
> - compatible = "xlnx,xps-gpio-1.00.a";
> - reg = < 0x81420000 0x10000 >;
> - xlnx,all-inputs = <0x0>;
> - xlnx,all-inputs-2 = <0x0>;
> - xlnx,dout-default = <0x0>;
> - xlnx,dout-default-2 = <0x0>;
> - xlnx,family = "virtex5";
> - xlnx,gpio-width = <0xb>;
> - xlnx,interrupt-present = <0x0>;
> - xlnx,is-bidir = <0x1>;
> - xlnx,is-bidir-2 = <0x1>;
> - xlnx,is-dual = <0x0>;
> - xlnx,tri-default = <0xffffffff>;
> - xlnx,tri-default-2 = <0xffffffff>;
> - } ;
> - LEDs_4Bit: gpio@81400000 {
> - compatible = "xlnx,xps-gpio-1.00.a";
> - reg = < 0x81400000 0x10000 >;
> - xlnx,all-inputs = <0x0>;
> - xlnx,all-inputs-2 = <0x0>;
> - xlnx,dout-default = <0x0>;
> - xlnx,dout-default-2 = <0x0>;
> - xlnx,family = "virtex5";
> - xlnx,gpio-width = <0x4>;
> - xlnx,interrupt-present = <0x0>;
> - xlnx,is-bidir = <0x1>;
> - xlnx,is-bidir-2 = <0x1>;
> - xlnx,is-dual = <0x0>;
> - xlnx,tri-default = <0xffffffff>;
> - xlnx,tri-default-2 = <0xffffffff>;
> - } ;
> - RS232_Uart_1: serial@83e00000 {
> - clock-frequency = <100000000>;
> - compatible = "xlnx,xps-uart16550-2.00.b", "ns16550";
> - current-speed = <9600>;
> - device_type = "serial";
> - interrupt-parent = <&xps_intc_0>;
> - interrupts = < 11 2 >;
> - reg = < 0x83e00000 0x10000 >;
> - reg-offset = <0x1003>;
> - reg-shift = <2>;
> - xlnx,family = "virtex5";
> - xlnx,has-external-rclk = <0x0>;
> - xlnx,has-external-xin = <0x0>;
> - xlnx,is-a-16550 = <0x1>;
> - } ;
> - SPI_EEPROM: xps-spi@feff8000 {
> - compatible = "xlnx,xps-spi-2.00.b";
> - interrupt-parent = <&xps_intc_0>;
> - interrupts = < 10 2 >;
> - reg = < 0xfeff8000 0x80 >;
> - xlnx,family = "virtex5";
> - xlnx,fifo-exist = <0x1>;
> - xlnx,num-ss-bits = <0x1>;
> - xlnx,num-transfer-bits = <0x8>;
> - xlnx,sck-ratio = <0x80>;
> - } ;
> - SysACE_CompactFlash: sysace@83600000 {
> - compatible = "xlnx,xps-sysace-1.00.a";
> - interrupt-parent = <&xps_intc_0>;
> - interrupts = < 7 2 >;
> - reg = < 0x83600000 0x10000 >;
> - xlnx,family = "virtex5";
> - xlnx,mem-width = <0x10>;
> - } ;
> - plbv46_pci_0: plbv46-pci@85e00000 {
> - #size-cells = <2>;
> - #address-cells = <3>;
> - compatible = "xlnx,plbv46-pci-1.03.a";
> - device_type = "pci";
> - reg = < 0x85e00000 0x10000 >;
> -
> - /*
> - * The default ML510 BSB has C_IPIFBAR2PCIBAR_0 set to
> - * 0 which means that a read/write to the memory mapped
> - * i/o region (which starts at 0xa0000000) for pci
> - * bar 0 on the plb side translates to 0.
> - * It is important to set this value to 0xa0000000, so
> - * that inbound and outbound pci transactions work
> - * properly including DMA.
> - */
> - ranges = <0x02000000 0 0xa0000000 0xa0000000 0 0x20000000
> - 0x01000000 0 0x00000000 0xf0000000 0 0x00010000>;
> -
> - #interrupt-cells = <1>;
> - interrupt-parent = <&xps_intc_0>;
> - interrupt-map-mask = <0xff00 0x0 0x0 0x7>;
> - interrupt-map = <
> - /* IRQ mapping for pci slots and ALI M1533
> - * periperhals. In total there are 5 interrupt
> - * lines connected to a xps_intc controller.
> - * Four of them are PCI IRQ A, B, C, D and
> - * which correspond to respectively xpx_intc
> - * 5, 4, 3 and 2. The fifth interrupt line is
> - * connected to the south bridge and this one
> - * uses irq 1 and is active high instead of
> - * active low.
> - *
> - * The M1533 contains various peripherals
> - * including AC97 audio, a modem, USB, IDE and
> - * some power management stuff. The modem
> - * isn't connected on the ML510 and the power
> - * management core also isn't used.
> - */
> -
> - /* IDSEL 0x16 / dev=6, bus=0 / PCI slot 3 */
> - 0x3000 0 0 1 &xps_intc_0 3 2
> - 0x3000 0 0 2 &xps_intc_0 2 2
> - 0x3000 0 0 3 &xps_intc_0 5 2
> - 0x3000 0 0 4 &xps_intc_0 4 2
> -
> - /* IDSEL 0x13 / dev=3, bus=1 / PCI slot 4 */
> - /*
> - 0x11800 0 0 1 &xps_intc_0 5 0 2
> - 0x11800 0 0 2 &xps_intc_0 4 0 2
> - 0x11800 0 0 3 &xps_intc_0 3 0 2
> - 0x11800 0 0 4 &xps_intc_0 2 0 2
> - */
> -
> - /* According to the datasheet + schematic
> - * ABCD [FPGA] of slot 5 is mapped to DABC.
> - * Testing showed that at least A maps to B,
> - * the mapping of the other pins is a guess
> - * and for that reason the lines have been
> - * commented out.
> - */
> - /* IDSEL 0x15 / dev=5, bus=0 / PCI slot 5 */
> - 0x2800 0 0 1 &xps_intc_0 4 2
> - /*
> - 0x2800 0 0 2 &xps_intc_0 3 2
> - 0x2800 0 0 3 &xps_intc_0 2 2
> - 0x2800 0 0 4 &xps_intc_0 5 2
> - */
> -
> - /* IDSEL 0x12 / dev=2, bus=1 / PCI slot 6 */
> - /*
> - 0x11000 0 0 1 &xps_intc_0 4 0 2
> - 0x11000 0 0 2 &xps_intc_0 3 0 2
> - 0x11000 0 0 3 &xps_intc_0 2 0 2
> - 0x11000 0 0 4 &xps_intc_0 5 0 2
> - */
> -
> - /* IDSEL 0x11 / dev=1, bus=0 / AC97 audio */
> - 0x0800 0 0 1 &i8259 7 2
> -
> - /* IDSEL 0x1b / dev=11, bus=0 / IDE */
> - 0x5800 0 0 1 &i8259 14 2
> -
> - /* IDSEL 0x1f / dev 15, bus=0 / 2x USB 1.1 */
> - 0x7800 0 0 1 &i8259 7 2
> - >;
> - ali_m1533 {
> - #size-cells = <1>;
> - #address-cells = <2>;
> - i8259: interrupt-controller@20 {
> - reg = <1 0x20 2
> - 1 0xa0 2
> - 1 0x4d0 2>;
> - interrupt-controller;
> - device_type = "interrupt-controller";
> - #address-cells = <0>;
> - #interrupt-cells = <2>;
> - compatible = "chrp,iic";
> -
> - /* south bridge irq is active high */
> - interrupts = <1 3>;
> - interrupt-parent = <&xps_intc_0>;
> - };
> - };
> - } ;
> - xps_bram_if_cntlr_1: xps-bram-if-cntlr@ffff0000 {
> - compatible = "xlnx,xps-bram-if-cntlr-1.00.a";
> - reg = < 0xffff0000 0x10000 >;
> - xlnx,family = "virtex5";
> - } ;
> - xps_intc_0: interrupt-controller@81800000 {
> - #interrupt-cells = <0x2>;
> - compatible = "xlnx,xps-intc-1.00.a";
> - interrupt-controller ;
> - reg = < 0x81800000 0x10000 >;
> - xlnx,num-intr-inputs = <0xc>;
> - } ;
> - xps_tft_0: tft@86e00000 {
> - compatible = "xlnx,xps-tft-1.00.a";
> - reg = < 0x86e00000 0x10000 >;
> - xlnx,dcr-splb-slave-if = <0x1>;
> - xlnx,default-tft-base-addr = <0x0>;
> - xlnx,family = "virtex5";
> - xlnx,i2c-slave-addr = <0x76>;
> - xlnx,mplb-awidth = <0x20>;
> - xlnx,mplb-dwidth = <0x80>;
> - xlnx,mplb-native-dwidth = <0x40>;
> - xlnx,mplb-smallest-slave = <0x20>;
> - xlnx,tft-interface = <0x1>;
> - } ;
> - } ;
> -} ;
> diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h
> index e0606766480f..6455fc9a244f 100644
> --- a/arch/powerpc/boot/ops.h
> +++ b/arch/powerpc/boot/ops.h
> @@ -88,7 +88,6 @@ int serial_console_init(void);
> int ns16550_console_init(void *devp, struct serial_console_data *scdp);
> int cpm_console_init(void *devp, struct serial_console_data *scdp);
> int mpc5200_psc_console_init(void *devp, struct serial_console_data *scdp);
> -int uartlite_console_init(void *devp, struct serial_console_data *scdp);
> int opal_console_init(void *devp, struct serial_console_data *scdp);
> void *simple_alloc_init(char *base, unsigned long heap_size,
> unsigned long granularity, unsigned long max_allocs);
> diff --git a/arch/powerpc/boot/serial.c b/arch/powerpc/boot/serial.c
> index 9457863147f9..0bfa7e87e546 100644
> --- a/arch/powerpc/boot/serial.c
> +++ b/arch/powerpc/boot/serial.c
> @@ -132,11 +132,6 @@ int serial_console_init(void)
> else if (dt_is_compatible(devp, "fsl,mpc5200-psc-uart"))
> rc = mpc5200_psc_console_init(devp, &serial_cd);
> #endif
> -#ifdef CONFIG_XILINX_VIRTEX
> - else if (dt_is_compatible(devp, "xlnx,opb-uartlite-1.00.b") ||
> - dt_is_compatible(devp, "xlnx,xps-uartlite-1.00.a"))
> - rc = uartlite_console_init(devp, &serial_cd);
> -#endif
> #ifdef CONFIG_PPC64_BOOT_WRAPPER
> else if (dt_is_compatible(devp, "ibm,opal-console-raw"))
> rc = opal_console_init(devp, &serial_cd);
> diff --git a/arch/powerpc/boot/uartlite.c b/arch/powerpc/boot/uartlite.c
> deleted file mode 100644
> index 46bed69b4169..000000000000
> --- a/arch/powerpc/boot/uartlite.c
> +++ /dev/null
> @@ -1,79 +0,0 @@
> -/*
> - * Xilinx UARTLITE bootloader driver
> - *
> - * Copyright (C) 2007 Secret Lab Technologies Ltd.
> - *
> - * This file is licensed under the terms of the GNU General Public License
> - * version 2. This program is licensed "as is" without any warranty of any
> - * kind, whether express or implied.
> - */
> -
> -#include <stdarg.h>
> -#include <stddef.h>
> -#include "types.h"
> -#include "string.h"
> -#include "stdio.h"
> -#include "io.h"
> -#include "ops.h"
> -
> -#define ULITE_RX 0x00
> -#define ULITE_TX 0x04
> -#define ULITE_STATUS 0x08
> -#define ULITE_CONTROL 0x0c
> -
> -#define ULITE_STATUS_RXVALID 0x01
> -#define ULITE_STATUS_TXFULL 0x08
> -
> -#define ULITE_CONTROL_RST_RX 0x02
> -
> -static void * reg_base;
> -
> -static int uartlite_open(void)
> -{
> - /* Clear the RX FIFO */
> - out_be32(reg_base + ULITE_CONTROL, ULITE_CONTROL_RST_RX);
> - return 0;
> -}
> -
> -static void uartlite_putc(unsigned char c)
> -{
> - u32 reg = ULITE_STATUS_TXFULL;
> - while (reg & ULITE_STATUS_TXFULL) /* spin on TXFULL bit */
> - reg = in_be32(reg_base + ULITE_STATUS);
> - out_be32(reg_base + ULITE_TX, c);
> -}
> -
> -static unsigned char uartlite_getc(void)
> -{
> - u32 reg = 0;
> - while (!(reg & ULITE_STATUS_RXVALID)) /* spin waiting for RXVALID bit */
> - reg = in_be32(reg_base + ULITE_STATUS);
> - return in_be32(reg_base + ULITE_RX);
> -}
> -
> -static u8 uartlite_tstc(void)
> -{
> - u32 reg = in_be32(reg_base + ULITE_STATUS);
> - return reg & ULITE_STATUS_RXVALID;
> -}
> -
> -int uartlite_console_init(void *devp, struct serial_console_data *scdp)
> -{
> - int n;
> - unsigned long reg_phys;
> -
> - n = getprop(devp, "virtual-reg", ®_base, sizeof(reg_base));
> - if (n != sizeof(reg_base)) {
> - if (!dt_xlate_reg(devp, 0, ®_phys, NULL))
> - return -1;
> -
> - reg_base = (void *)reg_phys;
> - }
> -
> - scdp->open = uartlite_open;
> - scdp->putc = uartlite_putc;
> - scdp->getc = uartlite_getc;
> - scdp->tstc = uartlite_tstc;
> - scdp->close = NULL;
> - return 0;
> -}
> diff --git a/arch/powerpc/boot/virtex.c b/arch/powerpc/boot/virtex.c
> deleted file mode 100644
> index f731cbb4bff0..000000000000
> --- a/arch/powerpc/boot/virtex.c
> +++ /dev/null
> @@ -1,97 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * The platform specific code for virtex devices since a boot loader is not
> - * always used.
> - *
> - * (C) Copyright 2008 Xilinx, Inc.
> - */
> -
> -#include "ops.h"
> -#include "io.h"
> -#include "stdio.h"
> -
> -#define UART_DLL 0 /* Out: Divisor Latch Low */
> -#define UART_DLM 1 /* Out: Divisor Latch High */
> -#define UART_FCR 2 /* Out: FIFO Control Register */
> -#define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */
> -#define UART_FCR_CLEAR_XMIT 0x04 /* Clear the XMIT FIFO */
> -#define UART_LCR 3 /* Out: Line Control Register */
> -#define UART_MCR 4 /* Out: Modem Control Register */
> -#define UART_MCR_RTS 0x02 /* RTS complement */
> -#define UART_MCR_DTR 0x01 /* DTR complement */
> -#define UART_LCR_DLAB 0x80 /* Divisor latch access bit */
> -#define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */
> -
> -static int virtex_ns16550_console_init(void *devp)
> -{
> - unsigned char *reg_base;
> - u32 reg_shift, reg_offset, clk, spd;
> - u16 divisor;
> - int n;
> -
> - if (dt_get_virtual_reg(devp, (void **)®_base, 1) < 1)
> - return -1;
> -
> - n = getprop(devp, "reg-offset", ®_offset, sizeof(reg_offset));
> - if (n == sizeof(reg_offset))
> - reg_base += reg_offset;
> -
> - n = getprop(devp, "reg-shift", ®_shift, sizeof(reg_shift));
> - if (n != sizeof(reg_shift))
> - reg_shift = 0;
> -
> - n = getprop(devp, "current-speed", (void *)&spd, sizeof(spd));
> - if (n != sizeof(spd))
> - spd = 9600;
> -
> - /* should there be a default clock rate?*/
> - n = getprop(devp, "clock-frequency", (void *)&clk, sizeof(clk));
> - if (n != sizeof(clk))
> - return -1;
> -
> - divisor = clk / (16 * spd);
> -
> - /* Access baud rate */
> - out_8(reg_base + (UART_LCR << reg_shift), UART_LCR_DLAB);
> -
> - /* Baud rate based on input clock */
> - out_8(reg_base + (UART_DLL << reg_shift), divisor & 0xFF);
> - out_8(reg_base + (UART_DLM << reg_shift), divisor >> 8);
> -
> - /* 8 data, 1 stop, no parity */
> - out_8(reg_base + (UART_LCR << reg_shift), UART_LCR_WLEN8);
> -
> - /* RTS/DTR */
> - out_8(reg_base + (UART_MCR << reg_shift), UART_MCR_RTS | UART_MCR_DTR);
> -
> - /* Clear transmitter and receiver */
> - out_8(reg_base + (UART_FCR << reg_shift),
> - UART_FCR_CLEAR_XMIT | UART_FCR_CLEAR_RCVR);
> - return 0;
> -}
> -
> -/* For virtex, the kernel may be loaded without using a bootloader and if so
> - some UARTs need more setup than is provided in the normal console init
> -*/
> -int platform_specific_init(void)
> -{
> - void *devp;
> - char devtype[MAX_PROP_LEN];
> - char path[MAX_PATH_LEN];
> -
> - devp = finddevice("/chosen");
> - if (devp == NULL)
> - return -1;
> -
> - if (getprop(devp, "linux,stdout-path", path, MAX_PATH_LEN) > 0) {
> - devp = finddevice(path);
> - if (devp == NULL)
> - return -1;
> -
> - if ((getprop(devp, "device_type", devtype, sizeof(devtype)) > 0)
> - && !strcmp(devtype, "serial")
> - && (dt_is_compatible(devp, "ns16550")))
> - virtex_ns16550_console_init(devp);
> - }
> - return 0;
> -}
> diff --git a/arch/powerpc/boot/virtex405-head.S b/arch/powerpc/boot/virtex405-head.S
> deleted file mode 100644
> index 00bab7d7c48c..000000000000
> --- a/arch/powerpc/boot/virtex405-head.S
> +++ /dev/null
> @@ -1,31 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0 */
> -#include "ppc_asm.h"
> -
> - .text
> - .global _zimage_start
> -_zimage_start:
> -
> - /* PPC errata 213: needed by Virtex-4 FX */
> - mfccr0 0
> - oris 0,0,0x50000000@h
> - mtccr0 0
> -
> - /*
> - * Invalidate the data cache if the data cache is turned off.
> - * - The 405 core does not invalidate the data cache on power-up
> - * or reset but does turn off the data cache. We cannot assume
> - * that the cache contents are valid.
> - * - If the data cache is turned on this must have been done by
> - * a bootloader and we assume that the cache contents are
> - * valid.
> - */
> - mfdccr r9
> - cmplwi r9,0
> - bne 2f
> - lis r9,0
> - li r8,256
> - mtctr r8
> -1: dccci r0,r9
> - addi r9,r9,0x20
> - bdnz 1b
> -2: b _zimage_start_lib
> diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
> index ed6266367bc0..de5fd5a047e8 100755
> --- a/arch/powerpc/boot/wrapper
> +++ b/arch/powerpc/boot/wrapper
> @@ -323,14 +323,6 @@ adder875-redboot)
> platformo="$object/fixed-head.o $object/redboot-8xx.o"
> binary=y
> ;;
> -simpleboot-virtex405-*)
> - platformo="$object/virtex405-head.o $object/simpleboot.o $object/virtex.o"
> - binary=y
> - ;;
> -simpleboot-virtex440-*)
> - platformo="$object/fixed-head.o $object/simpleboot.o $object/virtex.o"
> - binary=y
> - ;;
> simpleboot-*)
> platformo="$object/fixed-head.o $object/simpleboot.o"
> binary=y
> diff --git a/arch/powerpc/configs/40x/virtex_defconfig b/arch/powerpc/configs/40x/virtex_defconfig
> deleted file mode 100644
> index 5e7c61d1d7d0..000000000000
> --- a/arch/powerpc/configs/40x/virtex_defconfig
> +++ /dev/null
> @@ -1,75 +0,0 @@
> -CONFIG_40x=y
> -# CONFIG_LOCALVERSION_AUTO is not set
> -CONFIG_SYSVIPC=y
> -CONFIG_POSIX_MQUEUE=y
> -CONFIG_IKCONFIG=y
> -CONFIG_IKCONFIG_PROC=y
> -CONFIG_LOG_BUF_SHIFT=14
> -CONFIG_BLK_DEV_INITRD=y
> -CONFIG_SLAB=y
> -CONFIG_MODULES=y
> -CONFIG_MODULE_UNLOAD=y
> -CONFIG_MODULE_FORCE_UNLOAD=y
> -CONFIG_MODVERSIONS=y
> -# CONFIG_BLK_DEV_BSG is not set
> -# CONFIG_WALNUT is not set
> -CONFIG_XILINX_VIRTEX_GENERIC_BOARD=y
> -CONFIG_PREEMPT=y
> -CONFIG_MATH_EMULATION=y
> -CONFIG_CMDLINE_BOOL=y
> -CONFIG_CMDLINE=""
> -CONFIG_PCI=y
> -CONFIG_NET=y
> -CONFIG_PACKET=y
> -CONFIG_UNIX=y
> -CONFIG_INET=y
> -CONFIG_IP_MULTICAST=y
> -CONFIG_IP_PNP=y
> -CONFIG_IP_PNP_DHCP=y
> -CONFIG_IP_PNP_BOOTP=y
> -CONFIG_NETFILTER=y
> -CONFIG_IP_NF_IPTABLES=m
> -CONFIG_IP_NF_FILTER=m
> -CONFIG_IP_NF_MANGLE=m
> -CONFIG_BLK_DEV_LOOP=y
> -CONFIG_BLK_DEV_RAM=y
> -CONFIG_BLK_DEV_RAM_SIZE=8192
> -CONFIG_XILINX_SYSACE=y
> -CONFIG_NETDEVICES=y
> -# CONFIG_SERIO_SERPORT is not set
> -CONFIG_SERIO_XILINX_XPS_PS2=y
> -CONFIG_SERIAL_8250=y
> -CONFIG_SERIAL_8250_CONSOLE=y
> -CONFIG_SERIAL_OF_PLATFORM=y
> -CONFIG_SERIAL_UARTLITE=y
> -CONFIG_SERIAL_UARTLITE_CONSOLE=y
> -CONFIG_XILINX_HWICAP=y
> -CONFIG_GPIOLIB=y
> -CONFIG_GPIO_SYSFS=y
> -CONFIG_GPIO_XILINX=y
> -# CONFIG_HWMON is not set
> -CONFIG_FB=y
> -CONFIG_FB_XILINX=y
> -CONFIG_FRAMEBUFFER_CONSOLE=y
> -CONFIG_LOGO=y
> -# CONFIG_USB_SUPPORT is not set
> -CONFIG_EXT2_FS=y
> -CONFIG_AUTOFS4_FS=y
> -CONFIG_MSDOS_FS=y
> -CONFIG_VFAT_FS=y
> -CONFIG_TMPFS=y
> -CONFIG_CRAMFS=y
> -CONFIG_ROMFS_FS=y
> -CONFIG_NFS_FS=y
> -CONFIG_ROOT_NFS=y
> -CONFIG_NLS_CODEPAGE_437=y
> -CONFIG_NLS_ASCII=m
> -CONFIG_NLS_ISO8859_1=m
> -CONFIG_NLS_UTF8=m
> -CONFIG_CRC_CCITT=y
> -CONFIG_FONTS=y
> -CONFIG_FONT_8x8=y
> -CONFIG_FONT_8x16=y
> -CONFIG_PRINTK_TIME=y
> -CONFIG_DEBUG_INFO=y
> -CONFIG_DEBUG_KERNEL=y
> diff --git a/arch/powerpc/configs/44x/virtex5_defconfig b/arch/powerpc/configs/44x/virtex5_defconfig
> deleted file mode 100644
> index 1f74079e1703..000000000000
> --- a/arch/powerpc/configs/44x/virtex5_defconfig
> +++ /dev/null
> @@ -1,74 +0,0 @@
> -CONFIG_44x=y
> -# CONFIG_LOCALVERSION_AUTO is not set
> -CONFIG_SYSVIPC=y
> -CONFIG_POSIX_MQUEUE=y
> -CONFIG_IKCONFIG=y
> -CONFIG_IKCONFIG_PROC=y
> -CONFIG_LOG_BUF_SHIFT=14
> -CONFIG_BLK_DEV_INITRD=y
> -CONFIG_SLAB=y
> -CONFIG_MODULES=y
> -CONFIG_MODULE_UNLOAD=y
> -CONFIG_MODULE_FORCE_UNLOAD=y
> -CONFIG_MODVERSIONS=y
> -# CONFIG_BLK_DEV_BSG is not set
> -# CONFIG_EBONY is not set
> -CONFIG_XILINX_VIRTEX440_GENERIC_BOARD=y
> -CONFIG_PREEMPT=y
> -CONFIG_MATH_EMULATION=y
> -CONFIG_CMDLINE_BOOL=y
> -CONFIG_CMDLINE=""
> -CONFIG_NET=y
> -CONFIG_PACKET=y
> -CONFIG_UNIX=y
> -CONFIG_INET=y
> -CONFIG_IP_MULTICAST=y
> -CONFIG_IP_PNP=y
> -CONFIG_IP_PNP_DHCP=y
> -CONFIG_IP_PNP_BOOTP=y
> -CONFIG_NETFILTER=y
> -CONFIG_IP_NF_IPTABLES=m
> -CONFIG_IP_NF_FILTER=m
> -CONFIG_IP_NF_MANGLE=m
> -CONFIG_BLK_DEV_LOOP=y
> -CONFIG_BLK_DEV_RAM=y
> -CONFIG_BLK_DEV_RAM_SIZE=8192
> -CONFIG_XILINX_SYSACE=y
> -CONFIG_NETDEVICES=y
> -# CONFIG_SERIO_SERPORT is not set
> -CONFIG_SERIO_XILINX_XPS_PS2=y
> -CONFIG_SERIAL_8250=y
> -CONFIG_SERIAL_8250_CONSOLE=y
> -CONFIG_SERIAL_OF_PLATFORM=y
> -CONFIG_SERIAL_UARTLITE=y
> -CONFIG_SERIAL_UARTLITE_CONSOLE=y
> -CONFIG_XILINX_HWICAP=y
> -CONFIG_GPIOLIB=y
> -CONFIG_GPIO_SYSFS=y
> -CONFIG_GPIO_XILINX=y
> -# CONFIG_HWMON is not set
> -CONFIG_FB=y
> -CONFIG_FB_XILINX=y
> -CONFIG_FRAMEBUFFER_CONSOLE=y
> -CONFIG_LOGO=y
> -# CONFIG_USB_SUPPORT is not set
> -CONFIG_EXT2_FS=y
> -CONFIG_AUTOFS4_FS=y
> -CONFIG_MSDOS_FS=y
> -CONFIG_VFAT_FS=y
> -CONFIG_TMPFS=y
> -CONFIG_CRAMFS=y
> -CONFIG_ROMFS_FS=y
> -CONFIG_NFS_FS=y
> -CONFIG_ROOT_NFS=y
> -CONFIG_NLS_CODEPAGE_437=y
> -CONFIG_NLS_ASCII=m
> -CONFIG_NLS_ISO8859_1=m
> -CONFIG_NLS_UTF8=m
> -CONFIG_CRC_CCITT=y
> -CONFIG_FONTS=y
> -CONFIG_FONT_8x8=y
> -CONFIG_FONT_8x16=y
> -CONFIG_PRINTK_TIME=y
> -CONFIG_DEBUG_INFO=y
> -CONFIG_DEBUG_KERNEL=y
> diff --git a/arch/powerpc/configs/ppc40x_defconfig b/arch/powerpc/configs/ppc40x_defconfig
> index a5f683aed328..88960a72b525 100644
> --- a/arch/powerpc/configs/ppc40x_defconfig
> +++ b/arch/powerpc/configs/ppc40x_defconfig
> @@ -14,7 +14,6 @@ CONFIG_EP405=y
> CONFIG_HOTFOOT=y
> CONFIG_KILAUEA=y
> CONFIG_MAKALU=y
> -CONFIG_XILINX_VIRTEX_GENERIC_BOARD=y
> CONFIG_NET=y
> CONFIG_PACKET=y
> CONFIG_UNIX=y
> @@ -37,33 +36,26 @@ CONFIG_MTD_UBI=m
> CONFIG_MTD_UBI_GLUEBI=m
> CONFIG_BLK_DEV_RAM=y
> CONFIG_BLK_DEV_RAM_SIZE=35000
> -CONFIG_XILINX_SYSACE=m
> CONFIG_NETDEVICES=y
> CONFIG_IBM_EMAC=y
> # CONFIG_INPUT is not set
> CONFIG_SERIO=m
> # CONFIG_SERIO_I8042 is not set
> # CONFIG_SERIO_SERPORT is not set
> -CONFIG_SERIO_XILINX_XPS_PS2=m
> # CONFIG_VT is not set
> CONFIG_SERIAL_8250=y
> CONFIG_SERIAL_8250_CONSOLE=y
> CONFIG_SERIAL_8250_EXTENDED=y
> CONFIG_SERIAL_8250_SHARE_IRQ=y
> CONFIG_SERIAL_OF_PLATFORM=y
> -CONFIG_SERIAL_UARTLITE=y
> -CONFIG_SERIAL_UARTLITE_CONSOLE=y
> # CONFIG_HW_RANDOM is not set
> -CONFIG_XILINX_HWICAP=m
> CONFIG_I2C=m
> CONFIG_I2C_CHARDEV=m
> CONFIG_I2C_GPIO=m
> CONFIG_I2C_IBM_IIC=m
> -CONFIG_GPIO_XILINX=y
> # CONFIG_HWMON is not set
> CONFIG_THERMAL=y
> CONFIG_FB=m
> -CONFIG_FB_XILINX=m
> CONFIG_EXT2_FS=y
> CONFIG_EXT4_FS=m
> CONFIG_VFAT_FS=m
> diff --git a/arch/powerpc/configs/ppc44x_defconfig b/arch/powerpc/configs/ppc44x_defconfig
> index a41eedfe0a5f..8b595f67068c 100644
> --- a/arch/powerpc/configs/ppc44x_defconfig
> +++ b/arch/powerpc/configs/ppc44x_defconfig
> @@ -22,7 +22,6 @@ CONFIG_GLACIER=y
> CONFIG_REDWOOD=y
> CONFIG_EIGER=y
> CONFIG_YOSEMITE=y
> -CONFIG_XILINX_VIRTEX440_GENERIC_BOARD=y
> CONFIG_PPC4xx_GPIO=y
> CONFIG_MATH_EMULATION=y
> CONFIG_NET=y
> @@ -46,7 +45,6 @@ CONFIG_MTD_UBI=m
> CONFIG_MTD_UBI_GLUEBI=m
> CONFIG_BLK_DEV_RAM=y
> CONFIG_BLK_DEV_RAM_SIZE=35000
> -CONFIG_XILINX_SYSACE=m
> CONFIG_SCSI=m
> CONFIG_BLK_DEV_SD=m
> # CONFIG_SCSI_LOWLEVEL is not set
> @@ -57,7 +55,6 @@ CONFIG_IBM_EMAC=y
> CONFIG_SERIO=m
> # CONFIG_SERIO_I8042 is not set
> # CONFIG_SERIO_SERPORT is not set
> -CONFIG_SERIO_XILINX_XPS_PS2=m
> # CONFIG_VT is not set
> CONFIG_SERIAL_8250=y
> CONFIG_SERIAL_8250_CONSOLE=y
> @@ -65,18 +62,13 @@ CONFIG_SERIAL_8250_CONSOLE=y
> CONFIG_SERIAL_8250_EXTENDED=y
> CONFIG_SERIAL_8250_SHARE_IRQ=y
> CONFIG_SERIAL_OF_PLATFORM=y
> -CONFIG_SERIAL_UARTLITE=y
> -CONFIG_SERIAL_UARTLITE_CONSOLE=y
> # CONFIG_HW_RANDOM is not set
> -CONFIG_XILINX_HWICAP=m
> CONFIG_I2C=m
> CONFIG_I2C_CHARDEV=m
> CONFIG_I2C_GPIO=m
> CONFIG_I2C_IBM_IIC=m
> -CONFIG_GPIO_XILINX=y
> # CONFIG_HWMON is not set
> CONFIG_FB=m
> -CONFIG_FB_XILINX=m
> CONFIG_USB=m
> CONFIG_USB_EHCI_HCD=m
> CONFIG_USB_OHCI_HCD=m
> diff --git a/arch/powerpc/include/asm/xilinx_intc.h b/arch/powerpc/include/asm/xilinx_intc.h
> deleted file mode 100644
> index ca9aa162fb09..000000000000
> --- a/arch/powerpc/include/asm/xilinx_intc.h
> +++ /dev/null
> @@ -1,16 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0-or-later */
> -/*
> - * Xilinx intc external definitions
> - *
> - * Copyright 2007 Secret Lab Technologies Ltd.
> - */
> -#ifndef _ASM_POWERPC_XILINX_INTC_H
> -#define _ASM_POWERPC_XILINX_INTC_H
> -
> -#ifdef __KERNEL__
> -
> -extern void __init xilinx_intc_init_tree(void);
> -extern unsigned int xintc_get_irq(void);
> -
> -#endif /* __KERNEL__ */
> -#endif /* _ASM_POWERPC_XILINX_INTC_H */
> diff --git a/arch/powerpc/include/asm/xilinx_pci.h b/arch/powerpc/include/asm/xilinx_pci.h
> deleted file mode 100644
> index 7a8275caf6af..000000000000
> --- a/arch/powerpc/include/asm/xilinx_pci.h
> +++ /dev/null
> @@ -1,21 +0,0 @@
> -/*
> - * Xilinx pci external definitions
> - *
> - * Copyright 2009 Roderick Colenbrander
> - * Copyright 2009 Secret Lab Technologies Ltd.
> - *
> - * This file is licensed under the terms of the GNU General Public License
> - * version 2. This program is licensed "as is" without any warranty of any
> - * kind, whether express or implied.
> - */
> -
> -#ifndef INCLUDE_XILINX_PCI
> -#define INCLUDE_XILINX_PCI
> -
> -#ifdef CONFIG_XILINX_PCI
> -extern void __init xilinx_pci_init(void);
> -#else
> -static inline void __init xilinx_pci_init(void) { return; }
> -#endif
> -
> -#endif /* INCLUDE_XILINX_PCI */
> diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
> index 245be4fafe13..2dff9041bcdc 100644
> --- a/arch/powerpc/kernel/cputable.c
> +++ b/arch/powerpc/kernel/cputable.c
> @@ -1385,32 +1385,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
> .machine_check = machine_check_4xx,
> .platform = "ppc405",
> },
> - { /* Xilinx Virtex-II Pro */
> - .pvr_mask = 0xfffff000,
> - .pvr_value = 0x20010000,
> - .cpu_name = "Virtex-II Pro",
> - .cpu_features = CPU_FTRS_40X,
> - .cpu_user_features = PPC_FEATURE_32 |
> - PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
> - .mmu_features = MMU_FTR_TYPE_40x,
> - .icache_bsize = 32,
> - .dcache_bsize = 32,
> - .machine_check = machine_check_4xx,
> - .platform = "ppc405",
> - },
> - { /* Xilinx Virtex-4 FX */
> - .pvr_mask = 0xfffff000,
> - .pvr_value = 0x20011000,
> - .cpu_name = "Virtex-4 FX",
> - .cpu_features = CPU_FTRS_40X,
> - .cpu_user_features = PPC_FEATURE_32 |
> - PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
> - .mmu_features = MMU_FTR_TYPE_40x,
> - .icache_bsize = 32,
> - .dcache_bsize = 32,
> - .machine_check = machine_check_4xx,
> - .platform = "ppc405",
> - },
> { /* 405EP */
> .pvr_mask = 0xffff0000,
> .pvr_value = 0x51210000,
> @@ -1800,19 +1774,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
> .machine_check = machine_check_440A,
> .platform = "ppc440",
> },
> - { /* 440 in Xilinx Virtex-5 FXT */
> - .pvr_mask = 0xfffffff0,
> - .pvr_value = 0x7ff21910,
> - .cpu_name = "440 in Virtex-5 FXT",
> - .cpu_features = CPU_FTRS_44X,
> - .cpu_user_features = COMMON_USER_BOOKE,
> - .mmu_features = MMU_FTR_TYPE_44x,
> - .icache_bsize = 32,
> - .dcache_bsize = 32,
> - .cpu_setup = __setup_cpu_440x5,
> - .machine_check = machine_check_440A,
> - .platform = "ppc440",
> - },
> { /* 460EX */
> .pvr_mask = 0xffff0006,
> .pvr_value = 0x13020002,
> diff --git a/arch/powerpc/platforms/40x/Kconfig b/arch/powerpc/platforms/40x/Kconfig
> index 6da813b65b42..d06ca51e8443 100644
> --- a/arch/powerpc/platforms/40x/Kconfig
> +++ b/arch/powerpc/platforms/40x/Kconfig
> @@ -55,23 +55,6 @@ config WALNUT
> help
> This option enables support for the IBM PPC405GP evaluation board.
>
> -config XILINX_VIRTEX_GENERIC_BOARD
> - bool "Generic Xilinx Virtex board"
> - depends on 40x
> - select XILINX_VIRTEX_II_PRO
> - select XILINX_VIRTEX_4_FX
> - select XILINX_INTC
> - help
> - This option enables generic support for Xilinx Virtex based boards.
> -
> - The generic virtex board support matches any device tree which
> - specifies 'xilinx,virtex' in its compatible field. This includes
> - the Xilinx ML3xx and ML4xx reference designs using the powerpc
> - core.
> -
> - Most Virtex designs should use this unless it needs to do some
> - special configuration at board probe time.
> -
> config OBS600
> bool "OpenBlockS 600"
> depends on 40x
> @@ -109,20 +92,6 @@ config 405EZ
> select IBM_EMAC_MAL_CLR_ICINTSTAT if IBM_EMAC
> select IBM_EMAC_MAL_COMMON_ERR if IBM_EMAC
>
> -config XILINX_VIRTEX
> - bool
> - select DEFAULT_UIMAGE
> -
> -config XILINX_VIRTEX_II_PRO
> - bool
> - select XILINX_VIRTEX
> - select IBM405_ERR77
> - select IBM405_ERR51
> -
> -config XILINX_VIRTEX_4_FX
> - bool
> - select XILINX_VIRTEX
> -
> config STB03xxx
> bool
> select IBM405_ERR77
> diff --git a/arch/powerpc/platforms/40x/Makefile b/arch/powerpc/platforms/40x/Makefile
> index 828d78340dd9..e9386deed505 100644
> --- a/arch/powerpc/platforms/40x/Makefile
> +++ b/arch/powerpc/platforms/40x/Makefile
> @@ -1,5 +1,4 @@
> # SPDX-License-Identifier: GPL-2.0-only
> obj-$(CONFIG_WALNUT) += walnut.o
> -obj-$(CONFIG_XILINX_VIRTEX_GENERIC_BOARD) += virtex.o
> obj-$(CONFIG_EP405) += ep405.o
> obj-$(CONFIG_PPC40x_SIMPLE) += ppc40x_simple.o
> diff --git a/arch/powerpc/platforms/40x/virtex.c b/arch/powerpc/platforms/40x/virtex.c
> deleted file mode 100644
> index e3d5e095846b..000000000000
> --- a/arch/powerpc/platforms/40x/virtex.c
> +++ /dev/null
> @@ -1,54 +0,0 @@
> -/*
> - * Xilinx Virtex (IIpro & 4FX) based board support
> - *
> - * Copyright 2007 Secret Lab Technologies Ltd.
> - *
> - * This file is licensed under the terms of the GNU General Public License
> - * version 2. This program is licensed "as is" without any warranty of any
> - * kind, whether express or implied.
> - */
> -
> -#include <linux/init.h>
> -#include <linux/of_platform.h>
> -#include <asm/machdep.h>
> -#include <asm/prom.h>
> -#include <asm/time.h>
> -#include <asm/xilinx_intc.h>
> -#include <asm/xilinx_pci.h>
> -#include <asm/ppc4xx.h>
> -
> -static const struct of_device_id xilinx_of_bus_ids[] __initconst = {
> - { .compatible = "xlnx,plb-v46-1.00.a", },
> - { .compatible = "xlnx,plb-v34-1.01.a", },
> - { .compatible = "xlnx,plb-v34-1.02.a", },
> - { .compatible = "xlnx,opb-v20-1.10.c", },
> - { .compatible = "xlnx,dcr-v29-1.00.a", },
> - { .compatible = "xlnx,compound", },
> - {}
> -};
> -
> -static int __init virtex_device_probe(void)
> -{
> - of_platform_bus_probe(NULL, xilinx_of_bus_ids, NULL);
> -
> - return 0;
> -}
> -machine_device_initcall(virtex, virtex_device_probe);
> -
> -static int __init virtex_probe(void)
> -{
> - if (!of_machine_is_compatible("xlnx,virtex"))
> - return 0;
> -
> - return 1;
> -}
> -
> -define_machine(virtex) {
> - .name = "Xilinx Virtex",
> - .probe = virtex_probe,
> - .setup_arch = xilinx_pci_init,
> - .init_IRQ = xilinx_intc_init_tree,
> - .get_irq = xintc_get_irq,
> - .restart = ppc4xx_reset_system,
> - .calibrate_decr = generic_calibrate_decr,
> -};
> diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
> index 25ebe634a661..39e93d23fb38 100644
> --- a/arch/powerpc/platforms/44x/Kconfig
> +++ b/arch/powerpc/platforms/44x/Kconfig
> @@ -232,33 +232,6 @@ config ICON
> help
> This option enables support for the AMCC PPC440SPe evaluation board.
>
> -config XILINX_VIRTEX440_GENERIC_BOARD
> - bool "Generic Xilinx Virtex 5 FXT board support"
> - depends on 44x
> - select XILINX_VIRTEX_5_FXT
> - select XILINX_INTC
> - help
> - This option enables generic support for Xilinx Virtex based boards
> - that use a 440 based processor in the Virtex 5 FXT FPGA architecture.
> -
> - The generic virtex board support matches any device tree which
> - specifies 'xlnx,virtex440' in its compatible field. This includes
> - the Xilinx ML5xx reference designs using the powerpc core.
> -
> - Most Virtex 5 designs should use this unless it needs to do some
> - special configuration at board probe time.
> -
> -config XILINX_ML510
> - bool "Xilinx ML510 extra support"
> - depends on XILINX_VIRTEX440_GENERIC_BOARD
> - select HAVE_PCI
> - select XILINX_PCI if PCI
> - select PPC_INDIRECT_PCI if PCI
> - select PPC_I8259 if PCI
> - help
> - This option enables extra support for features on the Xilinx ML510
> - board. The ML510 has a PCI bus with ALI south bridge.
> -
> config PPC44x_SIMPLE
> bool "Simple PowerPC 44x board support"
> depends on 44x
> @@ -354,13 +327,3 @@ config 476FPE_ERR46
> config IBM440EP_ERR42
> bool
>
> -# Xilinx specific config options.
> -config XILINX_VIRTEX
> - bool
> - select DEFAULT_UIMAGE
> -
> -# Xilinx Virtex 5 FXT FPGA architecture, selected by a Xilinx board above
> -config XILINX_VIRTEX_5_FXT
> - bool
> - select XILINX_VIRTEX
> -
> diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile
> index 1b78c6af821a..5ba031f57652 100644
> --- a/arch/powerpc/platforms/44x/Makefile
> +++ b/arch/powerpc/platforms/44x/Makefile
> @@ -7,8 +7,6 @@ obj-$(CONFIG_PPC44x_SIMPLE) += ppc44x_simple.o
> obj-$(CONFIG_EBONY) += ebony.o
> obj-$(CONFIG_SAM440EP) += sam440ep.o
> obj-$(CONFIG_WARP) += warp.o
> -obj-$(CONFIG_XILINX_VIRTEX_5_FXT) += virtex.o
> -obj-$(CONFIG_XILINX_ML510) += virtex_ml510.o
> obj-$(CONFIG_ISS4xx) += iss4xx.o
> obj-$(CONFIG_CANYONLANDS)+= canyonlands.o
> obj-$(CONFIG_CURRITUCK) += ppc476.o
> diff --git a/arch/powerpc/platforms/44x/virtex.c b/arch/powerpc/platforms/44x/virtex.c
> deleted file mode 100644
> index 3eb13ed926ee..000000000000
> --- a/arch/powerpc/platforms/44x/virtex.c
> +++ /dev/null
> @@ -1,60 +0,0 @@
> -/*
> - * Xilinx Virtex 5FXT based board support, derived from
> - * the Xilinx Virtex (IIpro & 4FX) based board support
> - *
> - * Copyright 2007 Secret Lab Technologies Ltd.
> - * Copyright 2008 Xilinx, Inc.
> - *
> - * This file is licensed under the terms of the GNU General Public License
> - * version 2. This program is licensed "as is" without any warranty of any
> - * kind, whether express or implied.
> - */
> -
> -#include <linux/init.h>
> -#include <linux/of_platform.h>
> -#include <asm/machdep.h>
> -#include <asm/prom.h>
> -#include <asm/time.h>
> -#include <asm/xilinx_intc.h>
> -#include <asm/xilinx_pci.h>
> -#include <asm/reg.h>
> -#include <asm/ppc4xx.h>
> -#include "44x.h"
> -
> -static const struct of_device_id xilinx_of_bus_ids[] __initconst = {
> - { .compatible = "simple-bus", },
> - { .compatible = "xlnx,plb-v46-1.00.a", },
> - { .compatible = "xlnx,plb-v46-1.02.a", },
> - { .compatible = "xlnx,plb-v34-1.01.a", },
> - { .compatible = "xlnx,plb-v34-1.02.a", },
> - { .compatible = "xlnx,opb-v20-1.10.c", },
> - { .compatible = "xlnx,dcr-v29-1.00.a", },
> - { .compatible = "xlnx,compound", },
> - {}
> -};
> -
> -static int __init virtex_device_probe(void)
> -{
> - of_platform_bus_probe(NULL, xilinx_of_bus_ids, NULL);
> -
> - return 0;
> -}
> -machine_device_initcall(virtex, virtex_device_probe);
> -
> -static int __init virtex_probe(void)
> -{
> - if (!of_machine_is_compatible("xlnx,virtex440"))
> - return 0;
> -
> - return 1;
> -}
> -
> -define_machine(virtex) {
> - .name = "Xilinx Virtex440",
> - .probe = virtex_probe,
> - .setup_arch = xilinx_pci_init,
> - .init_IRQ = xilinx_intc_init_tree,
> - .get_irq = xintc_get_irq,
> - .calibrate_decr = generic_calibrate_decr,
> - .restart = ppc4xx_reset_system,
> -};
> diff --git a/arch/powerpc/platforms/44x/virtex_ml510.c b/arch/powerpc/platforms/44x/virtex_ml510.c
> deleted file mode 100644
> index 349f218b335c..000000000000
> --- a/arch/powerpc/platforms/44x/virtex_ml510.c
> +++ /dev/null
> @@ -1,30 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0
> -#include <asm/i8259.h>
> -#include <linux/pci.h>
> -#include "44x.h"
> -
> -/**
> - * ml510_ail_quirk
> - */
> -static void ml510_ali_quirk(struct pci_dev *dev)
> -{
> - /* Enable the IDE controller */
> - pci_write_config_byte(dev, 0x58, 0x4c);
> - /* Assign irq 14 to the primary ide channel */
> - pci_write_config_byte(dev, 0x44, 0x0d);
> - /* Assign irq 15 to the secondary ide channel */
> - pci_write_config_byte(dev, 0x75, 0x0f);
> - /* Set the ide controller in native mode */
> - pci_write_config_byte(dev, 0x09, 0xff);
> -
> - /* INTB = disabled, INTA = disabled */
> - pci_write_config_byte(dev, 0x48, 0x00);
> - /* INTD = disabled, INTC = disabled */
> - pci_write_config_byte(dev, 0x4a, 0x00);
> - /* Audio = INT7, Modem = disabled. */
> - pci_write_config_byte(dev, 0x4b, 0x60);
> - /* USB = INT7 */
> - pci_write_config_byte(dev, 0x74, 0x06);
> -}
> -DECLARE_PCI_FIXUP_EARLY(0x10b9, 0x1533, ml510_ali_quirk);
> -
> diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
> index 1f8025383caa..5e6479d409a0 100644
> --- a/arch/powerpc/platforms/Kconfig
> +++ b/arch/powerpc/platforms/Kconfig
> @@ -317,8 +317,4 @@ config MCU_MPC8349EMITX
> also register MCU GPIOs with the generic GPIO API, so you'll able
> to use MCU pins as GPIOs.
>
> -config XILINX_PCI
> - bool "Xilinx PCI host bridge support"
> - depends on PCI && XILINX_VIRTEX
> -
> endmenu
> diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
> index cb5a5bd2cef5..026b3f01a991 100644
> --- a/arch/powerpc/sysdev/Makefile
> +++ b/arch/powerpc/sysdev/Makefile
> @@ -31,8 +31,6 @@ obj-$(CONFIG_RTC_DRV_CMOS) += rtc_cmos_setup.o
> obj-$(CONFIG_PPC_INDIRECT_PCI) += indirect_pci.o
> obj-$(CONFIG_PPC_I8259) += i8259.o
> obj-$(CONFIG_IPIC) += ipic.o
> -obj-$(CONFIG_XILINX_VIRTEX) += xilinx_intc.o
> -obj-$(CONFIG_XILINX_PCI) += xilinx_pci.o
> obj-$(CONFIG_OF_RTC) += of_rtc.o
>
> obj-$(CONFIG_CPM) += cpm_common.o
> diff --git a/arch/powerpc/sysdev/xilinx_intc.c b/arch/powerpc/sysdev/xilinx_intc.c
> deleted file mode 100644
> index 4a86dcff3fcd..000000000000
> --- a/arch/powerpc/sysdev/xilinx_intc.c
> +++ /dev/null
> @@ -1,88 +0,0 @@
> -/*
> - * Interrupt controller driver for Xilinx Virtex FPGAs
> - *
> - * Copyright (C) 2007 Secret Lab Technologies Ltd.
> - *
> - * This file is licensed under the terms of the GNU General Public License
> - * version 2. This program is licensed "as is" without any warranty of any
> - * kind, whether express or implied.
> - *
> - */
> -
> -/*
> - * This is a driver for the interrupt controller typically found in
> - * Xilinx Virtex FPGA designs.
> - *
> - * The interrupt sense levels are hard coded into the FPGA design with
> - * typically a 1:1 relationship between irq lines and devices (no shared
> - * irq lines). Therefore, this driver does not attempt to handle edge
> - * and level interrupts differently.
> - */
> -#undef DEBUG
> -
> -#include <linux/kernel.h>
> -#include <linux/irq.h>
> -#include <linux/of.h>
> -#include <linux/of_address.h>
> -#include <linux/of_irq.h>
> -#include <asm/io.h>
> -#include <asm/processor.h>
> -#include <asm/i8259.h>
> -#include <asm/irq.h>
> -#include <linux/irqchip.h>
> -
> -#if defined(CONFIG_PPC_I8259)
> -/*
> - * Support code for cascading to 8259 interrupt controllers
> - */
> -static void xilinx_i8259_cascade(struct irq_desc *desc)
> -{
> - struct irq_chip *chip = irq_desc_get_chip(desc);
> - unsigned int cascade_irq = i8259_irq();
> -
> - if (cascade_irq)
> - generic_handle_irq(cascade_irq);
> -
> - /* Let xilinx_intc end the interrupt */
> - chip->irq_unmask(&desc->irq_data);
> -}
> -
> -static void __init xilinx_i8259_setup_cascade(void)
> -{
> - struct device_node *cascade_node;
> - int cascade_irq;
> -
> - /* Initialize i8259 controller */
> - cascade_node = of_find_compatible_node(NULL, NULL, "chrp,iic");
> - if (!cascade_node)
> - return;
> -
> - cascade_irq = irq_of_parse_and_map(cascade_node, 0);
> - if (!cascade_irq) {
> - pr_err("virtex_ml510: Failed to map cascade interrupt\n");
> - goto out;
> - }
> -
> - i8259_init(cascade_node, 0);
> - irq_set_chained_handler(cascade_irq, xilinx_i8259_cascade);
> -
> - /* Program irq 7 (usb/audio), 14/15 (ide) to level sensitive */
> - /* This looks like a dirty hack to me --gcl */
> - outb(0xc0, 0x4d0);
> - outb(0xc0, 0x4d1);
> -
> - out:
> - of_node_put(cascade_node);
> -}
> -#else
> -static inline void xilinx_i8259_setup_cascade(void) { return; }
> -#endif /* defined(CONFIG_PPC_I8259) */
> -
> -/*
> - * Initialize master Xilinx interrupt controller
> - */
> -void __init xilinx_intc_init_tree(void)
> -{
> - irqchip_init();
> - xilinx_i8259_setup_cascade();
> -}
> diff --git a/arch/powerpc/sysdev/xilinx_pci.c b/arch/powerpc/sysdev/xilinx_pci.c
> deleted file mode 100644
> index fea5667699ed..000000000000
> --- a/arch/powerpc/sysdev/xilinx_pci.c
> +++ /dev/null
> @@ -1,132 +0,0 @@
> -/*
> - * PCI support for Xilinx plbv46_pci soft-core which can be used on
> - * Xilinx Virtex ML410 / ML510 boards.
> - *
> - * Copyright 2009 Roderick Colenbrander
> - * Copyright 2009 Secret Lab Technologies Ltd.
> - *
> - * The pci bridge fixup code was copied from ppc4xx_pci.c and was written
> - * by Benjamin Herrenschmidt.
> - * Copyright 2007 Ben. Herrenschmidt <benh@kernel.crashing.org>, IBM Corp.
> - *
> - * This file is licensed under the terms of the GNU General Public License
> - * version 2. This program is licensed "as is" without any warranty of any
> - * kind, whether express or implied.
> - */
> -
> -#include <linux/ioport.h>
> -#include <linux/of.h>
> -#include <linux/pci.h>
> -#include <mm/mmu_decl.h>
> -#include <asm/io.h>
> -#include <asm/xilinx_pci.h>
> -
> -#define XPLB_PCI_ADDR 0x10c
> -#define XPLB_PCI_DATA 0x110
> -#define XPLB_PCI_BUS 0x114
> -
> -#define PCI_HOST_ENABLE_CMD PCI_COMMAND_SERR | PCI_COMMAND_PARITY | PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY
> -
> -static const struct of_device_id xilinx_pci_match[] = {
> - { .compatible = "xlnx,plbv46-pci-1.03.a", },
> - {}
> -};
> -
> -/**
> - * xilinx_pci_fixup_bridge - Block Xilinx PHB configuration.
> - */
> -static void xilinx_pci_fixup_bridge(struct pci_dev *dev)
> -{
> - struct pci_controller *hose;
> - int i;
> -
> - if (dev->devfn || dev->bus->self)
> - return;
> -
> - hose = pci_bus_to_host(dev->bus);
> - if (!hose)
> - return;
> -
> - if (!of_match_node(xilinx_pci_match, hose->dn))
> - return;
> -
> - /* Hide the PCI host BARs from the kernel as their content doesn't
> - * fit well in the resource management
> - */
> - for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
> - dev->resource[i].start = 0;
> - dev->resource[i].end = 0;
> - dev->resource[i].flags = 0;
> - }
> -
> - dev_info(&dev->dev, "Hiding Xilinx plb-pci host bridge resources %s\n",
> - pci_name(dev));
> -}
> -DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, xilinx_pci_fixup_bridge);
> -
> -/**
> - * xilinx_pci_exclude_device - Don't do config access for non-root bus
> - *
> - * This is a hack. Config access to any bus other than bus 0 does not
> - * currently work on the ML510 so we prevent it here.
> - */
> -static int
> -xilinx_pci_exclude_device(struct pci_controller *hose, u_char bus, u8 devfn)
> -{
> - return (bus != 0);
> -}
> -
> -/**
> - * xilinx_pci_init - Find and register a Xilinx PCI host bridge
> - */
> -void __init xilinx_pci_init(void)
> -{
> - struct pci_controller *hose;
> - struct resource r;
> - void __iomem *pci_reg;
> - struct device_node *pci_node;
> -
> - pci_node = of_find_matching_node(NULL, xilinx_pci_match);
> - if(!pci_node)
> - return;
> -
> - if (of_address_to_resource(pci_node, 0, &r)) {
> - pr_err("xilinx-pci: cannot resolve base address\n");
> - return;
> - }
> -
> - hose = pcibios_alloc_controller(pci_node);
> - if (!hose) {
> - pr_err("xilinx-pci: pcibios_alloc_controller() failed\n");
> - return;
> - }
> -
> - /* Setup config space */
> - setup_indirect_pci(hose, r.start + XPLB_PCI_ADDR,
> - r.start + XPLB_PCI_DATA,
> - PPC_INDIRECT_TYPE_SET_CFG_TYPE);
> -
> - /* According to the xilinx plbv46_pci documentation the soft-core starts
> - * a self-init when the bus master enable bit is set. Without this bit
> - * set the pci bus can't be scanned.
> - */
> - early_write_config_word(hose, 0, 0, PCI_COMMAND, PCI_HOST_ENABLE_CMD);
> -
> - /* Set the max latency timer to 255 */
> - early_write_config_byte(hose, 0, 0, PCI_LATENCY_TIMER, 0xff);
> -
> - /* Set the max bus number to 255 */
> - pci_reg = of_iomap(pci_node, 0);
> - out_8(pci_reg + XPLB_PCI_BUS, 0xff);
> - iounmap(pci_reg);
> -
> - /* Nothing past the root bridge is working right now. By default
> - * exclude config access to anything except bus 0 */
> - if (!ppc_md.pci_exclude_device)
> - ppc_md.pci_exclude_device = xilinx_pci_exclude_device;
> -
> - /* Register the host bridge with the linux kernel! */
> - pci_process_bridge_OF_ranges(hose, pci_node, 1);
> -
> - pr_info("xilinx-pci: Registered PCI host bridge\n");
> -}
> diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
> index 26956c006987..0ccbd6fd6de1 100644
> --- a/drivers/char/Kconfig
> +++ b/drivers/char/Kconfig
> @@ -316,7 +316,7 @@ config DTLK
>
> config XILINX_HWICAP
> tristate "Xilinx HWICAP Support"
> - depends on XILINX_VIRTEX || MICROBLAZE
> + depends on MICROBLAZE
> help
> This option enables support for Xilinx Internal Configuration
> Access Port (ICAP) driver. The ICAP is used on Xilinx Virtex
> diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
> index f65991a67af2..b174650e0f09 100644
> --- a/drivers/video/fbdev/Kconfig
> +++ b/drivers/video/fbdev/Kconfig
> @@ -2007,7 +2007,7 @@ config FB_PS3_DEFAULT_SIZE_M
>
> config FB_XILINX
> tristate "Xilinx frame buffer support"
> - depends on FB && (XILINX_VIRTEX || MICROBLAZE || ARCH_ZYNQ || ARCH_ZYNQMP)
> + depends on FB && (MICROBLAZE || ARCH_ZYNQ || ARCH_ZYNQMP)
> select FB_CFB_FILLRECT
> select FB_CFB_COPYAREA
> select FB_CFB_IMAGEBLIT
> --
> 2.26.0
>
--
Thanks,
~Nick Desaulniers
^ permalink raw reply
* [PATCH RFC] mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP (was: Re: [PATCH v3 0/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA)
From: Mike Rapoport @ 2020-03-31 21:56 UTC (permalink / raw)
To: Michal Hocko
Cc: mmorana, Catalin Marinas, Heiko Carstens,
open list:MEMORY MANAGEMENT, Paul Mackerras, H. Peter Anvin,
sparclinux, Alexander Duyck, linux-s390, x86,
Christian Borntraeger, Ingo Molnar, Hoan Tran, Pavel Tatashin,
lho, Vasily Gorbik, Vlastimil Babka, Will Deacon, Borislav Petkov,
Thomas Gleixner, linux-arm-kernel, Oscar Salvador, linux-kernel,
Andrew Morton, linuxppc-dev, David S. Miller
In-Reply-To: <20200330095843.GF14243@dhcp22.suse.cz>
On Mon, Mar 30, 2020 at 11:58:43AM +0200, Michal Hocko wrote:
>
> What would it take to make ia64 use HAVE_MEMBLOCK_NODE_MAP? I would
> really love to see that thing go away. It is causing problems when
> people try to use memblock api.
Well, it's a small patch in the end :)
Currently all NUMA architectures currently enable
CONFIG_HAVE_MEMBLOCK_NODE_MAP and use free_area_init_nodes() to initialize
nodes and zones structures.
On the other hand, the systems that don't have
CONFIG_HAVE_MEMBLOCK_NODE_MAP use free_area_init() or free_area_init_node()
for this purpose.
With this assumptions, it's possible to make selection of the functions
that calculate spanned and absent pages at runtime.
This patch builds for arm and x86-64 and boots on qemu-system for both.
From f907df987db4d6735c4940b30cfb4764fc0007d4 Mon Sep 17 00:00:00 2001
From: Mike Rapoport <rppt@linux.ibm.com>
Date: Wed, 1 Apr 2020 00:27:17 +0300
Subject: [PATCH RFC] mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP option
The CONFIG_HAVE_MEMBLOCK_NODE_MAP is used to differentiate initialization
of nodes and zones structures between the systems that have region to node
mapping in memblock and those that don't.
Currently all the NUMA architectures enable this option and for the
non-NUMA systems we can presume that all the memory belongs to node 0 and
therefore the compile time configuration option is not required.
Still, free_area_init_node() must have a backward compatible version
because its semantics with and without CONFIG_HAVE_MEMBLOCK_NODE_MAP is
different. Once all the architectures will be converted from
free_area_init() and free_area_init_node() to free_area_init_nodes(), the
entire compatibility layer can be dropped.
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
---
include/linux/memblock.h | 15 ------
include/linux/mm.h | 16 +-----
include/linux/mmzone.h | 13 -----
mm/memblock.c | 9 +---
mm/memory_hotplug.c | 4 --
mm/page_alloc.c | 103 ++++++++++++++++++++++-----------------
6 files changed, 61 insertions(+), 99 deletions(-)
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 079d17d96410..9de81112447e 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -50,9 +50,7 @@ struct memblock_region {
phys_addr_t base;
phys_addr_t size;
enum memblock_flags flags;
-#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
int nid;
-#endif
};
/**
@@ -215,7 +213,6 @@ static inline bool memblock_is_nomap(struct memblock_region *m)
return m->flags & MEMBLOCK_NOMAP;
}
-#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
int memblock_search_pfn_nid(unsigned long pfn, unsigned long *start_pfn,
unsigned long *end_pfn);
void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn,
@@ -234,7 +231,6 @@ void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn,
#define for_each_mem_pfn_range(i, nid, p_start, p_end, p_nid) \
for (i = -1, __next_mem_pfn_range(&i, nid, p_start, p_end, p_nid); \
i >= 0; __next_mem_pfn_range(&i, nid, p_start, p_end, p_nid))
-#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
void __next_mem_pfn_range_in_zone(u64 *idx, struct zone *zone,
@@ -310,7 +306,6 @@ void __next_mem_pfn_range_in_zone(u64 *idx, struct zone *zone,
for_each_mem_range_rev(i, &memblock.memory, &memblock.reserved, \
nid, flags, p_start, p_end, p_nid)
-#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
int memblock_set_node(phys_addr_t base, phys_addr_t size,
struct memblock_type *type, int nid);
@@ -323,16 +318,6 @@ static inline int memblock_get_region_node(const struct memblock_region *r)
{
return r->nid;
}
-#else
-static inline void memblock_set_region_node(struct memblock_region *r, int nid)
-{
-}
-
-static inline int memblock_get_region_node(const struct memblock_region *r)
-{
- return 0;
-}
-#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
/* Flags for memblock allocation APIs */
#define MEMBLOCK_ALLOC_ANYWHERE (~(phys_addr_t)0)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index c54fb96cb1e6..368a45d4696a 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2125,9 +2125,8 @@ static inline unsigned long get_num_physpages(void)
return phys_pages;
}
-#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
/*
- * With CONFIG_HAVE_MEMBLOCK_NODE_MAP set, an architecture may initialise its
+ * Using memblock node mappings, an architecture may initialise its
* zones, allocate the backing mem_map and account for memory holes in a more
* architecture independent manner. This is a substitute for creating the
* zone_sizes[] and zholes_size[] arrays and passing them to
@@ -2148,9 +2147,6 @@ static inline unsigned long get_num_physpages(void)
* registered physical page range. Similarly
* sparse_memory_present_with_active_regions() calls memory_present() for
* each range when SPARSEMEM is enabled.
- *
- * See mm/page_alloc.c for more information on each function exposed by
- * CONFIG_HAVE_MEMBLOCK_NODE_MAP.
*/
extern void free_area_init_nodes(unsigned long *max_zone_pfn);
unsigned long node_map_pfn_alignment(void);
@@ -2165,22 +2161,12 @@ extern void free_bootmem_with_active_regions(int nid,
unsigned long max_low_pfn);
extern void sparse_memory_present_with_active_regions(int nid);
-#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
-#if !defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) && \
- !defined(CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID)
-static inline int __early_pfn_to_nid(unsigned long pfn,
- struct mminit_pfnnid_cache *state)
-{
- return 0;
-}
-#else
/* please see mm/page_alloc.c */
extern int __meminit early_pfn_to_nid(unsigned long pfn);
/* there is a per-arch backend function. */
extern int __meminit __early_pfn_to_nid(unsigned long pfn,
struct mminit_pfnnid_cache *state);
-#endif
extern void set_dma_reserve(unsigned long new_dma_reserve);
extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long,
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 462f6873905a..4422d1961d0e 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -917,11 +917,7 @@ extern int movable_zone;
#ifdef CONFIG_HIGHMEM
static inline int zone_movable_is_highmem(void)
{
-#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
return movable_zone == ZONE_HIGHMEM;
-#else
- return (ZONE_MOVABLE - 1) == ZONE_HIGHMEM;
-#endif
}
#endif
@@ -1121,15 +1117,6 @@ static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist,
#include <asm/sparsemem.h>
#endif
-#if !defined(CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID) && \
- !defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP)
-static inline unsigned long early_pfn_to_nid(unsigned long pfn)
-{
- BUILD_BUG_ON(IS_ENABLED(CONFIG_NUMA));
- return 0;
-}
-#endif
-
#ifdef CONFIG_FLATMEM
#define pfn_to_nid(pfn) (0)
#endif
diff --git a/mm/memblock.c b/mm/memblock.c
index eba94ee3de0b..819441133a21 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -620,9 +620,7 @@ static int __init_memblock memblock_add_range(struct memblock_type *type,
* area, insert that portion.
*/
if (rbase > base) {
-#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
WARN_ON(nid != memblock_get_region_node(rgn));
-#endif
WARN_ON(flags != rgn->flags);
nr_new++;
if (insert)
@@ -1197,7 +1195,6 @@ void __init_memblock __next_mem_range_rev(u64 *idx, int nid,
*idx = ULLONG_MAX;
}
-#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
/*
* Common iterator interface used to define for_each_mem_pfn_range().
*/
@@ -1258,7 +1255,7 @@ int __init_memblock memblock_set_node(phys_addr_t base, phys_addr_t size,
memblock_merge_regions(type);
return 0;
}
-#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
+
#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
/**
* __next_mem_pfn_range_in_zone - iterator for for_each_*_range_in_zone()
@@ -1797,7 +1794,6 @@ bool __init_memblock memblock_is_map_memory(phys_addr_t addr)
return !memblock_is_nomap(&memblock.memory.regions[i]);
}
-#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
int __init_memblock memblock_search_pfn_nid(unsigned long pfn,
unsigned long *start_pfn, unsigned long *end_pfn)
{
@@ -1812,7 +1808,6 @@ int __init_memblock memblock_search_pfn_nid(unsigned long pfn,
return type->regions[mid].nid;
}
-#endif
/**
* memblock_is_region_memory - check if a region is a subset of memory
@@ -1903,11 +1898,9 @@ static void __init_memblock memblock_dump(struct memblock_type *type)
size = rgn->size;
end = base + size - 1;
flags = rgn->flags;
-#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
if (memblock_get_region_node(rgn) != MAX_NUMNODES)
snprintf(nid_buf, sizeof(nid_buf), " on node %d",
memblock_get_region_node(rgn));
-#endif
pr_info(" %s[%#x]\t[%pa-%pa], %pa bytes%s flags: %#x\n",
type->name, idx, &base, &end, &size, nid_buf, flags);
}
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 19389cdc16a5..dc8828b087bf 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1366,11 +1366,7 @@ check_pages_isolated_cb(unsigned long start_pfn, unsigned long nr_pages,
static int __init cmdline_parse_movable_node(char *p)
{
-#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
movable_node_enabled = true;
-#else
- pr_warn("movable_node parameter depends on CONFIG_HAVE_MEMBLOCK_NODE_MAP to work properly\n");
-#endif
return 0;
}
early_param("movable_node", cmdline_parse_movable_node);
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 3c4eb750a199..84a69d6e7e61 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -335,7 +335,6 @@ static unsigned long nr_kernel_pages __initdata;
static unsigned long nr_all_pages __initdata;
static unsigned long dma_reserve __initdata;
-#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
static unsigned long arch_zone_lowest_possible_pfn[MAX_NR_ZONES] __initdata;
static unsigned long arch_zone_highest_possible_pfn[MAX_NR_ZONES] __initdata;
static unsigned long required_kernelcore __initdata;
@@ -348,7 +347,6 @@ static bool mirrored_kernelcore __meminitdata;
/* movable_zone is the "real" zone pages in ZONE_MOVABLE are taken from */
int movable_zone;
EXPORT_SYMBOL(movable_zone);
-#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
#if MAX_NUMNODES > 1
unsigned int nr_node_ids __read_mostly = MAX_NUMNODES;
@@ -1447,9 +1445,6 @@ void __free_pages_core(struct page *page, unsigned int order)
__free_pages(page, order);
}
-#if defined(CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID) || \
- defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP)
-
static struct mminit_pfnnid_cache early_pfnnid_cache __meminitdata;
int __meminit early_pfn_to_nid(unsigned long pfn)
@@ -1465,7 +1460,6 @@ int __meminit early_pfn_to_nid(unsigned long pfn)
return nid;
}
-#endif
#ifdef CONFIG_NODES_SPAN_OTHER_NODES
/* Only safe to use early in boot when initialisation is single-threaded */
@@ -5828,7 +5822,6 @@ void __ref build_all_zonelists(pg_data_t *pgdat)
static bool __meminit
overlap_memmap_init(unsigned long zone, unsigned long *pfn)
{
-#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
static struct memblock_region *r;
if (mirrored_kernelcore && zone == ZONE_MOVABLE) {
@@ -5844,7 +5837,7 @@ overlap_memmap_init(unsigned long zone, unsigned long *pfn)
return true;
}
}
-#endif
+
return false;
}
@@ -6227,7 +6220,6 @@ void __meminit init_currently_empty_zone(struct zone *zone,
zone->initialized = 1;
}
-#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
#ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
/*
@@ -6503,8 +6495,7 @@ static unsigned long __init zone_absent_pages_in_node(int nid,
return nr_absent;
}
-#else /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
-static inline unsigned long __init zone_spanned_pages_in_node(int nid,
+static inline unsigned long __init compat_zone_spanned_pages_in_node(int nid,
unsigned long zone_type,
unsigned long node_start_pfn,
unsigned long node_end_pfn,
@@ -6523,7 +6514,7 @@ static inline unsigned long __init zone_spanned_pages_in_node(int nid,
return zones_size[zone_type];
}
-static inline unsigned long __init zone_absent_pages_in_node(int nid,
+static inline unsigned long __init compat_zone_absent_pages_in_node(int nid,
unsigned long zone_type,
unsigned long node_start_pfn,
unsigned long node_end_pfn,
@@ -6535,13 +6526,12 @@ static inline unsigned long __init zone_absent_pages_in_node(int nid,
return zholes_size[zone_type];
}
-#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
-
static void __init calculate_node_totalpages(struct pglist_data *pgdat,
unsigned long node_start_pfn,
unsigned long node_end_pfn,
unsigned long *zones_size,
- unsigned long *zholes_size)
+ unsigned long *zholes_size,
+ bool compat)
{
unsigned long realtotalpages = 0, totalpages = 0;
enum zone_type i;
@@ -6549,17 +6539,38 @@ static void __init calculate_node_totalpages(struct pglist_data *pgdat,
for (i = 0; i < MAX_NR_ZONES; i++) {
struct zone *zone = pgdat->node_zones + i;
unsigned long zone_start_pfn, zone_end_pfn;
+ unsigned long spanned, absent;
unsigned long size, real_size;
- size = zone_spanned_pages_in_node(pgdat->node_id, i,
- node_start_pfn,
- node_end_pfn,
- &zone_start_pfn,
- &zone_end_pfn,
- zones_size);
- real_size = size - zone_absent_pages_in_node(pgdat->node_id, i,
- node_start_pfn, node_end_pfn,
- zholes_size);
+ if (compat) {
+ spanned = compat_zone_spanned_pages_in_node(
+ pgdat->node_id, i,
+ node_start_pfn,
+ node_end_pfn,
+ &zone_start_pfn,
+ &zone_end_pfn,
+ zones_size);
+ absent = compat_zone_absent_pages_in_node(
+ pgdat->node_id, i,
+ node_start_pfn,
+ node_end_pfn,
+ zholes_size);
+ } else {
+ spanned = zone_spanned_pages_in_node(pgdat->node_id, i,
+ node_start_pfn,
+ node_end_pfn,
+ &zone_start_pfn,
+ &zone_end_pfn,
+ zones_size);
+ absent = zone_absent_pages_in_node(pgdat->node_id, i,
+ node_start_pfn,
+ node_end_pfn,
+ zholes_size);
+ }
+
+ size = spanned;
+ real_size = size - absent;
+
if (size)
zone->zone_start_pfn = zone_start_pfn;
else
@@ -6859,10 +6870,8 @@ static void __ref alloc_node_mem_map(struct pglist_data *pgdat)
*/
if (pgdat == NODE_DATA(0)) {
mem_map = NODE_DATA(0)->node_mem_map;
-#if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM)
if (page_to_pfn(mem_map) != pgdat->node_start_pfn)
mem_map -= offset;
-#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
}
#endif
}
@@ -6879,9 +6888,10 @@ static inline void pgdat_set_deferred_range(pg_data_t *pgdat)
static inline void pgdat_set_deferred_range(pg_data_t *pgdat) {}
#endif
-void __init free_area_init_node(int nid, unsigned long *zones_size,
- unsigned long node_start_pfn,
- unsigned long *zholes_size)
+void __init __free_area_init_node(int nid, unsigned long *zones_size,
+ unsigned long node_start_pfn,
+ unsigned long *zholes_size,
+ bool compat)
{
pg_data_t *pgdat = NODE_DATA(nid);
unsigned long start_pfn = 0;
@@ -6893,16 +6903,17 @@ void __init free_area_init_node(int nid, unsigned long *zones_size,
pgdat->node_id = nid;
pgdat->node_start_pfn = node_start_pfn;
pgdat->per_cpu_nodestats = NULL;
-#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
- get_pfn_range_for_nid(nid, &start_pfn, &end_pfn);
- pr_info("Initmem setup node %d [mem %#018Lx-%#018Lx]\n", nid,
- (u64)start_pfn << PAGE_SHIFT,
- end_pfn ? ((u64)end_pfn << PAGE_SHIFT) - 1 : 0);
-#else
- start_pfn = node_start_pfn;
-#endif
+ if (!compat) {
+ get_pfn_range_for_nid(nid, &start_pfn, &end_pfn);
+ pr_info("Initmem setup node %d [mem %#018Lx-%#018Lx]\n", nid,
+ (u64)start_pfn << PAGE_SHIFT,
+ end_pfn ? ((u64)end_pfn << PAGE_SHIFT) - 1 : 0);
+ } else {
+ start_pfn = node_start_pfn;
+ }
+
calculate_node_totalpages(pgdat, start_pfn, end_pfn,
- zones_size, zholes_size);
+ zones_size, zholes_size, compat);
alloc_node_mem_map(pgdat);
pgdat_set_deferred_range(pgdat);
@@ -6910,6 +6921,14 @@ void __init free_area_init_node(int nid, unsigned long *zones_size,
free_area_init_core(pgdat);
}
+void __init free_area_init_node(int nid, unsigned long *zones_size,
+ unsigned long node_start_pfn,
+ unsigned long *zholes_size)
+{
+ __free_area_init_node(nid, zones_size, node_start_pfn, zholes_size,
+ true);
+}
+
#if !defined(CONFIG_FLAT_NODE_MEM_MAP)
/*
* Initialize all valid struct pages in the range [spfn, epfn) and mark them
@@ -6993,8 +7012,6 @@ static inline void __init init_unavailable_mem(void)
}
#endif /* !CONFIG_FLAT_NODE_MEM_MAP */
-#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
-
#if MAX_NUMNODES > 1
/*
* Figure out the number of possible node ids.
@@ -7423,8 +7440,8 @@ void __init free_area_init_nodes(unsigned long *max_zone_pfn)
init_unavailable_mem();
for_each_online_node(nid) {
pg_data_t *pgdat = NODE_DATA(nid);
- free_area_init_node(nid, NULL,
- find_min_pfn_for_node(nid), NULL);
+ __free_area_init_node(nid, NULL,
+ find_min_pfn_for_node(nid), NULL, false);
/* Any memory on that node */
if (pgdat->node_present_pages)
@@ -7489,8 +7506,6 @@ static int __init cmdline_parse_movablecore(char *p)
early_param("kernelcore", cmdline_parse_kernelcore);
early_param("movablecore", cmdline_parse_movablecore);
-#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
-
void adjust_managed_page_count(struct page *page, long count)
{
atomic_long_add(count, &page_zone(page)->managed_pages);
--
2.25.1
^ permalink raw reply related
* Re: [PATCH] powerpc: Add new HWCAP bits
From: Michael Neuling @ 2020-03-31 22:47 UTC (permalink / raw)
To: Tulio Magno Quites Machado Filho, Alistair Popple, linuxppc-dev
In-Reply-To: <877dz0sglo.fsf@linux.ibm.com>
On Tue, 2020-03-31 at 12:12 -0300, Tulio Magno Quites Machado Filho wrote:
> Alistair Popple <alistair@popple.id.au> writes:
>
> > diff --git a/arch/powerpc/include/uapi/asm/cputable.h
> > b/arch/powerpc/include/uapi/asm/cputable.h
> > index 540592034740..8888c6fe10b2 100644
> > --- a/arch/powerpc/include/uapi/asm/cputable.h
> > +++ b/arch/powerpc/include/uapi/asm/cputable.h
> > @@ -50,6 +50,8 @@
> > #define PPC_FEATURE2_DARN 0x00200000 /* darn random number insn */
> > #define PPC_FEATURE2_SCV 0x00100000 /* scv syscall */
> > #define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 /* TM w/out suspended
> > state */
> > +#define PPC_FEATURE2_ARCH_3_10 0x00040000 /* ISA 3.10 */
>
> I think this should have been:
>
> #define PPC_FEATURE2_ARCH_3_1 0x00040000 /* ISA 3.1 */
Agreed. That's the new name.
Sorry Al I should have caught that earlier.
Mikey
^ permalink raw reply
* Re: [PATCH] powerpc: Add new HWCAP bits
From: Alistair Popple @ 2020-03-31 23:27 UTC (permalink / raw)
To: Michael Neuling; +Cc: Tulio Magno Quites Machado Filho, linuxppc-dev
In-Reply-To: <34ff52dfe8233007db6dd7b1cd98a741e5bc392c.camel@neuling.org>
On Wednesday, 1 April 2020 9:47:03 AM AEDT Michael Neuling wrote:
> On Tue, 2020-03-31 at 12:12 -0300, Tulio Magno Quites Machado Filho wrote:
> > Alistair Popple <alistair@popple.id.au> writes:
> > > diff --git a/arch/powerpc/include/uapi/asm/cputable.h
> > > b/arch/powerpc/include/uapi/asm/cputable.h
> > > index 540592034740..8888c6fe10b2 100644
> > > --- a/arch/powerpc/include/uapi/asm/cputable.h
> > > +++ b/arch/powerpc/include/uapi/asm/cputable.h
> > > @@ -50,6 +50,8 @@
> > >
> > > #define PPC_FEATURE2_DARN 0x00200000 /* darn random number insn */
> > > #define PPC_FEATURE2_SCV 0x00100000 /* scv syscall */
> > > #define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 /* TM w/out suspended
> > >
> > > state */
> > > +#define PPC_FEATURE2_ARCH_3_10 0x00040000 /* ISA 3.10 */
> >
> > I think this should have been:
> >
> > #define PPC_FEATURE2_ARCH_3_1 0x00040000 /* ISA 3.1 */
>
> Agreed. That's the new name.
>
> Sorry Al I should have caught that earlier.
No worries, I missed it too. Will send v2.
- Alistair
> Mikey
^ permalink raw reply
* [PATCH v2] powerpc: Add new HWCAP bits
From: Alistair Popple @ 2020-03-31 23:50 UTC (permalink / raw)
To: linuxppc-dev; +Cc: tuliom, mikey, Alistair Popple
Two new future architectural features requiring HWCAP bits are being
developed. Once allocated in the kernel firmware can enable these via
device tree cpu features.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
---
v2: ISA v3.10 -> ISA v3.1
---
arch/powerpc/include/uapi/asm/cputable.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/include/uapi/asm/cputable.h b/arch/powerpc/include/uapi/asm/cputable.h
index 540592034740..2692a56bf20b 100644
--- a/arch/powerpc/include/uapi/asm/cputable.h
+++ b/arch/powerpc/include/uapi/asm/cputable.h
@@ -50,6 +50,8 @@
#define PPC_FEATURE2_DARN 0x00200000 /* darn random number insn */
#define PPC_FEATURE2_SCV 0x00100000 /* scv syscall */
#define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 /* TM w/out suspended state */
+#define PPC_FEATURE2_ARCH_3_1 0x00040000 /* ISA 3.1 */
+#define PPC_FEATURE2_MMA 0x00020000 /* Matrix Multiply Accumulate */
/*
* IMPORTANT!
--
2.20.1
^ permalink raw reply related
* Re: [PATCH v2] powerpc/XIVE: SVM: share the event-queue page with the Hypervisor.
From: Thiago Jung Bauermann @ 2020-03-31 23:53 UTC (permalink / raw)
To: Ram Pai; +Cc: aik, andmike, groug, kvm-ppc, clg, sukadev, linuxppc-dev, david
In-Reply-To: <1585211927-784-1-git-send-email-linuxram@us.ibm.com>
Hi Ram,
Ram Pai <linuxram@us.ibm.com> writes:
> diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c
> index 55dc61c..608b52f 100644
> --- a/arch/powerpc/sysdev/xive/spapr.c
> +++ b/arch/powerpc/sysdev/xive/spapr.c
> @@ -26,6 +26,8 @@
> #include <asm/xive.h>
> #include <asm/xive-regs.h>
> #include <asm/hvcall.h>
> +#include <asm/svm.h>
> +#include <asm/ultravisor.h>
>
> #include "xive-internal.h"
>
> @@ -501,6 +503,9 @@ static int xive_spapr_configure_queue(u32 target, struct xive_q *q, u8 prio,
> rc = -EIO;
> } else {
> q->qpage = qpage;
> + if (is_secure_guest())
> + uv_share_page(PHYS_PFN(qpage_phys),
> + 1 << xive_alloc_order(order));
If I understand this correctly, you're passing the number of bytes of
the queue to uv_share_page(), but that ultracall expects the number of
pages to be shared.
> }
> fail:
> return rc;
> @@ -534,6 +539,8 @@ static void xive_spapr_cleanup_queue(unsigned int cpu, struct xive_cpu *xc,
> hw_cpu, prio);
>
> alloc_order = xive_alloc_order(xive_queue_shift);
> + if (is_secure_guest())
> + uv_unshare_page(PHYS_PFN(__pa(q->qpage)), 1 << alloc_order);
> free_pages((unsigned long)q->qpage, alloc_order);
> q->qpage = NULL;
> }
Same problem here.
--
Thiago Jung Bauermann
IBM Linux Technology Center
^ permalink raw reply
* [PATCH v3 1/1] ppc/crash: Reset spinlocks during crash
From: Leonardo Bras @ 2020-04-01 0:00 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
Enrico Weigelt, Leonardo Bras, Alexios Zavras, Thomas Gleixner,
Greg Kroah-Hartman, Christophe Leroy, peterz
Cc: linuxppc-dev, linux-kernel
During a crash, there is chance that the cpus that handle the NMI IPI
are holding a spin_lock. If this spin_lock is needed by crashing_cpu it
will cause a deadlock. (rtas.lock and printk logbuf_lock as of today)
This is a problem if the system has kdump set up, given if it crashes
for any reason kdump may not be saved for crash analysis.
After NMI IPI is sent to all other cpus, force unlock all spinlocks
needed for finishing crash routine.
Signed-off-by: Leonardo Bras <leonardo@linux.ibm.com>
---
Changes from v2:
- Instead of skipping spinlocks, unlock the needed ones.
Changes from v1:
- Exported variable
---
arch/powerpc/kexec/crash.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/powerpc/kexec/crash.c b/arch/powerpc/kexec/crash.c
index d488311efab1..8d63fca3242c 100644
--- a/arch/powerpc/kexec/crash.c
+++ b/arch/powerpc/kexec/crash.c
@@ -24,6 +24,7 @@
#include <asm/smp.h>
#include <asm/setjmp.h>
#include <asm/debug.h>
+#include <asm/rtas.h>
/*
* The primary CPU waits a while for all secondary CPUs to enter. This is to
@@ -49,6 +50,8 @@ static int time_to_dump;
*/
int crash_wake_offline;
+extern raw_spinlock_t logbuf_lock;
+
#define CRASH_HANDLER_MAX 3
/* List of shutdown handles */
static crash_shutdown_t crash_shutdown_handles[CRASH_HANDLER_MAX];
@@ -129,6 +132,13 @@ static void crash_kexec_prepare_cpus(int cpu)
/* Would it be better to replace the trap vector here? */
if (atomic_read(&cpus_in_crash) >= ncpus) {
+ /*
+ * At this point no other CPU is running, and some of them may
+ * have been interrupted while holding one of the locks needed
+ * to complete crashing. Free them so there is no deadlock.
+ */
+ arch_spin_unlock(&logbuf_lock.raw_lock);
+ arch_spin_unlock(&rtas.lock);
printk(KERN_EMERG "IPI complete\n");
return;
}
--
2.25.1
^ permalink raw reply related
* [PATCH] Fix "[v3, 12/32] powerpc/64s/exception: move KVM test to common code"
From: Nicholas Piggin @ 2020-04-01 1:12 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Nicholas Piggin
Moving KVM test to the common entry code missed the case of HMI and MCE,
which do not do __GEN_COMMON_ENTRY (because they don't want to switch
to virt mode).
This means a MCE or HMI exception that is taken while KVM is running a
guest context will not be switched out of that context, and KVM won't
be notified. Found by running sigfuz in guest with patched host on
POWER9 DD2.3, which causes some TM related HMI interrupts (which are
expected and supposed to be handled by KVM).
This fix adds a __GEN_REALMODE_COMMON_ENTRY for those handlers to add
the KVM test. This makes them look a little more like other handlers
that all use __GEN_COMMON_ENTRY.
Conflicts with later patches in series:
- powerpc/64s/exception: remove confusing IEARLY option
Fix: Remove mfspr (H)SRR, keep __GEN_REALMODE_COMMON_ENTRY
- powerpc/64s/exception: trim unused arguments from KVMTEST macro
Fix: Trim IHSRR IVEC args from the KVMTEST in __GEN_REALMODE_COMMON_ENTRY
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/kernel/exceptions-64s.S | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 74809f1b521d..1bc73acceb9a 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -451,7 +451,9 @@ END_FTR_SECTION_NESTED(CPU_FTR_HAS_PPR,CPU_FTR_HAS_PPR,948)
/*
* __GEN_COMMON_ENTRY is required to receive the branch from interrupt
- * entry, except in the case of the IEARLY handlers.
+ * entry, except in the case of the real-mode handlers which require
+ * __GEN_REALMODE_COMMON_ENTRY.
+ *
* This switches to virtual mode and sets MSR[RI].
*/
.macro __GEN_COMMON_ENTRY name
@@ -487,6 +489,18 @@ DEFINE_FIXED_SYMBOL(\name\()_common_virt)
.endif /* IVIRT */
.endm
+/*
+ * Don't switch to virt mode. Used for early MCE and HMI handlers that
+ * want to run in real mode.
+ */
+.macro __GEN_REALMODE_COMMON_ENTRY name
+DEFINE_FIXED_SYMBOL(\name\()_common_real)
+\name\()_common_real:
+ .if IKVM_REAL
+ KVMTEST \name IHSRR IVEC
+ .endif
+.endm
+
.macro __GEN_COMMON_BODY name
.if IMASK
lbz r10,PACAIRQSOFTMASK(r13)
@@ -976,6 +990,8 @@ EXC_COMMON_BEGIN(machine_check_early_common)
mfspr r11,SPRN_SRR0
mfspr r12,SPRN_SRR1
+ __GEN_REALMODE_COMMON_ENTRY machine_check_early
+
/*
* Switch to mc_emergency stack and handle re-entrancy (we limit
* the nested MCE upto level 4 to avoid stack overflow).
@@ -1831,6 +1847,9 @@ EXC_VIRT_NONE(0x4e60, 0x20)
EXC_COMMON_BEGIN(hmi_exception_early_common)
mfspr r11,SPRN_HSRR0 /* Save HSRR0 */
mfspr r12,SPRN_HSRR1 /* Save HSRR1 */
+
+ __GEN_REALMODE_COMMON_ENTRY hmi_exception_early
+
mr r10,r1 /* Save r1 */
ld r1,PACAEMERGSP(r13) /* Use emergency stack for realmode */
subi r1,r1,INT_FRAME_SIZE /* alloc stack frame */
--
2.23.0
^ permalink raw reply related
* Re: [PATCH v2 0/2] powerpc: Remove support for ppc405/440 Xilinx platforms
From: Michael Ellerman @ 2020-04-01 2:07 UTC (permalink / raw)
To: Michal Simek, linux-kernel, monstr, michal.simek, git, sfr, maz
Cc: Kate Stewart, Mark Rutland, Desnes A. Nunes do Rosario,
Geert Uytterhoeven, linux-doc, alsa-devel, dri-devel,
Jaroslav Kysela, Richard Fontana, Paul Mackerras, Miquel Raynal,
Mauro Carvalho Chehab, Fabio Estevam, Sasha Levin,
Jonathan Corbet, Masahiro Yamada, YueHaibing, Krzysztof Kozlowski,
Allison Randal, linux-arm-kernel, devicetree, Andrew Donnellan,
Arnd Bergmann, Bartlomiej Zolnierkiewicz, Alistair Popple,
linuxppc-dev, Nicholas Piggin, Alexios Zavras, Mark Brown,
linux-fbdev, Jonathan Cameron, Thomas Gleixner, Andy Shevchenko,
Dmitry Vyukov, Wei Hu, Greg Kroah-Hartman, Nick Desaulniers,
Takashi Iwai, Rob Herring, Enrico Weigelt, David S. Miller,
Thiago Jung Bauermann
In-Reply-To: <cover.1585575111.git.michal.simek@xilinx.com>
Michal Simek <michal.simek@xilinx.com> writes:
> Hi,
>
> recently we wanted to update xilinx intc driver and we found that function
> which we wanted to remove is still wired by ancient Xilinx PowerPC
> platforms. Here is the thread about it.
> https://lore.kernel.org/linux-next/48d3232d-0f1d-42ea-3109-f44bbabfa2e8@xilinx.com/
>
> I have been talking about it internally and there is no interest in these
> platforms and it is also orphan for quite a long time. None is really
> running/testing these platforms regularly that's why I think it makes sense
> to remove them also with drivers which are specific to this platform.
>
> U-Boot support was removed in 2017 without anybody complain about it
> https://github.com/Xilinx/u-boot-xlnx/commit/98f705c9cefdfdba62c069821bbba10273a0a8ed
>
> Based on current ppc/next.
>
> If anyone has any objection about it, please let me know.
Thanks for taking the time to find all this code and remove it.
I'm not going to take this series for v5.7, it was posted too close to
the merge window, and doing so wouldn't give people much time to object,
especially given people are distracted at the moment.
I'm happy to take it for v5.8, assuming there's no major objections.
cheers
^ permalink raw reply
* Re: [PATCH v2 07/11] powerpc/xmon: Remove PPC403 and PPC405
From: Michael Ellerman @ 2020-04-01 2:16 UTC (permalink / raw)
To: Arnd Bergmann, Christophe Leroy
Cc: linuxppc-dev, Paul Mackerras, Michal Simek,
linux-kernel@vger.kernel.org
In-Reply-To: <CAK8P3a2Q5gmcyjo03QoDMNO-xEWXDjhW8ScUsGGRWVKgVXj5_g@mail.gmail.com>
Arnd Bergmann <arnd@arndb.de> writes:
> On Tue, Mar 31, 2020 at 9:49 AM Christophe Leroy
> <christophe.leroy@c-s.fr> wrote:
>>
>> xmon has special support for PPC403 and PPC405 which were part
>> of 40x platforms.
>>
>> 40x platforms are gone, remove support of PPC403 and PPC405 in xmon.
>>
>> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>> ---
>> arch/powerpc/xmon/ppc-opc.c | 277 +++++++-----------------------------
>> arch/powerpc/xmon/ppc.h | 6 -
>
> These files are from binutils, and may get synchronized with changes there
> in the future. I'd suggest leaving the code in here for now and instead removing
> it from the binutils version first, if they are ready to drop it, too.
Yes those files are almost direct copies of the binutils versions, and
we'd like to keep it that way to ease future synchronisation of changes.
cheers
^ permalink raw reply
* Re: [PATCH v2 09/11] powerpc/platforms: Move files from 4xx to 44x
From: Michael Ellerman @ 2020-04-01 2:20 UTC (permalink / raw)
To: Christophe Leroy, Arnd Bergmann
Cc: linuxppc-dev, Paul Mackerras, Michal Simek,
linux-kernel@vger.kernel.org
In-Reply-To: <74e76b4e-5e4f-f3de-96a8-f6a451b3243a@c-s.fr>
Christophe Leroy <christophe.leroy@c-s.fr> writes:
> Le 31/03/2020 à 18:04, Arnd Bergmann a écrit :
>> On Tue, Mar 31, 2020 at 5:26 PM Christophe Leroy
>> <christophe.leroy@c-s.fr> wrote:
>>> Le 31/03/2020 à 17:14, Arnd Bergmann a écrit :
>>>> On Tue, Mar 31, 2020 at 9:49 AM Christophe Leroy
>>>> <christophe.leroy@c-s.fr> wrote:
>>>>>
>>>>> Only 44x uses 4xx now, so only keep one directory.
>>>>>
>>>>> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>>>>> ---
>>>>> arch/powerpc/platforms/44x/Makefile | 9 +++++++-
>>>>> arch/powerpc/platforms/{4xx => 44x}/cpm.c | 0
>>>>
>>>> No objections to moving everything into one place, but I wonder if the
>>>> combined name should be 4xx instead of 44x, given that 44x currently
>>>> include 46x and 47x. OTOH your approach has the advantage of
>>>> moving fewer files.
>>>>
>>>
>>> In that case, should we also rename CONFIG_44x to CONFIG_4xx ?
>>
>> That has the risk of breaking user's defconfig files, but given the
>> small number of users, it may be nicer for consistency. In either
>> case, the two symbols should probably hang around as synonyms,
>> the question is just which one is user visible.
>>
>
> Not sure it is a good idea to keep two synonyms. In the past we made our
> best to remove synonyms (We had CONFIG_8xx and CONFIG_PPC_8xx being
> synonyms, we had CONFIG_6xx and CONFIG_BOOK3S_32 and
> CONFIG_PPC_STD_MMU_32 being synonyms).
> I think it is a lot cleaner when we can avoid synonyms.
>
> By the way I already dropped CONFIG_4xx in previous patch (8/11). It was
> not many 4xx changed to 44x. It would be a lot more in the other way
> round I'm afraid.
>
> But I agree with you it might be more natural to change to 4xx.
>
> Michael, any preference ?
I'd say just use 44x, we've had the inconsistency of 476 living in
platforms/44x, and it hasn't really led to much confusion.
I think for most folks they see 4xx/44x and just think "some 32-bit
embedded thing", so the precise distinction between 4xx, 44x, 476 etc.
is not that important to justify renaming the symbol everywhere I think.
cheers
^ permalink raw reply
* Re: [PATCH v7 7/7] powerpc/32: use set_memory_attr()
From: Russell Currey @ 2020-04-01 2:27 UTC (permalink / raw)
To: Christophe Leroy, linuxppc-dev; +Cc: kernel-hardening, ajd, npiggin, dja
In-Reply-To: <e61a1f88-1ad6-ca26-790b-f036faacb790@c-s.fr>
On Tue, 2020-03-31 at 11:56 +0200, Christophe Leroy wrote:
>
> Le 31/03/2020 à 06:48, Russell Currey a écrit :
> > From: Christophe Leroy <christophe.leroy@c-s.fr>
> >
> > Use set_memory_attr() instead of the PPC32 specific
> > change_page_attr()
> >
> > change_page_attr() was checking that the address was not mapped by
> > blocks and was handling highmem, but that's unneeded because the
> > affected pages can't be in highmem and block mapping verification
> > is already done by the callers.
> >
> > Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> > ---
> > arch/powerpc/mm/pgtable_32.c | 95 ++++---------------------------
> > -----
> > 1 file changed, 10 insertions(+), 85 deletions(-)
> >
> > diff --git a/arch/powerpc/mm/pgtable_32.c
> > b/arch/powerpc/mm/pgtable_32.c
> > index 5fb90edd865e..3d92eaf3ee2f 100644
> > --- a/arch/powerpc/mm/pgtable_32.c
> > +++ b/arch/powerpc/mm/pgtable_32.c
> > @@ -23,6 +23,7 @@
> > #include <linux/highmem.h>
> > #include <linux/memblock.h>
> > #include <linux/slab.h>
> > +#include <linux/set_memory.h>
> >
> > #include <asm/pgtable.h>
> > #include <asm/pgalloc.h>
> > @@ -121,99 +122,20 @@ void __init mapin_ram(void)
> > }
> > }
> >
> > -/* Scan the real Linux page tables and return a PTE pointer for
> > - * a virtual address in a context.
> > - * Returns true (1) if PTE was found, zero otherwise. The pointer
> > to
> > - * the PTE pointer is unmodified if PTE is not found.
> > - */
> > -static int
> > -get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep,
> > pmd_t **pmdp)
>
> This will conflict, get_pteptr() is gone now, see
> https://github.com/linuxppc/linux/commit/2efc7c085f05870eda6f29ac71eeb83f3bd54415
>
> Christophe
OK cool, so I can just drop that hunk? Will try that and make sure it
rebases on powerpc/next
- Russell
>
>
> > -{
> > - pgd_t *pgd;
> > - pud_t *pud;
> > - pmd_t *pmd;
> > - pte_t *pte;
> > - int retval = 0;
> > -
> > - pgd = pgd_offset(mm, addr & PAGE_MASK);
> > - if (pgd) {
> > - pud = pud_offset(pgd, addr & PAGE_MASK);
> > - if (pud && pud_present(*pud)) {
> > - pmd = pmd_offset(pud, addr & PAGE_MASK);
> > - if (pmd_present(*pmd)) {
> > - pte = pte_offset_map(pmd, addr &
> > PAGE_MASK);
> > - if (pte) {
> > - retval = 1;
> > - *ptep = pte;
> > - if (pmdp)
> > - *pmdp = pmd;
> > - /* XXX caller needs to do
> > pte_unmap, yuck */
> > - }
> > - }
> > - }
> > - }
> > - return(retval);
> > -}
> > -
> > -static int __change_page_attr_noflush(struct page *page, pgprot_t
> > prot)
> > -{
> > - pte_t *kpte;
> > - pmd_t *kpmd;
> > - unsigned long address;
> > -
> > - BUG_ON(PageHighMem(page));
> > - address = (unsigned long)page_address(page);
> > -
> > - if (v_block_mapped(address))
> > - return 0;
> > - if (!get_pteptr(&init_mm, address, &kpte, &kpmd))
> > - return -EINVAL;
> > - __set_pte_at(&init_mm, address, kpte, mk_pte(page, prot), 0);
> > - pte_unmap(kpte);
> > -
> > - return 0;
> > -}
> > -
> > -/*
> > - * Change the page attributes of an page in the linear mapping.
> > - *
> > - * THIS DOES NOTHING WITH BAT MAPPINGS, DEBUG USE ONLY
> > - */
> > -static int change_page_attr(struct page *page, int numpages,
> > pgprot_t prot)
> > -{
> > - int i, err = 0;
> > - unsigned long flags;
> > - struct page *start = page;
> > -
> > - local_irq_save(flags);
> > - for (i = 0; i < numpages; i++, page++) {
> > - err = __change_page_attr_noflush(page, prot);
> > - if (err)
> > - break;
> > - }
> > - wmb();
> > - local_irq_restore(flags);
> > - flush_tlb_kernel_range((unsigned long)page_address(start),
> > - (unsigned long)page_address(page));
> > - return err;
> > -}
> > -
> > void mark_initmem_nx(void)
> > {
> > - struct page *page = virt_to_page(_sinittext);
> > unsigned long numpages = PFN_UP((unsigned long)_einittext) -
> > PFN_DOWN((unsigned long)_sinittext);
> >
> > if (v_block_mapped((unsigned long)_stext + 1))
> > mmu_mark_initmem_nx();
> > else
> > - change_page_attr(page, numpages, PAGE_KERNEL);
> > + set_memory_attr((unsigned long)_sinittext, numpages,
> > PAGE_KERNEL);
> > }
> >
> > #ifdef CONFIG_STRICT_KERNEL_RWX
> > void mark_rodata_ro(void)
> > {
> > - struct page *page;
> > unsigned long numpages;
> >
> > if (v_block_mapped((unsigned long)_sinittext)) {
> > @@ -222,20 +144,18 @@ void mark_rodata_ro(void)
> > return;
> > }
> >
> > - page = virt_to_page(_stext);
> > numpages = PFN_UP((unsigned long)_etext) -
> > PFN_DOWN((unsigned long)_stext);
> >
> > - change_page_attr(page, numpages, PAGE_KERNEL_ROX);
> > + set_memory_attr((unsigned long)_stext, numpages,
> > PAGE_KERNEL_ROX);
> > /*
> > * mark .rodata as read only. Use __init_begin rather than
> > __end_rodata
> > * to cover NOTES and EXCEPTION_TABLE.
> > */
> > - page = virt_to_page(__start_rodata);
> > numpages = PFN_UP((unsigned long)__init_begin) -
> > PFN_DOWN((unsigned long)__start_rodata);
> >
> > - change_page_attr(page, numpages, PAGE_KERNEL_RO);
> > + set_memory_attr((unsigned long)__start_rodata, numpages,
> > PAGE_KERNEL_RO);
> >
> > // mark_initmem_nx() should have already run by now
> > ptdump_check_wx();
> > @@ -245,9 +165,14 @@ void mark_rodata_ro(void)
> > #ifdef CONFIG_DEBUG_PAGEALLOC
> > void __kernel_map_pages(struct page *page, int numpages, int
> > enable)
> > {
> > + unsigned long addr = (unsigned long)page_address(page);
> > +
> > if (PageHighMem(page))
> > return;
> >
> > - change_page_attr(page, numpages, enable ? PAGE_KERNEL :
> > __pgprot(0));
> > + if (enable)
> > + set_memory_attr(addr, numpages, PAGE_KERNEL);
> > + else
> > + set_memory_attr(addr, numpages, __pgprot(0));
> > }
> > #endif /* CONFIG_DEBUG_PAGEALLOC */
> >
^ permalink raw reply
* [PATCH] powerpc/64/tm: Don't let userspace set regs->trap via sigreturn
From: Michael Ellerman @ 2020-04-01 2:38 UTC (permalink / raw)
To: linuxppc-dev; +Cc: mikey, npiggin, gromero
In restore_tm_sigcontexts() we take the trap value directly from the
user sigcontext with no checking:
err |= __get_user(regs->trap, &sc->gp_regs[PT_TRAP]);
This means we can be in the kernel with an arbitrary regs->trap value.
Although that's not immediately problematic, there is a risk we could
trigger one of the uses of CHECK_FULL_REGS():
#define CHECK_FULL_REGS(regs) BUG_ON(regs->trap & 1)
It can also cause us to unnecessarily save non-volatile GPRs again in
save_nvgprs(), which shouldn't be problematic but is still wrong.
It's also possible it could trick the syscall restart machinery, which
relies on regs->trap not being == 0xc00 (see 9a81c16b5275 ("powerpc:
fix double syscall restarts")), though I haven't been able to make
that happen.
Finally it doesn't match the behaviour of the non-TM case, in
restore_sigcontext() which zeroes regs->trap.
So change restore_tm_sigcontexts() to zero regs->trap.
This was discovered while testing Nick's upcoming rewrite of the
syscall entry path. In that series the call to save_nvgprs() prior to
signal handling (do_notify_resume()) is removed, which leaves the
low-bit of regs->trap uncleared which can then trigger the FULL_REGS()
WARNs in setup_tm_sigcontexts().
Fixes: 2b0a576d15e0 ("powerpc: Add new transactional memory state to the signal context")
Cc: stable@vger.kernel.org # v3.9+
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/kernel/signal_64.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index 84ed2e77ef9c..adfde59cf4ba 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -473,8 +473,10 @@ static long restore_tm_sigcontexts(struct task_struct *tsk,
err |= __get_user(tsk->thread.ckpt_regs.ccr,
&sc->gp_regs[PT_CCR]);
+ /* Don't allow userspace to set the trap value */
+ regs->trap = 0;
+
/* These regs are not checkpointed; they can go in 'regs'. */
- err |= __get_user(regs->trap, &sc->gp_regs[PT_TRAP]);
err |= __get_user(regs->dar, &sc->gp_regs[PT_DAR]);
err |= __get_user(regs->dsisr, &sc->gp_regs[PT_DSISR]);
err |= __get_user(regs->result, &sc->gp_regs[PT_RESULT]);
base-commit: 7074695ac6fb965d478f373b95bc5c636e9f21b0
--
2.25.1
^ permalink raw reply related
* Re: [PATCH v3 1/1] ppc/crash: Reset spinlocks during crash
From: kbuild test robot @ 2020-04-01 3:07 UTC (permalink / raw)
To: Leonardo Bras
Cc: kbuild-all, Greg Kroah-Hartman, peterz, linuxppc-dev,
linux-kernel, Alexios Zavras, Paul Mackerras, Leonardo Bras,
Thomas Gleixner, Enrico Weigelt
In-Reply-To: <20200401000020.590447-1-leonardo@linux.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1455 bytes --]
Hi Leonardo,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on powerpc/next]
[also build test ERROR on paulus-powerpc/kvm-ppc-next linus/master linux/master v5.6 next-20200331]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Leonardo-Bras/ppc-crash-Reset-spinlocks-during-crash/20200401-091600
base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-rhel-kconfig (attached as .config)
compiler: powerpc64le-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=9.3.0 make.cross ARCH=powerpc
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
powerpc64le-linux-ld: warning: orphan section `.gnu.hash' from `linker stubs' being placed in section `.gnu.hash'
>> powerpc64le-linux-ld: arch/powerpc/kexec/crash.o:(.toc+0x0): undefined reference to `rtas'
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 15339 bytes --]
^ permalink raw reply
* Re: [PATCH 0/2] selftests: vm: Build fixes for powerpc64
From: Michael Ellerman @ 2020-04-01 3:37 UTC (permalink / raw)
To: Shuah Khan, Sandipan Das, shuah, linux-kselftest
Cc: aneesh.kumar, kamalesh, linux-mm, mhiramat, Shuah Khan,
linuxppc-dev
In-Reply-To: <4837525c-c078-0e33-614e-103514946ff9@linuxfoundation.org>
Shuah Khan <skhan@linuxfoundation.org> writes:
> On 1/30/20 12:01 AM, Sandipan Das wrote:
>> The second patch was already posted independently but because
>> of the changes in the first patch, the second one now depends
>> on it. Hence posting it now as a part of this series.
>>
>> The last version (v2) of the second patch can be found at:
>> https://patchwork.ozlabs.org/patch/1225969/
>>
>> Sandipan Das (2):
>> selftests: vm: Do not override definition of ARCH
>> selftests: vm: Fix 64-bit test builds for powerpc64le
>>
>> tools/testing/selftests/vm/Makefile | 4 ++--
>> tools/testing/selftests/vm/run_vmtests | 2 +-
>> 2 files changed, 3 insertions(+), 3 deletions(-)
>>
>
> Michael,
>
> I see your tested-by on these two patches. I will take these
> through kselftest fixes.
Thanks.
cheers
^ permalink raw reply
* Re: Emulate ppc64le builds on x86/x64 machine
From: Michael Ellerman @ 2020-04-01 3:57 UTC (permalink / raw)
To: shivakanth k, linuxppc-dev
In-Reply-To: <CAMksNJXP5BKoS245igR2aNXVnf6Yvh_zXseyvg=Q7+h-0gavcQ@mail.gmail.com>
shivakanth k <shiva.jaishankar@gmail.com> writes:
> Hi ,
> Could you please help me to set up ppc64le 0n liunux machine
There's some instructions here:
https://github.com/linuxppc/wiki/wiki/Building-powerpc-kernels
cheers
^ permalink raw reply
* Re: [PATCH v5 1/4] powerpc/papr_scm: Fetch nvdimm health information from PHYP
From: Aneesh Kumar K.V @ 2020-04-01 5:30 UTC (permalink / raw)
To: Vaibhav Jain, linuxppc-dev, linux-nvdimm
Cc: Vaibhav Jain, Michael Ellerman, Alastair D'Silva
In-Reply-To: <20200331143229.306718-2-vaibhav@linux.ibm.com>
Vaibhav Jain <vaibhav@linux.ibm.com> writes:
> Implement support for fetching nvdimm health information via
> H_SCM_HEALTH hcall as documented in Ref[1]. The hcall returns a pair
> of 64-bit big-endian integers which are then stored in 'struct
> papr_scm_priv' and subsequently partially exposed to user-space via
> newly introduced dimm specific attribute 'papr_flags'. Also a new asm
> header named 'papr-scm.h' is added that describes the interface
> between PHYP and guest kernel.
>
> Following flags are reported via 'papr_flags' sysfs attribute contents
> of which are space separated string flags indicating various nvdimm
> states:
>
> * "not_armed" : Indicating that nvdimm contents wont survive a power
> cycle.
> * "save_fail" : Indicating that nvdimm contents couldn't be flushed
> during last shutdown event.
> * "restore_fail": Indicating that nvdimm contents couldn't be restored
> during dimm initialization.
> * "encrypted" : Dimm contents are encrypted.
> * "smart_notify": There is health event for the nvdimm.
> * "scrubbed" : Indicating that contents of the nvdimm have been
> scrubbed.
> * "locked" : Indicating that nvdimm contents cant be modified
> until next power cycle.
>
> [1]: commit 58b278f568f0 ("powerpc: Provide initial documentation for
> PAPR hcalls")
>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
> Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
> ---
> Changelog:
>
> v4..v5 : None
>
> v3..v4 : None
>
> v2..v3 : Removed PAPR_SCM_DIMM_HEALTH_NON_CRITICAL as a condition for
> NVDIMM unarmed [Aneesh]
>
> v1..v2 : New patch in the series.
> ---
> arch/powerpc/include/asm/papr_scm.h | 48 ++++++++++
> arch/powerpc/platforms/pseries/papr_scm.c | 105 +++++++++++++++++++++-
> 2 files changed, 151 insertions(+), 2 deletions(-)
> create mode 100644 arch/powerpc/include/asm/papr_scm.h
>
> diff --git a/arch/powerpc/include/asm/papr_scm.h b/arch/powerpc/include/asm/papr_scm.h
> new file mode 100644
> index 000000000000..868d3360f56a
> --- /dev/null
> +++ b/arch/powerpc/include/asm/papr_scm.h
> @@ -0,0 +1,48 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +/*
> + * Structures and defines needed to manage nvdimms for spapr guests.
> + */
> +#ifndef _ASM_POWERPC_PAPR_SCM_H_
> +#define _ASM_POWERPC_PAPR_SCM_H_
> +
> +#include <linux/types.h>
> +#include <asm/bitsperlong.h>
> +
> +/* DIMM health bitmap bitmap indicators */
> +/* SCM device is unable to persist memory contents */
> +#define PAPR_SCM_DIMM_UNARMED PPC_BIT(0)
> +/* SCM device failed to persist memory contents */
> +#define PAPR_SCM_DIMM_SHUTDOWN_DIRTY PPC_BIT(1)
> +/* SCM device contents are persisted from previous IPL */
> +#define PAPR_SCM_DIMM_SHUTDOWN_CLEAN PPC_BIT(2)
> +/* SCM device contents are not persisted from previous IPL */
> +#define PAPR_SCM_DIMM_EMPTY PPC_BIT(3)
> +/* SCM device memory life remaining is critically low */
> +#define PAPR_SCM_DIMM_HEALTH_CRITICAL PPC_BIT(4)
> +/* SCM device will be garded off next IPL due to failure */
> +#define PAPR_SCM_DIMM_HEALTH_FATAL PPC_BIT(5)
> +/* SCM contents cannot persist due to current platform health status */
> +#define PAPR_SCM_DIMM_HEALTH_UNHEALTHY PPC_BIT(6)
> +/* SCM device is unable to persist memory contents in certain conditions */
> +#define PAPR_SCM_DIMM_HEALTH_NON_CRITICAL PPC_BIT(7)
> +/* SCM device is encrypted */
> +#define PAPR_SCM_DIMM_ENCRYPTED PPC_BIT(8)
> +/* SCM device has been scrubbed and locked */
> +#define PAPR_SCM_DIMM_SCRUBBED_AND_LOCKED PPC_BIT(9)
> +
> +/* Bits status indicators for health bitmap indicating unarmed dimm */
> +#define PAPR_SCM_DIMM_UNARMED_MASK (PAPR_SCM_DIMM_UNARMED | \
> + PAPR_SCM_DIMM_HEALTH_UNHEALTHY)
> +
> +/* Bits status indicators for health bitmap indicating unflushed dimm */
> +#define PAPR_SCM_DIMM_BAD_SHUTDOWN_MASK (PAPR_SCM_DIMM_SHUTDOWN_DIRTY)
> +
> +/* Bits status indicators for health bitmap indicating unrestored dimm */
> +#define PAPR_SCM_DIMM_BAD_RESTORE_MASK (PAPR_SCM_DIMM_EMPTY)
> +
> +/* Bit status indicators for smart event notification */
> +#define PAPR_SCM_DIMM_SMART_EVENT_MASK (PAPR_SCM_DIMM_HEALTH_CRITICAL | \
> + PAPR_SCM_DIMM_HEALTH_FATAL | \
> + PAPR_SCM_DIMM_HEALTH_UNHEALTHY)
> +
> +#endif
> diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/powerpc/platforms/pseries/papr_scm.c
> index 0b4467e378e5..aaf2e4ab1f75 100644
> --- a/arch/powerpc/platforms/pseries/papr_scm.c
> +++ b/arch/powerpc/platforms/pseries/papr_scm.c
> @@ -14,6 +14,7 @@
> #include <linux/delay.h>
>
> #include <asm/plpar_wrappers.h>
> +#include <asm/papr_scm.h>
>
> #define BIND_ANY_ADDR (~0ul)
>
> @@ -39,6 +40,13 @@ struct papr_scm_priv {
> struct resource res;
> struct nd_region *region;
> struct nd_interleave_set nd_set;
> +
> + /* Protect dimm data from concurrent access */
> + struct mutex dimm_mutex;
> +
> + /* Health information for the dimm */
> + __be64 health_bitmap;
> + __be64 health_bitmap_valid;
> };
>
> static int drc_pmem_bind(struct papr_scm_priv *p)
> @@ -144,6 +152,35 @@ static int drc_pmem_query_n_bind(struct papr_scm_priv *p)
> return drc_pmem_bind(p);
> }
>
> +static int drc_pmem_query_health(struct papr_scm_priv *p)
> +{
> + unsigned long ret[PLPAR_HCALL_BUFSIZE];
> + int64_t rc;
> +
> + rc = plpar_hcall(H_SCM_HEALTH, ret, p->drc_index);
> + if (rc != H_SUCCESS) {
> + dev_err(&p->pdev->dev,
> + "Failed to query health information, Err:%lld\n", rc);
> + return -ENXIO;
> + }
> +
> + /* Protect modifications to papr_scm_priv with the mutex */
> + rc = mutex_lock_interruptible(&p->dimm_mutex);
> + if (rc)
> + return rc;
> +
> + /* Store the retrieved health information in dimm platform data */
> + p->health_bitmap = ret[0];
> + p->health_bitmap_valid = ret[1];
> +
> + dev_dbg(&p->pdev->dev,
> + "Queried dimm health info. Bitmap:0x%016llx Mask:0x%016llx\n",
> + be64_to_cpu(p->health_bitmap),
> + be64_to_cpu(p->health_bitmap_valid));
> +
> + mutex_unlock(&p->dimm_mutex);
> + return 0;
> +}
>
> static int papr_scm_meta_get(struct papr_scm_priv *p,
> struct nd_cmd_get_config_data_hdr *hdr)
> @@ -304,6 +341,67 @@ static inline int papr_scm_node(int node)
> return min_node;
> }
>
> +static ssize_t papr_flags_show(struct device *dev,
> + struct device_attribute *attr, char *buf)
> +{
> + struct nvdimm *dimm = to_nvdimm(dev);
> + struct papr_scm_priv *p = nvdimm_provider_data(dimm);
> + __be64 health;
> + int rc;
> +
> + rc = drc_pmem_query_health(p);
> + if (rc)
> + return rc;
> +
> + /* Protect against modifications to papr_scm_priv with the mutex */
> + rc = mutex_lock_interruptible(&p->dimm_mutex);
> + if (rc)
> + return rc;
> +
> + health = p->health_bitmap & p->health_bitmap_valid;
> +
> + /* Check for various masks in bitmap and set the buffer */
> + if (health & PAPR_SCM_DIMM_UNARMED_MASK)
> + rc += sprintf(buf, "not_armed ");
> +
> + if (health & PAPR_SCM_DIMM_BAD_SHUTDOWN_MASK)
> + rc += sprintf(buf + rc, "save_fail ");
> +
> + if (health & PAPR_SCM_DIMM_BAD_RESTORE_MASK)
> + rc += sprintf(buf + rc, "restore_fail ");
> +
> + if (health & PAPR_SCM_DIMM_ENCRYPTED)
> + rc += sprintf(buf + rc, "encrypted ");
> +
> + if (health & PAPR_SCM_DIMM_SMART_EVENT_MASK)
> + rc += sprintf(buf + rc, "smart_notify ");
> +
> + if (health & PAPR_SCM_DIMM_SCRUBBED_AND_LOCKED)
> + rc += sprintf(buf + rc, "scrubbed locked ");
> +
> + if (rc > 0)
> + rc += sprintf(buf + rc, "\n");
> +
> + mutex_unlock(&p->dimm_mutex);
> + return rc;
> +}
> +DEVICE_ATTR_RO(papr_flags);
> +
> +/* papr_scm specific dimm attributes */
> +static struct attribute *papr_scm_nd_attributes[] = {
> + &dev_attr_papr_flags.attr,
> + NULL,
> +};
> +
> +static struct attribute_group papr_scm_nd_attribute_group = {
> + .attrs = papr_scm_nd_attributes,
> +};
> +
> +static const struct attribute_group *papr_scm_dimm_attr_groups[] = {
> + &papr_scm_nd_attribute_group,
> + NULL,
> +};
> +
> static int papr_scm_nvdimm_init(struct papr_scm_priv *p)
> {
> struct device *dev = &p->pdev->dev;
> @@ -330,8 +428,8 @@ static int papr_scm_nvdimm_init(struct papr_scm_priv *p)
> dimm_flags = 0;
> set_bit(NDD_ALIASING, &dimm_flags);
>
> - p->nvdimm = nvdimm_create(p->bus, p, NULL, dimm_flags,
> - PAPR_SCM_DIMM_CMD_MASK, 0, NULL);
> + p->nvdimm = nvdimm_create(p->bus, p, papr_scm_dimm_attr_groups,
> + dimm_flags, PAPR_SCM_DIMM_CMD_MASK, 0, NULL);
> if (!p->nvdimm) {
> dev_err(dev, "Error creating DIMM object for %pOF\n", p->dn);
> goto err;
> @@ -415,6 +513,9 @@ static int papr_scm_probe(struct platform_device *pdev)
> if (!p)
> return -ENOMEM;
>
> + /* Initialize the dimm mutex */
> + mutex_init(&p->dimm_mutex);
> +
> /* optional DT properties */
> of_property_read_u32(dn, "ibm,metadata-size", &metadata_size);
>
> --
> 2.25.1
> _______________________________________________
> Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
> To unsubscribe send an email to linux-nvdimm-leave@lists.01.org
^ permalink raw reply
* Re: [PATCH v5 2/4] ndctl/uapi: Introduce NVDIMM_FAMILY_PAPR_SCM as a new NVDIMM DSM family
From: Aneesh Kumar K.V @ 2020-04-01 5:31 UTC (permalink / raw)
To: Vaibhav Jain, linuxppc-dev, linux-nvdimm
Cc: Vaibhav Jain, Michael Ellerman, Alastair D'Silva
In-Reply-To: <20200331143229.306718-3-vaibhav@linux.ibm.com>
Vaibhav Jain <vaibhav@linux.ibm.com> writes:
> Add PAPR-scm family of DSM command-set to the white list of NVDIMM
> command sets.
>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
> Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
> ---
> Changelog:
>
> v4..v5 : None
>
> v3..v4 : None
>
> v2..v3 : Updated the patch prefix to 'ndctl/uapi' [Aneesh]
>
> v1..v2 : None
> ---
> include/uapi/linux/ndctl.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h
> index de5d90212409..99fb60600ef8 100644
> --- a/include/uapi/linux/ndctl.h
> +++ b/include/uapi/linux/ndctl.h
> @@ -244,6 +244,7 @@ struct nd_cmd_pkg {
> #define NVDIMM_FAMILY_HPE2 2
> #define NVDIMM_FAMILY_MSFT 3
> #define NVDIMM_FAMILY_HYPERV 4
> +#define NVDIMM_FAMILY_PAPR_SCM 5
>
> #define ND_IOCTL_CALL _IOWR(ND_IOCTL, ND_CMD_CALL,\
> struct nd_cmd_pkg)
> --
> 2.25.1
> _______________________________________________
> Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
> To unsubscribe send an email to linux-nvdimm-leave@lists.01.org
^ permalink raw reply
* Re: [PATCH v2] powerpc/XIVE: SVM: share the event-queue page with the Hypervisor.
From: Ram Pai @ 2020-04-01 5:32 UTC (permalink / raw)
To: Thiago Jung Bauermann
Cc: aik, andmike, groug, kvm-ppc, clg, sukadev, linuxppc-dev, david
In-Reply-To: <87r1x86pzw.fsf@morokweng.localdomain>
On Tue, Mar 31, 2020 at 08:53:07PM -0300, Thiago Jung Bauermann wrote:
>
> Hi Ram,
>
> Ram Pai <linuxram@us.ibm.com> writes:
>
> > diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c
> > index 55dc61c..608b52f 100644
> > --- a/arch/powerpc/sysdev/xive/spapr.c
> > +++ b/arch/powerpc/sysdev/xive/spapr.c
> > @@ -26,6 +26,8 @@
> > #include <asm/xive.h>
> > #include <asm/xive-regs.h>
> > #include <asm/hvcall.h>
> > +#include <asm/svm.h>
> > +#include <asm/ultravisor.h>
> >
> > #include "xive-internal.h"
> >
> > @@ -501,6 +503,9 @@ static int xive_spapr_configure_queue(u32 target, struct xive_q *q, u8 prio,
> > rc = -EIO;
> > } else {
> > q->qpage = qpage;
> > + if (is_secure_guest())
> > + uv_share_page(PHYS_PFN(qpage_phys),
> > + 1 << xive_alloc_order(order));
>
> If I understand this correctly, you're passing the number of bytes of
> the queue to uv_share_page(), but that ultracall expects the number of
> pages to be shared.
static inline u32 xive_alloc_order(u32 queue_shift)
{
return (queue_shift > PAGE_SHIFT) ? (queue_shift - PAGE_SHIFT) : 0;
}
xive_alloc_order(order) returns the order of PAGE_SIZE pages.
Hence the value passed to uv_shared_pages is the number of pages,
and not the number of bytes.
BTW: I did verify through testing that it was indeed passing 1 page to the
uv_share_page().
RP
^ permalink raw reply
* Re: [PATCH v5 3/4] powerpc/papr_scm,uapi: Add support for handling PAPR DSM commands
From: Aneesh Kumar K.V @ 2020-04-01 5:32 UTC (permalink / raw)
To: Vaibhav Jain, linuxppc-dev, linux-nvdimm
Cc: Vaibhav Jain, Michael Ellerman, Alastair D'Silva
In-Reply-To: <20200331143229.306718-4-vaibhav@linux.ibm.com>
Vaibhav Jain <vaibhav@linux.ibm.com> writes:
> Implement support for handling PAPR DSM commands in papr_scm
> module. We advertise support for ND_CMD_CALL for the dimm command mask
> and implement necessary scaffolding in the module to handle ND_CMD_CALL
> ioctl and DSM commands that we receive.
>
> The layout of the DSM commands as we expect from libnvdimm/libndctl is
> described in newly introduced uapi header 'papr_scm_dsm.h' which
> defines a new 'struct nd_papr_scm_cmd_pkg' header. This header is used
> to communicate the DSM command via 'nd_pkg_papr_scm->nd_command' and
> size of payload that need to be sent/received for servicing the DSM.
>
> The PAPR DSM commands are assigned indexes started from 0x10000 to
> prevent them from overlapping ND_CMD_* values and also makes handling
> dimm commands in papr_scm_ndctl(). A new function cmd_to_func() is
> implemented that reads the args to papr_scm_ndctl() and performs
> sanity tests on them. In case of a DSM command being sent via
> ND_CMD_CALL a newly introduced function papr_scm_service_dsm() is
> called to handle the request.
>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
> Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
>
> ---
> Changelog:
>
> v4..v5: Fixed a bug in new implementation of papr_scm_ndctl().
>
> v3..v4: Updated papr_scm_ndctl() to delegate DSM command handling to a
> different function papr_scm_service_dsm(). [Aneesh]
>
> v2..v3: Updated the nd_papr_scm_cmd_pkg to use __xx types as its
> exported to the userspace [Aneesh]
>
> v1..v2: New patch in the series.
> ---
> arch/powerpc/include/uapi/asm/papr_scm_dsm.h | 161 +++++++++++++++++++
> arch/powerpc/platforms/pseries/papr_scm.c | 97 ++++++++++-
> 2 files changed, 252 insertions(+), 6 deletions(-)
> create mode 100644 arch/powerpc/include/uapi/asm/papr_scm_dsm.h
>
> diff --git a/arch/powerpc/include/uapi/asm/papr_scm_dsm.h b/arch/powerpc/include/uapi/asm/papr_scm_dsm.h
> new file mode 100644
> index 000000000000..c039a49b41b4
> --- /dev/null
> +++ b/arch/powerpc/include/uapi/asm/papr_scm_dsm.h
> @@ -0,0 +1,161 @@
> +/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
> +/*
> + * PAPR SCM Device specific methods and struct for libndctl and ndctl
> + *
> + * (C) Copyright IBM 2020
> + *
> + * Author: Vaibhav Jain <vaibhav at linux.ibm.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2, or (at your option)
> + * any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + */
> +
> +#ifndef _UAPI_ASM_POWERPC_PAPR_SCM_DSM_H_
> +#define _UAPI_ASM_POWERPC_PAPR_SCM_DSM_H_
> +
> +#include <linux/types.h>
> +
> +#ifdef __KERNEL__
> +#include <linux/ndctl.h>
> +#else
> +#include <ndctl.h>
> +#endif
> +
> +/*
> + * DSM Envelope:
> + *
> + * The ioctl ND_CMD_CALL transfers data between user-space and kernel via
> + * 'envelopes' which consists of a header and user-defined payload sections.
> + * The header is described by 'struct nd_papr_scm_cmd_pkg' which expects a
> + * payload following it and offset of which relative to the struct is provided
> + * by 'nd_papr_scm_cmd_pkg.payload_offset'. *
> + *
> + * +-------------+---------------------+---------------------------+
> + * | 64-Bytes | 8-Bytes | Max 184-Bytes |
> + * +-------------+---------------------+---------------------------+
> + * | nd_papr_scm_cmd_pkg | |
> + * |-------------+ | |
> + * | nd_cmd_pkg | | |
> + * +-------------+---------------------+---------------------------+
> + * | nd_family | | |
> + * | nd_size_out | cmd_status | |
> + * | nd_size_in | payload_version | PAYLOAD |
> + * | nd_command | payload_offset -----> |
> + * | nd_fw_size | | |
> + * +-------------+---------------------+---------------------------+
> + *
> + * DSM Header:
> + *
> + * The header is defined as 'struct nd_papr_scm_cmd_pkg' which embeds a
> + * 'struct nd_cmd_pkg' instance. The DSM command is assigned to member
> + * 'nd_cmd_pkg.nd_command'. Apart from size information of the envelop which is
> + * contained in 'struct nd_cmd_pkg', the header also has members following
> + * members:
> + *
> + * 'cmd_status' : (Out) Errors if any encountered while servicing DSM.
> + * 'payload_version' : (In/Out) Version number associated with the payload.
> + * 'payload_offset' : (In)Relative offset of payload from start of envelope.
> + *
> + * DSM Payload:
> + *
> + * The layout of the DSM Payload is defined by various structs shared between
> + * papr_scm and libndctl so that contents of payload can be interpreted. During
> + * servicing of a DSM the papr_scm module will read input args from the payload
> + * field by casting its contents to an appropriate struct pointer based on the
> + * DSM command. Similarly the output of servicing the DSM command will be copied
> + * to the payload field using the same struct.
> + *
> + * 'libnvdimm' enforces a hard limit of 256 bytes on the envelope size, which
> + * leaves around 184 bytes for the envelope payload (ignoring any padding that
> + * the compiler may silently introduce).
> + *
> + * Payload Version:
> + *
> + * A 'payload_version' field is present in DSM header that indicates a specific
> + * version of the structure present in DSM Payload for a given DSM command. This
> + * provides backward compatibility in case the DSM Payload structure evolves
> + * and different structures are supported by 'papr_scm' and 'libndctl'.
> + *
> + * When sending a DSM Payload to 'papr_scm', 'libndctl' should send the version
> + * of the payload struct it supports via 'payload_version' field. The 'papr_scm'
> + * module when servicing the DSM envelop checks the 'payload_version' and then
> + * uses 'payload struct version' == MIN('payload_version field',
> + * 'max payload-struct-version supported by papr_scm') to service the DSM. After
> + * servicing the DSM, 'papr_scm' put the negotiated version of payload struct in
> + * returned 'payload_version' field.
> + *
> + * Libndctl on receiving the envelop back from papr_scm again checks the
> + * 'payload_version' field and based on it use the appropriate version dsm
> + * struct to parse the results.
> + *
> + * Backward Compatibility:
> + *
> + * Above scheme of exchanging different versioned DSM struct between libndctl
> + * and papr_scm should provide backward compatibility until following two
> + * assumptions/conditions when defining new DSM structs hold:
> + *
> + * Let T(X) = { set of attributes in DSM struct 'T' versioned X }
> + *
> + * 1. T(X) is a proper subset of T(Y) if X > Y.
> + * i.e Each new version of DSM struct should retain existing struct
> + * attributes from previous version
> + *
> + * 2. If an entity (libndctl or papr_scm) supports a DSM struct T(X) then
> + * it should also support T(1), T(2)...T(X - 1).
> + * i.e When adding support for new version of a DSM struct, libndctl
> + * and papr_scm should retain support of the existing DSM struct
> + * version they support.
> + */
> +
> +/* Papr-scm-header + payload expected with ND_CMD_CALL ioctl from libnvdimm */
> +struct nd_papr_scm_cmd_pkg {
> + struct nd_cmd_pkg hdr; /* Package header containing sub-cmd */
> + __s32 cmd_status; /* Out: Sub-cmd status returned back */
> + __u16 payload_offset; /* In: offset from start of struct */
> + __u16 payload_version; /* In/Out: version of the payload */
> + __u8 payload[]; /* In/Out: Sub-cmd data buffer */
> +};
> +
> +/*
> + * Sub commands for ND_CMD_CALL. To prevent overlap from ND_CMD_*, values for
> + * these enums start at 0x10000. These values are then returned from
> + * cmd_to_func() making it easy to implement the switch-case block in
> + * papr_scm_ndctl(). These commands are sent to the kernel via
> + * 'nd_papr_scm_cmd_pkg.hdr.nd_command'
> + */
> +enum dsm_papr_scm {
> + DSM_PAPR_SCM_MIN = 0x10000,
> + DSM_PAPR_SCM_MAX,
> +};
> +
> +/* Helpers to evaluate the size of PAPR_SCM envelope */
> +/* Calculate the papr_scm-header size */
> +#define ND_PAPR_SCM_ENVELOPE_CONTENT_HDR_SIZE \
> + (sizeof(struct nd_papr_scm_cmd_pkg) - sizeof(struct nd_cmd_pkg))
> +
> +/* Given a type calculate envelope-content size (papr_scm-header + payload) */
> +#define ND_PAPR_SCM_ENVELOPE_CONTENT_SIZE(_type_) \
> + (sizeof(_type_) + ND_PAPR_SCM_ENVELOPE_CONTENT_HDR_SIZE)
> +
> +/* Convert a libnvdimm nd_cmd_pkg to papr_scm specific pkg */
> +static struct nd_papr_scm_cmd_pkg *nd_to_papr_cmd_pkg(struct nd_cmd_pkg *cmd)
> +{
> + return (struct nd_papr_scm_cmd_pkg *) cmd;
> +}
> +
> +/* Return the payload pointer for a given pcmd */
> +static void *papr_scm_pcmd_to_payload(struct nd_papr_scm_cmd_pkg *pcmd)
> +{
> + if (pcmd->hdr.nd_size_in == 0 && pcmd->hdr.nd_size_out == 0)
> + return NULL;
> + else
> + return (void *)((__u8 *) pcmd + pcmd->payload_offset);
> +}
> +#endif /* _UAPI_ASM_POWERPC_PAPR_SCM_DSM_H_ */
> diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/powerpc/platforms/pseries/papr_scm.c
> index aaf2e4ab1f75..e8ce96d2249e 100644
> --- a/arch/powerpc/platforms/pseries/papr_scm.c
> +++ b/arch/powerpc/platforms/pseries/papr_scm.c
> @@ -15,13 +15,15 @@
>
> #include <asm/plpar_wrappers.h>
> #include <asm/papr_scm.h>
> +#include <asm/papr_scm_dsm.h>
>
> #define BIND_ANY_ADDR (~0ul)
>
> #define PAPR_SCM_DIMM_CMD_MASK \
> ((1ul << ND_CMD_GET_CONFIG_SIZE) | \
> (1ul << ND_CMD_GET_CONFIG_DATA) | \
> - (1ul << ND_CMD_SET_CONFIG_DATA))
> + (1ul << ND_CMD_SET_CONFIG_DATA) | \
> + (1ul << ND_CMD_CALL))
>
> struct papr_scm_priv {
> struct platform_device *pdev;
> @@ -283,15 +285,92 @@ static int papr_scm_meta_set(struct papr_scm_priv *p,
> return 0;
> }
>
> +/*
> + * Validate the inputs args to dimm-control function and return '0' if valid.
> + * This also does initial sanity validation to ND_CMD_CALL sub-command packages.
> + */
> +static int is_cmd_valid(struct nvdimm *nvdimm, unsigned int cmd, void *buf,
> + unsigned int buf_len)
> +{
> + unsigned long cmd_mask = PAPR_SCM_DIMM_CMD_MASK;
> + struct nd_papr_scm_cmd_pkg *pkg = nd_to_papr_cmd_pkg(buf);
> +
> + /* Only dimm-specific calls are supported atm */
> + if (!nvdimm)
> + return -EINVAL;
> +
> + if (!test_bit(cmd, &cmd_mask)) {
> + pr_debug("%s: Unsupported cmd=%u\n", __func__, cmd);
> + return -EINVAL;
> + } else if (cmd == ND_CMD_CALL) {
> +
> + /* Verify the envelop package */
> + if (!buf || buf_len < sizeof(struct nd_papr_scm_cmd_pkg)) {
> + pr_debug("%s: Invalid pkg size=%u\n", __func__,
> + buf_len);
> + return -EINVAL;
> + }
> +
> + /* Verify that the DSM command family is valid */
> + if (pkg->hdr.nd_family != NVDIMM_FAMILY_PAPR_SCM) {
> + pr_debug("%s: Invalid pkg family=0x%llx\n", __func__,
> + pkg->hdr.nd_family);
> + return -EINVAL;
> +
> + }
> +
> + /* We except a payload with all DSM commands */
> + if (papr_scm_pcmd_to_payload(pkg) == NULL) {
> + pr_debug("%s: Empty payload for sub-command=0x%llx\n",
> + __func__, pkg->hdr.nd_command);
> + return -EINVAL;
> + }
> + }
> +
> + /* Command looks valid */
> + return 0;
> +}
> +
> +static int papr_scm_service_dsm(struct papr_scm_priv *p,
> + struct nd_papr_scm_cmd_pkg *call_pkg)
> +{
> + /* unknown subcommands return error in packages */
> + if (call_pkg->hdr.nd_command <= DSM_PAPR_SCM_MIN ||
> + call_pkg->hdr.nd_command >= DSM_PAPR_SCM_MAX) {
> + pr_debug("Invalid DSM command 0x%llx\n",
> + call_pkg->hdr.nd_command);
> + call_pkg->cmd_status = -EINVAL;
> + return 0;
> + }
> +
> + /* Depending on the DSM command call appropriate service routine */
> + switch (call_pkg->hdr.nd_command) {
> + default:
> + pr_debug("Unsupported DSM command 0x%llx\n",
> + call_pkg->hdr.nd_command);
> + call_pkg->cmd_status = -ENOENT;
> + return 0;
> + }
> +}
> +
> int papr_scm_ndctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
> unsigned int cmd, void *buf, unsigned int buf_len, int *cmd_rc)
> {
> struct nd_cmd_get_config_size *get_size_hdr;
> struct papr_scm_priv *p;
> + struct nd_papr_scm_cmd_pkg *call_pkg = NULL;
> + int rc;
>
> - /* Only dimm-specific calls are supported atm */
> - if (!nvdimm)
> - return -EINVAL;
> + /* Use a local variable in case cmd_rc pointer is NULL */
> + if (cmd_rc == NULL)
> + cmd_rc = &rc;
> +
> + *cmd_rc = is_cmd_valid(nvdimm, cmd, buf, buf_len);
> + if (*cmd_rc) {
> + pr_debug("%s: Invalid cmd=0x%x. Err=%d\n", __func__,
> + cmd, *cmd_rc);
> + return *cmd_rc;
> + }
>
> p = nvdimm_provider_data(nvdimm);
>
> @@ -313,13 +392,19 @@ int papr_scm_ndctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
> *cmd_rc = papr_scm_meta_set(p, buf);
> break;
>
> + case ND_CMD_CALL:
> + call_pkg = nd_to_papr_cmd_pkg(buf);
> + *cmd_rc = papr_scm_service_dsm(p, call_pkg);
> + break;
> +
> default:
> - return -EINVAL;
> + dev_dbg(&p->pdev->dev, "Unknown command = %d\n", cmd);
> + *cmd_rc = -EINVAL;
> }
>
> dev_dbg(&p->pdev->dev, "returned with cmd_rc = %d\n", *cmd_rc);
>
> - return 0;
> + return *cmd_rc;
> }
>
> static inline int papr_scm_node(int node)
> --
> 2.25.1
> _______________________________________________
> Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
> To unsubscribe send an email to linux-nvdimm-leave@lists.01.org
^ permalink raw reply
* Re: [PATCH v5 4/4] powerpc/papr_scm: Implement support for DSM_PAPR_SCM_HEALTH
From: Aneesh Kumar K.V @ 2020-04-01 5:32 UTC (permalink / raw)
To: Vaibhav Jain, linuxppc-dev, linux-nvdimm
Cc: Vaibhav Jain, Michael Ellerman, Alastair D'Silva
In-Reply-To: <20200331143229.306718-5-vaibhav@linux.ibm.com>
Vaibhav Jain <vaibhav@linux.ibm.com> writes:
> This patch implements support for papr_scm command
> 'DSM_PAPR_SCM_HEALTH' that returns a newly introduced 'struct
> nd_papr_scm_dimm_health_stat' instance containing dimm health
> information back to user space in response to ND_CMD_CALL. This
> functionality is implemented in newly introduced papr_scm_get_health()
> that queries the scm-dimm health information and then copies these bitmaps
> to the package payload whose layout is defined by 'struct
> papr_scm_ndctl_health'.
>
> The patch also introduces a new member a new member 'struct
> papr_scm_priv.health' thats an instance of 'struct
> nd_papr_scm_dimm_health_stat' to cache the health information of a
> scm-dimm. As a result functions drc_pmem_query_health() and
> papr_flags_show() are updated to populate and use this new struct
> instead of two be64 integers that we earlier used.
>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
> Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
> ---
> Changelog:
>
> v4..v5: None
>
> v3..v4: Call the DSM_PAPR_SCM_HEALTH service function from
> papr_scm_service_dsm() instead of papr_scm_ndctl(). [Aneesh]
>
> v2..v3: Updated struct nd_papr_scm_dimm_health_stat_v1 to use '__xx'
> types as its exported to the userspace [Aneesh]
> Changed the constants DSM_PAPR_SCM_DIMM_XX indicating dimm
> health from enum to #defines [Aneesh]
>
> v1..v2: New patch in the series
> ---
> arch/powerpc/include/uapi/asm/papr_scm_dsm.h | 40 +++++++
> arch/powerpc/platforms/pseries/papr_scm.c | 109 ++++++++++++++++---
> 2 files changed, 132 insertions(+), 17 deletions(-)
>
> diff --git a/arch/powerpc/include/uapi/asm/papr_scm_dsm.h b/arch/powerpc/include/uapi/asm/papr_scm_dsm.h
> index c039a49b41b4..8265125304ca 100644
> --- a/arch/powerpc/include/uapi/asm/papr_scm_dsm.h
> +++ b/arch/powerpc/include/uapi/asm/papr_scm_dsm.h
> @@ -132,6 +132,7 @@ struct nd_papr_scm_cmd_pkg {
> */
> enum dsm_papr_scm {
> DSM_PAPR_SCM_MIN = 0x10000,
> + DSM_PAPR_SCM_HEALTH,
> DSM_PAPR_SCM_MAX,
> };
>
> @@ -158,4 +159,43 @@ static void *papr_scm_pcmd_to_payload(struct nd_papr_scm_cmd_pkg *pcmd)
> else
> return (void *)((__u8 *) pcmd + pcmd->payload_offset);
> }
> +
> +/* Various scm-dimm health indicators */
> +#define DSM_PAPR_SCM_DIMM_HEALTHY 0
> +#define DSM_PAPR_SCM_DIMM_UNHEALTHY 1
> +#define DSM_PAPR_SCM_DIMM_CRITICAL 2
> +#define DSM_PAPR_SCM_DIMM_FATAL 3
> +
> +/*
> + * Struct exchanged between kernel & ndctl in for PAPR_DSM_PAPR_SMART_HEALTH
> + * Various bitflags indicate the health status of the dimm.
> + *
> + * dimm_unarmed : Dimm not armed. So contents wont persist.
> + * dimm_bad_shutdown : Previous shutdown did not persist contents.
> + * dimm_bad_restore : Contents from previous shutdown werent restored.
> + * dimm_scrubbed : Contents of the dimm have been scrubbed.
> + * dimm_locked : Contents of the dimm cant be modified until CEC reboot
> + * dimm_encrypted : Contents of dimm are encrypted.
> + * dimm_health : Dimm health indicator.
> + */
> +struct nd_papr_scm_dimm_health_stat_v1 {
> + __u8 dimm_unarmed;
> + __u8 dimm_bad_shutdown;
> + __u8 dimm_bad_restore;
> + __u8 dimm_scrubbed;
> + __u8 dimm_locked;
> + __u8 dimm_encrypted;
> + __u16 dimm_health;
> +};
> +
> +/*
> + * Typedef the current struct for dimm_health so that any application
> + * or kernel recompiled after introducing a new version automatically
> + * supports the new version.
> + */
> +#define nd_papr_scm_dimm_health_stat nd_papr_scm_dimm_health_stat_v1
> +
> +/* Current version number for the dimm health struct */
> +#define ND_PAPR_SCM_DIMM_HEALTH_VERSION 1
> +
> #endif /* _UAPI_ASM_POWERPC_PAPR_SCM_DSM_H_ */
> diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/powerpc/platforms/pseries/papr_scm.c
> index e8ce96d2249e..ce94762954e0 100644
> --- a/arch/powerpc/platforms/pseries/papr_scm.c
> +++ b/arch/powerpc/platforms/pseries/papr_scm.c
> @@ -47,8 +47,7 @@ struct papr_scm_priv {
> struct mutex dimm_mutex;
>
> /* Health information for the dimm */
> - __be64 health_bitmap;
> - __be64 health_bitmap_valid;
> + struct nd_papr_scm_dimm_health_stat health;
> };
>
> static int drc_pmem_bind(struct papr_scm_priv *p)
> @@ -158,6 +157,7 @@ static int drc_pmem_query_health(struct papr_scm_priv *p)
> {
> unsigned long ret[PLPAR_HCALL_BUFSIZE];
> int64_t rc;
> + __be64 health;
>
> rc = plpar_hcall(H_SCM_HEALTH, ret, p->drc_index);
> if (rc != H_SUCCESS) {
> @@ -172,13 +172,41 @@ static int drc_pmem_query_health(struct papr_scm_priv *p)
> return rc;
>
> /* Store the retrieved health information in dimm platform data */
> - p->health_bitmap = ret[0];
> - p->health_bitmap_valid = ret[1];
> + health = ret[0] & ret[1];
>
> dev_dbg(&p->pdev->dev,
> "Queried dimm health info. Bitmap:0x%016llx Mask:0x%016llx\n",
> - be64_to_cpu(p->health_bitmap),
> - be64_to_cpu(p->health_bitmap_valid));
> + be64_to_cpu(ret[0]),
> + be64_to_cpu(ret[1]));
> +
> + memset(&p->health, 0, sizeof(p->health));
> +
> + /* Check for various masks in bitmap and set the buffer */
> + if (health & PAPR_SCM_DIMM_UNARMED_MASK)
> + p->health.dimm_unarmed = true;
> +
> + if (health & PAPR_SCM_DIMM_BAD_SHUTDOWN_MASK)
> + p->health.dimm_bad_shutdown = true;
> +
> + if (health & PAPR_SCM_DIMM_BAD_RESTORE_MASK)
> + p->health.dimm_bad_restore = true;
> +
> + if (health & PAPR_SCM_DIMM_ENCRYPTED)
> + p->health.dimm_encrypted = true;
> +
> + if (health & PAPR_SCM_DIMM_SCRUBBED_AND_LOCKED) {
> + p->health.dimm_locked = true;
> + p->health.dimm_scrubbed = true;
> + }
> +
> + if (health & PAPR_SCM_DIMM_HEALTH_UNHEALTHY)
> + p->health.dimm_health = DSM_PAPR_SCM_DIMM_UNHEALTHY;
> +
> + if (health & PAPR_SCM_DIMM_HEALTH_CRITICAL)
> + p->health.dimm_health = DSM_PAPR_SCM_DIMM_CRITICAL;
> +
> + if (health & PAPR_SCM_DIMM_HEALTH_FATAL)
> + p->health.dimm_health = DSM_PAPR_SCM_DIMM_FATAL;
>
> mutex_unlock(&p->dimm_mutex);
> return 0;
> @@ -331,6 +359,51 @@ static int is_cmd_valid(struct nvdimm *nvdimm, unsigned int cmd, void *buf,
> return 0;
> }
>
> +/* Fetch the DIMM health info and populate it in provided package. */
> +static int papr_scm_get_health(struct papr_scm_priv *p,
> + struct nd_papr_scm_cmd_pkg *pkg)
> +{
> + int rc;
> + size_t copysize = sizeof(p->health);
> +
> + rc = drc_pmem_query_health(p);
> + if (rc)
> + goto out;
> + /*
> + * If the requested payload version is greater than one we know
> + * about, return the payload version we know about and let
> + * caller/userspace handle.
> + */
> + if (pkg->payload_version > ND_PAPR_SCM_DIMM_HEALTH_VERSION)
> + pkg->payload_version = ND_PAPR_SCM_DIMM_HEALTH_VERSION;
> +
> + if (pkg->hdr.nd_size_out < copysize) {
> + dev_dbg(&p->pdev->dev, "%s Payload not large enough\n",
> + __func__);
> + dev_dbg(&p->pdev->dev, "%s Expected %lu, available %u\n",
> + __func__, copysize, pkg->hdr.nd_size_out);
> + rc = -ENOSPC;
> + goto out;
> + }
> +
> + dev_dbg(&p->pdev->dev, "%s Copying payload size=%lu version=0x%x\n",
> + __func__, copysize, pkg->payload_version);
> +
> + /* Copy a subset of health struct based on copysize */
> + memcpy(papr_scm_pcmd_to_payload(pkg), &p->health, copysize);
> + pkg->hdr.nd_fw_size = copysize;
> +
> +out:
> + /*
> + * Put the error in out package and return success from function
> + * so that errors if any are propogated back to userspace.
> + */
> + pkg->cmd_status = rc;
> + dev_dbg(&p->pdev->dev, "%s completion code = %d\n", __func__, rc);
> +
> + return 0;
> +}
> +
> static int papr_scm_service_dsm(struct papr_scm_priv *p,
> struct nd_papr_scm_cmd_pkg *call_pkg)
> {
> @@ -345,6 +418,9 @@ static int papr_scm_service_dsm(struct papr_scm_priv *p,
>
> /* Depending on the DSM command call appropriate service routine */
> switch (call_pkg->hdr.nd_command) {
> + case DSM_PAPR_SCM_HEALTH:
> + return papr_scm_get_health(p, call_pkg);
> +
> default:
> pr_debug("Unsupported DSM command 0x%llx\n",
> call_pkg->hdr.nd_command);
> @@ -431,7 +507,6 @@ static ssize_t papr_flags_show(struct device *dev,
> {
> struct nvdimm *dimm = to_nvdimm(dev);
> struct papr_scm_priv *p = nvdimm_provider_data(dimm);
> - __be64 health;
> int rc;
>
> rc = drc_pmem_query_health(p);
> @@ -443,26 +518,26 @@ static ssize_t papr_flags_show(struct device *dev,
> if (rc)
> return rc;
>
> - health = p->health_bitmap & p->health_bitmap_valid;
> -
> - /* Check for various masks in bitmap and set the buffer */
> - if (health & PAPR_SCM_DIMM_UNARMED_MASK)
> + if (p->health.dimm_unarmed)
> rc += sprintf(buf, "not_armed ");
>
> - if (health & PAPR_SCM_DIMM_BAD_SHUTDOWN_MASK)
> + if (p->health.dimm_bad_shutdown)
> rc += sprintf(buf + rc, "save_fail ");
>
> - if (health & PAPR_SCM_DIMM_BAD_RESTORE_MASK)
> + if (p->health.dimm_bad_restore)
> rc += sprintf(buf + rc, "restore_fail ");
>
> - if (health & PAPR_SCM_DIMM_ENCRYPTED)
> + if (p->health.dimm_encrypted)
> rc += sprintf(buf + rc, "encrypted ");
>
> - if (health & PAPR_SCM_DIMM_SMART_EVENT_MASK)
> + if (p->health.dimm_health)
> rc += sprintf(buf + rc, "smart_notify ");
>
> - if (health & PAPR_SCM_DIMM_SCRUBBED_AND_LOCKED)
> - rc += sprintf(buf + rc, "scrubbed locked ");
> + if (p->health.dimm_scrubbed)
> + rc += sprintf(buf + rc, "scrubbed ");
> +
> + if (p->health.dimm_locked)
> + rc += sprintf(buf + rc, "locked ");
>
> if (rc > 0)
> rc += sprintf(buf + rc, "\n");
> --
> 2.25.1
> _______________________________________________
> Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
> To unsubscribe send an email to linux-nvdimm-leave@lists.01.org
^ permalink raw reply
* Re: [PATCH RFC] mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP (was: Re: [PATCH v3 0/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA)
From: Baoquan He @ 2020-04-01 5:42 UTC (permalink / raw)
To: Mike Rapoport
Cc: mmorana, Catalin Marinas, Heiko Carstens, Michal Hocko,
open list:MEMORY MANAGEMENT, Paul Mackerras, H. Peter Anvin,
sparclinux, Alexander Duyck, linux-s390, x86,
Christian Borntraeger, Ingo Molnar, Hoan Tran, Pavel Tatashin,
lho, Vasily Gorbik, Vlastimil Babka, Will Deacon, Borislav Petkov,
Thomas Gleixner, linux-arm-kernel, Oscar Salvador, linux-kernel,
Andrew Morton, linuxppc-dev, David S. Miller
In-Reply-To: <20200331215618.GG30942@linux.ibm.com>
On 04/01/20 at 12:56am, Mike Rapoport wrote:
> On Mon, Mar 30, 2020 at 11:58:43AM +0200, Michal Hocko wrote:
> >
> > What would it take to make ia64 use HAVE_MEMBLOCK_NODE_MAP? I would
> > really love to see that thing go away. It is causing problems when
> > people try to use memblock api.
>
> Well, it's a small patch in the end :)
>
> Currently all NUMA architectures currently enable
> CONFIG_HAVE_MEMBLOCK_NODE_MAP and use free_area_init_nodes() to initialize
> nodes and zones structures.
I did some investigation, there are nine ARCHes having NUMA config. And
among them, alpha doesn't have HAVE_MEMBLOCK_NODE_MAP support. While the
interesting thing is there are two ARCHes which have
HAVE_MEMBLOCK_NODE_MAP config, but don't have NUMA config adding, they
are microblaze and riscv. Obviously it was not carefully considered to
add HAVE_MEMBLOCK_NODE_MAP config into riscv and microblaze.
arch/alpha/Kconfig:config NUMA
arch/arm64/Kconfig:config NUMA
arch/ia64/Kconfig:config NUMA
arch/mips/Kconfig:config NUMA
arch/powerpc/Kconfig:config NUMA
arch/s390/Kconfig:config NUMA
arch/sh/mm/Kconfig:config NUMA
arch/sparc/Kconfig:config NUMA
arch/x86/Kconfig:config NUMA
From above information, we can remove HAVE_MEMBLOCK_NODE_MAP, and
replace it with CONFIG_NUMA. That sounds more sensible to store nid into
memblock when NUMA support is enabled.
> diff --git a/include/linux/memblock.h b/include/linux/memblock.h
> index 079d17d96410..9de81112447e 100644
> --- a/include/linux/memblock.h
> +++ b/include/linux/memblock.h
> @@ -50,9 +50,7 @@ struct memblock_region {
> phys_addr_t base;
> phys_addr_t size;
> enum memblock_flags flags;
> -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
> int nid;
> -#endif
I didn't look into other change very carefully, but feel enabling
memblock node map for all ARCHes looks a little radical. After all, many
ARCHes even don't have NUMA support.
> };
>
> /**
> @@ -215,7 +213,6 @@ static inline bool memblock_is_nomap(struct memblock_region *m)
> return m->flags & MEMBLOCK_NOMAP;
> }
>
> -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
> int memblock_search_pfn_nid(unsigned long pfn, unsigned long *start_pfn,
> unsigned long *end_pfn);
> void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn,
> @@ -234,7 +231,6 @@ void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn,
> #define for_each_mem_pfn_range(i, nid, p_start, p_end, p_nid) \
> for (i = -1, __next_mem_pfn_range(&i, nid, p_start, p_end, p_nid); \
> i >= 0; __next_mem_pfn_range(&i, nid, p_start, p_end, p_nid))
> -#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
>
> #ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
> void __next_mem_pfn_range_in_zone(u64 *idx, struct zone *zone,
> @@ -310,7 +306,6 @@ void __next_mem_pfn_range_in_zone(u64 *idx, struct zone *zone,
> for_each_mem_range_rev(i, &memblock.memory, &memblock.reserved, \
> nid, flags, p_start, p_end, p_nid)
>
> -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
> int memblock_set_node(phys_addr_t base, phys_addr_t size,
> struct memblock_type *type, int nid);
>
> @@ -323,16 +318,6 @@ static inline int memblock_get_region_node(const struct memblock_region *r)
> {
> return r->nid;
> }
> -#else
> -static inline void memblock_set_region_node(struct memblock_region *r, int nid)
> -{
> -}
> -
> -static inline int memblock_get_region_node(const struct memblock_region *r)
> -{
> - return 0;
> -}
> -#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
>
> /* Flags for memblock allocation APIs */
> #define MEMBLOCK_ALLOC_ANYWHERE (~(phys_addr_t)0)
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index c54fb96cb1e6..368a45d4696a 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -2125,9 +2125,8 @@ static inline unsigned long get_num_physpages(void)
> return phys_pages;
> }
>
> -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
> /*
> - * With CONFIG_HAVE_MEMBLOCK_NODE_MAP set, an architecture may initialise its
> + * Using memblock node mappings, an architecture may initialise its
> * zones, allocate the backing mem_map and account for memory holes in a more
> * architecture independent manner. This is a substitute for creating the
> * zone_sizes[] and zholes_size[] arrays and passing them to
> @@ -2148,9 +2147,6 @@ static inline unsigned long get_num_physpages(void)
> * registered physical page range. Similarly
> * sparse_memory_present_with_active_regions() calls memory_present() for
> * each range when SPARSEMEM is enabled.
> - *
> - * See mm/page_alloc.c for more information on each function exposed by
> - * CONFIG_HAVE_MEMBLOCK_NODE_MAP.
> */
> extern void free_area_init_nodes(unsigned long *max_zone_pfn);
> unsigned long node_map_pfn_alignment(void);
> @@ -2165,22 +2161,12 @@ extern void free_bootmem_with_active_regions(int nid,
> unsigned long max_low_pfn);
> extern void sparse_memory_present_with_active_regions(int nid);
>
> -#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
>
> -#if !defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) && \
> - !defined(CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID)
> -static inline int __early_pfn_to_nid(unsigned long pfn,
> - struct mminit_pfnnid_cache *state)
> -{
> - return 0;
> -}
> -#else
> /* please see mm/page_alloc.c */
> extern int __meminit early_pfn_to_nid(unsigned long pfn);
> /* there is a per-arch backend function. */
> extern int __meminit __early_pfn_to_nid(unsigned long pfn,
> struct mminit_pfnnid_cache *state);
> -#endif
>
> extern void set_dma_reserve(unsigned long new_dma_reserve);
> extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long,
> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index 462f6873905a..4422d1961d0e 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -917,11 +917,7 @@ extern int movable_zone;
> #ifdef CONFIG_HIGHMEM
> static inline int zone_movable_is_highmem(void)
> {
> -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
> return movable_zone == ZONE_HIGHMEM;
> -#else
> - return (ZONE_MOVABLE - 1) == ZONE_HIGHMEM;
> -#endif
> }
> #endif
>
> @@ -1121,15 +1117,6 @@ static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist,
> #include <asm/sparsemem.h>
> #endif
>
> -#if !defined(CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID) && \
> - !defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP)
> -static inline unsigned long early_pfn_to_nid(unsigned long pfn)
> -{
> - BUILD_BUG_ON(IS_ENABLED(CONFIG_NUMA));
> - return 0;
> -}
> -#endif
> -
> #ifdef CONFIG_FLATMEM
> #define pfn_to_nid(pfn) (0)
> #endif
> diff --git a/mm/memblock.c b/mm/memblock.c
> index eba94ee3de0b..819441133a21 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -620,9 +620,7 @@ static int __init_memblock memblock_add_range(struct memblock_type *type,
> * area, insert that portion.
> */
> if (rbase > base) {
> -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
> WARN_ON(nid != memblock_get_region_node(rgn));
> -#endif
> WARN_ON(flags != rgn->flags);
> nr_new++;
> if (insert)
> @@ -1197,7 +1195,6 @@ void __init_memblock __next_mem_range_rev(u64 *idx, int nid,
> *idx = ULLONG_MAX;
> }
>
> -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
> /*
> * Common iterator interface used to define for_each_mem_pfn_range().
> */
> @@ -1258,7 +1255,7 @@ int __init_memblock memblock_set_node(phys_addr_t base, phys_addr_t size,
> memblock_merge_regions(type);
> return 0;
> }
> -#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
> +
> #ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
> /**
> * __next_mem_pfn_range_in_zone - iterator for for_each_*_range_in_zone()
> @@ -1797,7 +1794,6 @@ bool __init_memblock memblock_is_map_memory(phys_addr_t addr)
> return !memblock_is_nomap(&memblock.memory.regions[i]);
> }
>
> -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
> int __init_memblock memblock_search_pfn_nid(unsigned long pfn,
> unsigned long *start_pfn, unsigned long *end_pfn)
> {
> @@ -1812,7 +1808,6 @@ int __init_memblock memblock_search_pfn_nid(unsigned long pfn,
>
> return type->regions[mid].nid;
> }
> -#endif
>
> /**
> * memblock_is_region_memory - check if a region is a subset of memory
> @@ -1903,11 +1898,9 @@ static void __init_memblock memblock_dump(struct memblock_type *type)
> size = rgn->size;
> end = base + size - 1;
> flags = rgn->flags;
> -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
> if (memblock_get_region_node(rgn) != MAX_NUMNODES)
> snprintf(nid_buf, sizeof(nid_buf), " on node %d",
> memblock_get_region_node(rgn));
> -#endif
> pr_info(" %s[%#x]\t[%pa-%pa], %pa bytes%s flags: %#x\n",
> type->name, idx, &base, &end, &size, nid_buf, flags);
> }
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 19389cdc16a5..dc8828b087bf 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -1366,11 +1366,7 @@ check_pages_isolated_cb(unsigned long start_pfn, unsigned long nr_pages,
>
> static int __init cmdline_parse_movable_node(char *p)
> {
> -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
> movable_node_enabled = true;
> -#else
> - pr_warn("movable_node parameter depends on CONFIG_HAVE_MEMBLOCK_NODE_MAP to work properly\n");
> -#endif
> return 0;
> }
> early_param("movable_node", cmdline_parse_movable_node);
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 3c4eb750a199..84a69d6e7e61 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -335,7 +335,6 @@ static unsigned long nr_kernel_pages __initdata;
> static unsigned long nr_all_pages __initdata;
> static unsigned long dma_reserve __initdata;
>
> -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
> static unsigned long arch_zone_lowest_possible_pfn[MAX_NR_ZONES] __initdata;
> static unsigned long arch_zone_highest_possible_pfn[MAX_NR_ZONES] __initdata;
> static unsigned long required_kernelcore __initdata;
> @@ -348,7 +347,6 @@ static bool mirrored_kernelcore __meminitdata;
> /* movable_zone is the "real" zone pages in ZONE_MOVABLE are taken from */
> int movable_zone;
> EXPORT_SYMBOL(movable_zone);
> -#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
>
> #if MAX_NUMNODES > 1
> unsigned int nr_node_ids __read_mostly = MAX_NUMNODES;
> @@ -1447,9 +1445,6 @@ void __free_pages_core(struct page *page, unsigned int order)
> __free_pages(page, order);
> }
>
> -#if defined(CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID) || \
> - defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP)
> -
> static struct mminit_pfnnid_cache early_pfnnid_cache __meminitdata;
>
> int __meminit early_pfn_to_nid(unsigned long pfn)
> @@ -1465,7 +1460,6 @@ int __meminit early_pfn_to_nid(unsigned long pfn)
>
> return nid;
> }
> -#endif
>
> #ifdef CONFIG_NODES_SPAN_OTHER_NODES
> /* Only safe to use early in boot when initialisation is single-threaded */
> @@ -5828,7 +5822,6 @@ void __ref build_all_zonelists(pg_data_t *pgdat)
> static bool __meminit
> overlap_memmap_init(unsigned long zone, unsigned long *pfn)
> {
> -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
> static struct memblock_region *r;
>
> if (mirrored_kernelcore && zone == ZONE_MOVABLE) {
> @@ -5844,7 +5837,7 @@ overlap_memmap_init(unsigned long zone, unsigned long *pfn)
> return true;
> }
> }
> -#endif
> +
> return false;
> }
>
> @@ -6227,7 +6220,6 @@ void __meminit init_currently_empty_zone(struct zone *zone,
> zone->initialized = 1;
> }
>
> -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
> #ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
>
> /*
> @@ -6503,8 +6495,7 @@ static unsigned long __init zone_absent_pages_in_node(int nid,
> return nr_absent;
> }
>
> -#else /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
> -static inline unsigned long __init zone_spanned_pages_in_node(int nid,
> +static inline unsigned long __init compat_zone_spanned_pages_in_node(int nid,
> unsigned long zone_type,
> unsigned long node_start_pfn,
> unsigned long node_end_pfn,
> @@ -6523,7 +6514,7 @@ static inline unsigned long __init zone_spanned_pages_in_node(int nid,
> return zones_size[zone_type];
> }
>
> -static inline unsigned long __init zone_absent_pages_in_node(int nid,
> +static inline unsigned long __init compat_zone_absent_pages_in_node(int nid,
> unsigned long zone_type,
> unsigned long node_start_pfn,
> unsigned long node_end_pfn,
> @@ -6535,13 +6526,12 @@ static inline unsigned long __init zone_absent_pages_in_node(int nid,
> return zholes_size[zone_type];
> }
>
> -#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
> -
> static void __init calculate_node_totalpages(struct pglist_data *pgdat,
> unsigned long node_start_pfn,
> unsigned long node_end_pfn,
> unsigned long *zones_size,
> - unsigned long *zholes_size)
> + unsigned long *zholes_size,
> + bool compat)
> {
> unsigned long realtotalpages = 0, totalpages = 0;
> enum zone_type i;
> @@ -6549,17 +6539,38 @@ static void __init calculate_node_totalpages(struct pglist_data *pgdat,
> for (i = 0; i < MAX_NR_ZONES; i++) {
> struct zone *zone = pgdat->node_zones + i;
> unsigned long zone_start_pfn, zone_end_pfn;
> + unsigned long spanned, absent;
> unsigned long size, real_size;
>
> - size = zone_spanned_pages_in_node(pgdat->node_id, i,
> - node_start_pfn,
> - node_end_pfn,
> - &zone_start_pfn,
> - &zone_end_pfn,
> - zones_size);
> - real_size = size - zone_absent_pages_in_node(pgdat->node_id, i,
> - node_start_pfn, node_end_pfn,
> - zholes_size);
> + if (compat) {
> + spanned = compat_zone_spanned_pages_in_node(
> + pgdat->node_id, i,
> + node_start_pfn,
> + node_end_pfn,
> + &zone_start_pfn,
> + &zone_end_pfn,
> + zones_size);
> + absent = compat_zone_absent_pages_in_node(
> + pgdat->node_id, i,
> + node_start_pfn,
> + node_end_pfn,
> + zholes_size);
> + } else {
> + spanned = zone_spanned_pages_in_node(pgdat->node_id, i,
> + node_start_pfn,
> + node_end_pfn,
> + &zone_start_pfn,
> + &zone_end_pfn,
> + zones_size);
> + absent = zone_absent_pages_in_node(pgdat->node_id, i,
> + node_start_pfn,
> + node_end_pfn,
> + zholes_size);
> + }
> +
> + size = spanned;
> + real_size = size - absent;
> +
> if (size)
> zone->zone_start_pfn = zone_start_pfn;
> else
> @@ -6859,10 +6870,8 @@ static void __ref alloc_node_mem_map(struct pglist_data *pgdat)
> */
> if (pgdat == NODE_DATA(0)) {
> mem_map = NODE_DATA(0)->node_mem_map;
> -#if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM)
> if (page_to_pfn(mem_map) != pgdat->node_start_pfn)
> mem_map -= offset;
> -#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
> }
> #endif
> }
> @@ -6879,9 +6888,10 @@ static inline void pgdat_set_deferred_range(pg_data_t *pgdat)
> static inline void pgdat_set_deferred_range(pg_data_t *pgdat) {}
> #endif
>
> -void __init free_area_init_node(int nid, unsigned long *zones_size,
> - unsigned long node_start_pfn,
> - unsigned long *zholes_size)
> +void __init __free_area_init_node(int nid, unsigned long *zones_size,
> + unsigned long node_start_pfn,
> + unsigned long *zholes_size,
> + bool compat)
> {
> pg_data_t *pgdat = NODE_DATA(nid);
> unsigned long start_pfn = 0;
> @@ -6893,16 +6903,17 @@ void __init free_area_init_node(int nid, unsigned long *zones_size,
> pgdat->node_id = nid;
> pgdat->node_start_pfn = node_start_pfn;
> pgdat->per_cpu_nodestats = NULL;
> -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
> - get_pfn_range_for_nid(nid, &start_pfn, &end_pfn);
> - pr_info("Initmem setup node %d [mem %#018Lx-%#018Lx]\n", nid,
> - (u64)start_pfn << PAGE_SHIFT,
> - end_pfn ? ((u64)end_pfn << PAGE_SHIFT) - 1 : 0);
> -#else
> - start_pfn = node_start_pfn;
> -#endif
> + if (!compat) {
> + get_pfn_range_for_nid(nid, &start_pfn, &end_pfn);
> + pr_info("Initmem setup node %d [mem %#018Lx-%#018Lx]\n", nid,
> + (u64)start_pfn << PAGE_SHIFT,
> + end_pfn ? ((u64)end_pfn << PAGE_SHIFT) - 1 : 0);
> + } else {
> + start_pfn = node_start_pfn;
> + }
> +
> calculate_node_totalpages(pgdat, start_pfn, end_pfn,
> - zones_size, zholes_size);
> + zones_size, zholes_size, compat);
>
> alloc_node_mem_map(pgdat);
> pgdat_set_deferred_range(pgdat);
> @@ -6910,6 +6921,14 @@ void __init free_area_init_node(int nid, unsigned long *zones_size,
> free_area_init_core(pgdat);
> }
>
> +void __init free_area_init_node(int nid, unsigned long *zones_size,
> + unsigned long node_start_pfn,
> + unsigned long *zholes_size)
> +{
> + __free_area_init_node(nid, zones_size, node_start_pfn, zholes_size,
> + true);
> +}
> +
> #if !defined(CONFIG_FLAT_NODE_MEM_MAP)
> /*
> * Initialize all valid struct pages in the range [spfn, epfn) and mark them
> @@ -6993,8 +7012,6 @@ static inline void __init init_unavailable_mem(void)
> }
> #endif /* !CONFIG_FLAT_NODE_MEM_MAP */
>
> -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
> -
> #if MAX_NUMNODES > 1
> /*
> * Figure out the number of possible node ids.
> @@ -7423,8 +7440,8 @@ void __init free_area_init_nodes(unsigned long *max_zone_pfn)
> init_unavailable_mem();
> for_each_online_node(nid) {
> pg_data_t *pgdat = NODE_DATA(nid);
> - free_area_init_node(nid, NULL,
> - find_min_pfn_for_node(nid), NULL);
> + __free_area_init_node(nid, NULL,
> + find_min_pfn_for_node(nid), NULL, false);
>
> /* Any memory on that node */
> if (pgdat->node_present_pages)
> @@ -7489,8 +7506,6 @@ static int __init cmdline_parse_movablecore(char *p)
> early_param("kernelcore", cmdline_parse_kernelcore);
> early_param("movablecore", cmdline_parse_movablecore);
>
> -#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
> -
> void adjust_managed_page_count(struct page *page, long count)
> {
> atomic_long_add(count, &page_zone(page)->managed_pages);
> --
> 2.25.1
>
>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox