Linux 4.20-rc7

-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAlwW4/oeHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiG2QMH/Rl6iMpTUX23tMHe
 eXQzAOSvQXaWlFoX25j1Jvt8nhS7Uy8vkdpYTCOI/7DF0Jg4O/6uxcZkErlwWxb8
 MW1rMgpfO+OpDLSLXAO2GKxaKI3ArqF2BcOQA2mji1/jR2VUTqmIvBoudn5d+GYz
 19aCyfdzmVTC38G9sBhhcqJ10EkxLiHe2K74bf4JxVuSf2EnTI4LYt5xJPDoT0/C
 6fOeUNwVhvv5a4svvzJmortq7x7BwyxBQArc7PbO0MPhabLU4wyFUOTRszgsGd76
 o5JuOFwgdIIHlSSacGla6rKq10nmkwR07fHfRFFwbvrfBOEHsXOP2hvzMZX+FLBK
 IXOzdtc=
 =XlMc
 -----END PGP SIGNATURE-----

Merge tag 'v4.20-rc7' into perf/core, to pick up fixes

Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
Ingo Molnar 2018-12-17 17:46:26 +01:00
commit 76aea1eeb9
437 changed files with 4851 additions and 2109 deletions

View File

@ -2541,6 +2541,10 @@ S: Ormond
S: Victoria 3163 S: Victoria 3163
S: Australia S: Australia
N: Eric Miao
E: eric.y.miao@gmail.com
D: MMP support
N: Pauline Middelink N: Pauline Middelink
E: middelin@polyware.nl E: middelin@polyware.nl
D: General low-level bug fixes, /proc fixes, identd support D: General low-level bug fixes, /proc fixes, identd support
@ -4115,6 +4119,10 @@ S: 1507 145th Place SE #B5
S: Bellevue, Washington 98007 S: Bellevue, Washington 98007
S: USA S: USA
N: Haojian Zhuang
E: haojian.zhuang@gmail.com
D: MMP support
N: Richard Zidlicky N: Richard Zidlicky
E: rz@linux-m68k.org, rdzidlic@geocities.com E: rz@linux-m68k.org, rdzidlic@geocities.com
W: http://www.geocities.com/rdzidlic W: http://www.geocities.com/rdzidlic

View File

@ -1,4 +1,4 @@
What: /sys/class/net/<iface>/tagging What: /sys/class/net/<iface>/dsa/tagging
Date: August 2018 Date: August 2018
KernelVersion: 4.20 KernelVersion: 4.20
Contact: netdev@vger.kernel.org Contact: netdev@vger.kernel.org

View File

@ -187,6 +187,8 @@ Takes xa_lock internally:
* :c:func:`xa_erase_bh` * :c:func:`xa_erase_bh`
* :c:func:`xa_erase_irq` * :c:func:`xa_erase_irq`
* :c:func:`xa_cmpxchg` * :c:func:`xa_cmpxchg`
* :c:func:`xa_cmpxchg_bh`
* :c:func:`xa_cmpxchg_irq`
* :c:func:`xa_store_range` * :c:func:`xa_store_range`
* :c:func:`xa_alloc` * :c:func:`xa_alloc`
* :c:func:`xa_alloc_bh` * :c:func:`xa_alloc_bh`
@ -263,7 +265,8 @@ using :c:func:`xa_lock_irqsave` in both the interrupt handler and process
context, or :c:func:`xa_lock_irq` in process context and :c:func:`xa_lock` context, or :c:func:`xa_lock_irq` in process context and :c:func:`xa_lock`
in the interrupt handler. Some of the more common patterns have helper in the interrupt handler. Some of the more common patterns have helper
functions such as :c:func:`xa_store_bh`, :c:func:`xa_store_irq`, functions such as :c:func:`xa_store_bh`, :c:func:`xa_store_irq`,
:c:func:`xa_erase_bh` and :c:func:`xa_erase_irq`. :c:func:`xa_erase_bh`, :c:func:`xa_erase_irq`, :c:func:`xa_cmpxchg_bh`
and :c:func:`xa_cmpxchg_irq`.
Sometimes you need to protect access to the XArray with a mutex because Sometimes you need to protect access to the XArray with a mutex because
that lock sits above another mutex in the locking hierarchy. That does that lock sits above another mutex in the locking hierarchy. That does

View File

@ -168,3 +168,19 @@ a shared clock is forbidden.
Configuration of common clocks, which affect multiple consumer devices can Configuration of common clocks, which affect multiple consumer devices can
be similarly specified in the clock provider node. be similarly specified in the clock provider node.
==Protected clocks==
Some platforms or firmwares may not fully expose all the clocks to the OS, such
as in situations where those clks are used by drivers running in ARM secure
execution levels. Such a configuration can be specified in device tree with the
protected-clocks property in the form of a clock specifier list. This property should
only be specified in the node that is providing the clocks being protected:
clock-controller@a000f000 {
compatible = "vendor,clk95;
reg = <0xa000f000 0x1000>
#clocks-cells = <1>;
...
protected-clocks = <UART3_CLK>, <SPI5_CLK>;
};

View File

@ -12,7 +12,7 @@ The /chosen node should contain a 'linux,sysrq-reset-seq' child node to define
a set of keys. a set of keys.
Required property: Required property:
sysrq-reset-seq: array of Linux keycodes, one keycode per cell. keyset: array of Linux keycodes, one keycode per cell.
Optional property: Optional property:
timeout-ms: duration keys must be pressed together in milliseconds before timeout-ms: duration keys must be pressed together in milliseconds before

View File

@ -1,29 +0,0 @@
device-tree bindings for rockchip VPU codec
Rockchip (Video Processing Unit) present in various Rockchip platforms,
such as RK3288 and RK3399.
Required properties:
- compatible: value should be one of the following
"rockchip,rk3288-vpu";
"rockchip,rk3399-vpu";
- interrupts: encoding and decoding interrupt specifiers
- interrupt-names: should be "vepu" and "vdpu"
- clocks: phandle to VPU aclk, hclk clocks
- clock-names: should be "aclk" and "hclk"
- power-domains: phandle to power domain node
- iommus: phandle to a iommu node
Example:
SoC-specific DT entry:
vpu: video-codec@ff9a0000 {
compatible = "rockchip,rk3288-vpu";
reg = <0x0 0xff9a0000 0x0 0x800>;
interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "vepu", "vdpu";
clocks = <&cru ACLK_VCODEC>, <&cru HCLK_VCODEC>;
clock-names = "aclk", "hclk";
power-domains = <&power RK3288_PD_VIDEO>;
iommus = <&vpu_mmu>;
};

View File

@ -1,4 +1,28 @@
.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-or-later WITH no-invariant-sections .. This file is dual-licensed: you can use it either under the terms
.. of the GPL or the GFDL 1.1+ license, at your option. Note that this
.. dual licensing only applies to this file, and not this project as a
.. whole.
..
.. a) This file 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 of
.. the License, or (at your option) any later version.
..
.. This file 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.
..
.. Or, alternatively,
..
.. b) Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/media/uapi/fdl-appendix.rst.
..
.. TODO: replace it to GPL-2.0 OR GFDL-1.1-or-later WITH no-invariant-sections
.. _media_ioc_request_alloc: .. _media_ioc_request_alloc:

View File

@ -1,4 +1,28 @@
.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-or-later WITH no-invariant-sections .. This file is dual-licensed: you can use it either under the terms
.. of the GPL or the GFDL 1.1+ license, at your option. Note that this
.. dual licensing only applies to this file, and not this project as a
.. whole.
..
.. a) This file 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 of
.. the License, or (at your option) any later version.
..
.. This file 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.
..
.. Or, alternatively,
..
.. b) Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/media/uapi/fdl-appendix.rst.
..
.. TODO: replace it to GPL-2.0 OR GFDL-1.1-or-later WITH no-invariant-sections
.. _media_request_ioc_queue: .. _media_request_ioc_queue:

View File

@ -1,4 +1,28 @@
.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-or-later WITH no-invariant-sections .. This file is dual-licensed: you can use it either under the terms
.. of the GPL or the GFDL 1.1+ license, at your option. Note that this
.. dual licensing only applies to this file, and not this project as a
.. whole.
..
.. a) This file 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 of
.. the License, or (at your option) any later version.
..
.. This file 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.
..
.. Or, alternatively,
..
.. b) Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/media/uapi/fdl-appendix.rst.
..
.. TODO: replace it to GPL-2.0 OR GFDL-1.1-or-later WITH no-invariant-sections
.. _media_request_ioc_reinit: .. _media_request_ioc_reinit:

View File

@ -1,4 +1,28 @@
.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-or-later WITH no-invariant-sections .. This file is dual-licensed: you can use it either under the terms
.. of the GPL or the GFDL 1.1+ license, at your option. Note that this
.. dual licensing only applies to this file, and not this project as a
.. whole.
..
.. a) This file 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 of
.. the License, or (at your option) any later version.
..
.. This file 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.
..
.. Or, alternatively,
..
.. b) Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/media/uapi/fdl-appendix.rst.
..
.. TODO: replace it to GPL-2.0 OR GFDL-1.1-or-later WITH no-invariant-sections
.. _media-request-api: .. _media-request-api:

View File

@ -1,4 +1,28 @@
.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-or-later WITH no-invariant-sections .. This file is dual-licensed: you can use it either under the terms
.. of the GPL or the GFDL 1.1+ license, at your option. Note that this
.. dual licensing only applies to this file, and not this project as a
.. whole.
..
.. a) This file 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 of
.. the License, or (at your option) any later version.
..
.. This file 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.
..
.. Or, alternatively,
..
.. b) Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/media/uapi/fdl-appendix.rst.
..
.. TODO: replace it to GPL-2.0 OR GFDL-1.1-or-later WITH no-invariant-sections
.. _request-func-close: .. _request-func-close:

View File

@ -1,4 +1,28 @@
.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-or-later WITH no-invariant-sections .. This file is dual-licensed: you can use it either under the terms
.. of the GPL or the GFDL 1.1+ license, at your option. Note that this
.. dual licensing only applies to this file, and not this project as a
.. whole.
..
.. a) This file 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 of
.. the License, or (at your option) any later version.
..
.. This file 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.
..
.. Or, alternatively,
..
.. b) Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/media/uapi/fdl-appendix.rst.
..
.. TODO: replace it to GPL-2.0 OR GFDL-1.1-or-later WITH no-invariant-sections
.. _request-func-ioctl: .. _request-func-ioctl:

View File

@ -1,4 +1,28 @@
.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-or-later WITH no-invariant-sections .. This file is dual-licensed: you can use it either under the terms
.. of the GPL or the GFDL 1.1+ license, at your option. Note that this
.. dual licensing only applies to this file, and not this project as a
.. whole.
..
.. a) This file 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 of
.. the License, or (at your option) any later version.
..
.. This file 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.
..
.. Or, alternatively,
..
.. b) Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/media/uapi/fdl-appendix.rst.
..
.. TODO: replace it to GPL-2.0 OR GFDL-1.1-or-later WITH no-invariant-sections
.. _request-func-poll: .. _request-func-poll:

View File

@ -1505,6 +1505,11 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type -
configuring a stateless hardware decoding pipeline for MPEG-2. configuring a stateless hardware decoding pipeline for MPEG-2.
The bitstream parameters are defined according to :ref:`mpeg2part2`. The bitstream parameters are defined according to :ref:`mpeg2part2`.
.. note::
This compound control is not yet part of the public kernel API and
it is expected to change.
.. c:type:: v4l2_ctrl_mpeg2_slice_params .. c:type:: v4l2_ctrl_mpeg2_slice_params
.. cssclass:: longtable .. cssclass:: longtable
@ -1625,6 +1630,11 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type -
Specifies quantization matrices (as extracted from the bitstream) for the Specifies quantization matrices (as extracted from the bitstream) for the
associated MPEG-2 slice data. associated MPEG-2 slice data.
.. note::
This compound control is not yet part of the public kernel API and
it is expected to change.
.. c:type:: v4l2_ctrl_mpeg2_quantization .. c:type:: v4l2_ctrl_mpeg2_quantization
.. cssclass:: longtable .. cssclass:: longtable

View File

@ -1472,6 +1472,7 @@ F: drivers/clk/sirf/
F: drivers/clocksource/timer-prima2.c F: drivers/clocksource/timer-prima2.c
F: drivers/clocksource/timer-atlas7.c F: drivers/clocksource/timer-atlas7.c
N: [^a-z]sirf N: [^a-z]sirf
X: drivers/gnss
ARM/EBSA110 MACHINE SUPPORT ARM/EBSA110 MACHINE SUPPORT
M: Russell King <linux@armlinux.org.uk> M: Russell King <linux@armlinux.org.uk>
@ -1738,13 +1739,17 @@ ARM/Mediatek SoC support
M: Matthias Brugger <matthias.bgg@gmail.com> M: Matthias Brugger <matthias.bgg@gmail.com>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
L: linux-mediatek@lists.infradead.org (moderated for non-subscribers) L: linux-mediatek@lists.infradead.org (moderated for non-subscribers)
W: https://mtk.bcnfs.org/
C: irc://chat.freenode.net/linux-mediatek
S: Maintained S: Maintained
F: arch/arm/boot/dts/mt6* F: arch/arm/boot/dts/mt6*
F: arch/arm/boot/dts/mt7* F: arch/arm/boot/dts/mt7*
F: arch/arm/boot/dts/mt8* F: arch/arm/boot/dts/mt8*
F: arch/arm/mach-mediatek/ F: arch/arm/mach-mediatek/
F: arch/arm64/boot/dts/mediatek/ F: arch/arm64/boot/dts/mediatek/
F: drivers/soc/mediatek/
N: mtk N: mtk
N: mt[678]
K: mediatek K: mediatek
ARM/Mediatek USB3 PHY DRIVER ARM/Mediatek USB3 PHY DRIVER
@ -3271,11 +3276,16 @@ S: Maintained
F: sound/pci/oxygen/ F: sound/pci/oxygen/
C-SKY ARCHITECTURE C-SKY ARCHITECTURE
M: Guo Ren <ren_guo@c-sky.com> M: Guo Ren <guoren@kernel.org>
T: git https://github.com/c-sky/csky-linux.git T: git https://github.com/c-sky/csky-linux.git
S: Supported S: Supported
F: arch/csky/ F: arch/csky/
F: Documentation/devicetree/bindings/csky/ F: Documentation/devicetree/bindings/csky/
F: drivers/irqchip/irq-csky-*
F: Documentation/devicetree/bindings/interrupt-controller/csky,*
F: drivers/clocksource/timer-gx6605s.c
F: drivers/clocksource/timer-mp-csky.c
F: Documentation/devicetree/bindings/timer/csky,*
K: csky K: csky
N: csky N: csky
@ -4837,6 +4847,7 @@ F: include/uapi/drm/vmwgfx_drm.h
DRM DRIVERS DRM DRIVERS
M: David Airlie <airlied@linux.ie> M: David Airlie <airlied@linux.ie>
M: Daniel Vetter <daniel@ffwll.ch>
L: dri-devel@lists.freedesktop.org L: dri-devel@lists.freedesktop.org
T: git git://anongit.freedesktop.org/drm/drm T: git git://anongit.freedesktop.org/drm/drm
B: https://bugs.freedesktop.org/ B: https://bugs.freedesktop.org/
@ -6316,6 +6327,7 @@ F: include/uapi/linux/gigaset_dev.h
GNSS SUBSYSTEM GNSS SUBSYSTEM
M: Johan Hovold <johan@kernel.org> M: Johan Hovold <johan@kernel.org>
T: git git://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss.git
S: Maintained S: Maintained
F: Documentation/ABI/testing/sysfs-class-gnss F: Documentation/ABI/testing/sysfs-class-gnss
F: Documentation/devicetree/bindings/gnss/ F: Documentation/devicetree/bindings/gnss/
@ -9998,12 +10010,9 @@ S: Odd Fixes
F: drivers/media/radio/radio-miropcm20* F: drivers/media/radio/radio-miropcm20*
MMP SUPPORT MMP SUPPORT
M: Eric Miao <eric.y.miao@gmail.com> R: Lubomir Rintel <lkundrak@v3.sk>
M: Haojian Zhuang <haojian.zhuang@gmail.com>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
T: git git://github.com/hzhuang1/linux.git S: Odd Fixes
T: git git://git.linaro.org/people/ycmiao/pxa-linux.git
S: Maintained
F: arch/arm/boot/dts/mmp* F: arch/arm/boot/dts/mmp*
F: arch/arm/mach-mmp/ F: arch/arm/mach-mmp/
@ -13883,6 +13892,13 @@ F: drivers/md/raid*
F: include/linux/raid/ F: include/linux/raid/
F: include/uapi/linux/raid/ F: include/uapi/linux/raid/
SOCIONEXT (SNI) AVE NETWORK DRIVER
M: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
L: netdev@vger.kernel.org
S: Maintained
F: drivers/net/ethernet/socionext/sni_ave.c
F: Documentation/devicetree/bindings/net/socionext,uniphier-ave4.txt
SOCIONEXT (SNI) NETSEC NETWORK DRIVER SOCIONEXT (SNI) NETSEC NETWORK DRIVER
M: Jassi Brar <jaswinder.singh@linaro.org> M: Jassi Brar <jaswinder.singh@linaro.org>
L: netdev@vger.kernel.org L: netdev@vger.kernel.org

View File

@ -2,7 +2,7 @@
VERSION = 4 VERSION = 4
PATCHLEVEL = 20 PATCHLEVEL = 20
SUBLEVEL = 0 SUBLEVEL = 0
EXTRAVERSION = -rc5 EXTRAVERSION = -rc7
NAME = Shy Crocodile NAME = Shy Crocodile
# *DOCUMENTATION* # *DOCUMENTATION*

View File

@ -634,6 +634,7 @@ setup_arch(char **cmdline_p)
/* Find our memory. */ /* Find our memory. */
setup_memory(kernel_end); setup_memory(kernel_end);
memblock_set_bottom_up(true);
/* First guess at cpu cache sizes. Do this before init_arch. */ /* First guess at cpu cache sizes. Do this before init_arch. */
determine_cpu_caches(cpu->type); determine_cpu_caches(cpu->type);

View File

@ -144,14 +144,14 @@ setup_memory_node(int nid, void *kernel_end)
if (!nid && (node_max_pfn < end_kernel_pfn || node_min_pfn > start_kernel_pfn)) if (!nid && (node_max_pfn < end_kernel_pfn || node_min_pfn > start_kernel_pfn))
panic("kernel loaded out of ram"); panic("kernel loaded out of ram");
memblock_add(PFN_PHYS(node_min_pfn),
(node_max_pfn - node_min_pfn) << PAGE_SHIFT);
/* Zone start phys-addr must be 2^(MAX_ORDER-1) aligned. /* Zone start phys-addr must be 2^(MAX_ORDER-1) aligned.
Note that we round this down, not up - node memory Note that we round this down, not up - node memory
has much larger alignment than 8Mb, so it's safe. */ has much larger alignment than 8Mb, so it's safe. */
node_min_pfn &= ~((1UL << (MAX_ORDER-1))-1); node_min_pfn &= ~((1UL << (MAX_ORDER-1))-1);
memblock_add(PFN_PHYS(node_min_pfn),
(node_max_pfn - node_min_pfn) << PAGE_SHIFT);
NODE_DATA(nid)->node_start_pfn = node_min_pfn; NODE_DATA(nid)->node_start_pfn = node_min_pfn;
NODE_DATA(nid)->node_present_pages = node_max_pfn - node_min_pfn; NODE_DATA(nid)->node_present_pages = node_max_pfn - node_min_pfn;

View File

@ -109,7 +109,7 @@ endmenu
choice choice
prompt "ARC Instruction Set" prompt "ARC Instruction Set"
default ISA_ARCOMPACT default ISA_ARCV2
config ISA_ARCOMPACT config ISA_ARCOMPACT
bool "ARCompact ISA" bool "ARCompact ISA"
@ -176,13 +176,11 @@ endchoice
config CPU_BIG_ENDIAN config CPU_BIG_ENDIAN
bool "Enable Big Endian Mode" bool "Enable Big Endian Mode"
default n
help help
Build kernel for Big Endian Mode of ARC CPU Build kernel for Big Endian Mode of ARC CPU
config SMP config SMP
bool "Symmetric Multi-Processing" bool "Symmetric Multi-Processing"
default n
select ARC_MCIP if ISA_ARCV2 select ARC_MCIP if ISA_ARCV2
help help
This enables support for systems with more than one CPU. This enables support for systems with more than one CPU.
@ -254,7 +252,6 @@ config ARC_CACHE_PAGES
config ARC_CACHE_VIPT_ALIASING config ARC_CACHE_VIPT_ALIASING
bool "Support VIPT Aliasing D$" bool "Support VIPT Aliasing D$"
depends on ARC_HAS_DCACHE && ISA_ARCOMPACT depends on ARC_HAS_DCACHE && ISA_ARCOMPACT
default n
endif #ARC_CACHE endif #ARC_CACHE
@ -262,7 +259,6 @@ config ARC_HAS_ICCM
bool "Use ICCM" bool "Use ICCM"
help help
Single Cycle RAMS to store Fast Path Code Single Cycle RAMS to store Fast Path Code
default n
config ARC_ICCM_SZ config ARC_ICCM_SZ
int "ICCM Size in KB" int "ICCM Size in KB"
@ -273,7 +269,6 @@ config ARC_HAS_DCCM
bool "Use DCCM" bool "Use DCCM"
help help
Single Cycle RAMS to store Fast Path Data Single Cycle RAMS to store Fast Path Data
default n
config ARC_DCCM_SZ config ARC_DCCM_SZ
int "DCCM Size in KB" int "DCCM Size in KB"
@ -366,13 +361,11 @@ if ISA_ARCOMPACT
config ARC_COMPACT_IRQ_LEVELS config ARC_COMPACT_IRQ_LEVELS
bool "Setup Timer IRQ as high Priority" bool "Setup Timer IRQ as high Priority"
default n
# if SMP, LV2 enabled ONLY if ARC implementation has LV2 re-entrancy # if SMP, LV2 enabled ONLY if ARC implementation has LV2 re-entrancy
depends on !SMP depends on !SMP
config ARC_FPU_SAVE_RESTORE config ARC_FPU_SAVE_RESTORE
bool "Enable FPU state persistence across context switch" bool "Enable FPU state persistence across context switch"
default n
help help
Double Precision Floating Point unit had dedicated regs which Double Precision Floating Point unit had dedicated regs which
need to be saved/restored across context-switch. need to be saved/restored across context-switch.
@ -453,7 +446,6 @@ config HIGHMEM
config ARC_HAS_PAE40 config ARC_HAS_PAE40
bool "Support for the 40-bit Physical Address Extension" bool "Support for the 40-bit Physical Address Extension"
default n
depends on ISA_ARCV2 depends on ISA_ARCV2
select HIGHMEM select HIGHMEM
select PHYS_ADDR_T_64BIT select PHYS_ADDR_T_64BIT
@ -496,7 +488,6 @@ config HZ
config ARC_METAWARE_HLINK config ARC_METAWARE_HLINK
bool "Support for Metaware debugger assisted Host access" bool "Support for Metaware debugger assisted Host access"
default n
help help
This options allows a Linux userland apps to directly access This options allows a Linux userland apps to directly access
host file system (open/creat/read/write etc) with help from host file system (open/creat/read/write etc) with help from
@ -524,13 +515,11 @@ config ARC_DW2_UNWIND
config ARC_DBG_TLB_PARANOIA config ARC_DBG_TLB_PARANOIA
bool "Paranoia Checks in Low Level TLB Handlers" bool "Paranoia Checks in Low Level TLB Handlers"
default n
endif endif
config ARC_UBOOT_SUPPORT config ARC_UBOOT_SUPPORT
bool "Support uboot arg Handling" bool "Support uboot arg Handling"
default n
help help
ARC Linux by default checks for uboot provided args as pointers to ARC Linux by default checks for uboot provided args as pointers to
external cmdline or DTB. This however breaks in absence of uboot, external cmdline or DTB. This however breaks in absence of uboot,

View File

@ -6,7 +6,7 @@
# published by the Free Software Foundation. # published by the Free Software Foundation.
# #
KBUILD_DEFCONFIG := nsim_700_defconfig KBUILD_DEFCONFIG := nsim_hs_defconfig
cflags-y += -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__ cflags-y += -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__
cflags-$(CONFIG_ISA_ARCOMPACT) += -mA7 cflags-$(CONFIG_ISA_ARCOMPACT) += -mA7

View File

@ -222,6 +222,21 @@ mmc@a000 {
bus-width = <4>; bus-width = <4>;
dma-coherent; dma-coherent;
}; };
gpio: gpio@3000 {
compatible = "snps,dw-apb-gpio";
reg = <0x3000 0x20>;
#address-cells = <1>;
#size-cells = <0>;
gpio_port_a: gpio-controller@0 {
compatible = "snps,dw-apb-gpio-port";
gpio-controller;
#gpio-cells = <2>;
snps,nr-gpios = <24>;
reg = <0>;
};
};
}; };
memory@80000000 { memory@80000000 {

View File

@ -14,6 +14,7 @@ CONFIG_PERF_EVENTS=y
# CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_VM_EVENT_COUNTERS is not set
# CONFIG_SLUB_DEBUG is not set # CONFIG_SLUB_DEBUG is not set
# CONFIG_COMPAT_BRK is not set # CONFIG_COMPAT_BRK is not set
CONFIG_ISA_ARCOMPACT=y
CONFIG_MODULES=y CONFIG_MODULES=y
CONFIG_MODULE_FORCE_LOAD=y CONFIG_MODULE_FORCE_LOAD=y
CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_UNLOAD=y
@ -95,6 +96,7 @@ CONFIG_VFAT_FS=y
CONFIG_NTFS_FS=y CONFIG_NTFS_FS=y
CONFIG_TMPFS=y CONFIG_TMPFS=y
CONFIG_NFS_FS=y CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y
CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y CONFIG_NLS_ISO8859_1=y
# CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_ENABLE_WARN_DEPRECATED is not set

View File

@ -94,6 +94,7 @@ CONFIG_VFAT_FS=y
CONFIG_NTFS_FS=y CONFIG_NTFS_FS=y
CONFIG_TMPFS=y CONFIG_TMPFS=y
CONFIG_NFS_FS=y CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y
CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y CONFIG_NLS_ISO8859_1=y
# CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_ENABLE_WARN_DEPRECATED is not set

View File

@ -97,6 +97,7 @@ CONFIG_VFAT_FS=y
CONFIG_NTFS_FS=y CONFIG_NTFS_FS=y
CONFIG_TMPFS=y CONFIG_TMPFS=y
CONFIG_NFS_FS=y CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y
CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y CONFIG_NLS_ISO8859_1=y
# CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_ENABLE_WARN_DEPRECATED is not set

View File

@ -45,6 +45,9 @@ CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_DW=y CONFIG_SERIAL_8250_DW=y
CONFIG_SERIAL_OF_PLATFORM=y CONFIG_SERIAL_OF_PLATFORM=y
# CONFIG_HW_RANDOM is not set # CONFIG_HW_RANDOM is not set
CONFIG_GPIOLIB=y
CONFIG_GPIO_SYSFS=y
CONFIG_GPIO_DWAPB=y
# CONFIG_HWMON is not set # CONFIG_HWMON is not set
CONFIG_DRM=y CONFIG_DRM=y
# CONFIG_DRM_FBDEV_EMULATION is not set # CONFIG_DRM_FBDEV_EMULATION is not set
@ -65,6 +68,7 @@ CONFIG_EXT3_FS=y
CONFIG_VFAT_FS=y CONFIG_VFAT_FS=y
CONFIG_TMPFS=y CONFIG_TMPFS=y
CONFIG_NFS_FS=y CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y
CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y CONFIG_NLS_ISO8859_1=y
# CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_ENABLE_WARN_DEPRECATED is not set

View File

@ -15,6 +15,7 @@ CONFIG_SYSCTL_SYSCALL=y
CONFIG_EMBEDDED=y CONFIG_EMBEDDED=y
CONFIG_PERF_EVENTS=y CONFIG_PERF_EVENTS=y
# CONFIG_COMPAT_BRK is not set # CONFIG_COMPAT_BRK is not set
CONFIG_ISA_ARCOMPACT=y
CONFIG_KPROBES=y CONFIG_KPROBES=y
CONFIG_MODULES=y CONFIG_MODULES=y
CONFIG_MODULE_FORCE_LOAD=y CONFIG_MODULE_FORCE_LOAD=y
@ -73,6 +74,7 @@ CONFIG_PROC_KCORE=y
CONFIG_TMPFS=y CONFIG_TMPFS=y
# CONFIG_MISC_FILESYSTEMS is not set # CONFIG_MISC_FILESYSTEMS is not set
CONFIG_NFS_FS=y CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y
CONFIG_ROOT_NFS=y CONFIG_ROOT_NFS=y
CONFIG_DEBUG_INFO=y CONFIG_DEBUG_INFO=y
# CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_ENABLE_WARN_DEPRECATED is not set

View File

@ -15,6 +15,7 @@ CONFIG_EMBEDDED=y
CONFIG_PERF_EVENTS=y CONFIG_PERF_EVENTS=y
# CONFIG_SLUB_DEBUG is not set # CONFIG_SLUB_DEBUG is not set
# CONFIG_COMPAT_BRK is not set # CONFIG_COMPAT_BRK is not set
CONFIG_ISA_ARCOMPACT=y
CONFIG_KPROBES=y CONFIG_KPROBES=y
CONFIG_MODULES=y CONFIG_MODULES=y
# CONFIG_LBDAF is not set # CONFIG_LBDAF is not set

View File

@ -15,6 +15,7 @@ CONFIG_EMBEDDED=y
CONFIG_PERF_EVENTS=y CONFIG_PERF_EVENTS=y
# CONFIG_SLUB_DEBUG is not set # CONFIG_SLUB_DEBUG is not set
# CONFIG_COMPAT_BRK is not set # CONFIG_COMPAT_BRK is not set
CONFIG_ISA_ARCOMPACT=y
CONFIG_KPROBES=y CONFIG_KPROBES=y
CONFIG_MODULES=y CONFIG_MODULES=y
# CONFIG_LBDAF is not set # CONFIG_LBDAF is not set
@ -66,5 +67,6 @@ CONFIG_EXT2_FS_XATTR=y
CONFIG_TMPFS=y CONFIG_TMPFS=y
# CONFIG_MISC_FILESYSTEMS is not set # CONFIG_MISC_FILESYSTEMS is not set
CONFIG_NFS_FS=y CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y
# CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_ENABLE_WARN_DEPRECATED is not set
# CONFIG_ENABLE_MUST_CHECK is not set # CONFIG_ENABLE_MUST_CHECK is not set

View File

@ -65,5 +65,6 @@ CONFIG_EXT2_FS_XATTR=y
CONFIG_TMPFS=y CONFIG_TMPFS=y
# CONFIG_MISC_FILESYSTEMS is not set # CONFIG_MISC_FILESYSTEMS is not set
CONFIG_NFS_FS=y CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y
# CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_ENABLE_WARN_DEPRECATED is not set
# CONFIG_ENABLE_MUST_CHECK is not set # CONFIG_ENABLE_MUST_CHECK is not set

View File

@ -76,6 +76,7 @@ CONFIG_EXT2_FS_XATTR=y
CONFIG_TMPFS=y CONFIG_TMPFS=y
# CONFIG_MISC_FILESYSTEMS is not set # CONFIG_MISC_FILESYSTEMS is not set
CONFIG_NFS_FS=y CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y
# CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_ENABLE_WARN_DEPRECATED is not set
# CONFIG_ENABLE_MUST_CHECK is not set # CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_FTRACE=y CONFIG_FTRACE=y

View File

@ -19,6 +19,7 @@ CONFIG_KALLSYMS_ALL=y
# CONFIG_AIO is not set # CONFIG_AIO is not set
CONFIG_EMBEDDED=y CONFIG_EMBEDDED=y
# CONFIG_COMPAT_BRK is not set # CONFIG_COMPAT_BRK is not set
CONFIG_ISA_ARCOMPACT=y
CONFIG_SLAB=y CONFIG_SLAB=y
CONFIG_MODULES=y CONFIG_MODULES=y
CONFIG_MODULE_FORCE_LOAD=y CONFIG_MODULE_FORCE_LOAD=y

View File

@ -85,6 +85,7 @@ CONFIG_NTFS_FS=y
CONFIG_TMPFS=y CONFIG_TMPFS=y
CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS=y
CONFIG_NFS_FS=y CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y
CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y CONFIG_NLS_ISO8859_1=y
# CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_ENABLE_WARN_DEPRECATED is not set

View File

@ -90,6 +90,7 @@ CONFIG_NTFS_FS=y
CONFIG_TMPFS=y CONFIG_TMPFS=y
CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS=y
CONFIG_NFS_FS=y CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y
CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y CONFIG_NLS_ISO8859_1=y
# CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_ENABLE_WARN_DEPRECATED is not set

View File

@ -113,7 +113,9 @@ extern unsigned long perip_base, perip_end;
/* IO coherency related Auxiliary registers */ /* IO coherency related Auxiliary registers */
#define ARC_REG_IO_COH_ENABLE 0x500 #define ARC_REG_IO_COH_ENABLE 0x500
#define ARC_IO_COH_ENABLE_BIT BIT(0)
#define ARC_REG_IO_COH_PARTIAL 0x501 #define ARC_REG_IO_COH_PARTIAL 0x501
#define ARC_IO_COH_PARTIAL_BIT BIT(0)
#define ARC_REG_IO_COH_AP0_BASE 0x508 #define ARC_REG_IO_COH_AP0_BASE 0x508
#define ARC_REG_IO_COH_AP0_SIZE 0x509 #define ARC_REG_IO_COH_AP0_SIZE 0x509

View File

@ -12,6 +12,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/unaligned.h>
#ifdef CONFIG_ISA_ARCV2 #ifdef CONFIG_ISA_ARCV2
#include <asm/barrier.h> #include <asm/barrier.h>
@ -94,6 +95,42 @@ static inline u32 __raw_readl(const volatile void __iomem *addr)
return w; return w;
} }
/*
* {read,write}s{b,w,l}() repeatedly access the same IO address in
* native endianness in 8-, 16-, 32-bit chunks {into,from} memory,
* @count times
*/
#define __raw_readsx(t,f) \
static inline void __raw_reads##f(const volatile void __iomem *addr, \
void *ptr, unsigned int count) \
{ \
bool is_aligned = ((unsigned long)ptr % ((t) / 8)) == 0; \
u##t *buf = ptr; \
\
if (!count) \
return; \
\
/* Some ARC CPU's don't support unaligned accesses */ \
if (is_aligned) { \
do { \
u##t x = __raw_read##f(addr); \
*buf++ = x; \
} while (--count); \
} else { \
do { \
u##t x = __raw_read##f(addr); \
put_unaligned(x, buf++); \
} while (--count); \
} \
}
#define __raw_readsb __raw_readsb
__raw_readsx(8, b)
#define __raw_readsw __raw_readsw
__raw_readsx(16, w)
#define __raw_readsl __raw_readsl
__raw_readsx(32, l)
#define __raw_writeb __raw_writeb #define __raw_writeb __raw_writeb
static inline void __raw_writeb(u8 b, volatile void __iomem *addr) static inline void __raw_writeb(u8 b, volatile void __iomem *addr)
{ {
@ -126,6 +163,35 @@ static inline void __raw_writel(u32 w, volatile void __iomem *addr)
} }
#define __raw_writesx(t,f) \
static inline void __raw_writes##f(volatile void __iomem *addr, \
const void *ptr, unsigned int count) \
{ \
bool is_aligned = ((unsigned long)ptr % ((t) / 8)) == 0; \
const u##t *buf = ptr; \
\
if (!count) \
return; \
\
/* Some ARC CPU's don't support unaligned accesses */ \
if (is_aligned) { \
do { \
__raw_write##f(*buf++, addr); \
} while (--count); \
} else { \
do { \
__raw_write##f(get_unaligned(buf++), addr); \
} while (--count); \
} \
}
#define __raw_writesb __raw_writesb
__raw_writesx(8, b)
#define __raw_writesw __raw_writesw
__raw_writesx(16, w)
#define __raw_writesl __raw_writesl
__raw_writesx(32, l)
/* /*
* MMIO can also get buffered/optimized in micro-arch, so barriers needed * MMIO can also get buffered/optimized in micro-arch, so barriers needed
* Based on ARM model for the typical use case * Based on ARM model for the typical use case
@ -141,10 +207,16 @@ static inline void __raw_writel(u32 w, volatile void __iomem *addr)
#define readb(c) ({ u8 __v = readb_relaxed(c); __iormb(); __v; }) #define readb(c) ({ u8 __v = readb_relaxed(c); __iormb(); __v; })
#define readw(c) ({ u16 __v = readw_relaxed(c); __iormb(); __v; }) #define readw(c) ({ u16 __v = readw_relaxed(c); __iormb(); __v; })
#define readl(c) ({ u32 __v = readl_relaxed(c); __iormb(); __v; }) #define readl(c) ({ u32 __v = readl_relaxed(c); __iormb(); __v; })
#define readsb(p,d,l) ({ __raw_readsb(p,d,l); __iormb(); })
#define readsw(p,d,l) ({ __raw_readsw(p,d,l); __iormb(); })
#define readsl(p,d,l) ({ __raw_readsl(p,d,l); __iormb(); })
#define writeb(v,c) ({ __iowmb(); writeb_relaxed(v,c); }) #define writeb(v,c) ({ __iowmb(); writeb_relaxed(v,c); })
#define writew(v,c) ({ __iowmb(); writew_relaxed(v,c); }) #define writew(v,c) ({ __iowmb(); writew_relaxed(v,c); })
#define writel(v,c) ({ __iowmb(); writel_relaxed(v,c); }) #define writel(v,c) ({ __iowmb(); writel_relaxed(v,c); })
#define writesb(p,d,l) ({ __iowmb(); __raw_writesb(p,d,l); })
#define writesw(p,d,l) ({ __iowmb(); __raw_writesw(p,d,l); })
#define writesl(p,d,l) ({ __iowmb(); __raw_writesl(p,d,l); })
/* /*
* Relaxed API for drivers which can handle barrier ordering themselves * Relaxed API for drivers which can handle barrier ordering themselves

View File

@ -243,7 +243,7 @@ static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len)
{ {
struct cpuinfo_arc *cpu = &cpuinfo_arc700[cpu_id]; struct cpuinfo_arc *cpu = &cpuinfo_arc700[cpu_id];
struct bcr_identity *core = &cpu->core; struct bcr_identity *core = &cpu->core;
int i, n = 0; int i, n = 0, ua = 0;
FIX_PTR(cpu); FIX_PTR(cpu);
@ -263,10 +263,13 @@ static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len)
IS_AVAIL2(cpu->extn.rtc, "RTC [UP 64-bit] ", CONFIG_ARC_TIMERS_64BIT), IS_AVAIL2(cpu->extn.rtc, "RTC [UP 64-bit] ", CONFIG_ARC_TIMERS_64BIT),
IS_AVAIL2(cpu->extn.gfrc, "GFRC [SMP 64-bit] ", CONFIG_ARC_TIMERS_64BIT)); IS_AVAIL2(cpu->extn.gfrc, "GFRC [SMP 64-bit] ", CONFIG_ARC_TIMERS_64BIT));
n += i = scnprintf(buf + n, len - n, "%s%s%s%s%s", #ifdef __ARC_UNALIGNED__
ua = 1;
#endif
n += i = scnprintf(buf + n, len - n, "%s%s%s%s%s%s",
IS_AVAIL2(cpu->isa.atomic, "atomic ", CONFIG_ARC_HAS_LLSC), IS_AVAIL2(cpu->isa.atomic, "atomic ", CONFIG_ARC_HAS_LLSC),
IS_AVAIL2(cpu->isa.ldd, "ll64 ", CONFIG_ARC_HAS_LL64), IS_AVAIL2(cpu->isa.ldd, "ll64 ", CONFIG_ARC_HAS_LL64),
IS_AVAIL1(cpu->isa.unalign, "unalign (not used)")); IS_AVAIL1(cpu->isa.unalign, "unalign "), IS_USED_RUN(ua));
if (i) if (i)
n += scnprintf(buf + n, len - n, "\n\t\t: "); n += scnprintf(buf + n, len - n, "\n\t\t: ");

View File

@ -1144,6 +1144,20 @@ noinline void __init arc_ioc_setup(void)
{ {
unsigned int ioc_base, mem_sz; unsigned int ioc_base, mem_sz;
/*
* If IOC was already enabled (due to bootloader) it technically needs to
* be reconfigured with aperture base,size corresponding to Linux memory map
* which will certainly be different than uboot's. But disabling and
* reenabling IOC when DMA might be potentially active is tricky business.
* To avoid random memory issues later, just panic here and ask user to
* upgrade bootloader to one which doesn't enable IOC
*/
if (read_aux_reg(ARC_REG_IO_COH_ENABLE) & ARC_IO_COH_ENABLE_BIT)
panic("IOC already enabled, please upgrade bootloader!\n");
if (!ioc_enable)
return;
/* /*
* As for today we don't support both IOC and ZONE_HIGHMEM enabled * As for today we don't support both IOC and ZONE_HIGHMEM enabled
* simultaneously. This happens because as of today IOC aperture covers * simultaneously. This happens because as of today IOC aperture covers
@ -1187,8 +1201,8 @@ noinline void __init arc_ioc_setup(void)
panic("IOC Aperture start must be aligned to the size of the aperture"); panic("IOC Aperture start must be aligned to the size of the aperture");
write_aux_reg(ARC_REG_IO_COH_AP0_BASE, ioc_base >> 12); write_aux_reg(ARC_REG_IO_COH_AP0_BASE, ioc_base >> 12);
write_aux_reg(ARC_REG_IO_COH_PARTIAL, 1); write_aux_reg(ARC_REG_IO_COH_PARTIAL, ARC_IO_COH_PARTIAL_BIT);
write_aux_reg(ARC_REG_IO_COH_ENABLE, 1); write_aux_reg(ARC_REG_IO_COH_ENABLE, ARC_IO_COH_ENABLE_BIT);
/* Re-enable L1 dcache */ /* Re-enable L1 dcache */
__dc_enable(); __dc_enable();
@ -1265,7 +1279,7 @@ void __init arc_cache_init_master(void)
if (is_isa_arcv2() && l2_line_sz && !slc_enable) if (is_isa_arcv2() && l2_line_sz && !slc_enable)
arc_slc_disable(); arc_slc_disable();
if (is_isa_arcv2() && ioc_enable) if (is_isa_arcv2() && ioc_exists)
arc_ioc_setup(); arc_ioc_setup();
if (is_isa_arcv2() && l2_line_sz && slc_enable) { if (is_isa_arcv2() && l2_line_sz && slc_enable) {

View File

@ -66,7 +66,7 @@ void do_page_fault(unsigned long address, struct pt_regs *regs)
struct vm_area_struct *vma = NULL; struct vm_area_struct *vma = NULL;
struct task_struct *tsk = current; struct task_struct *tsk = current;
struct mm_struct *mm = tsk->mm; struct mm_struct *mm = tsk->mm;
int si_code; int si_code = 0;
int ret; int ret;
vm_fault_t fault; vm_fault_t fault;
int write = regs->ecr_cause & ECR_C_PROTV_STORE; /* ST/EX */ int write = regs->ecr_cause & ECR_C_PROTV_STORE; /* ST/EX */

View File

@ -45,7 +45,7 @@ memory {
}; };
/* The voltage to the MMC card is hardwired at 3.3V */ /* The voltage to the MMC card is hardwired at 3.3V */
vmmc: fixedregulator@0 { vmmc: regulator-vmmc {
compatible = "regulator-fixed"; compatible = "regulator-fixed";
regulator-name = "vmmc"; regulator-name = "vmmc";
regulator-min-microvolt = <3300000>; regulator-min-microvolt = <3300000>;
@ -53,7 +53,7 @@ vmmc: fixedregulator@0 {
regulator-boot-on; regulator-boot-on;
}; };
veth: fixedregulator@0 { veth: regulator-veth {
compatible = "regulator-fixed"; compatible = "regulator-fixed";
regulator-name = "veth"; regulator-name = "veth";
regulator-min-microvolt = <3300000>; regulator-min-microvolt = <3300000>;

View File

@ -145,7 +145,7 @@ pmu {
}; };
/* The voltage to the MMC card is hardwired at 3.3V */ /* The voltage to the MMC card is hardwired at 3.3V */
vmmc: fixedregulator@0 { vmmc: regulator-vmmc {
compatible = "regulator-fixed"; compatible = "regulator-fixed";
regulator-name = "vmmc"; regulator-name = "vmmc";
regulator-min-microvolt = <3300000>; regulator-min-microvolt = <3300000>;
@ -153,7 +153,7 @@ vmmc: fixedregulator@0 {
regulator-boot-on; regulator-boot-on;
}; };
veth: fixedregulator@0 { veth: regulator-veth {
compatible = "regulator-fixed"; compatible = "regulator-fixed";
regulator-name = "veth"; regulator-name = "veth";
regulator-min-microvolt = <3300000>; regulator-min-microvolt = <3300000>;

View File

@ -31,7 +31,7 @@ pwr {
wifi_pwrseq: wifi-pwrseq { wifi_pwrseq: wifi-pwrseq {
compatible = "mmc-pwrseq-simple"; compatible = "mmc-pwrseq-simple";
reset-gpios = <&expgpio 1 GPIO_ACTIVE_HIGH>; reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
}; };
}; };

View File

@ -26,7 +26,7 @@ act {
wifi_pwrseq: wifi-pwrseq { wifi_pwrseq: wifi-pwrseq {
compatible = "mmc-pwrseq-simple"; compatible = "mmc-pwrseq-simple";
reset-gpios = <&expgpio 1 GPIO_ACTIVE_HIGH>; reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
}; };
}; };

View File

@ -86,13 +86,17 @@ reg_wlan: regulator-wlan {
compatible = "regulator-fixed"; compatible = "regulator-fixed";
regulator-min-microvolt = <3300000>; regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>; regulator-max-microvolt = <3300000>;
clocks = <&clks IMX7D_CLKO2_ROOT_DIV>;
clock-names = "slow";
regulator-name = "reg_wlan"; regulator-name = "reg_wlan";
startup-delay-us = <70000>; startup-delay-us = <70000>;
gpio = <&gpio4 21 GPIO_ACTIVE_HIGH>; gpio = <&gpio4 21 GPIO_ACTIVE_HIGH>;
enable-active-high; enable-active-high;
}; };
usdhc2_pwrseq: usdhc2_pwrseq {
compatible = "mmc-pwrseq-simple";
clocks = <&clks IMX7D_CLKO2_ROOT_DIV>;
clock-names = "ext_clock";
};
}; };
&adc1 { &adc1 {
@ -375,6 +379,7 @@ &usdhc2 {
bus-width = <4>; bus-width = <4>;
non-removable; non-removable;
vmmc-supply = <&reg_wlan>; vmmc-supply = <&reg_wlan>;
mmc-pwrseq = <&usdhc2_pwrseq>;
cap-power-off-card; cap-power-off-card;
keep-power-in-suspend; keep-power-in-suspend;
status = "okay"; status = "okay";

View File

@ -100,6 +100,19 @@ reg_vref_1v8: regulator-vref-1v8 {
regulator-min-microvolt = <1800000>; regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>; regulator-max-microvolt = <1800000>;
}; };
usdhc2_pwrseq: usdhc2_pwrseq {
compatible = "mmc-pwrseq-simple";
clocks = <&clks IMX7D_CLKO2_ROOT_DIV>;
clock-names = "ext_clock";
};
};
&clks {
assigned-clocks = <&clks IMX7D_CLKO2_ROOT_SRC>,
<&clks IMX7D_CLKO2_ROOT_DIV>;
assigned-clock-parents = <&clks IMX7D_CKIL>;
assigned-clock-rates = <0>, <32768>;
}; };
&i2c4 { &i2c4 {
@ -199,12 +212,13 @@ vgen6_reg: vldo4 {
&usdhc2 { /* Wifi SDIO */ &usdhc2 { /* Wifi SDIO */
pinctrl-names = "default"; pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usdhc2>; pinctrl-0 = <&pinctrl_usdhc2 &pinctrl_wifi_clk>;
no-1-8-v; no-1-8-v;
non-removable; non-removable;
keep-power-in-suspend; keep-power-in-suspend;
wakeup-source; wakeup-source;
vmmc-supply = <&reg_ap6212>; vmmc-supply = <&reg_ap6212>;
mmc-pwrseq = <&usdhc2_pwrseq>;
status = "okay"; status = "okay";
}; };
@ -301,6 +315,12 @@ MX7D_PAD_SD3_DATA7__SD3_DATA7 0x5b
}; };
&iomuxc_lpsr { &iomuxc_lpsr {
pinctrl_wifi_clk: wificlkgrp {
fsl,pins = <
MX7D_PAD_LPSR_GPIO1_IO03__CCM_CLKO2 0x7d
>;
};
pinctrl_wdog: wdoggrp { pinctrl_wdog: wdoggrp {
fsl,pins = < fsl,pins = <
MX7D_PAD_LPSR_GPIO1_IO00__WDOG1_WDOG_B 0x74 MX7D_PAD_LPSR_GPIO1_IO00__WDOG1_WDOG_B 0x74

View File

@ -314,8 +314,8 @@ &reg_dldo1 {
&reg_dldo3 { &reg_dldo3 {
regulator-always-on; regulator-always-on;
regulator-min-microvolt = <2500000>; regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <2500000>; regulator-max-microvolt = <3300000>;
regulator-name = "vcc-pd"; regulator-name = "vcc-pd";
}; };

View File

@ -110,7 +110,7 @@ int __init imx6sx_cpuidle_init(void)
* except for power up sw2iso which need to be * except for power up sw2iso which need to be
* larger than LDO ramp up time. * larger than LDO ramp up time.
*/ */
imx_gpc_set_arm_power_up_timing(2, 1); imx_gpc_set_arm_power_up_timing(0xf, 1);
imx_gpc_set_arm_power_down_timing(1, 1); imx_gpc_set_arm_power_down_timing(1, 1);
return cpuidle_register(&imx6sx_cpuidle_driver, NULL); return cpuidle_register(&imx6sx_cpuidle_driver, NULL);

View File

@ -44,10 +44,12 @@ static inline int cpu_is_pxa910(void)
#define cpu_is_pxa910() (0) #define cpu_is_pxa910() (0)
#endif #endif
#ifdef CONFIG_CPU_MMP2 #if defined(CONFIG_CPU_MMP2) || defined(CONFIG_MACH_MMP2_DT)
static inline int cpu_is_mmp2(void) static inline int cpu_is_mmp2(void)
{ {
return (((read_cpuid_id() >> 8) & 0xff) == 0x58); return (((read_cpuid_id() >> 8) & 0xff) == 0x58) &&
(((mmp_chip_id & 0xfff) == 0x410) ||
((mmp_chip_id & 0xfff) == 0x610));
} }
#else #else
#define cpu_is_mmp2() (0) #define cpu_is_mmp2() (0)

View File

@ -360,14 +360,16 @@ v7_dma_inv_range:
ALT_UP(W(nop)) ALT_UP(W(nop))
#endif #endif
mcrne p15, 0, r0, c7, c14, 1 @ clean & invalidate D / U line mcrne p15, 0, r0, c7, c14, 1 @ clean & invalidate D / U line
addne r0, r0, r2
tst r1, r3 tst r1, r3
bic r1, r1, r3 bic r1, r1, r3
mcrne p15, 0, r1, c7, c14, 1 @ clean & invalidate D / U line mcrne p15, 0, r1, c7, c14, 1 @ clean & invalidate D / U line
1:
mcr p15, 0, r0, c7, c6, 1 @ invalidate D / U line
add r0, r0, r2
cmp r0, r1 cmp r0, r1
1:
mcrlo p15, 0, r0, c7, c6, 1 @ invalidate D / U line
addlo r0, r0, r2
cmplo r0, r1
blo 1b blo 1b
dsb st dsb st
ret lr ret lr

View File

@ -73,9 +73,11 @@
/* /*
* dcimvac: Invalidate data cache line by MVA to PoC * dcimvac: Invalidate data cache line by MVA to PoC
*/ */
.macro dcimvac, rt, tmp .irp c,,eq,ne,cs,cc,mi,pl,vs,vc,hi,ls,ge,lt,gt,le,hs,lo
v7m_cacheop \rt, \tmp, V7M_SCB_DCIMVAC .macro dcimvac\c, rt, tmp
v7m_cacheop \rt, \tmp, V7M_SCB_DCIMVAC, \c
.endm .endm
.endr
/* /*
* dccmvau: Clean data cache line by MVA to PoU * dccmvau: Clean data cache line by MVA to PoU
@ -369,14 +371,16 @@ v7m_dma_inv_range:
tst r0, r3 tst r0, r3
bic r0, r0, r3 bic r0, r0, r3
dccimvacne r0, r3 dccimvacne r0, r3
addne r0, r0, r2
subne r3, r2, #1 @ restore r3, corrupted by v7m's dccimvac subne r3, r2, #1 @ restore r3, corrupted by v7m's dccimvac
tst r1, r3 tst r1, r3
bic r1, r1, r3 bic r1, r1, r3
dccimvacne r1, r3 dccimvacne r1, r3
1:
dcimvac r0, r3
add r0, r0, r2
cmp r0, r1 cmp r0, r1
1:
dcimvaclo r0, r3
addlo r0, r0, r2
cmplo r0, r1
blo 1b blo 1b
dsb st dsb st
ret lr ret lr

View File

@ -829,7 +829,7 @@ static int __arm_dma_mmap(struct device *dev, struct vm_area_struct *vma,
void *cpu_addr, dma_addr_t dma_addr, size_t size, void *cpu_addr, dma_addr_t dma_addr, size_t size,
unsigned long attrs) unsigned long attrs)
{ {
int ret; int ret = -ENXIO;
unsigned long nr_vma_pages = vma_pages(vma); unsigned long nr_vma_pages = vma_pages(vma);
unsigned long nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT; unsigned long nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT;
unsigned long pfn = dma_to_pfn(dev, dma_addr); unsigned long pfn = dma_to_pfn(dev, dma_addr);

View File

@ -274,6 +274,13 @@
.endm .endm
.macro define_processor_functions name:req, dabort:req, pabort:req, nommu=0, suspend=0, bugs=0 .macro define_processor_functions name:req, dabort:req, pabort:req, nommu=0, suspend=0, bugs=0
/*
* If we are building for big.Little with branch predictor hardening,
* we need the processor function tables to remain available after boot.
*/
#if 1 // defined(CONFIG_BIG_LITTLE) && defined(CONFIG_HARDEN_BRANCH_PREDICTOR)
.section ".rodata"
#endif
.type \name\()_processor_functions, #object .type \name\()_processor_functions, #object
.align 2 .align 2
ENTRY(\name\()_processor_functions) ENTRY(\name\()_processor_functions)
@ -309,6 +316,9 @@ ENTRY(\name\()_processor_functions)
.endif .endif
.size \name\()_processor_functions, . - \name\()_processor_functions .size \name\()_processor_functions, . - \name\()_processor_functions
#if 1 // defined(CONFIG_BIG_LITTLE) && defined(CONFIG_HARDEN_BRANCH_PREDICTOR)
.previous
#endif
.endm .endm
.macro define_cache_functions name:req .macro define_cache_functions name:req

View File

@ -247,7 +247,7 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op, struct kprobe *or
} }
/* Copy arch-dep-instance from template. */ /* Copy arch-dep-instance from template. */
memcpy(code, &optprobe_template_entry, memcpy(code, (unsigned char *)optprobe_template_entry,
TMPL_END_IDX * sizeof(kprobe_opcode_t)); TMPL_END_IDX * sizeof(kprobe_opcode_t));
/* Adjust buffer according to instruction. */ /* Adjust buffer according to instruction. */

View File

@ -20,28 +20,24 @@ cpu0: cpu@0 {
compatible = "arm,cortex-a72", "arm,armv8"; compatible = "arm,cortex-a72", "arm,armv8";
reg = <0x000>; reg = <0x000>;
enable-method = "psci"; enable-method = "psci";
cpu-idle-states = <&CPU_SLEEP_0>;
}; };
cpu1: cpu@1 { cpu1: cpu@1 {
device_type = "cpu"; device_type = "cpu";
compatible = "arm,cortex-a72", "arm,armv8"; compatible = "arm,cortex-a72", "arm,armv8";
reg = <0x001>; reg = <0x001>;
enable-method = "psci"; enable-method = "psci";
cpu-idle-states = <&CPU_SLEEP_0>;
}; };
cpu2: cpu@100 { cpu2: cpu@100 {
device_type = "cpu"; device_type = "cpu";
compatible = "arm,cortex-a72", "arm,armv8"; compatible = "arm,cortex-a72", "arm,armv8";
reg = <0x100>; reg = <0x100>;
enable-method = "psci"; enable-method = "psci";
cpu-idle-states = <&CPU_SLEEP_0>;
}; };
cpu3: cpu@101 { cpu3: cpu@101 {
device_type = "cpu"; device_type = "cpu";
compatible = "arm,cortex-a72", "arm,armv8"; compatible = "arm,cortex-a72", "arm,armv8";
reg = <0x101>; reg = <0x101>;
enable-method = "psci"; enable-method = "psci";
cpu-idle-states = <&CPU_SLEEP_0>;
}; };
}; };
}; };

View File

@ -28,33 +28,6 @@ psci {
method = "smc"; method = "smc";
}; };
cpus {
#address-cells = <1>;
#size-cells = <0>;
idle_states {
entry_method = "arm,pcsi";
CPU_SLEEP_0: cpu-sleep-0 {
compatible = "arm,idle-state";
local-timer-stop;
arm,psci-suspend-param = <0x0010000>;
entry-latency-us = <80>;
exit-latency-us = <160>;
min-residency-us = <320>;
};
CLUSTER_SLEEP_0: cluster-sleep-0 {
compatible = "arm,idle-state";
local-timer-stop;
arm,psci-suspend-param = <0x1010000>;
entry-latency-us = <500>;
exit-latency-us = <1000>;
min-residency-us = <2500>;
};
};
};
ap806 { ap806 {
#address-cells = <2>; #address-cells = <2>;
#size-cells = <2>; #size-cells = <2>;

View File

@ -16,8 +16,13 @@ / {
model = "Bananapi BPI-R64"; model = "Bananapi BPI-R64";
compatible = "bananapi,bpi-r64", "mediatek,mt7622"; compatible = "bananapi,bpi-r64", "mediatek,mt7622";
aliases {
serial0 = &uart0;
};
chosen { chosen {
bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n1 swiotlb=512"; stdout-path = "serial0:115200n8";
bootargs = "earlycon=uart8250,mmio32,0x11002000 swiotlb=512";
}; };
cpus { cpus {

View File

@ -17,8 +17,13 @@ / {
model = "MediaTek MT7622 RFB1 board"; model = "MediaTek MT7622 RFB1 board";
compatible = "mediatek,mt7622-rfb1", "mediatek,mt7622"; compatible = "mediatek,mt7622-rfb1", "mediatek,mt7622";
aliases {
serial0 = &uart0;
};
chosen { chosen {
bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n1 swiotlb=512"; stdout-path = "serial0:115200n8";
bootargs = "earlycon=uart8250,mmio32,0x11002000 swiotlb=512";
}; };
cpus { cpus {

View File

@ -227,16 +227,6 @@ pericfg: pericfg@10002000 {
#reset-cells = <1>; #reset-cells = <1>;
}; };
timer: timer@10004000 {
compatible = "mediatek,mt7622-timer",
"mediatek,mt6577-timer";
reg = <0 0x10004000 0 0x80>;
interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_LOW>;
clocks = <&infracfg CLK_INFRA_APXGPT_PD>,
<&topckgen CLK_TOP_RTC>;
clock-names = "system-clk", "rtc-clk";
};
scpsys: scpsys@10006000 { scpsys: scpsys@10006000 {
compatible = "mediatek,mt7622-scpsys", compatible = "mediatek,mt7622-scpsys",
"syscon"; "syscon";

View File

@ -343,6 +343,12 @@ vreg_s3c_0p6: smps3 {
}; };
}; };
&gcc {
protected-clocks = <GCC_QSPI_CORE_CLK>,
<GCC_QSPI_CORE_CLK_SRC>,
<GCC_QSPI_CNOC_PERIPH_AHB_CLK>;
};
&i2c10 { &i2c10 {
status = "okay"; status = "okay";
clock-frequency = <400000>; clock-frequency = <400000>;

View File

@ -34,15 +34,6 @@
*/ */
#define PCI_IO_SIZE SZ_16M #define PCI_IO_SIZE SZ_16M
/*
* Log2 of the upper bound of the size of a struct page. Used for sizing
* the vmemmap region only, does not affect actual memory footprint.
* We don't use sizeof(struct page) directly since taking its size here
* requires its definition to be available at this point in the inclusion
* chain, and it may not be a power of 2 in the first place.
*/
#define STRUCT_PAGE_MAX_SHIFT 6
/* /*
* VMEMMAP_SIZE - allows the whole linear region to be covered by * VMEMMAP_SIZE - allows the whole linear region to be covered by
* a struct page array * a struct page array

View File

@ -214,7 +214,7 @@ static int create_safe_exec_page(void *src_start, size_t length,
} }
memcpy((void *)dst, src_start, length); memcpy((void *)dst, src_start, length);
flush_icache_range(dst, dst + length); __flush_icache_range(dst, dst + length);
pgdp = pgd_offset_raw(allocator(mask), dst_addr); pgdp = pgd_offset_raw(allocator(mask), dst_addr);
if (pgd_none(READ_ONCE(*pgdp))) { if (pgd_none(READ_ONCE(*pgdp))) {

View File

@ -429,9 +429,9 @@ static void *__iommu_alloc_attrs(struct device *dev, size_t size,
prot, prot,
__builtin_return_address(0)); __builtin_return_address(0));
if (addr) { if (addr) {
memset(addr, 0, size);
if (!coherent) if (!coherent)
__dma_flush_area(page_to_virt(page), iosize); __dma_flush_area(page_to_virt(page), iosize);
memset(addr, 0, size);
} else { } else {
iommu_dma_unmap_page(dev, *handle, iosize, 0, attrs); iommu_dma_unmap_page(dev, *handle, iosize, 0, attrs);
dma_release_from_contiguous(dev, page, dma_release_from_contiguous(dev, page,

View File

@ -610,14 +610,6 @@ void __init mem_init(void)
BUILD_BUG_ON(TASK_SIZE_32 > TASK_SIZE_64); BUILD_BUG_ON(TASK_SIZE_32 > TASK_SIZE_64);
#endif #endif
#ifdef CONFIG_SPARSEMEM_VMEMMAP
/*
* Make sure we chose the upper bound of sizeof(struct page)
* correctly when sizing the VMEMMAP array.
*/
BUILD_BUG_ON(sizeof(struct page) > (1 << STRUCT_PAGE_MAX_SHIFT));
#endif
if (PAGE_SIZE >= 16384 && get_num_physpages() <= 128) { if (PAGE_SIZE >= 16384 && get_num_physpages() <= 128) {
extern int sysctl_overcommit_memory; extern int sysctl_overcommit_memory;
/* /*

View File

@ -16,7 +16,7 @@
static inline void tlbmiss_handler_setup_pgd(unsigned long pgd, bool kernel) static inline void tlbmiss_handler_setup_pgd(unsigned long pgd, bool kernel)
{ {
pgd &= ~(1<<31); pgd -= PAGE_OFFSET;
pgd += PHYS_OFFSET; pgd += PHYS_OFFSET;
pgd |= 1; pgd |= 1;
setup_pgd(pgd, kernel); setup_pgd(pgd, kernel);
@ -29,7 +29,7 @@ static inline void tlbmiss_handler_setup_pgd(unsigned long pgd, bool kernel)
static inline unsigned long tlb_get_pgd(void) static inline unsigned long tlb_get_pgd(void)
{ {
return ((get_pgd()|(1<<31)) - PHYS_OFFSET) & ~1; return ((get_pgd() - PHYS_OFFSET) & ~1) + PAGE_OFFSET;
} }
#define cpu_context(cpu, mm) ((mm)->context.asid[cpu]) #define cpu_context(cpu, mm) ((mm)->context.asid[cpu])

View File

@ -71,6 +71,13 @@ ifdef CONFIG_MLONGCALLS
KBUILD_CFLAGS_KERNEL += -mlong-calls KBUILD_CFLAGS_KERNEL += -mlong-calls
endif endif
# Without this, "ld -r" results in .text sections that are too big (> 0x40000)
# for branches to reach stubs. And multiple .text sections trigger a warning
# when creating the sysfs module information section.
ifndef CONFIG_64BIT
KBUILD_CFLAGS_MODULE += -ffunction-sections
endif
# select which processor to optimise for # select which processor to optimise for
cflags-$(CONFIG_PA7000) += -march=1.1 -mschedule=7100 cflags-$(CONFIG_PA7000) += -march=1.1 -mschedule=7100
cflags-$(CONFIG_PA7200) += -march=1.1 -mschedule=7200 cflags-$(CONFIG_PA7200) += -march=1.1 -mschedule=7200

View File

@ -197,7 +197,7 @@ $(obj)/empty.c:
$(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds : $(obj)/%: $(srctree)/$(src)/%.S $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds : $(obj)/%: $(srctree)/$(src)/%.S
$(Q)cp $< $@ $(Q)cp $< $@
$(obj)/serial.c: $(obj)/autoconf.h $(srctree)/$(src)/serial.c: $(obj)/autoconf.h
$(obj)/autoconf.h: $(obj)/%: $(objtree)/include/generated/% $(obj)/autoconf.h: $(obj)/%: $(objtree)/include/generated/%
$(Q)cp $< $@ $(Q)cp $< $@

View File

@ -15,7 +15,7 @@
RELA = 7 RELA = 7
RELACOUNT = 0x6ffffff9 RELACOUNT = 0x6ffffff9
.text .data
/* A procedure descriptor used when booting this as a COFF file. /* A procedure descriptor used when booting this as a COFF file.
* When making COFF, this comes first in the link and we're * When making COFF, this comes first in the link and we're
* linked at 0x500000. * linked at 0x500000.
@ -23,6 +23,8 @@ RELACOUNT = 0x6ffffff9
.globl _zimage_start_opd .globl _zimage_start_opd
_zimage_start_opd: _zimage_start_opd:
.long 0x500000, 0, 0, 0 .long 0x500000, 0, 0, 0
.text
b _zimage_start
#ifdef __powerpc64__ #ifdef __powerpc64__
.balign 8 .balign 8

View File

@ -26,6 +26,8 @@
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <asm/reg.h> #include <asm/reg.h>
#define perf_arch_bpf_user_pt_regs(regs) &regs->user_regs
/* /*
* Overload regs->result to specify whether we should use the MSR (result * Overload regs->result to specify whether we should use the MSR (result
* is zero) or the SIAR (result is non zero). * is zero) or the SIAR (result is non zero).

View File

@ -1,7 +1,6 @@
# UAPI Header export list # UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm include include/uapi/asm-generic/Kbuild.asm
generic-y += bpf_perf_event.h
generic-y += param.h generic-y += param.h
generic-y += poll.h generic-y += poll.h
generic-y += resource.h generic-y += resource.h

View File

@ -0,0 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _UAPI__ASM_BPF_PERF_EVENT_H__
#define _UAPI__ASM_BPF_PERF_EVENT_H__
#include <asm/ptrace.h>
typedef struct user_pt_regs bpf_user_pt_regs_t;
#endif /* _UAPI__ASM_BPF_PERF_EVENT_H__ */

View File

@ -372,6 +372,8 @@ void __init find_legacy_serial_ports(void)
/* Now find out if one of these is out firmware console */ /* Now find out if one of these is out firmware console */
path = of_get_property(of_chosen, "linux,stdout-path", NULL); path = of_get_property(of_chosen, "linux,stdout-path", NULL);
if (path == NULL)
path = of_get_property(of_chosen, "stdout-path", NULL);
if (path != NULL) { if (path != NULL) {
stdout = of_find_node_by_path(path); stdout = of_find_node_by_path(path);
if (stdout) if (stdout)
@ -595,8 +597,10 @@ static int __init check_legacy_serial_console(void)
/* We are getting a weird phandle from OF ... */ /* We are getting a weird phandle from OF ... */
/* ... So use the full path instead */ /* ... So use the full path instead */
name = of_get_property(of_chosen, "linux,stdout-path", NULL); name = of_get_property(of_chosen, "linux,stdout-path", NULL);
if (name == NULL)
name = of_get_property(of_chosen, "stdout-path", NULL);
if (name == NULL) { if (name == NULL) {
DBG(" no linux,stdout-path !\n"); DBG(" no stdout-path !\n");
return -ENODEV; return -ENODEV;
} }
prom_stdout = of_find_node_by_path(name); prom_stdout = of_find_node_by_path(name);

View File

@ -34,5 +34,10 @@ void arch_teardown_msi_irqs(struct pci_dev *dev)
{ {
struct pci_controller *phb = pci_bus_to_host(dev->bus); struct pci_controller *phb = pci_bus_to_host(dev->bus);
/*
* We can be called even when arch_setup_msi_irqs() returns -ENOSYS,
* so check the pointer again.
*/
if (phb->controller_ops.teardown_msi_irqs)
phb->controller_ops.teardown_msi_irqs(dev); phb->controller_ops.teardown_msi_irqs(dev);
} }

View File

@ -3266,12 +3266,17 @@ long do_syscall_trace_enter(struct pt_regs *regs)
user_exit(); user_exit();
if (test_thread_flag(TIF_SYSCALL_EMU)) { if (test_thread_flag(TIF_SYSCALL_EMU)) {
ptrace_report_syscall(regs);
/* /*
* A nonzero return code from tracehook_report_syscall_entry()
* tells us to prevent the syscall execution, but we are not
* going to execute it anyway.
*
* Returning -1 will skip the syscall execution. We want to * Returning -1 will skip the syscall execution. We want to
* avoid clobbering any register also, thus, not 'gotoing' * avoid clobbering any register also, thus, not 'gotoing'
* skip label. * skip label.
*/ */
if (tracehook_report_syscall_entry(regs))
;
return -1; return -1;
} }

View File

@ -19,6 +19,7 @@
#include <linux/hugetlb.h> #include <linux/hugetlb.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/highmem.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <asm/fixmap.h> #include <asm/fixmap.h>

View File

@ -188,15 +188,20 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
pr_debug("vmemmap_populate %lx..%lx, node %d\n", start, end, node); pr_debug("vmemmap_populate %lx..%lx, node %d\n", start, end, node);
for (; start < end; start += page_size) { for (; start < end; start += page_size) {
void *p; void *p = NULL;
int rc; int rc;
if (vmemmap_populated(start, page_size)) if (vmemmap_populated(start, page_size))
continue; continue;
/*
* Allocate from the altmap first if we have one. This may
* fail due to alignment issues when using 16MB hugepages, so
* fall back to system memory if the altmap allocation fail.
*/
if (altmap) if (altmap)
p = altmap_alloc_block_buf(page_size, altmap); p = altmap_alloc_block_buf(page_size, altmap);
else if (!p)
p = vmemmap_alloc_block_buf(page_size, node); p = vmemmap_alloc_block_buf(page_size, node);
if (!p) if (!p)
return -ENOMEM; return -ENOMEM;
@ -255,8 +260,15 @@ void __ref vmemmap_free(unsigned long start, unsigned long end,
{ {
unsigned long page_size = 1 << mmu_psize_defs[mmu_vmemmap_psize].shift; unsigned long page_size = 1 << mmu_psize_defs[mmu_vmemmap_psize].shift;
unsigned long page_order = get_order(page_size); unsigned long page_order = get_order(page_size);
unsigned long alt_start = ~0, alt_end = ~0;
unsigned long base_pfn;
start = _ALIGN_DOWN(start, page_size); start = _ALIGN_DOWN(start, page_size);
if (altmap) {
alt_start = altmap->base_pfn;
alt_end = altmap->base_pfn + altmap->reserve +
altmap->free + altmap->alloc + altmap->align;
}
pr_debug("vmemmap_free %lx...%lx\n", start, end); pr_debug("vmemmap_free %lx...%lx\n", start, end);
@ -280,8 +292,9 @@ void __ref vmemmap_free(unsigned long start, unsigned long end,
page = pfn_to_page(addr >> PAGE_SHIFT); page = pfn_to_page(addr >> PAGE_SHIFT);
section_base = pfn_to_page(vmemmap_section_start(start)); section_base = pfn_to_page(vmemmap_section_start(start));
nr_pages = 1 << page_order; nr_pages = 1 << page_order;
base_pfn = PHYS_PFN(addr);
if (altmap) { if (base_pfn >= alt_start && base_pfn < alt_end) {
vmem_altmap_free(altmap, nr_pages); vmem_altmap_free(altmap, nr_pages);
} else if (PageReserved(page)) { } else if (PageReserved(page)) {
/* allocated from bootmem */ /* allocated from bootmem */

View File

@ -891,6 +891,55 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
return 0; return 0;
} }
/* Fix the branch target addresses for subprog calls */
static int bpf_jit_fixup_subprog_calls(struct bpf_prog *fp, u32 *image,
struct codegen_context *ctx, u32 *addrs)
{
const struct bpf_insn *insn = fp->insnsi;
bool func_addr_fixed;
u64 func_addr;
u32 tmp_idx;
int i, ret;
for (i = 0; i < fp->len; i++) {
/*
* During the extra pass, only the branch target addresses for
* the subprog calls need to be fixed. All other instructions
* can left untouched.
*
* The JITed image length does not change because we already
* ensure that the JITed instruction sequence for these calls
* are of fixed length by padding them with NOPs.
*/
if (insn[i].code == (BPF_JMP | BPF_CALL) &&
insn[i].src_reg == BPF_PSEUDO_CALL) {
ret = bpf_jit_get_func_addr(fp, &insn[i], true,
&func_addr,
&func_addr_fixed);
if (ret < 0)
return ret;
/*
* Save ctx->idx as this would currently point to the
* end of the JITed image and set it to the offset of
* the instruction sequence corresponding to the
* subprog call temporarily.
*/
tmp_idx = ctx->idx;
ctx->idx = addrs[i] / 4;
bpf_jit_emit_func_call_rel(image, ctx, func_addr);
/*
* Restore ctx->idx here. This is safe as the length
* of the JITed sequence remains unchanged.
*/
ctx->idx = tmp_idx;
}
}
return 0;
}
struct powerpc64_jit_data { struct powerpc64_jit_data {
struct bpf_binary_header *header; struct bpf_binary_header *header;
u32 *addrs; u32 *addrs;
@ -989,6 +1038,22 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
skip_init_ctx: skip_init_ctx:
code_base = (u32 *)(image + FUNCTION_DESCR_SIZE); code_base = (u32 *)(image + FUNCTION_DESCR_SIZE);
if (extra_pass) {
/*
* Do not touch the prologue and epilogue as they will remain
* unchanged. Only fix the branch target address for subprog
* calls in the body.
*
* This does not change the offsets and lengths of the subprog
* call instruction sequences and hence, the size of the JITed
* image as well.
*/
bpf_jit_fixup_subprog_calls(fp, code_base, &cgctx, addrs);
/* There is no need to perform the usual passes. */
goto skip_codegen_passes;
}
/* Code generation passes 1-2 */ /* Code generation passes 1-2 */
for (pass = 1; pass < 3; pass++) { for (pass = 1; pass < 3; pass++) {
/* Now build the prologue, body code & epilogue for real. */ /* Now build the prologue, body code & epilogue for real. */
@ -1002,6 +1067,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
proglen - (cgctx.idx * 4), cgctx.seen); proglen - (cgctx.idx * 4), cgctx.seen);
} }
skip_codegen_passes:
if (bpf_jit_enable > 1) if (bpf_jit_enable > 1)
/* /*
* Note that we output the base address of the code_base * Note that we output the base address of the code_base

View File

@ -140,8 +140,7 @@ config IBMEBUS
Bus device driver for GX bus based adapters. Bus device driver for GX bus based adapters.
config PAPR_SCM config PAPR_SCM
depends on PPC_PSERIES && MEMORY_HOTPLUG depends on PPC_PSERIES && MEMORY_HOTPLUG && LIBNVDIMM
select LIBNVDIMM
tristate "Support for the PAPR Storage Class Memory interface" tristate "Support for the PAPR Storage Class Memory interface"
help help
Enable access to hypervisor provided storage class memory. Enable access to hypervisor provided storage class memory.

View File

@ -55,7 +55,7 @@ static int drc_pmem_bind(struct papr_scm_priv *p)
do { do {
rc = plpar_hcall(H_SCM_BIND_MEM, ret, p->drc_index, 0, rc = plpar_hcall(H_SCM_BIND_MEM, ret, p->drc_index, 0,
p->blocks, BIND_ANY_ADDR, token); p->blocks, BIND_ANY_ADDR, token);
token = be64_to_cpu(ret[0]); token = ret[0];
cond_resched(); cond_resched();
} while (rc == H_BUSY); } while (rc == H_BUSY);
@ -64,7 +64,7 @@ static int drc_pmem_bind(struct papr_scm_priv *p)
return -ENXIO; return -ENXIO;
} }
p->bound_addr = be64_to_cpu(ret[1]); p->bound_addr = ret[1];
dev_dbg(&p->pdev->dev, "bound drc %x to %pR\n", p->drc_index, &p->res); dev_dbg(&p->pdev->dev, "bound drc %x to %pR\n", p->drc_index, &p->res);
@ -82,7 +82,7 @@ static int drc_pmem_unbind(struct papr_scm_priv *p)
do { do {
rc = plpar_hcall(H_SCM_UNBIND_MEM, ret, p->drc_index, rc = plpar_hcall(H_SCM_UNBIND_MEM, ret, p->drc_index,
p->bound_addr, p->blocks, token); p->bound_addr, p->blocks, token);
token = be64_to_cpu(ret); token = ret[0];
cond_resched(); cond_resched();
} while (rc == H_BUSY); } while (rc == H_BUSY);
@ -223,6 +223,9 @@ static int papr_scm_nvdimm_init(struct papr_scm_priv *p)
goto err; goto err;
} }
if (nvdimm_bus_check_dimm_count(p->bus, 1))
goto err;
/* now add the region */ /* now add the region */
memset(&mapping, 0, sizeof(mapping)); memset(&mapping, 0, sizeof(mapping));
@ -257,9 +260,12 @@ err: nvdimm_bus_unregister(p->bus);
static int papr_scm_probe(struct platform_device *pdev) static int papr_scm_probe(struct platform_device *pdev)
{ {
uint32_t drc_index, metadata_size, unit_cap[2];
struct device_node *dn = pdev->dev.of_node; struct device_node *dn = pdev->dev.of_node;
u32 drc_index, metadata_size;
u64 blocks, block_size;
struct papr_scm_priv *p; struct papr_scm_priv *p;
const char *uuid_str;
u64 uuid[2];
int rc; int rc;
/* check we have all the required DT properties */ /* check we have all the required DT properties */
@ -268,8 +274,18 @@ static int papr_scm_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
} }
if (of_property_read_u32_array(dn, "ibm,unit-capacity", unit_cap, 2)) { if (of_property_read_u64(dn, "ibm,block-size", &block_size)) {
dev_err(&pdev->dev, "%pOF: missing unit-capacity!\n", dn); dev_err(&pdev->dev, "%pOF: missing block-size!\n", dn);
return -ENODEV;
}
if (of_property_read_u64(dn, "ibm,number-of-blocks", &blocks)) {
dev_err(&pdev->dev, "%pOF: missing number-of-blocks!\n", dn);
return -ENODEV;
}
if (of_property_read_string(dn, "ibm,unit-guid", &uuid_str)) {
dev_err(&pdev->dev, "%pOF: missing unit-guid!\n", dn);
return -ENODEV; return -ENODEV;
} }
@ -282,8 +298,13 @@ static int papr_scm_probe(struct platform_device *pdev)
p->dn = dn; p->dn = dn;
p->drc_index = drc_index; p->drc_index = drc_index;
p->block_size = unit_cap[0]; p->block_size = block_size;
p->blocks = unit_cap[1]; p->blocks = blocks;
/* We just need to ensure that set cookies are unique across */
uuid_parse(uuid_str, (uuid_t *) uuid);
p->nd_set.cookie1 = uuid[0];
p->nd_set.cookie2 = uuid[1];
/* might be zero */ /* might be zero */
p->metadata_size = metadata_size; p->metadata_size = metadata_size;
@ -296,7 +317,7 @@ static int papr_scm_probe(struct platform_device *pdev)
/* setup the resource for the newly bound range */ /* setup the resource for the newly bound range */
p->res.start = p->bound_addr; p->res.start = p->bound_addr;
p->res.end = p->bound_addr + p->blocks * p->block_size; p->res.end = p->bound_addr + p->blocks * p->block_size - 1;
p->res.name = pdev->name; p->res.name = pdev->name;
p->res.flags = IORESOURCE_MEM; p->res.flags = IORESOURCE_MEM;

View File

@ -24,6 +24,7 @@
#define __IO_PREFIX generic #define __IO_PREFIX generic
#include <asm/io_generic.h> #include <asm/io_generic.h>
#include <asm/io_trapped.h> #include <asm/io_trapped.h>
#include <asm-generic/pci_iomap.h>
#include <mach/mangle-port.h> #include <mach/mangle-port.h>
#define __raw_writeb(v,a) (__chk_io_ptr(a), *(volatile u8 __force *)(a) = (v)) #define __raw_writeb(v,a) (__chk_io_ptr(a), *(volatile u8 __force *)(a) = (v))

View File

@ -108,10 +108,9 @@ int iommu_table_init(struct iommu *iommu, int tsbsize,
/* Allocate and initialize the free area map. */ /* Allocate and initialize the free area map. */
sz = num_tsb_entries / 8; sz = num_tsb_entries / 8;
sz = (sz + 7UL) & ~7UL; sz = (sz + 7UL) & ~7UL;
iommu->tbl.map = kmalloc_node(sz, GFP_KERNEL, numa_node); iommu->tbl.map = kzalloc_node(sz, GFP_KERNEL, numa_node);
if (!iommu->tbl.map) if (!iommu->tbl.map)
return -ENOMEM; return -ENOMEM;
memset(iommu->tbl.map, 0, sz);
iommu_tbl_pool_init(&iommu->tbl, num_tsb_entries, IO_PAGE_SHIFT, iommu_tbl_pool_init(&iommu->tbl, num_tsb_entries, IO_PAGE_SHIFT,
(tlb_type != hypervisor ? iommu_flushall : NULL), (tlb_type != hypervisor ? iommu_flushall : NULL),

View File

@ -683,6 +683,7 @@ void do_signal32(struct pt_regs * regs)
regs->tpc -= 4; regs->tpc -= 4;
regs->tnpc -= 4; regs->tnpc -= 4;
pt_regs_clear_syscall(regs); pt_regs_clear_syscall(regs);
/* fall through */
case ERESTART_RESTARTBLOCK: case ERESTART_RESTARTBLOCK:
regs->u_regs[UREG_G1] = __NR_restart_syscall; regs->u_regs[UREG_G1] = __NR_restart_syscall;
regs->tpc -= 4; regs->tpc -= 4;

View File

@ -508,6 +508,7 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
regs->pc -= 4; regs->pc -= 4;
regs->npc -= 4; regs->npc -= 4;
pt_regs_clear_syscall(regs); pt_regs_clear_syscall(regs);
/* fall through */
case ERESTART_RESTARTBLOCK: case ERESTART_RESTARTBLOCK:
regs->u_regs[UREG_G1] = __NR_restart_syscall; regs->u_regs[UREG_G1] = __NR_restart_syscall;
regs->pc -= 4; regs->pc -= 4;

View File

@ -533,6 +533,7 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
regs->tpc -= 4; regs->tpc -= 4;
regs->tnpc -= 4; regs->tnpc -= 4;
pt_regs_clear_syscall(regs); pt_regs_clear_syscall(regs);
/* fall through */
case ERESTART_RESTARTBLOCK: case ERESTART_RESTARTBLOCK:
regs->u_regs[UREG_G1] = __NR_restart_syscall; regs->u_regs[UREG_G1] = __NR_restart_syscall;
regs->tpc -= 4; regs->tpc -= 4;

View File

@ -220,9 +220,6 @@ KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
# Avoid indirect branches in kernel to deal with Spectre # Avoid indirect branches in kernel to deal with Spectre
ifdef CONFIG_RETPOLINE ifdef CONFIG_RETPOLINE
ifeq ($(RETPOLINE_CFLAGS),)
$(error You are building kernel with non-retpoline compiler, please update your compiler.)
endif
KBUILD_CFLAGS += $(RETPOLINE_CFLAGS) KBUILD_CFLAGS += $(RETPOLINE_CFLAGS)
endif endif
@ -307,6 +304,13 @@ ifndef CC_HAVE_ASM_GOTO
@echo Compiler lacks asm-goto support. @echo Compiler lacks asm-goto support.
@exit 1 @exit 1
endif endif
ifdef CONFIG_RETPOLINE
ifeq ($(RETPOLINE_CFLAGS),)
@echo "You are building kernel with non-retpoline compiler." >&2
@echo "Please update your compiler." >&2
@false
endif
endif
archclean: archclean:
$(Q)rm -rf $(objtree)/arch/i386 $(Q)rm -rf $(objtree)/arch/i386

View File

@ -1,3 +1,4 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
* *
* Copyright 2011 Intel Corporation; author Matt Fleming * Copyright 2011 Intel Corporation; author Matt Fleming
@ -634,37 +635,54 @@ static efi_status_t alloc_e820ext(u32 nr_desc, struct setup_data **e820ext,
return status; return status;
} }
static efi_status_t allocate_e820(struct boot_params *params,
struct setup_data **e820ext,
u32 *e820ext_size)
{
unsigned long map_size, desc_size, buff_size;
struct efi_boot_memmap boot_map;
efi_memory_desc_t *map;
efi_status_t status;
__u32 nr_desc;
boot_map.map = &map;
boot_map.map_size = &map_size;
boot_map.desc_size = &desc_size;
boot_map.desc_ver = NULL;
boot_map.key_ptr = NULL;
boot_map.buff_size = &buff_size;
status = efi_get_memory_map(sys_table, &boot_map);
if (status != EFI_SUCCESS)
return status;
nr_desc = buff_size / desc_size;
if (nr_desc > ARRAY_SIZE(params->e820_table)) {
u32 nr_e820ext = nr_desc - ARRAY_SIZE(params->e820_table);
status = alloc_e820ext(nr_e820ext, e820ext, e820ext_size);
if (status != EFI_SUCCESS)
return status;
}
return EFI_SUCCESS;
}
struct exit_boot_struct { struct exit_boot_struct {
struct boot_params *boot_params; struct boot_params *boot_params;
struct efi_info *efi; struct efi_info *efi;
struct setup_data *e820ext;
__u32 e820ext_size;
}; };
static efi_status_t exit_boot_func(efi_system_table_t *sys_table_arg, static efi_status_t exit_boot_func(efi_system_table_t *sys_table_arg,
struct efi_boot_memmap *map, struct efi_boot_memmap *map,
void *priv) void *priv)
{ {
static bool first = true;
const char *signature; const char *signature;
__u32 nr_desc; __u32 nr_desc;
efi_status_t status; efi_status_t status;
struct exit_boot_struct *p = priv; struct exit_boot_struct *p = priv;
if (first) {
nr_desc = *map->buff_size / *map->desc_size;
if (nr_desc > ARRAY_SIZE(p->boot_params->e820_table)) {
u32 nr_e820ext = nr_desc -
ARRAY_SIZE(p->boot_params->e820_table);
status = alloc_e820ext(nr_e820ext, &p->e820ext,
&p->e820ext_size);
if (status != EFI_SUCCESS)
return status;
}
first = false;
}
signature = efi_is_64bit() ? EFI64_LOADER_SIGNATURE signature = efi_is_64bit() ? EFI64_LOADER_SIGNATURE
: EFI32_LOADER_SIGNATURE; : EFI32_LOADER_SIGNATURE;
memcpy(&p->efi->efi_loader_signature, signature, sizeof(__u32)); memcpy(&p->efi->efi_loader_signature, signature, sizeof(__u32));
@ -687,8 +705,8 @@ static efi_status_t exit_boot(struct boot_params *boot_params, void *handle)
{ {
unsigned long map_sz, key, desc_size, buff_size; unsigned long map_sz, key, desc_size, buff_size;
efi_memory_desc_t *mem_map; efi_memory_desc_t *mem_map;
struct setup_data *e820ext; struct setup_data *e820ext = NULL;
__u32 e820ext_size; __u32 e820ext_size = 0;
efi_status_t status; efi_status_t status;
__u32 desc_version; __u32 desc_version;
struct efi_boot_memmap map; struct efi_boot_memmap map;
@ -702,8 +720,10 @@ static efi_status_t exit_boot(struct boot_params *boot_params, void *handle)
map.buff_size = &buff_size; map.buff_size = &buff_size;
priv.boot_params = boot_params; priv.boot_params = boot_params;
priv.efi = &boot_params->efi_info; priv.efi = &boot_params->efi_info;
priv.e820ext = NULL;
priv.e820ext_size = 0; status = allocate_e820(boot_params, &e820ext, &e820ext_size);
if (status != EFI_SUCCESS)
return status;
/* Might as well exit boot services now */ /* Might as well exit boot services now */
status = efi_exit_boot_services(sys_table, handle, &map, &priv, status = efi_exit_boot_services(sys_table, handle, &map, &priv,
@ -711,9 +731,6 @@ static efi_status_t exit_boot(struct boot_params *boot_params, void *handle)
if (status != EFI_SUCCESS) if (status != EFI_SUCCESS)
return status; return status;
e820ext = priv.e820ext;
e820ext_size = priv.e820ext_size;
/* Historic? */ /* Historic? */
boot_params->alt_mem_k = 32 * 1024; boot_params->alt_mem_k = 32 * 1024;

View File

@ -566,6 +566,7 @@ ENTRY(interrupt_entry)
ret ret
END(interrupt_entry) END(interrupt_entry)
_ASM_NOKPROBE(interrupt_entry)
/* Interrupt entry/exit. */ /* Interrupt entry/exit. */
@ -766,6 +767,7 @@ native_irq_return_ldt:
jmp native_irq_return_iret jmp native_irq_return_iret
#endif #endif
END(common_interrupt) END(common_interrupt)
_ASM_NOKPROBE(common_interrupt)
/* /*
* APIC interrupts. * APIC interrupts.
@ -780,6 +782,7 @@ ENTRY(\sym)
call \do_sym /* rdi points to pt_regs */ call \do_sym /* rdi points to pt_regs */
jmp ret_from_intr jmp ret_from_intr
END(\sym) END(\sym)
_ASM_NOKPROBE(\sym)
.endm .endm
/* Make sure APIC interrupt handlers end up in the irqentry section: */ /* Make sure APIC interrupt handlers end up in the irqentry section: */
@ -960,6 +963,7 @@ ENTRY(\sym)
jmp error_exit jmp error_exit
.endif .endif
_ASM_NOKPROBE(\sym)
END(\sym) END(\sym)
.endm .endm

View File

@ -47,7 +47,7 @@ targets += $(vdso_img_sodbg) $(vdso_img-y:%=vdso%.so)
CPPFLAGS_vdso.lds += -P -C CPPFLAGS_vdso.lds += -P -C
VDSO_LDFLAGS_vdso.lds = -m elf_x86_64 -soname linux-vdso.so.1 --no-undefined \ VDSO_LDFLAGS_vdso.lds = -m elf_x86_64 -soname linux-vdso.so.1 --no-undefined \
-z max-page-size=4096 -z common-page-size=4096 -z max-page-size=4096
$(obj)/vdso64.so.dbg: $(obj)/vdso.lds $(vobjs) FORCE $(obj)/vdso64.so.dbg: $(obj)/vdso.lds $(vobjs) FORCE
$(call if_changed,vdso) $(call if_changed,vdso)
@ -98,7 +98,7 @@ CFLAGS_REMOVE_vvar.o = -pg
CPPFLAGS_vdsox32.lds = $(CPPFLAGS_vdso.lds) CPPFLAGS_vdsox32.lds = $(CPPFLAGS_vdso.lds)
VDSO_LDFLAGS_vdsox32.lds = -m elf32_x86_64 -soname linux-vdso.so.1 \ VDSO_LDFLAGS_vdsox32.lds = -m elf32_x86_64 -soname linux-vdso.so.1 \
-z max-page-size=4096 -z common-page-size=4096 -z max-page-size=4096
# x32-rebranded versions # x32-rebranded versions
vobjx32s-y := $(vobjs-y:.o=-x32.o) vobjx32s-y := $(vobjs-y:.o=-x32.o)

View File

@ -36,6 +36,7 @@ static void sanitize_boot_params(struct boot_params *boot_params)
*/ */
if (boot_params->sentinel) { if (boot_params->sentinel) {
/* fields in boot_params are left uninitialized, clear them */ /* fields in boot_params are left uninitialized, clear them */
boot_params->acpi_rsdp_addr = 0;
memset(&boot_params->ext_ramdisk_image, 0, memset(&boot_params->ext_ramdisk_image, 0,
(char *)&boot_params->efi_info - (char *)&boot_params->efi_info -
(char *)&boot_params->ext_ramdisk_image); (char *)&boot_params->ext_ramdisk_image);

View File

@ -189,7 +189,7 @@ static int copy_optimized_instructions(u8 *dest, u8 *src, u8 *real)
int len = 0, ret; int len = 0, ret;
while (len < RELATIVEJUMP_SIZE) { while (len < RELATIVEJUMP_SIZE) {
ret = __copy_instruction(dest + len, src + len, real, &insn); ret = __copy_instruction(dest + len, src + len, real + len, &insn);
if (!ret || !can_boost(&insn, src + len)) if (!ret || !can_boost(&insn, src + len))
return -EINVAL; return -EINVAL;
len += ret; len += ret;

View File

@ -183,7 +183,7 @@ early_efi_write(struct console *con, const char *str, unsigned int num)
num--; num--;
} }
if (efi_x >= si->lfb_width) { if (efi_x + font->width > si->lfb_width) {
efi_x = 0; efi_x = 0;
efi_y += font->height; efi_y += font->height;
} }

View File

@ -638,7 +638,7 @@ static bool bfq_varied_queue_weights_or_active_groups(struct bfq_data *bfqd)
bfqd->queue_weights_tree.rb_node->rb_right) bfqd->queue_weights_tree.rb_node->rb_right)
#ifdef CONFIG_BFQ_GROUP_IOSCHED #ifdef CONFIG_BFQ_GROUP_IOSCHED
) || ) ||
(bfqd->num_active_groups > 0 (bfqd->num_groups_with_pending_reqs > 0
#endif #endif
); );
} }
@ -802,7 +802,21 @@ void bfq_weights_tree_remove(struct bfq_data *bfqd,
*/ */
break; break;
} }
bfqd->num_active_groups--;
/*
* The decrement of num_groups_with_pending_reqs is
* not performed immediately upon the deactivation of
* entity, but it is delayed to when it also happens
* that the first leaf descendant bfqq of entity gets
* all its pending requests completed. The following
* instructions perform this delayed decrement, if
* needed. See the comments on
* num_groups_with_pending_reqs for details.
*/
if (entity->in_groups_with_pending_reqs) {
entity->in_groups_with_pending_reqs = false;
bfqd->num_groups_with_pending_reqs--;
}
} }
} }
@ -3529,27 +3543,44 @@ static bool bfq_better_to_idle(struct bfq_queue *bfqq)
* fact, if there are active groups, then, for condition (i) * fact, if there are active groups, then, for condition (i)
* to become false, it is enough that an active group contains * to become false, it is enough that an active group contains
* more active processes or sub-groups than some other active * more active processes or sub-groups than some other active
* group. We address this issue with the following bi-modal * group. More precisely, for condition (i) to hold because of
* behavior, implemented in the function * such a group, it is not even necessary that the group is
* (still) active: it is sufficient that, even if the group
* has become inactive, some of its descendant processes still
* have some request already dispatched but still waiting for
* completion. In fact, requests have still to be guaranteed
* their share of the throughput even after being
* dispatched. In this respect, it is easy to show that, if a
* group frequently becomes inactive while still having
* in-flight requests, and if, when this happens, the group is
* not considered in the calculation of whether the scenario
* is asymmetric, then the group may fail to be guaranteed its
* fair share of the throughput (basically because idling may
* not be performed for the descendant processes of the group,
* but it had to be). We address this issue with the
* following bi-modal behavior, implemented in the function
* bfq_symmetric_scenario(). * bfq_symmetric_scenario().
* *
* If there are active groups, then the scenario is tagged as * If there are groups with requests waiting for completion
* (as commented above, some of these groups may even be
* already inactive), then the scenario is tagged as
* asymmetric, conservatively, without checking any of the * asymmetric, conservatively, without checking any of the
* conditions (i) and (ii). So the device is idled for bfqq. * conditions (i) and (ii). So the device is idled for bfqq.
* This behavior matches also the fact that groups are created * This behavior matches also the fact that groups are created
* exactly if controlling I/O (to preserve bandwidth and * exactly if controlling I/O is a primary concern (to
* latency guarantees) is a primary concern. * preserve bandwidth and latency guarantees).
* *
* On the opposite end, if there are no active groups, then * On the opposite end, if there are no groups with requests
* only condition (i) is actually controlled, i.e., provided * waiting for completion, then only condition (i) is actually
* that condition (i) holds, idling is not performed, * controlled, i.e., provided that condition (i) holds, idling
* regardless of whether condition (ii) holds. In other words, * is not performed, regardless of whether condition (ii)
* only if condition (i) does not hold, then idling is * holds. In other words, only if condition (i) does not hold,
* allowed, and the device tends to be prevented from queueing * then idling is allowed, and the device tends to be
* many requests, possibly of several processes. Since there * prevented from queueing many requests, possibly of several
* are no active groups, then, to control condition (i) it is * processes. Since there are no groups with requests waiting
* enough to check whether all active queues have the same * for completion, then, to control condition (i) it is enough
* weight. * to check just whether all the queues with requests waiting
* for completion also have the same weight.
* *
* Not checking condition (ii) evidently exposes bfqq to the * Not checking condition (ii) evidently exposes bfqq to the
* risk of getting less throughput than its fair share. * risk of getting less throughput than its fair share.
@ -3607,10 +3638,11 @@ static bool bfq_better_to_idle(struct bfq_queue *bfqq)
* bfqq is weight-raised is checked explicitly here. More * bfqq is weight-raised is checked explicitly here. More
* precisely, the compound condition below takes into account * precisely, the compound condition below takes into account
* also the fact that, even if bfqq is being weight-raised, * also the fact that, even if bfqq is being weight-raised,
* the scenario is still symmetric if all active queues happen * the scenario is still symmetric if all queues with requests
* to be weight-raised. Actually, we should be even more * waiting for completion happen to be
* precise here, and differentiate between interactive weight * weight-raised. Actually, we should be even more precise
* raising and soft real-time weight raising. * here, and differentiate between interactive weight raising
* and soft real-time weight raising.
* *
* As a side note, it is worth considering that the above * As a side note, it is worth considering that the above
* device-idling countermeasures may however fail in the * device-idling countermeasures may however fail in the
@ -5417,7 +5449,7 @@ static int bfq_init_queue(struct request_queue *q, struct elevator_type *e)
bfqd->idle_slice_timer.function = bfq_idle_slice_timer; bfqd->idle_slice_timer.function = bfq_idle_slice_timer;
bfqd->queue_weights_tree = RB_ROOT; bfqd->queue_weights_tree = RB_ROOT;
bfqd->num_active_groups = 0; bfqd->num_groups_with_pending_reqs = 0;
INIT_LIST_HEAD(&bfqd->active_list); INIT_LIST_HEAD(&bfqd->active_list);
INIT_LIST_HEAD(&bfqd->idle_list); INIT_LIST_HEAD(&bfqd->idle_list);

View File

@ -196,6 +196,9 @@ struct bfq_entity {
/* flag, set to request a weight, ioprio or ioprio_class change */ /* flag, set to request a weight, ioprio or ioprio_class change */
int prio_changed; int prio_changed;
/* flag, set if the entity is counted in groups_with_pending_reqs */
bool in_groups_with_pending_reqs;
}; };
struct bfq_group; struct bfq_group;
@ -448,10 +451,54 @@ struct bfq_data {
* bfq_weights_tree_[add|remove] for further details). * bfq_weights_tree_[add|remove] for further details).
*/ */
struct rb_root queue_weights_tree; struct rb_root queue_weights_tree;
/* /*
* number of groups with requests still waiting for completion * Number of groups with at least one descendant process that
* has at least one request waiting for completion. Note that
* this accounts for also requests already dispatched, but not
* yet completed. Therefore this number of groups may differ
* (be larger) than the number of active groups, as a group is
* considered active only if its corresponding entity has
* descendant queues with at least one request queued. This
* number is used to decide whether a scenario is symmetric.
* For a detailed explanation see comments on the computation
* of the variable asymmetric_scenario in the function
* bfq_better_to_idle().
*
* However, it is hard to compute this number exactly, for
* groups with multiple descendant processes. Consider a group
* that is inactive, i.e., that has no descendant process with
* pending I/O inside BFQ queues. Then suppose that
* num_groups_with_pending_reqs is still accounting for this
* group, because the group has descendant processes with some
* I/O request still in flight. num_groups_with_pending_reqs
* should be decremented when the in-flight request of the
* last descendant process is finally completed (assuming that
* nothing else has changed for the group in the meantime, in
* terms of composition of the group and active/inactive state of child
* groups and processes). To accomplish this, an additional
* pending-request counter must be added to entities, and must
* be updated correctly. To avoid this additional field and operations,
* we resort to the following tradeoff between simplicity and
* accuracy: for an inactive group that is still counted in
* num_groups_with_pending_reqs, we decrement
* num_groups_with_pending_reqs when the first descendant
* process of the group remains with no request waiting for
* completion.
*
* Even this simpler decrement strategy requires a little
* carefulness: to avoid multiple decrements, we flag a group,
* more precisely an entity representing a group, as still
* counted in num_groups_with_pending_reqs when it becomes
* inactive. Then, when the first descendant queue of the
* entity remains with no request waiting for completion,
* num_groups_with_pending_reqs is decremented, and this flag
* is reset. After this flag is reset for the entity,
* num_groups_with_pending_reqs won't be decremented any
* longer in case a new descendant queue of the entity remains
* with no request waiting for completion.
*/ */
unsigned int num_active_groups; unsigned int num_groups_with_pending_reqs;
/* /*
* Number of bfq_queues containing requests (including the * Number of bfq_queues containing requests (including the

View File

@ -1012,7 +1012,10 @@ static void __bfq_activate_entity(struct bfq_entity *entity,
container_of(entity, struct bfq_group, entity); container_of(entity, struct bfq_group, entity);
struct bfq_data *bfqd = bfqg->bfqd; struct bfq_data *bfqd = bfqg->bfqd;
bfqd->num_active_groups++; if (!entity->in_groups_with_pending_reqs) {
entity->in_groups_with_pending_reqs = true;
bfqd->num_groups_with_pending_reqs++;
}
} }
#endif #endif

View File

@ -1261,6 +1261,7 @@ struct bio *bio_copy_user_iov(struct request_queue *q,
if (ret) if (ret)
goto cleanup; goto cleanup;
} else { } else {
if (bmd->is_our_pages)
zero_fill_bio(bio); zero_fill_bio(bio);
iov_iter_advance(iter, bio->bi_iter.bi_size); iov_iter_advance(iter, bio->bi_iter.bi_size);
} }

View File

@ -1764,7 +1764,7 @@ static blk_status_t __blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx,
if (bypass_insert) if (bypass_insert)
return BLK_STS_RESOURCE; return BLK_STS_RESOURCE;
blk_mq_sched_insert_request(rq, false, run_queue, false); blk_mq_request_bypass_insert(rq, run_queue);
return BLK_STS_OK; return BLK_STS_OK;
} }
@ -1780,7 +1780,7 @@ static void blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx,
ret = __blk_mq_try_issue_directly(hctx, rq, cookie, false); ret = __blk_mq_try_issue_directly(hctx, rq, cookie, false);
if (ret == BLK_STS_RESOURCE || ret == BLK_STS_DEV_RESOURCE) if (ret == BLK_STS_RESOURCE || ret == BLK_STS_DEV_RESOURCE)
blk_mq_sched_insert_request(rq, false, true, false); blk_mq_request_bypass_insert(rq, true);
else if (ret != BLK_STS_OK) else if (ret != BLK_STS_OK)
blk_mq_end_request(rq, ret); blk_mq_end_request(rq, ret);
@ -1815,7 +1815,8 @@ void blk_mq_try_issue_list_directly(struct blk_mq_hw_ctx *hctx,
if (ret != BLK_STS_OK) { if (ret != BLK_STS_OK) {
if (ret == BLK_STS_RESOURCE || if (ret == BLK_STS_RESOURCE ||
ret == BLK_STS_DEV_RESOURCE) { ret == BLK_STS_DEV_RESOURCE) {
list_add(&rq->queuelist, list); blk_mq_request_bypass_insert(rq,
list_empty(list));
break; break;
} }
blk_mq_end_request(rq, ret); blk_mq_end_request(rq, ret);

View File

@ -378,7 +378,7 @@ static struct blk_zone *blk_alloc_zones(int node, unsigned int *nr_zones)
struct page *page; struct page *page;
int order; int order;
for (order = get_order(size); order > 0; order--) { for (order = get_order(size); order >= 0; order--) {
page = alloc_pages_node(node, GFP_NOIO | __GFP_ZERO, order); page = alloc_pages_node(node, GFP_NOIO | __GFP_ZERO, order);
if (page) { if (page) {
*nr_zones = min_t(unsigned int, *nr_zones, *nr_zones = min_t(unsigned int, *nr_zones,

View File

@ -1812,7 +1812,7 @@ config CRYPTO_USER_API_AEAD
cipher algorithms. cipher algorithms.
config CRYPTO_STATS config CRYPTO_STATS
bool "Crypto usage statistics for User-space" bool
help help
This option enables the gathering of crypto stats. This option enables the gathering of crypto stats.
This will collect: This will collect:

View File

@ -140,9 +140,8 @@ static int crypto_cbc_create(struct crypto_template *tmpl, struct rtattr **tb)
spawn = skcipher_instance_ctx(inst); spawn = skcipher_instance_ctx(inst);
err = crypto_init_spawn(spawn, alg, skcipher_crypto_instance(inst), err = crypto_init_spawn(spawn, alg, skcipher_crypto_instance(inst),
CRYPTO_ALG_TYPE_MASK); CRYPTO_ALG_TYPE_MASK);
crypto_mod_put(alg);
if (err) if (err)
goto err_free_inst; goto err_put_alg;
err = crypto_inst_setname(skcipher_crypto_instance(inst), "cbc", alg); err = crypto_inst_setname(skcipher_crypto_instance(inst), "cbc", alg);
if (err) if (err)
@ -174,12 +173,15 @@ static int crypto_cbc_create(struct crypto_template *tmpl, struct rtattr **tb)
err = skcipher_register_instance(tmpl, inst); err = skcipher_register_instance(tmpl, inst);
if (err) if (err)
goto err_drop_spawn; goto err_drop_spawn;
crypto_mod_put(alg);
out: out:
return err; return err;
err_drop_spawn: err_drop_spawn:
crypto_drop_spawn(spawn); crypto_drop_spawn(spawn);
err_put_alg:
crypto_mod_put(alg);
err_free_inst: err_free_inst:
kfree(inst); kfree(inst);
goto out; goto out;

View File

@ -286,9 +286,8 @@ static int crypto_cfb_create(struct crypto_template *tmpl, struct rtattr **tb)
spawn = skcipher_instance_ctx(inst); spawn = skcipher_instance_ctx(inst);
err = crypto_init_spawn(spawn, alg, skcipher_crypto_instance(inst), err = crypto_init_spawn(spawn, alg, skcipher_crypto_instance(inst),
CRYPTO_ALG_TYPE_MASK); CRYPTO_ALG_TYPE_MASK);
crypto_mod_put(alg);
if (err) if (err)
goto err_free_inst; goto err_put_alg;
err = crypto_inst_setname(skcipher_crypto_instance(inst), "cfb", alg); err = crypto_inst_setname(skcipher_crypto_instance(inst), "cfb", alg);
if (err) if (err)
@ -317,12 +316,15 @@ static int crypto_cfb_create(struct crypto_template *tmpl, struct rtattr **tb)
err = skcipher_register_instance(tmpl, inst); err = skcipher_register_instance(tmpl, inst);
if (err) if (err)
goto err_drop_spawn; goto err_drop_spawn;
crypto_mod_put(alg);
out: out:
return err; return err;
err_drop_spawn: err_drop_spawn:
crypto_drop_spawn(spawn); crypto_drop_spawn(spawn);
err_put_alg:
crypto_mod_put(alg);
err_free_inst: err_free_inst:
kfree(inst); kfree(inst);
goto out; goto out;

View File

@ -244,9 +244,8 @@ static int crypto_pcbc_create(struct crypto_template *tmpl, struct rtattr **tb)
spawn = skcipher_instance_ctx(inst); spawn = skcipher_instance_ctx(inst);
err = crypto_init_spawn(spawn, alg, skcipher_crypto_instance(inst), err = crypto_init_spawn(spawn, alg, skcipher_crypto_instance(inst),
CRYPTO_ALG_TYPE_MASK); CRYPTO_ALG_TYPE_MASK);
crypto_mod_put(alg);
if (err) if (err)
goto err_free_inst; goto err_put_alg;
err = crypto_inst_setname(skcipher_crypto_instance(inst), "pcbc", alg); err = crypto_inst_setname(skcipher_crypto_instance(inst), "pcbc", alg);
if (err) if (err)
@ -275,12 +274,15 @@ static int crypto_pcbc_create(struct crypto_template *tmpl, struct rtattr **tb)
err = skcipher_register_instance(tmpl, inst); err = skcipher_register_instance(tmpl, inst);
if (err) if (err)
goto err_drop_spawn; goto err_drop_spawn;
crypto_mod_put(alg);
out: out:
return err; return err;
err_drop_spawn: err_drop_spawn:
crypto_drop_spawn(spawn); crypto_drop_spawn(spawn);
err_put_alg:
crypto_mod_put(alg);
err_free_inst: err_free_inst:
kfree(inst); kfree(inst);
goto out; goto out;

View File

@ -1308,7 +1308,7 @@ static ssize_t scrub_store(struct device *dev,
if (nd_desc) { if (nd_desc) {
struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc); struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc);
rc = acpi_nfit_ars_rescan(acpi_desc, 0); rc = acpi_nfit_ars_rescan(acpi_desc, ARS_REQ_LONG);
} }
device_unlock(dev); device_unlock(dev);
if (rc) if (rc)

Some files were not shown because too many files have changed in this diff Show More