Commit Graph

26541 Commits

Author SHA1 Message Date
Linus Torvalds
d4ddefee51 Two more SME fixes related to ptrace(): ensure that the SME is properly
set up for the target thread and that the thread sees the ZT registers
 set via ptrace.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE5RElWfyWxS+3PLO2a9axLQDIXvEFAmTftxwACgkQa9axLQDI
 XvFYOg/9HlGxpKuWlaNZ9g9pUXPdmCnlqBRbHkqDtPdPwH/Gylh3P5DFcRDFWCS0
 74dls3iqQ0muAeKObB4EvfGTBRngX0HhEXTVnk81JFtTchVclzYtZa1J5+wO4c2Q
 UK/+iwRddGqTGUNQJWG9qEkV9FoaDOmnuV1ZSUDF+AiAzQloEJlWqPxnX3b+ZX33
 agoEir1i8hhtfKVReappIxZHWEcGUiBCKMFtkTACaJkGucg6uaNM7vzhjfzYlCrB
 3qxEQXCgTCjWTuzhOAAKi98Q/t8KP1Hcm4WGi6yLC16hyU/P3wy7HPL5s1CowROt
 /Ttkv9ux9W4ZUx8qmvWwmxjtFjmQZRAvcRGZg0XqdsnKul3NUCdVnXNWp+sGS8tk
 HVOtzTo5WlC+YKlO5uweTXBwS/hbH5M/mZPiEv4p3jsEVHpc43EUsM8RiLQRZPv7
 6fllZXoSje2Npf2evTlwQqiDrSDe2fHxCiUbQ8NpLTD+tr9M2j0xCAbVJd7qhd9i
 PdbLHTKFgR0ScZCDcnWSUwqCSNIFUHQNhnvLaYx5PIWchOimE4HCcQZcM9mc7643
 1jwGNIE2FP/7mLwoQNr/ri3rs0eYWXTZ6QaTXUmicCZnp4IhKKxeVzTmSSH67LRK
 DBcMUW4FXk85Z2dBgn3KbaMkdqAHcv4SAU3CzyfgWpJlb/z7/iI=
 =1dyE
 -----END PGP SIGNATURE-----

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Catalin Marinas:
 "Two more SME fixes related to ptrace(): ensure that the SME is
  properly set up for the target thread and that the thread sees
  the ZT registers set via ptrace"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64/ptrace: Ensure that the task sees ZT writes on first use
  arm64/ptrace: Ensure that SME is set up for target when writing SSVE state
2023-08-18 20:52:25 +02:00
Linus Torvalds
80706f5529 ARM: SoC fixes for 6.5, part 3
As usual, mostly DT fixes for the major Arm platforms from Qualcomm and
 NXP, plus a bit for Rockchips and others:
 
 The qualcomm fixes mainly deal with their higher-end arm64 devices trees,
 fixing issues in L3 interconnect, crypto, thermal, UFS and a regression
 for the DSI phy.
 
 NXP i.MX has two correctness fixes for the 64-bit chips, dealing with
 the imx93 "anatop" module and the CSI interface. On the 32-bit side,
 there are functional fixes for RTC, display and SD card intefaces.
 
 Rockchip fixes are for wifi support on certain boards, a eMMC stability
 and DT build warnings.
 
 On TI OMAP, a regulator is described in DT to avoid problems with the
 ethernet phy initialization.
 
 The code changes include a missing MMIO serialization on OMAP, plus a
 few minor fixes on ASpeed and AMD/Zynq chips.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmTe2VcACgkQYKtH/8kJ
 Uid+qxAAkNF+0roAULDQ9YCg8nnv9l6VN4AGu4K7PA/C8rouW8FbWmpc85xTBV9a
 rSm2AwdZEeHMb5S1hpdgu28MA4f3ja6IYIYSCjob4nE1mfgpVVwfxE6AXjUKApBp
 y6JN/jK/9W30JDLiReOFcsGNkM5Yqj80XKCBf+6/XLUfSWm90xgvXMFFte2p+AsV
 Qb4OInSIT06CtbkZ/DMJx9fFXPeB/lig5joLeuU7eChCXVF+GwcgRzBIueHvH4VS
 FbAEnprhlfDHfj4zvZAFKTXYhLDLCkWwxOHilGxauXykWhGP/4XY0qc6z1tk7y+5
 r8SPRgEAX4D6D4PwvloxhTJ5WnyqIzk6cS+8WYxMiheurzDGVnoofYp+dWR5CNMj
 2STXGzX7ZFkxIRZ3M7d8qz7GpzHsTnmQfg8SH4NiYsg/NptyfPLqdRPjYt1vhu+i
 zfVIA2tWmRGFDZbyTgFBpBoOz4EyBEyo31r/e2e8D5B7R9/7xC3rJS7wtjX5KWdV
 J6APuPKSmeag44gij7dK5vFtOI898FGkUiHEe3U0nUzNolWEogce1r6r1mdNdQsL
 HBUeTGI6CAElsX+WSpW0mYS1uLaDXz56fHj5Bm/681PobS69tk7qOv6WdOvyNpNZ
 7xtBwfOKDYmNAt5QYEIIAITJ1lm4nQoPdAjsaLeL91/1Sa5M770=
 =QlRp
 -----END PGP SIGNATURE-----

Merge tag 'soc-fixes-6.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull ARM SoC fixes from Arnd Bergmann:
 "As usual, mostly DT fixes for the major Arm platforms from Qualcomm
  and NXP, plus a bit for Rockchips and others:

  The qualcomm fixes mainly deal with their higher-end arm64 devices
  trees, fixing issues in L3 interconnect, crypto, thermal, UFS and a
  regression for the DSI phy.

  NXP i.MX has two correctness fixes for the 64-bit chips, dealing with
  the imx93 "anatop" module and the CSI interface. On the 32-bit side,
  there are functional fixes for RTC, display and SD card intefaces.

  Rockchip fixes are for wifi support on certain boards, a eMMC
  stability and DT build warnings.

  On TI OMAP, a regulator is described in DT to avoid problems with the
  ethernet phy initialization.

  The code changes include a missing MMIO serialization on OMAP, plus a
  few minor fixes on ASpeed and AMD/Zynq chips"

* tag 'soc-fixes-6.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (30 commits)
  ARM: dts: am335x-bone-common: Add vcc-supply for on-board eeprom
  ARM: dts: am335x-bone-common: Add GPIO PHY reset on revision C3 board
  soc: aspeed: socinfo: Add kfree for kstrdup
  soc: aspeed: uart-routing: Use __sysfs_match_string
  ARM: dts: integrator: fix PCI bus dtc warnings
  arm64: dts: imx93: Fix anatop node size
  arm64: dts: qcom: sc7180: Fix DSI0_PHY reg-names
  ARM: dts: imx: Set default tuning step for imx6sx usdhc
  arm64: dts: imx8mm: Drop CSI1 PHY reference clock configuration
  arm64: dts: imx8mn: Drop CSI1 PHY reference clock configuration
  ARM: dts: imx: Set default tuning step for imx7d usdhc
  ARM: dts: imx6: phytec: fix RTC interrupt level
  ARM: dts: imx6sx: Remove LDB endpoint
  arm64: dts: rockchip: Fix Wifi/Bluetooth on ROCK Pi 4 boards
  ARM: zynq: Explicitly include correct DT includes
  arm64: dts: qcom: sa8775p-ride: Update L4C parameters
  arm64: dts: rockchip: minor whitespace cleanup around '='
  arm64: dts: rockchip: Disable HS400 for eMMC on ROCK 4C+
  arm64: dts: rockchip: Disable HS400 for eMMC on ROCK Pi 4
  arm64: dts: rockchip: add missing space before { on indiedroid nova
  ...
2023-08-18 18:24:41 +02:00
Linus Torvalds
eabeef9054 asm-generic: regression fix for 6.5
Just one partial revert for a commit from the merge window
 that caused annoying behavior when building old kernels on
 arm64 hosts.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmTe0Z8ACgkQYKtH/8kJ
 UidZGQ/9GFtIHh9QK6XPlAlx3oC6HdFUrOqDwoueNd4sFk9nNAuW+Z/a0YX8DtnQ
 /SrJPiCtoPPNCMNlxk7ZDx+ra0Tu+iC7rAvRnogKSV8qB35jNLIqhEde2opCa2Dx
 sfmvtP0hr5c+b8UP9IN2U11WvJhv1yjldHtCKAjSf9zMtwPQjQvAIx1kzSlC57kE
 zjsKVTB3yXUddhYGR7639RT7/1K25BVcG6kfKIEN/uPm+M/ljk58EJhUhSeEEfBf
 NmtlhxWzJBySOTk5mjEVUsTAPrAckPI3Vh4sf0qd4rXe4Q+XX9Jvur9kPOoF8lQF
 GO+WXrmooaEir3+1+w4PB9xXgZD26Iz018xdhcigLgEGefieM1JpvwJa8NarK8UK
 iLg2+sBvCAJPJQ44E4r1hWf8ZFolEhwzg703/fGIjDPMQnhHNay4i73NyCw4ii2c
 F+iCFhea5AKz+d5qQuaZmg7klY/4cBIKDVY/EsO4lmK0187eq3zZKJSMLD21+NLy
 kr63OAV8yXbduLsIOjvR3KrbSvMq+9vasEX4zUGlzA+VR1l+MqtwJI13EPyqhubJ
 kQQi6PUe/353ECdzwk5IAqMbGP7qhkOuv89+Ff9mPTlKAwDPwdZjbnsz5I5peskB
 zVBO366Z0w3o2ENv9i4UEa+TtaCMIbLWdXJxPufwoqPHX3v7nUM=
 =tTzL
 -----END PGP SIGNATURE-----

Merge tag 'asm-generic-fix-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic

Pull asm-generic regression fix from Arnd Bergmann:
 "Just one partial revert for a commit from the merge window that caused
  annoying behavior when building old kernels on arm64 hosts"

* tag 'asm-generic-fix-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
  asm-generic: partially revert "Unify uapi bitsperlong.h for arm64, riscv and loongarch"
2023-08-18 18:13:36 +02:00
Mark Brown
2f43f549cd arm64/ptrace: Ensure that the task sees ZT writes on first use
When the value of ZT is set via ptrace we don't disable traps for SME.
This means that when a the task has never used SME before then the value
set via ptrace will never be seen by the target task since it will
trigger a SME access trap which will flush the register state.

Disable SME traps when setting ZT, this means we also need to allocate
storage for SVE if it is not already allocated, for the benefit of
streaming SVE.

Fixes: f90b529bcb ("arm64/sme: Implement ZT0 ptrace support")
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org> # 6.3.x
Link: https://lore.kernel.org/r/20230816-arm64-zt-ptrace-first-use-v2-1-00aa82847e28@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2023-08-17 19:00:03 +01:00
Mark Brown
5d0a8d2fba arm64/ptrace: Ensure that SME is set up for target when writing SSVE state
When we use NT_ARM_SSVE to either enable streaming mode or change the
vector length for a process we do not currently do anything to ensure that
there is storage allocated for the SME specific register state.  If the
task had not previously used SME or we changed the vector length then
the task will not have had TIF_SME set or backing storage for ZA/ZT
allocated, resulting in inconsistent register sizes when saving state
and spurious traps which flush the newly set register state.

We should set TIF_SME to disable traps and ensure that storage is
allocated for ZA and ZT if it is not already allocated.  This requires
modifying sme_alloc() to make the flush of any existing register state
optional so we don't disturb existing state for ZA and ZT.

Fixes: e12310a0d3 ("arm64/sme: Implement ptrace support for streaming mode SVE registers")
Reported-by: David Spickett <David.Spickett@arm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org> # 5.19.x
Link: https://lore.kernel.org/r/20230810-arm64-fix-ptrace-race-v1-1-a5361fad2bd6@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2023-08-17 18:59:51 +01:00
Arnd Bergmann
6e8d96909a asm-generic: partially revert "Unify uapi bitsperlong.h for arm64, riscv and loongarch"
Unifying the asm-generic headers across 32-bit and 64-bit architectures
based on the compiler provided macros was a good idea and appears to work
with all user space, but it caused a regression when building old kernels
on systems that have the new headers installed in /usr/include, as this
combination trips an inconsistency in the kernel's own tools/include
headers that are a mix of userspace and kernel-internal headers.

This affects kernel builds on arm64, riscv64 and loongarch64 systems that
might end up using the "#define __BITS_PER_LONG 32" default from the old
tools headers. Backporting the commit into stable kernels would address
this, but it would still break building kernels without that backport,
and waste time for developers trying to understand the problem.

arm64 build machines are rather common, and on riscv64 this can also
happen in practice, but loongarch64 is probably new enough to not
be used much for building old kernels, so only revert the bits
for arm64 and riscv.

Link: https://lore.kernel.org/all/20230731160402.GB1823389@dev-arch.thelio-3990X/
Reported-by: Nathan Chancellor <nathan@kernel.org>
Fixes: 8386f58f8d ("asm-generic: Unify uapi bitsperlong.h for arm64, riscv and loongarch")
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-08-17 14:51:20 +02:00
Arnd Bergmann
3c78dbf251 Qualcomm ARM64 fixes for v6.5
This corrects the invalid path specifier for L3 interconnects in the CPU
 nodes of SM8150 and SM8250. It corrects the compatible of the SC8180X L3
 node, to pass the binding check.
 
 The crypto core, and its DMA controller, is disabled on SM8350 to avoid
 the system from crashing at boot while the issue is diagnosed.
 
 A thermal zone node name conflict is resolved for PM8150L, on the RB5
 board.
 
 The UFS vccq voltage is corrected on the SA877P Ride platform, to
 address observed stability issues.
 
 The reg-names of the DSI phy on SC7180 are restored after an accidental
 search-and-replace update.
 -----BEGIN PGP SIGNATURE-----
 
 iQJJBAABCAAzFiEEBd4DzF816k8JZtUlCx85Pw2ZrcUFAmTbiYoVHGFuZGVyc3Nv
 bkBrZXJuZWwub3JnAAoJEAsfOT8Nma3FeCkQAJuHrH8Bb1954UR4yba3P7h4kmLQ
 xWgDzQXfTT6cl9MHmq/8RwoIhGABAbr3HNX0qwVNVNgn+w90LtVFSSL0SqKczkQk
 euwtJf+T2NKqFJnRisx2O78WhPYxw52d6rs+v2gw2AoWATX6zRdXpcHch37bUv+/
 jBRNdas9wttrkxuOtJ7TD4G42KlIrM+6YukDWCtdwpLhBkKZwqu/UuEa8jwWyV8b
 cY9edRqo4P2nem0Nt5PmCGwFdHSBKR7wqDGMkwYP9tlziHfe6WTtQNYM+J7ZRMzg
 tslny8xIXZvo2xy2fwB8JGYD/rhQY3D16wL72mPFxOZelokdU1esX6pURw4JIyiB
 gHFDWEfEWXXbYzV+QDrxdbm28jgUTZinzDiRkkbxoPsA8roBmN9XHHlxm+/I4Yoj
 Vm1ymH1KUDOidkKlM1lfuTaXNxFGZ3xTtHweXD72d+uN+woUwcSM9N/FLugPq0Fb
 rng9FwxpOmr3Wc4NaIneRNOYA57+KaSY1OgMp5X+e9pAkjKoPKqOEPokgWUhqmAG
 PW+P3VJpwqT9xpaidN15Eyb/dIwtPa6IsRkK70l8DRLhLIwl8Zdbch+bV4AjTc7R
 fyxkuazL3Y+G7ddEvRXvgo6i0e1w8TTjn11D2NLn9yINZJhr6JqGbuS1F4dzYmUD
 Zc7WroVo89eep9Wh
 =ZesT
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmTeFRQACgkQYKtH/8kJ
 UifBZxAAg83TGfOxhmmHC/+YsJDK3qFDx8TbG1O6a65zpAOF0+mrDOzjIkaCFBVC
 jxpR8eKTMNVOq/ovfYOzENDik4qIcULyFFyIJDL3KtGQLh97/C6QzALUCDdHUbt5
 CTS7sZ08VRIP7BRt0G9C6rlR4/cuCzEC1k5KgIKV8VLbzAgQN+ylC7CQZCCr/4uo
 mA2yDy2E3X15SA6W1PbH5JUBS1ckFzpwFFm5FsjrNgmAkMXtBshypjW1HFXQQFhg
 XZV+MLH32+Hdy3MQ016w/fHbln61W0DjVIjiABfyqLSgpiDQ5AqvONDcV3YbsdP3
 dTnQQ2UJJ9xrbVT5retKOAs2jjMBZ/hmwZhExaI+m5+ZnSHiuOUctfKDkPL7aHcB
 fTzgc7Hrzalca7UDWRtC31IUlzlaHyXO/WLuAljwTqwFST2r7Jck/FSPDJMyRdJr
 hUixLBgby4W32PouDsPNqxsEO5Rhp8cPAa2Eb3i0L85EbZ3Zua9F36cSuhKE3xP6
 lANsgnbr5he/wZohPIz9pDFUnFdUcIXghX3NGXM1obNxZ8T6/Y1mG3WZBCmQHgOI
 nWttoKhMHknnY6pKuk66IzIAvM7wED6wQgHekcUCK9ZkXr8zVZMzBaIX+0d4zx/F
 asi/g3pnxqt+RL3HjhLMQnIz48wF46rtajCsfEHoGEmoaO1UmD8=
 =VxVu
 -----END PGP SIGNATURE-----

Merge tag 'qcom-arm64-fixes-for-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/fixes

Qualcomm ARM64 fixes for v6.5

This corrects the invalid path specifier for L3 interconnects in the CPU
nodes of SM8150 and SM8250. It corrects the compatible of the SC8180X L3
node, to pass the binding check.

The crypto core, and its DMA controller, is disabled on SM8350 to avoid
the system from crashing at boot while the issue is diagnosed.

A thermal zone node name conflict is resolved for PM8150L, on the RB5
board.

The UFS vccq voltage is corrected on the SA877P Ride platform, to
address observed stability issues.

The reg-names of the DSI phy on SC7180 are restored after an accidental
search-and-replace update.

* tag 'qcom-arm64-fixes-for-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux:
  arm64: dts: qcom: sc7180: Fix DSI0_PHY reg-names
  arm64: dts: qcom: sa8775p-ride: Update L4C parameters
  arm64: dts: qcom: qrb5165-rb5: fix thermal zone conflict
  arm64: dts: qcom: sm8350: fix BAM DMA crash and reboot
  arm64: dts: qcom: sc8180x: Fix OSM L3 compatible
  arm64: dts: qcom: sm8250: Fix EPSS L3 interconnect cells
  arm64: dts: qcom: sm8150: Fix OSM L3 interconnect cells

Link: https://lore.kernel.org/r/20230815142042.2459048-1-andersson@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-08-17 14:39:47 +02:00
Arnd Bergmann
e7c12167a2 Correct wifi interrupt flags for some boards, fixed wifi on Rock PI4,
disabled hs400 speeds for some boards having problems with data
 intergrity and some dt property/styling fixes.
 -----BEGIN PGP SIGNATURE-----
 
 iQFEBAABCAAuFiEE7v+35S2Q1vLNA3Lx86Z5yZzRHYEFAmTdQagQHGhlaWtvQHNu
 dGVjaC5kZQAKCRDzpnnJnNEdga3AB/sFuePDO2RZcM4YAf5IB/Ct5nFgdaVEOvNk
 UxB60rD7nsVuTblc3FT9K6TRgGJfX3VKylDUWoSHlkbjoof0Hu8GJ/5dhiNM5dxc
 GRwTzobweVez3d6CWI78EMbEBa/phHSEFdEy5Dk0npolt91tBzOn1BqZTi3/CLY3
 56cPcBArLqlEWE7ExhNXHbrJ+WCblgjulabVm9aYjSeU8iOHHxnq+Z82M+DDIP2Q
 3I2rsyFqgHYOAsYaBGOyVnEzJiEVEOp/1+4bvlawmWLRj1s48bjn7aWUBaawLd1c
 NMcPRWFRKEDqyP28wxL45Kr8mWZ/97lQ4DY/MsyKtJFF7zj9CPIM
 =gBGI
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmTeD70ACgkQYKtH/8kJ
 Uif5+BAArCGIZsSXNvHiRYrjOJkfy3G/pAa6S+fVxS0H+A9MiJO6Z1wsqE+Qq/B8
 YFUFeWQpiijVfBip8E8vOZsLLykuY32z5LKv3u7fbMdDIThyr1npsiRGJ6I4KGM5
 pnfdqRo3hsIak67jp9idRXppRWfU7t5O2IqpD5+Yrul8cjLu0U+tEHrO30MzzpaJ
 TQfLwFjvWUe2MvI2p6ntPb44vfYuqK7vAuYhqIyMDnO/69r9hTOzf58NxqkQr09B
 f3bgMY+53dR7lKDrvdUSZDlNQmtclrrsCC1UK+eueYWgOMEhD2DOeVCzAIzkABzM
 mUrKHLAldi9zDLFfrXpOatUBlToj8Zq4BR9R6qKI1s4gvuXi70tkDhuK4DLjObad
 ADtTHFikrrcYE0wU9o2fnc5cndvkDZLQ/ploUwnwTfoL/YO2omKCDT59R9O7aDja
 eVkwUE60ZavOIQHvd11uFRtFSNeH5eh/97ggGSXKaYkamiSR9VFHnYnsD38phEMQ
 hcPzocN+eqaIIdhLgTqn+qHPJ20oHDcnjFjyJEDDHMTg5UEY2k4VCwCFVH1n0A2u
 R24XXzzdJHNEBQPL8o2SzgJfvyKyjVVe2+7OeIT6RxaSjRI+M90oA1zp4DMNEeqy
 +bIPCzi7aa48+U0EchM4lt+IJJphGMSOJ5mELaDmF8BDwPhKEzY=
 =yaB5
 -----END PGP SIGNATURE-----

Merge tag 'v6.5-rockchip-dtsfixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/fixes

Correct wifi interrupt flags for some boards, fixed wifi on Rock PI4,
disabled hs400 speeds for some boards having problems with data
intergrity and some dt property/styling fixes.

* tag 'v6.5-rockchip-dtsfixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip:
  arm64: dts: rockchip: Fix Wifi/Bluetooth on ROCK Pi 4 boards
  arm64: dts: rockchip: minor whitespace cleanup around '='
  arm64: dts: rockchip: Disable HS400 for eMMC on ROCK 4C+
  arm64: dts: rockchip: Disable HS400 for eMMC on ROCK Pi 4
  arm64: dts: rockchip: add missing space before { on indiedroid nova
  arm64: dts: rockchip: correct wifi interrupt flag in Box Demo
  arm64: dts: rockchip: correct wifi interrupt flag in Rock Pi 4B
  arm64: dts: rockchip: correct wifi interrupt flag in eaidk-610
  arm64: dts: rockchip: Drop invalid regulator-init-microvolt property

Link: https://lore.kernel.org/r/4519945.8hzESeGDPO@phil
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-08-17 14:17:01 +02:00
Mateusz Guzik
c8afaa1b0f locking: remove spin_lock_prefetch
The only remaining consumer is new_inode, where it showed up in 2001 as
commit c37fa164f793 ("v2.4.9.9 -> v2.4.9.10") in a historical repo [1]
with a changelog which does not mention it.

Since then the line got only touched up to keep compiling.

While it may have been of benefit back in the day, it is guaranteed to
at best not get in the way in the multicore setting -- as the code
performs *a lot* of work between the prefetch and actual lock acquire,
any contention means the cacheline is already invalid by the time the
routine calls spin_lock().  It adds spurious traffic, for short.

On top of it prefetch is notoriously tricky to use for single-threaded
purposes, making it questionable from the get go.

As such, remove it.

I admit upfront I did not see value in benchmarking this change, but I
can do it if that is deemed appropriate.

Removal from new_inode and of the entire thing are in the same patch as
requested by Linus, so whatever weird looks can be directed at that guy.

Link: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/fs/inode.c?id=c37fa164f793735b32aa3f53154ff1a7659e6442 [1]
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2023-08-12 09:18:47 -07:00
Arnd Bergmann
991e0d9dbb i.MX fixes for 6.5, 2nd round:
- Fix i.MX93 ANATOP 'reg' resource size to avoid overlapping with TMU
   memory area.
 - Fix RTC interrupt level on imx6qdl-phytec-mira board.
 - Remove LDB endpoint from from the common imx6sx.dtsi as it causes
   regression for boards that has the LCDIF connected directly to
   a parallel display.
 - Drop CSI1 PHY reference clock configuration from i.MX8MM/N device tree
   to avoid overclocking.
 - Set a proper default tuning step for i.MX6SX and i.MX7D uSDHC to fix
   a tuning failure seen with some SD cards.
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCgAyFiEEFmJXigPl4LoGSz08UFdYWoewfM4FAmTTYzIUHHNoYXduZ3Vv
 QGtlcm5lbC5vcmcACgkQUFdYWoewfM5THQf/bDZP+YPT8RxUdxVdL6jT2GGHR3t8
 wq3+vM1KVgg+1E9nMBcG0aT1fUTvPM22N5Ae72bGYd69HGbqS64UJ37JlvrSXfwW
 QtJHPb9mbDPsdyoLbWBuJq3bdY6NgdbzeKEEGRWlZAkJqvB5a1S63g3riJO89inp
 mMsm0dFGn7IZFkhflMtMFL9T0FOz4IwbJGBCm5WvRCR/5nH82MJe5w9JfWBGoRPY
 Y0+vm8bS8A/hjQrYVWyAxe1sRAjxNNPWEsjelY/F89gpqOcuBrTTFVmMhEVKX6sd
 BjgCQFFWzds4ezmTNloMTyB4dSnW/q2Nsg87A9MXVECW6eIzAeO9p2dINA==
 =pxhp
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmTXPu4ACgkQYKtH/8kJ
 UieZnRAAnbxsC6/NT7qOwo/d6+hfX2Nh7Tgy9MDLBwIGtzdR822SD0WKwYRIb0K/
 iMQMt+6ItPcYDKOLUXKv1MY3QX3BcirvE4yDyPGVxgcnkmL1egeUlYJ4R2U8QnOq
 Vwn+cqAcA6RSQIYEV0w32gXHjeDBMdsToT+DlV7id5C6QyreQEkSRzrqf0zm1CTF
 zNWCXeaaLkTV+j7W4fb3yPhSMhnnfkwmZB3lVVd5K/vwt7x3OQc7WaSQVNPAcGTC
 jiWsbW5KF4HbcukUpb16hyxyyJlt94FxrqqUyN86mj/ONBS55Hf7ilgZX4x/KphG
 PJ2V7fnCDnrhIWVEUlknMxLZmPUXTMqaSVsXrx0JOOz+y3KSq6lZudswXPK5fvbV
 WGZw9YpC/Hm3hN7Xi+BBUZVJGB7r9pyjcZUcUZBqK1EOxDSRiDMogyC55cC6C6Z2
 uX4AfntpeDskj1nUtAgXK38bM1NLQ/jQnkZPVV69qpSkRQK/zLBwNuTSDUtW42vM
 ftbbSIyN4tEBQD5bmXy01ug7qxFJaeRQ9dW44UH03zYvDlH5QTrRM64tmySKIRZ+
 urab1ShoN0UNA7t9PFpj45bbLb9sndeI6EOh0Vi8RozQ+dCEq1I6HFt54K886qar
 sjcsnrJxMZysZnoGGf3q1REe3NjuQ1gRd2nwg4Rbj7VkytuInWI=
 =3ZEY
 -----END PGP SIGNATURE-----

Merge tag 'imx-fixes-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes

i.MX fixes for 6.5, 2nd round:

- Fix i.MX93 ANATOP 'reg' resource size to avoid overlapping with TMU
  memory area.
- Fix RTC interrupt level on imx6qdl-phytec-mira board.
- Remove LDB endpoint from from the common imx6sx.dtsi as it causes
  regression for boards that has the LCDIF connected directly to
  a parallel display.
- Drop CSI1 PHY reference clock configuration from i.MX8MM/N device tree
  to avoid overclocking.
- Set a proper default tuning step for i.MX6SX and i.MX7D uSDHC to fix
  a tuning failure seen with some SD cards.

* tag 'imx-fixes-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  arm64: dts: imx93: Fix anatop node size
  ARM: dts: imx: Set default tuning step for imx6sx usdhc
  arm64: dts: imx8mm: Drop CSI1 PHY reference clock configuration
  arm64: dts: imx8mn: Drop CSI1 PHY reference clock configuration
  ARM: dts: imx: Set default tuning step for imx7d usdhc
  ARM: dts: imx6: phytec: fix RTC interrupt level
  ARM: dts: imx6sx: Remove LDB endpoint

Link: https://lore.kernel.org/r/20230809100034.GS151430@dragon
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-08-12 10:12:29 +02:00
Linus Torvalds
a027b2eca0 x86:
* Fix SEV race condition
 
 ARM:
 
 * Fixes for the configuration of SVE/SME traps when hVHE mode is in use
 
 * Allow use of pKVM on systems with FF-A implementations that are v1.0
   compatible
 
 * Request/release percpu IRQs (arch timer, vGIC maintenance) correctly
   when pKVM is in use
 
 * Fix function prototype after __kvm_host_psci_cpu_entry() rename
 
 * Skip to the next instruction when emulating writes to TCR_EL1 on
   AmpereOne systems
 
 Selftests:
 
 * Fix missing include
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmTQ7zsUHHBib256aW5p
 QHJlZGhhdC5jb20ACgkQv/vSX3jHroMaZwf+LCD+U/Z5W9o9BLfn0gq/mLS0EPJe
 +aa+AQvh1q0rQVFY8cgglGbpF3L1KGRWTEPNX2izJVOAmOzVwVjxlXj47fMhcwao
 RzFFQ8GIjZGjP+lJ4zTtUzlDSNNDQqeG+Ji2GoWvSZYE6HDmSPv6CYOsUkmp3T6V
 nEST2lCHY+lVEp62Y3YS+QcVEj6qsXDF21W4OxEPM9OWATj34IQTYmhCbbqzalgD
 7D08nIdUtzk3JyiiG52XKACfSpWJMg3W78Kt6noX6be89SAvr2cw14X0sqZP6lID
 akN6rByBZrSBaaj9TJQiEXSK5Ff/TphdxbDG4uDfOf8nzy2+QrKOXJ1Q7w==
 =zBPg
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull kvm fixes from Paolo Bonzini:
 "x86:

   - Fix SEV race condition

  ARM:

   - Fixes for the configuration of SVE/SME traps when hVHE mode is in
     use

   - Allow use of pKVM on systems with FF-A implementations that are
     v1.0 compatible

   - Request/release percpu IRQs (arch timer, vGIC maintenance)
     correctly when pKVM is in use

   - Fix function prototype after __kvm_host_psci_cpu_entry() rename

   - Skip to the next instruction when emulating writes to TCR_EL1 on
     AmpereOne systems

  Selftests:

   - Fix missing include"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  selftests/rseq: Fix build with undefined __weak
  KVM: SEV: remove ghcb variable declarations
  KVM: SEV: only access GHCB fields once
  KVM: SEV: snapshot the GHCB before accessing it
  KVM: arm64: Skip instruction after emulating write to TCR_EL1
  KVM: arm64: fix __kvm_host_psci_cpu_entry() prototype
  KVM: arm64: Fix resetting SME trap values on reset for (h)VHE
  KVM: arm64: Fix resetting SVE trap values on reset for hVHE
  KVM: arm64: Use the appropriate feature trap register when activating traps
  KVM: arm64: Helper to write to appropriate feature trap register based on mode
  KVM: arm64: Disable SME traps for (h)VHE at setup
  KVM: arm64: Use the appropriate feature trap register for SVE at EL2 setup
  KVM: arm64: Factor out code for checking (h)VHE mode into a macro
  KVM: arm64: Rephrase percpu enable/disable tracking in terms of hyp
  KVM: arm64: Fix hardware enable/disable flows for pKVM
  KVM: arm64: Allow pKVM on v1.0 compatible FF-A implementations
2023-08-07 10:18:20 -07:00
Alexander Stein
78e869dd8b arm64: dts: imx93: Fix anatop node size
Although the memory map of i.MX93 reference manual rev. 2 claims that
analog top has start address of 0x44480000 and end address of 0x4448ffff,
this overlaps with TMU memory area starting at 0x44482000, as stated in
section 73.6.1.
As PLL configuration registers start at addresses up to 0x44481400, as used
by clk-imx93, reduce the anatop size to 0x2000, so exclude the TMU area
but keep all PLL registers inside.

Fixes: ec8b5b5058 ("arm64: dts: freescale: Add i.MX93 dtsi support")
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2023-08-06 11:50:04 +08:00
Linus Torvalds
e6fda526d9 More SVE/SME fixes for ptrace() and for the (potentially future) case
where SME is implemented in hardware without SVE support.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE5RElWfyWxS+3PLO2a9axLQDIXvEFAmTNQv8ACgkQa9axLQDI
 XvF2lRAAhdMMFciXgU4KY13GnggPh83INemqDVgwdaOHb75Ucx/reDpSd6d2TaSo
 0m3bK4vCI46xzWSRT4VGItvuUGwtpf8zQB+x6Gv9Kv/FWjRjsgvzcyflh+mn3C6X
 LTSSk9yC/mS71cutJil/Otyf8YWjpGHX8T3ki4heqyrBxIzfYnovoVQhiqxuErj7
 KXitCCHqgmP0VwL14QGa+J5keThwv85xH/AtVMJa+Z1u/dYOfBGoahnuDGGDWzad
 shEHvLVVj7P25Bnp9ncdsHAhrumCOHFJ2c8UG71nGJH+ZGUQxcVJOXVJch/34kGj
 dBK6T+yASER5lt8vKsDfqwRx0KSTziF4ACDl3rGLei48qRSfMRVtkOSHuVcp/DtJ
 jTqj4oZswU3zokv8otMxWQHK+2uKlWXTcv3xeD154laX7+D0Tp/Og0h+ZDkpHU1N
 UfeuR0DwYYVEMLJo+Z1hGJ1qgrcx8qYveSDq9e4G4XaoIE7PjUEASCZ62aAXNQXB
 KpOUZ3h3Vrr++OMzHQ+fVcDvOcxyaSGiSuZIjfYy5S8oOz8jgsDZZaxzJEWz32ns
 fl3gRcVxPY65iFCL7Lnut8t+jmbvIIWzVjIOq1OICWFhDk/rQoB/KvFp+8b9ngpn
 GkAxuS5WZuIDyAKWf04nk4GX4vtDNARTvaRSC0y93H9JpU+dB7c=
 =Xy/A
 -----END PGP SIGNATURE-----

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Catalin Marinas:
 "More SVE/SME fixes for ptrace() and for the (potentially future) case
  where SME is implemented in hardware without SVE support"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64/fpsimd: Sync and zero pad FPSIMD state for streaming SVE
  arm64/fpsimd: Sync FPSIMD state with SVE for SME only systems
  arm64/ptrace: Don't enable SVE when setting streaming SVE
  arm64/ptrace: Flush FP state when setting ZT0
  arm64/fpsimd: Clear SME state in the target task when setting the VL
2023-08-04 12:11:40 -07:00
Paolo Bonzini
251199f4b3 KVM/arm64 fixes for 6.5, part #2
- Fixes for the configuration of SVE/SME traps when hVHE mode is in use
 
  - Allow use of pKVM on systems with FF-A implementations that are v1.0
    compatible
 
  - Request/release percpu IRQs (arch timer, vGIC maintenance) correctly
    when pKVM is in use
 
  - Fix function prototype after __kvm_host_psci_cpu_entry() rename
 
  - Skip to the next instruction when emulating writes to TCR_EL1 on
    AmpereOne systems
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQSNXHjWXuzMZutrKNKivnWIJHzdFgUCZMi85QAKCRCivnWIJHzd
 FvmQAP9Mk2hAW/42Z6oZw70xnJMzaLh+h2bx0t91iTvSXBap0gD/dMUAz+BpaGvq
 JppNoBtceA2eJJaDDiOpBHGpybwxtgI=
 =1fwI
 -----END PGP SIGNATURE-----

Merge tag 'kvmarm-fixes-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD

KVM/arm64 fixes for 6.5, part #2

 - Fixes for the configuration of SVE/SME traps when hVHE mode is in use

 - Allow use of pKVM on systems with FF-A implementations that are v1.0
   compatible

 - Request/release percpu IRQs (arch timer, vGIC maintenance) correctly
   when pKVM is in use

 - Fix function prototype after __kvm_host_psci_cpu_entry() rename

 - Skip to the next instruction when emulating writes to TCR_EL1 on
   AmpereOne systems
2023-08-04 13:39:07 -04:00
Mark Brown
69af56ae56 arm64/fpsimd: Sync and zero pad FPSIMD state for streaming SVE
We have a function sve_sync_from_fpsimd_zeropad() which is used by the
ptrace code to update the SVE state when the user writes to the the
FPSIMD register set.  Currently this checks that the task has SVE
enabled but this will miss updates for tasks which have streaming SVE
enabled if SVE has not been enabled for the thread, also do the
conversion if the task has streaming SVE enabled.

Fixes: e12310a0d3 ("arm64/sme: Implement ptrace support for streaming mode SVE registers")
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230803-arm64-fix-ptrace-ssve-no-sve-v1-3-49df214bfb3e@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2023-08-04 16:18:32 +01:00
Mark Brown
507ea5dd92 arm64/fpsimd: Sync FPSIMD state with SVE for SME only systems
Currently we guard FPSIMD/SVE state conversions with a check for the system
supporting SVE but SME only systems may need to sync streaming mode SVE
state so add a check for SME support too.  These functions are only used
by the ptrace code.

Fixes: e12310a0d3 ("arm64/sme: Implement ptrace support for streaming mode SVE registers")
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230803-arm64-fix-ptrace-ssve-no-sve-v1-2-49df214bfb3e@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2023-08-04 16:18:31 +01:00
Mark Brown
045aecdfcb arm64/ptrace: Don't enable SVE when setting streaming SVE
Systems which implement SME without also implementing SVE are
architecturally valid but were not initially supported by the kernel,
unfortunately we missed one issue in the ptrace code.

The SVE register setting code is shared between SVE and streaming mode
SVE. When we set full SVE register state we currently enable TIF_SVE
unconditionally, in the case where streaming SVE is being configured on a
system that supports vanilla SVE this is not an issue since we always
initialise enough state for both vector lengths but on a system which only
support SME it will result in us attempting to restore the SVE vector
length after having set streaming SVE registers.

Fix this by making the enabling of SVE conditional on setting SVE vector
state. If we set streaming SVE state and SVE was not already enabled this
will result in a SVE access trap on next use of normal SVE, this will cause
us to flush our register state but this is fine since the only way to
trigger a SVE access trap would be to exit streaming mode which will cause
the in register state to be flushed anyway.

Fixes: e12310a0d3 ("arm64/sme: Implement ptrace support for streaming mode SVE registers")
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230803-arm64-fix-ptrace-ssve-no-sve-v1-1-49df214bfb3e@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2023-08-04 16:18:31 +01:00
Mark Brown
89a65c3f17 arm64/ptrace: Flush FP state when setting ZT0
When setting ZT0 via ptrace we do not currently force a reload of the
floating point register state from memory, do that to ensure that the newly
set value gets loaded into the registers on next task execution.

The function was templated off the function for FPSIMD which due to our
providing the option of embedding a FPSIMD regset within the SVE regset
does not directly include the flush.

Fixes: f90b529bcb ("arm64/sme: Implement ZT0 ptrace support")
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230803-arm64-fix-ptrace-zt0-flush-v1-1-72e854eaf96e@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2023-08-03 15:42:14 +01:00
Mark Brown
c9bb40b7f7 arm64/fpsimd: Clear SME state in the target task when setting the VL
When setting SME vector lengths we clear TIF_SME to reenable SME traps,
doing a reallocation of the backing storage on next use. We do this using
clear_thread_flag() which operates on the current thread, meaning that when
setting the vector length via ptrace we may both not force traps for the
target task and force a spurious flush of any SME state that the tracing
task may have.

Clear the flag in the target task.

Fixes: e12310a0d3 ("arm64/sme: Implement ptrace support for streaming mode SVE registers")
Reported-by: David Spickett <David.Spickett@arm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230803-arm64-fix-ptrace-tif-sme-v1-1-88312fd6fbfd@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2023-08-03 15:41:03 +01:00
Linus Torvalds
ec351c8f2e ARM: SoC fixes for 6.5, part 2
A couple of platforms get a lone dts fix each:
 
  - SoCFPGA: Fix incorrect I2C property for SCL signal
 
  - Renesas: Fix interrupt names for MTU3 channels on RZ/G2L and RZ/V2L.
 
  - Juno/Vexpress: remove a dangling symlink
 
  - at91: sam9x60 SoC detection compatible strings
 
  - nspire: Fix arm primecell compatible string
 
 On the NXP i.MX platform, there multiple issues that get addressed:
 
  - A couple of ARM DTS fixes for i.MX6SLL usbphy and supported CPU
    frequency of sk-imx53 board
 
  - Add missing pull-up for imx8mn-var-som onboard PHY reset pinmux
 
  - A couple of imx8mm-venice fixes from Tim Harvey to diable disp_blk_ctrl
 
  - A couple of phycore-imx8mm fixes from Yashwanth Varakala to correct
    VPU label and gpio-line-names
 
  - Fix imx8mp-blk-ctrl driver to register HSIO PLL clock as bus_power_dev
    child, so that runtime PM can translate into the necessary GPC power
    domain action
 
 On the driver side, there are two fixes for tegra memory controller
 drivers addressing regressions from the merge window, a couple of
 minor correctness fixes for SCMI and SMCCC firmware, as well as
 a build fix for an lcd backlight driver.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmTKzBoACgkQYKtH/8kJ
 UienWxAArE9KMlN6eMk0bInLwEjuT3RDOymgqPZFcv8id0+nUcL+1hFnRXzN/wzR
 KFvf0KWRzi9BP5XGHZ2v16OLXtbm70Uul4RIJG+5TdOBtKAT2W52v2LTvAo2N539
 755wHyg8+Z+8ruPt8jzp4EDtOpmCYvEq+4EtqDp1gtQp2RLt0iIBsefAR5B1yMrW
 Ik0pMV5A7Xkec7N6giZVqIN3LEvkSisrwdHuw/QBh8kzhOXAtxMHfBHdrL7VZM41
 /9rHBfRgyzdkFxZpevacZuP4nL12f+Cn8cosgFW4tPS8dlsZEZ5UmprXE654KLkF
 /o+S2euvZqmaIxHMJNFfH2I2LqsoOT+wI453kyfZ+b11d2juFeWi2Z45MVwyhS4M
 eZTFveJVgMRKol8HA4ffPv2eNkjDGOWofoYonqwI1yWswrQtnswKGeJX1AA4+jFh
 FyHWPgj8IGnCyUkiOHEyU6Fq+RwvYxTqnstZEWj3SvH7wyaK82OaYzM1dVw1yIgN
 d1q6uowzp0zLobxGPhe+zcgNOQqIR2BD8nhQ6dNX7md4sdQA/RqBBe2CV76wYXpu
 uEXL7A+oHSI+fZIEJa2TOTsm6WyyOTkv3l6L+0vpoXOZchyOw0V3aLPQurlo1m/5
 zp35yRjQnP35wSm1VJEHG03liP0XUuCZnkw6iXhSaKQeWDaJu5M=
 =+evH
 -----END PGP SIGNATURE-----

Merge tag 'soc-fixes-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull ARM SoC fixes from Arnd Bergmann:
 "A couple of platforms get a lone dts fix each:

   - SoCFPGA: Fix incorrect I2C property for SCL signal

   - Renesas: Fix interrupt names for MTU3 channels on RZ/G2L and
     RZ/V2L.

   - Juno/Vexpress: remove a dangling symlink

   - at91: sam9x60 SoC detection compatible strings

   - nspire: Fix arm primecell compatible string

  On the NXP i.MX platform, there multiple issues that get addressed:

   - A couple of ARM DTS fixes for i.MX6SLL usbphy and supported CPU
     frequency of sk-imx53 board

   - Add missing pull-up for imx8mn-var-som onboard PHY reset pinmux

   - A couple of imx8mm-venice fixes from Tim Harvey to diable
     disp_blk_ctrl

   - A couple of phycore-imx8mm fixes from Yashwanth Varakala to correct
     VPU label and gpio-line-names

   - Fix imx8mp-blk-ctrl driver to register HSIO PLL clock as
     bus_power_dev child, so that runtime PM can translate into the
     necessary GPC power domain action

  On the driver side, there are two fixes for tegra memory controller
  drivers addressing regressions from the merge window, a couple of
  minor correctness fixes for SCMI and SMCCC firmware, as well as a
  build fix for an lcd backlight driver"

* tag 'soc-fixes-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (22 commits)
  backlight: corgi_lcd: fix missing prototype
  memory: tegra: make icc_set_bw return zero if BWMGR not supported
  arm64: dts: renesas: rzg2l: Update overfow/underflow IRQ names for MTU3 channels
  dt-bindings: serial: atmel,at91-usart: update compatible for sam9x60
  ARM: dts: at91: sam9x60: fix the SOC detection
  ARM: dts: nspire: Fix arm primecell compatible string
  firmware: arm_scmi: Fix chan_free cleanup on SMC
  firmware: arm_scmi: Drop OF node reference in the transport channel setup
  soc: imx: imx8mp-blk-ctrl: register HSIO PLL clock as bus_power_dev child
  ARM: dts: nxp/imx: limit sk-imx53 supported frequencies
  firmware: arm_scmi: Fix signed error return values handling
  firmware: smccc: Fix use of uninitialised results structure
  arm64: dts: freescale: Fix VPU G2 clock
  arm64: dts: imx8mn-var-som: add missing pull-up for onboard PHY reset pinmux
  arm64: dts: phycore-imx8mm: Correction in gpio-line-names
  arm64: dts: phycore-imx8mm: Label typo-fix of VPU
  ARM: dts: nxp/imx6sll: fix wrong property name in usbphy node
  arm64: dts: imx8mm-venice-gw7904: disable disp_blk_ctrl
  arm64: dts: imx8mm-venice-gw7903: disable disp_blk_ctrl
  arm64: dts: arm: Remove the dangling vexpress-v2m-rs1.dtsi symlink
  ...
2023-08-02 18:21:12 -07:00
Konrad Dybcio
6d4cc57630 arm64: dts: qcom: sc7180: Fix DSI0_PHY reg-names
Commit 2b616f86d5 ("arm64: dts: qcom: sc7180: rename labels for DSI
nodes") broke reg-names, possibly with search-and-replace. Fix it.

Fixes: 2b616f86d5 ("arm64: dts: qcom: sc7180: rename labels for DSI nodes")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20230627-topic-more_bindings-v1-1-6b4b6cd081e5@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2023-07-31 09:09:41 -07:00
Fabio Estevam
f02b53375e arm64: dts: imx8mm: Drop CSI1 PHY reference clock configuration
The CSI1 PHY reference clock is limited to 125 MHz according to:
i.MX 8M Mini Applications Processor Reference Manual, Rev. 3, 11/2020
Table 5-1. Clock Root Table (continued) / page 307
Slice Index n = 123 .

Currently the IMX8MM_CLK_CSI1_PHY_REF clock is configured to be
fed directly from 1 GHz PLL2 , which overclocks them. Instead, drop
the configuration altogether, which defaults the clock to 24 MHz REF
clock input, which for the PHY reference clock is just fine.

Based on a patch from Marek Vasut for the imx8mn.

Fixes: e523b7c54c ("arm64: dts: imx8mm: Add CSI nodes")
Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Reviewed-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2023-07-30 21:32:36 +08:00
Marek Vasut
926c733508 arm64: dts: imx8mn: Drop CSI1 PHY reference clock configuration
The CSI1 PHY reference clock are limited to 125 MHz according to:
i.MX 8M Nano Applications Processor Reference Manual, Rev. 2, 07/2022
Table 5-1. Clock Root Table (continued) / page 319
Slice Index n = 123 .

Currently those IMX8MN_CLK_CSI1_PHY_REF clock are configured to be
fed directly from 1 GHz PLL2 , which overclocks them . Instead, drop
the configuration altogether, which defaults the clock to 24 MHz REF
clock input, which for the PHY reference clock is just fine.

Fixes: ae9279f301 ("arm64: dts: imx8mn: Add CSI and ISI Nodes")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Reviewed-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2023-07-30 21:29:23 +08:00
Sven Joachim
1f2190d6b7 arch/*/configs/*defconfig: Replace AUTOFS4_FS by AUTOFS_FS
Commit a2225d931f ("autofs: remove left-over autofs4 stubs")
promised the removal of the fs/autofs/Kconfig fragment for AUTOFS4_FS
within a couple of releases, but five years later this still has not
happened yet, and AUTOFS4_FS is still enabled in 63 defconfigs.

Get rid of it mechanically:

   git grep -l CONFIG_AUTOFS4_FS -- '*defconfig' |
       xargs sed -i 's/AUTOFS4_FS/AUTOFS_FS/'

Also just remove the AUTOFS4_FS config option stub.  Anybody who hasn't
regenerated their config file in the last five years will need to just
get the new name right when they do.

Signed-off-by: Sven Joachim <svenjoac@gmx.de>
Acked-by: Ian Kent <raven@themaw.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2023-07-29 14:08:22 -07:00
Linus Torvalds
f837f0a3c9 A couple of SME updates for recent fixes (one of which went to stable):
reverting the flushing of the SME hardware state along with the thread
 flushing and making sure we have the correct vector length before
 reallocating.
 
 An ACPI/IORT fix to avoid skipping ID mappings whose "number of IDs" is
 0 (the spec reports the number of IDs in the mapping range minus 1).
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE5RElWfyWxS+3PLO2a9axLQDIXvEFAmTD40YACgkQa9axLQDI
 XvGmrw/+LSbXPWdBR4d4NnEOuw2YpD7jZ9DosfrtTUm5ca+gnQzLr+6Z9ysVOMX1
 jzEEVMacFHidpY3cSl9waakl/SKHyu6yPFVkKONWz0iFGbqY9w1RWvCQb7APHWUe
 +aaav0GQU/WfnaOGfipuw5mcMpZT4NUTQK3EPZ4C++YvaN4uQiEzivNLmaHkQTqV
 DwY/tUf3AgbEslfV5SO97eXjuZ+TO1DANaI+wdVrHd1k5Zcq+XYIyw+sbTEdUJOx
 KBuK5SjfovNU8x7sg5i1aTBFVR3/sPlPrc0ueGYZsSn3/mWNQHOu/Iy3HYIdFPVM
 P16udTKruXFZsJCLUeykf9DD4d/WnV7wmKZOZgtDTmHUu45CKsZawYC+cVIkNAIx
 kUnEZM+GcLdMY7Ry2oyeeb/deFK6QEt8GfbKfqNubYn/MKvNabTGimKze2gk1cQR
 w7s/WWDN0finRJVy9SZrKvB3NbTw28aUZ+zDd1MzbSQncRtn0mZ2O06muxAbrP+C
 OqgtG1VEmwc0mWs8A79GQ9UBY4NCVCdl49bFTRBlot3eyLWu8nZyDzS6XELqB9/n
 Q5j7SOmj4CiOLfJGeTKNKs5cGf1mm2NUs8hpdEOaCEa0+rkAgfLsUnwDtMmHwQZ8
 sHSsRwf4BR1KexfCpehqoic8XhOA9IjrDMQAx710cbQeLYiJ5iA=
 =qoWG
 -----END PGP SIGNATURE-----

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Catalin Marinas:

 - A couple of SME updates for recent fixes (one of which went to
   stable): reverting the flushing of the SME hardware state along with
   the thread flushing and making sure we have the correct vector length
   before reallocating.

 - An ACPI/IORT fix to avoid skipping ID mappings whose "number of IDs"
   is 0 (the spec reports the number of IDs in the mapping range minus
   1).

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  ACPI/IORT: Remove erroneous id_count check in iort_node_get_rmr_info()
  arm64/sme: Set new vector length before reallocating
  arm64/fpsimd: Don't flush SME register hardware state along with thread
2023-07-28 11:21:57 -07:00
Oliver Upton
74158a8cad KVM: arm64: Skip instruction after emulating write to TCR_EL1
Whelp, this is embarrassing. Since commit 082fdfd138 ("KVM: arm64:
Prevent guests from enabling HA/HD on Ampere1") KVM traps writes to
TCR_EL1 on AmpereOne to work around an erratum in the unadvertised
HAFDBS implementation, preventing the guest from enabling the feature.
Unfortunately, I failed virtualization 101 when working on that change,
and forgot to advance PC after instruction emulation.

Do the right thing and skip the MSR instruction after emulating the
write.

Fixes: 082fdfd138 ("KVM: arm64: Prevent guests from enabling HA/HD on Ampere1")
Acked-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230728000824.3848025-1-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
2023-07-28 17:11:23 +00:00
Arnd Bergmann
d21afb098c SoCFPGA dts fix for v6.5
- Fix incorrect I2C property for SCL signal
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEoHhMeiyk5VmwVMwNGZQEC4GjKPQFAmS+j6EACgkQGZQEC4Gj
 KPRzHRAAsmA1JDQiV83zCXPMB6gnoc49rrUddzcv4qjFmw/ev4rlKRCg9OPxQ/JG
 FMS7IVmPmDRsWrjMGLMPRDNA+Zxe+1REABUN3b0pZMlFdAHA5UVlT2xF/MIH0Fqp
 NGs2Sg/SMKNbW21JeEdiENPabx2Vok+krpwAD2yW/7mbJaPVNhh/jIdMF/eQGNTg
 P/1tyXlmh4xq1i9R0D/1UyXs02YWlbdDz0EoOkhDjbnq5YCggC6gL7k8xdKrhjxW
 c5i/MI1wpecMqEe9ThG+oYYy7NiK5jMlZ45902kAE4+H2w+NMegwpMiS4Ulnj/4D
 w5+/8MNSJ96NoBMmS/iwlBM35+EAlkdQeQUyZL6gr3QkPWBVeDa5UWfry8QJmhLV
 8GarV3rmLQfNU2eqERUVeUhvPsT6eIEnTZlpyiwajNVw0p+ASo68zoY8mr0R7am5
 r98a/ELfeD2x8jb/Ydk6lMem8ddpXyeGyfzW6cgq9ngo+XnskaOrXOGg77r5Od4g
 /HBwNZ65S08xvnR94BqHzIB1c0A5ATraOVAAYtWdWwTXccYd6RBwuoQici28Ao3c
 thn2D0lhHhmAQ71aSEkx7QDxeInD/ijUUEF7obluThHFj7U7Snj07OlBm1G6iO0b
 d3APH+BpX5YwoCv+fce2tJ4vdjngdbZHoMn7hdjcQvyts1gm7AA=
 =rGx/
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmTCdKMACgkQYKtH/8kJ
 UidH1w/9GCCx5lBd9qMNnIJM8/jkvOETeLH99DMFApSR6PTKlgF83vo67MqZ4Sax
 LszPeiENVw8/D5sLrWtn5R5VZsUDvFyQUmnzjML2Hgybk6G/z0EP8Ry1Oac/6Nwn
 KL9EILQz/mX3PPfzIKAEPQUj4mIqsJU+u0BazNg84eGeGmnHqhn2DcJ0jeyLvcUR
 4pTXJTxEICCQz/aYnqwMTA7g8Ii4nu2Cjm7ZAy4Mt1ZQRutRfF8hs4W3Iq71CIh4
 Slci4xj73t3wILanV9CXaHfrOxBW6GwESEl8SVNA+JqMDXJrllmGoh+fOGK8wj2c
 7/hbNGas90cWpbrFD90zhmrmuGivVJ1kwk/lt9Kzv3CritSV3LZaD7Rj+RVT5gjd
 SRRFyNPAfNfxk4EbpI3qUvQXwHTeSmxfzTG9VbpI+/iuo8Pg7VShlqgOjZeZQZBG
 A0OOmwJbqY6h+wPs1ISkCTjc6eppErM7GyOJtskhunfOsxtrVBH7DicMD0nyK/A6
 Hx+n1fZwqq5T0d0PxKFxAlHUjQhNFh4lSRUdGZS997WmHTSYTZ2ByRS/bG7Otwlm
 bONzOZ7j8EmM44yAehRsyZ9CPTow60tHDrounrs10iF/+HEK9/LdIFWRtRTe0VIA
 mto+KDIEtPu8CLHjQN1jfc4Yvrx1qqt9HVxWbcV6qdG6Uzf38m4=
 =lUGR
 -----END PGP SIGNATURE-----

Merge tag 'socfpga_dts_fix_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux into arm/fixes

SoCFPGA dts fix for v6.5
- Fix incorrect I2C property for SCL signal

* tag 'socfpga_dts_fix_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux:
  arm64: dts: stratix10: fix incorrect I2C property for SCL signal

Link: https://lore.kernel.org/r/20230724145617.887443-1-dinguyen@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-07-27 15:44:03 +02:00
Arnd Bergmann
77489a4eb7 Renesas fixes for v6.5
- Fix interrupt names for MTU3 channels on RZ/G2L and RZ/V2L.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCZMJsKwAKCRCKwlD9ZEnx
 cPzHAQCfpNE+Hhhx2nvOQ1F2cjRO9yjGT8poci55sXqWnYAvuAD9FgeovoHU+RD/
 K60+rPIVF7Sj7mMYRrXCir1je6f0pgM=
 =Qjrf
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmTCc/YACgkQYKtH/8kJ
 UiexeRAAs2tiC8z3GNaOXt0CoFShyG7aCuUt1Vy8owWzKky6NuIylCngFezEyDmm
 i9X8U93XcedrGyHo7vDIs/yNLdT1G1lhBcDTo50A2L7s9h7TK/EA2e1PSyzVnl8c
 4JTESdvRYikOh5GneY9+ClBt2o+S9EQk1CmkxkOhoqb9Hrn8V/UeYqbr/lA4sv9P
 QhHIQLKk8Qbz8+Q5ZHY6OGvBZFY6ttugA9Xeyh/RJyafGCJXq+2W4kR3ZhXTIMXK
 9UchyF4aJ8YwOYzrtUetxrtAmD304BXSBHci7WH470y0ca/MrkQr+6aWTLvrdJ3U
 bclPrS/dQtfS8fm7eIi4XXJm4xDtgOH9pVVzFsK8og2c8zmNlbSVD0ySDvuv2pZP
 51Jm9Ba6NTE7ZrhwEWi97wcSQwJLML+xUCDPlTbZJRe9UckeSeBWToFKV8lQJ0xm
 iJtV9rtofSMj8goDzAj8ZLrGGXzQmI4fytPZZK1iIhXkEu6e6Id2OqDRIKkd/Qjt
 3P3YW4HxAFTBfLxnRjbMbbB5HwXcPoVGd4tFnWzEqavdGM8R1Jkhu5xjUJbPIs2B
 ipx/D2cLNdNRoeMXeKbpqFW+SVEgv8/DmZpFqDvrl2oJwolNYZDuG+Q0tLCap+yX
 EVxF53xuWfko53qUyyes1lUNTfWGMVizf7k5YoLyReD5kSz+3Vw=
 =sDK/
 -----END PGP SIGNATURE-----

Merge tag 'renesas-fixes-for-v6.5-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/fixes

Renesas fixes for v6.5

  - Fix interrupt names for MTU3 channels on RZ/G2L and RZ/V2L.

* tag 'renesas-fixes-for-v6.5-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel:
  arm64: dts: renesas: rzg2l: Update overfow/underflow IRQ names for MTU3 channels

Link: https://lore.kernel.org/r/cover.1690463347.git.geert+renesas@glider.be
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-07-27 15:41:10 +02:00
Arnd Bergmann
c05cfd71df i.MX fixes for 6.5:
- A couple of ARM DTS fixes for i.MX6SLL usbphy and supported CPU
   frequency of sk-imx53 board
 - Add missing pull-up for imx8mn-var-som onboard PHY reset pinmux
 - A couple of imx8mm-venice fixes from Tim Harvey to diable disp_blk_ctrl
 - A couple of phycore-imx8mm fixes from Yashwanth Varakala to correct
   VPU label and gpio-line-names
 - Fix imx8mp-blk-ctrl driver to register HSIO PLL clock as bus_power_dev
   child, so that runtime PM can translate into the necessary GPC power
   domain action
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCgAyFiEEFmJXigPl4LoGSz08UFdYWoewfM4FAmS/gEwUHHNoYXduZ3Vv
 QGtlcm5lbC5vcmcACgkQUFdYWoewfM77UAf+Laavt+fI4DZb9CfTAK5BmsDXIl+j
 0AyBohtD2nFfFU3iHNvu1Tv3RWdVWhpUtmoL1TxzokdLsFtOkuv4tbPOmMg/cp7g
 L6pJs3EPTAczGwhtp+KtUgKerB/WcOKn7iRfJYmVd1toKuKZYvW3exU0oPmfUaKQ
 6qQTNdajB4QbOYQPFF7XKpIl28rT1WIpp/SdaZwWoqp/pMTRcHH8OlssHtbOcIOn
 4JakAYpshj2OuBCJ1nm3kCKL6a0DUyqZXJTc+6rnPF+vyrWOUTYcFuIPq/3nU/6X
 Kcf9MNrg3zg+AlP6pas8i341tFrZoC7OBwjynEf1sgfOWFizu2Fy90hAPw==
 =/4j8
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmTCc9cACgkQYKtH/8kJ
 UidoMRAAhKGp1ez1y/wuE0vcOifP+vKw1D6O7AInMji8O85TeNvTLFDocaMW4aNz
 s/DQnPDOndn9+Jjl1s6TYFcFU3yOPVL5aHSda4oWbqVUbtGkQAviKjyh2PA29P73
 ILa7BjD6CEcuBWaOgWJpZHJYLuCrvQrvBOE7I6rmjs7mufz9FEh6RLd1BmhWaNgV
 XOnp/IOHZHB/uIA5uACGoE23uHLO6fUyIS+4xQs0JKXDZbt6boloMeYWJA0GtX46
 efk0Z96cpSu8/eEkwx79uEaFFWcx0g74JgdxCPyjDR+16e3f7vAroCNxvbwbeCUk
 fZnpVBhcVImGazHi9uyOy+vxOk8OlI85fuRIf9a9f7K9v3Yb2Z8HfioLE5LBu6km
 /jAxvNI1MUuEQ4oN5comnaYPGdqcUh1/WlPrxxUF2TKq+2q7aCr2UV7QurVAAT8/
 x9qsSK1O97joopAcVpQ/8KdJ6aAeMX7BlsPt/X8HUIzpQOFGfL+oUibtq7lYjzhg
 LFznzQyQmfVBScQ6XKiQDq4HX18SHHwNb298ieqIg0s03ZTmzVWrgKHo6P459xBJ
 2fpy+T0mAhJD+22dTxyXpY6HkkM1bNTJz5hK8TcDjiu3vlqQRTfVGsaEWSFS579n
 peuQtj7idRiOkzGJou5XCa5Vk0a0x/4mMsEgfzfwJb2ydnds4DU=
 =nthh
 -----END PGP SIGNATURE-----

Merge tag 'imx-fixes-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes

i.MX fixes for 6.5:

- A couple of ARM DTS fixes for i.MX6SLL usbphy and supported CPU
  frequency of sk-imx53 board
- Add missing pull-up for imx8mn-var-som onboard PHY reset pinmux
- A couple of imx8mm-venice fixes from Tim Harvey to diable disp_blk_ctrl
- A couple of phycore-imx8mm fixes from Yashwanth Varakala to correct
  VPU label and gpio-line-names
- Fix imx8mp-blk-ctrl driver to register HSIO PLL clock as bus_power_dev
  child, so that runtime PM can translate into the necessary GPC power
  domain action

* tag 'imx-fixes-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  soc: imx: imx8mp-blk-ctrl: register HSIO PLL clock as bus_power_dev child
  ARM: dts: nxp/imx: limit sk-imx53 supported frequencies
  arm64: dts: freescale: Fix VPU G2 clock
  arm64: dts: imx8mn-var-som: add missing pull-up for onboard PHY reset pinmux
  arm64: dts: phycore-imx8mm: Correction in gpio-line-names
  arm64: dts: phycore-imx8mm: Label typo-fix of VPU
  ARM: dts: nxp/imx6sll: fix wrong property name in usbphy node
  arm64: dts: imx8mm-venice-gw7904: disable disp_blk_ctrl
  arm64: dts: imx8mm-venice-gw7903: disable disp_blk_ctrl

Link: https://lore.kernel.org/r/20230725075837.GR151430@dragon
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-07-27 15:40:39 +02:00
Mark Brown
05d881b85b arm64/sme: Set new vector length before reallocating
As part of fixing the allocation of the buffer for SVE state when changing
SME vector length we introduced an immediate reallocation of the SVE state,
this is also done when changing the SVE vector length for consistency.
Unfortunately this reallocation is done prior to writing the new vector
length to the task struct, meaning the allocation is done with the old
vector length and can lead to memory corruption due to an undersized buffer
being used.

Move the update of the vector length before the allocation to ensure that
the new vector length is taken into account.

For some reason this isn't triggering any problems when running tests on
the arm64 fixes branch (even after repeated tries) but is triggering
issues very often after merge into mainline.

Fixes: d4d5be94a8 ("arm64/fpsimd: Ensure SME storage is allocated after SVE VL changes")
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20230726-arm64-fix-sme-fix-v1-1-7752ec58af27@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2023-07-26 18:34:00 +01:00
Mark Brown
3421ddbe6d arm64/fpsimd: Don't flush SME register hardware state along with thread
We recently changed the fpsimd thread flush to flush the physical SME
state as well as the thread state for the current thread.  Unfortunately
this leads to intermittent corruption in interaction with the lazy
FPSIMD register switching.  When under heavy load such as can be
triggered by the startup phase of fp-stress it is possible that the
current thread may not be scheduled prior to returning to userspace, and
indeed we may end up returning to the last thread that was scheduled on
the PE without ever exiting the kernel to any other task.  If that
happens then we will not reload the register state from memory, leading
to loss of any SME register state.

Since this was purely an attempt to defensively close off potential
problems revert the change.

Fixes: af3215fd02 ("arm64/fpsimd: Exit streaming mode when flushing tasks")
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230724-arm64-dont-flush-smstate-v1-1-9a8b637ace6c@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2023-07-26 18:25:09 +01:00
Arnd Bergmann
01b94b0f39 KVM: arm64: fix __kvm_host_psci_cpu_entry() prototype
The kvm_host_psci_cpu_entry() function was renamed in order to add a wrapper around
it, but the prototype did not change, so now the missing-prototype warning came
back in W=1 builds:

arch/arm64/kvm/hyp/nvhe/psci-relay.c:203:28: error: no previous prototype for function '__kvm_host_psci_cpu_entry' [-Werror,-Wmissing-prototypes]
asmlinkage void __noreturn __kvm_host_psci_cpu_entry(bool is_cpu_on)

Fixes: dcf89d1111 ("KVM: arm64: Add missing BTI instructions")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230724121850.1386668-1-arnd@kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
2023-07-26 17:09:07 +00:00
Fuad Tabba
375110ab51 KVM: arm64: Fix resetting SME trap values on reset for (h)VHE
Ensure that SME traps are disabled for (h)VHE when getting the
reset value for the architectural feature control register.

Fixes: 75c76ab5a6 ("KVM: arm64: Rework CPTR_EL2 programming for HVHE configuration")
Signed-off-by: Fuad Tabba <tabba@google.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230724123829.2929609-9-tabba@google.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
2023-07-26 17:08:30 +00:00
Fuad Tabba
7af0d5e500 KVM: arm64: Fix resetting SVE trap values on reset for hVHE
Ensure that SVE traps are disabled for hVHE, if the FPSIMD state
isn't owned by the guest, when getting the reset value for the
architectural feature control register.

Fixes: 75c76ab5a6 ("KVM: arm64: Rework CPTR_EL2 programming for HVHE configuration")
Signed-off-by: Fuad Tabba <tabba@google.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230724123829.2929609-8-tabba@google.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
2023-07-26 17:08:30 +00:00
Fuad Tabba
a9626099a5 KVM: arm64: Use the appropriate feature trap register when activating traps
Instead of writing directly to cptr_el2, use the helper that
selects which feature trap register to write to based on the KVM
mode.

Fixes: 75c76ab5a6 ("KVM: arm64: Rework CPTR_EL2 programming for HVHE configuration")
Signed-off-by: Fuad Tabba <tabba@google.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230724123829.2929609-7-tabba@google.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
2023-07-26 17:08:30 +00:00
Fuad Tabba
90ae31c65d KVM: arm64: Helper to write to appropriate feature trap register based on mode
Factor out the code that decides whether to write to the feature
trap registers, CPTR_EL2 or CPACR_EL1, based on the KVM mode,
i.e., (h)VHE or nVHE.

This function will be used in the subsequent patch.

No functional change intended.

Signed-off-by: Fuad Tabba <tabba@google.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230724123829.2929609-6-tabba@google.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
2023-07-26 17:08:29 +00:00
Fuad Tabba
380624d435 KVM: arm64: Disable SME traps for (h)VHE at setup
Ensure that SME traps are disabled for (h)VHE when setting up
EL2, as they are for nVHE.

Signed-off-by: Fuad Tabba <tabba@google.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230724123829.2929609-5-tabba@google.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
2023-07-26 17:08:29 +00:00
Fuad Tabba
45a3681a10 KVM: arm64: Use the appropriate feature trap register for SVE at EL2 setup
Use the architectural feature trap/control register that
corresponds to the current KVM mode, i.e., CPTR_EL2 or CPACR_EL1,
when setting up SVE feature traps.

Signed-off-by: Fuad Tabba <tabba@google.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230724123829.2929609-4-tabba@google.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
2023-07-26 17:08:29 +00:00
Fuad Tabba
ce92232614 KVM: arm64: Factor out code for checking (h)VHE mode into a macro
The code for checking whether the kernel is in (h)VHE mode is
repeated, and will be needed again in future patches. Factor it
out in a macro.

No functional change intended.
No change in emitted assembly code intended.

Signed-off-by: Fuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/kvmarm/20230724123829.2929609-3-tabba@google.com/
Reviewed-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
2023-07-26 17:08:17 +00:00
Biju Das
4c188fa183 arm64: dts: renesas: rzg2l: Update overfow/underflow IRQ names for MTU3 channels
As per R01UH0914EJ0130 Rev.1.30 HW manual the MTU3 overflow/underflow
interrupt names start with 'tci' instead of 'tgi'.

Replace the below overflow/underflow interrupt names:
 - tgiv0->tciv0
 - tgiv1->tciv1
 - tgiu1->tciu1
 - tgiv2->tciv2
 - tgiu2->tciu2
 - tgiv3->tciv3
 - tgiv4->tciv4
 - tgiv6->tciv6
 - tgiv7->tciv7
 - tgiv8->tciv8
 - tgiu8->tciu8

Fixes: 26336d66d0 ("arm64: dts: renesas: r9a07g044: Add MTU3a node")
Fixes: dd123dd01d ("arm64: dts: renesas: r9a07g054: Add MTU3a node")
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230724091927.123847-5-biju.das.jz@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2023-07-25 11:40:34 +02:00
Yogesh Hegde
ebceec271e arm64: dts: rockchip: Fix Wifi/Bluetooth on ROCK Pi 4 boards
This patch fixes an issue affecting the Wifi/Bluetooth connectivity on
ROCK Pi 4 boards. Commit f471b1b2db ("arm64: dts: rockchip: Fix Bluetooth
on ROCK Pi 4 boards") introduced a problem with the clock configuration.
Specifically, the clock-names property of the sdio-pwrseq node was not
updated to 'lpo', causing the driver to wait indefinitely for the wrong clock
signal 'ext_clock' instead of the expected one 'lpo'. This prevented the proper
initialization of Wifi/Bluetooth chip on ROCK Pi 4 boards.

To address this, this patch updates the clock-names property of the
sdio-pwrseq node to "lpo" to align with the changes made to the bluetooth node.

This patch has been tested on ROCK Pi 4B.

Fixes: f471b1b2db ("arm64: dts: rockchip: Fix Bluetooth on ROCK Pi 4 boards")
Cc: stable@vger.kernel.org
Signed-off-by: Yogesh Hegde <yogi.kernel@gmail.com>
Link: https://lore.kernel.org/r/ZLbATQRjOl09aLAp@zephyrusG14
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2023-07-24 20:51:25 +02:00
Linus Torvalds
269f4a4b85 ARM:
* Avoid pKVM finalization if KVM initialization fails
 
 * Add missing BTI instructions in the hypervisor, fixing an early boot
   failure on BTI systems
 
 * Handle MMU notifiers correctly for non hugepage-aligned memslots
 
 * Work around a bug in the architecture where hypervisor timer controls
   have UNKNOWN behavior under nested virt.
 
 * Disable preemption in kvm_arch_hardware_enable(), fixing a kernel BUG
   in cpu hotplug resulting from per-CPU accessor sanity checking.
 
 * Make WFI emulation on GICv4 systems robust w.r.t. preemption,
   consistently requesting a doorbell interrupt on vcpu_put()
 
 * Uphold RES0 sysreg behavior when emulating older PMU versions
 
 * Avoid macro expansion when initializing PMU register names, ensuring
   the tracepoints pretty-print the sysreg.
 
 s390:
 
 * Two fixes for asynchronous destroy
 
 x86 fixes will come early next week.
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmS9WpwUHHBib256aW5p
 QHJlZGhhdC5jb20ACgkQv/vSX3jHroOhTAf9EsrnrDK2U0Q1wIGZCh/3d662yslF
 Kh0GidZ62w4P1O4q19lFhJ5ixVdHJjGaNrYGZm77yAi0UaYzx4wvkohdaDhIdeMg
 3do2uo6/iGU5m24BaVIXlSr8V6KDsMw0UvCAjxFWNvCzpR/7tpLOteXFS9rZQ+1N
 jfvoVKqE6LfgJ5IZiVdhIdEOxCf/QuQD/WdZ7fib8ngkY3dETi03MkATFKchtIzx
 j5aWruVHQlmb5ukZzHmmNuF7Yf6c1Bs+Rt6JFjyL+DxbtPBJmHP4TepYCDS4UqIm
 kkxrsqiTde13jQN7vDWzfzdpLQPIGV9OnvGWQoR4dyKfDlqSxJJyhXPuBw==
 =Mkzl
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull kvm fixes from Paolo Bonzini:
 "ARM:

   - Avoid pKVM finalization if KVM initialization fails

   - Add missing BTI instructions in the hypervisor, fixing an early
     boot failure on BTI systems

   - Handle MMU notifiers correctly for non hugepage-aligned memslots

   - Work around a bug in the architecture where hypervisor timer
     controls have UNKNOWN behavior under nested virt

   - Disable preemption in kvm_arch_hardware_enable(), fixing a kernel
     BUG in cpu hotplug resulting from per-CPU accessor sanity checking

   - Make WFI emulation on GICv4 systems robust w.r.t. preemption,
     consistently requesting a doorbell interrupt on vcpu_put()

   - Uphold RES0 sysreg behavior when emulating older PMU versions

   - Avoid macro expansion when initializing PMU register names,
     ensuring the tracepoints pretty-print the sysreg

  s390:

   - Two fixes for asynchronous destroy

  x86 fixes will come early next week"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: s390: pv: fix index value of replaced ASCE
  KVM: s390: pv: simplify shutdown and fix race
  KVM: arm64: Fix the name of sys_reg_desc related to PMU
  KVM: arm64: Correctly handle RES0 bits PMEVTYPER<n>_EL0.evtCount
  KVM: arm64: vgic-v4: Make the doorbell request robust w.r.t preemption
  KVM: arm64: Add missing BTI instructions
  KVM: arm64: Correctly handle page aging notifiers for unaligned memslot
  KVM: arm64: Disable preemption in kvm_arch_hardware_enable()
  KVM: arm64: Handle kvm_arm_init failure correctly in finalize_pkvm
  KVM: arm64: timers: Use CNTHCTL_EL2 when setting non-CNTKCTL_EL1 bits
2023-07-23 10:44:38 -07:00
Paolo Bonzini
675a15f4db KVM/arm64 fixes for 6.5, part #1
- Avoid pKVM finalization if KVM initialization fails
 
  - Add missing BTI instructions in the hypervisor, fixing an early boot
    failure on BTI systems
 
  - Handle MMU notifiers correctly for non hugepage-aligned memslots
 
  - Work around a bug in the architecture where hypervisor timer controls
    have UNKNOWN behavior under nested virt.
 
  - Disable preemption in kvm_arch_hardware_enable(), fixing a kernel BUG
    in cpu hotplug resulting from per-CPU accessor sanity checking.
 
  - Make WFI emulation on GICv4 systems robust w.r.t. preemption,
    consistently requesting a doorbell interrupt on vcpu_put()
 
  - Uphold RES0 sysreg behavior when emulating older PMU versions
 
  - Avoid macro expansion when initializing PMU register names, ensuring
    the tracepoints pretty-print the sysreg.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQSNXHjWXuzMZutrKNKivnWIJHzdFgUCZLWvCAAKCRCivnWIJHzd
 FvATAQDRFeGjnaEnnq2yufHNRcWeMEUgKSg153LUWYaVKYZMOAD+PfbXmCpZPuz3
 5nee77NrjrPHKMm38zMalABuK1qJFQM=
 =A7d0
 -----END PGP SIGNATURE-----

Merge tag 'kvmarm-fixes-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD

KVM/arm64 fixes for 6.5, part #1

 - Avoid pKVM finalization if KVM initialization fails

 - Add missing BTI instructions in the hypervisor, fixing an early boot
   failure on BTI systems

 - Handle MMU notifiers correctly for non hugepage-aligned memslots

 - Work around a bug in the architecture where hypervisor timer controls
   have UNKNOWN behavior under nested virt.

 - Disable preemption in kvm_arch_hardware_enable(), fixing a kernel BUG
   in cpu hotplug resulting from per-CPU accessor sanity checking.

 - Make WFI emulation on GICv4 systems robust w.r.t. preemption,
   consistently requesting a doorbell interrupt on vcpu_put()

 - Uphold RES0 sysreg behavior when emulating older PMU versions

 - Avoid macro expansion when initializing PMU register names, ensuring
   the tracepoints pretty-print the sysreg.
2023-07-23 12:50:14 -04:00
Linus Torvalds
d192f53825 arm64 fixes for -rc3
- Fix saving of SME state after SVE vector length is changed
 
 - Fix sparse warnings for missing vDSO function prototypes
 
 - Fix hibernation resume path when kfence is enabled
 
 - Fix field names for the HFGxTR_EL2 register
 -----BEGIN PGP SIGNATURE-----
 
 iQFEBAABCgAuFiEEPxTL6PPUbjXGY88ct6xw3ITBYzQFAmS6YxAQHHdpbGxAa2Vy
 bmVsLm9yZwAKCRC3rHDchMFjNE+HB/9Jepme+pnScRs5b91+fA6NUYENIk/VkkHo
 sG8IVz44+ME53fX20scZRHZhqlecWJ4z59T3jpPvTAvUUq1ZV2J/l4sKqGfKsgQt
 Mqvd8vZ66dQn7mDA7ENBhax0V0YuYtsshQ4jHgIYvxNi+Ye1nqyLiziFGUhZNpco
 E/YdQuxcx7nAKA5a467NQZD9YRgpgwZLLyxYs2/dJaDCOqlN05Azi2RqaDhHOVtv
 ycu+PBG5SoILJoNxdBXWA5o6eE/0zwkeiWNmHYDpCe7M1J7UcwfE1i/EJ5eihXKt
 XrCWbMQJe9GyS9GVWv7Ywjmuoapp4ZnzNsXt+lUw/lj4/uXOnLg9
 =MjJh
 -----END PGP SIGNATURE-----

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Will Deacon:
 "I've picked up a handful of arm64 fixes while Catalin's been away, so
  here they are. Below is the usual summary, but we have basically have
  two cleanups, a fix for an SME crash and a fix for hibernation:

   - Fix saving of SME state after SVE vector length is changed

   - Fix sparse warnings for missing vDSO function prototypes

   - Fix hibernation resume path when kfence is enabled

   - Fix field names for the HFGxTR_EL2 register"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64/fpsimd: Ensure SME storage is allocated after SVE VL changes
  arm64: vdso: Clear common make C=2 warnings
  arm64: mm: Make hibernation aware of KFENCE
  arm64: Fix HFGxTR_EL2 field naming
2023-07-21 10:24:21 -07:00
Arnd Bergmann
74d964097f Armv8 Juno/Vexpress DTS fix for v6.5
A single simple fix removing dangling symlink left as part of arm dts
 files movement to vendor sub-directories. It is harmless and causes no
 issue for the build but scripts copying files see errors/failures.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEunHlEgbzHrJD3ZPhAEG6vDF+4pgFAmS6anAACgkQAEG6vDF+
 4pi/Aw//dUaZTWYmEEX4Hz5vuZ4C6otJg0HEVhCj6IPaMK9sP/C0hbjn4PXWE6Lu
 O+qXVqIPFncy1a7CcYmfSB2sqtJoaLfM6nDdZW8+EwIIHVj4Uf0BPLytsMinb6Bj
 ze1DYoqRE8RkGFb/yRxc/K26qxkqTodYMeIIiQiGor3qJyAofmi//SjJXX2HhLlN
 TcBcm9tednWBkS24Z35c1w+A5yeXO6YNb92rWXVC1KFz+AevPGG0IZZMrgOD5KQ7
 Eb3wvuFDd2LaFVze1o0jtADc/pU0CWwGXMY/EXK0smezz7RL4hZVNw5IS6HHwxkU
 sjzk7XvwnlqE1gXTZjyQpCii7ImnBO+g9QyC4JCeqnDzLDHlUOKbf9n0X20o11Ot
 Q+2QTFM8bOzxLOeDJybUTFZYHVXMT47VbkwgGMZapPrfR1Y1qmEzk046leXsT17b
 IhUj+puXJyYGKRKrijXRstHRKAx3Gyr9qQw8nMpGBzGCZgqpU3s61tZewS6rKGLd
 d9fzHgDAZMOJRae/f00jgmO2E/XE0J/AGyqNITN3ESrkfp0/avkxID8QdQPP8wmo
 rGZXXJ4WASKa0H9d5TvcA65xDqNn42H+hOX85QmLNJOyamle6Sm4270KMYTnkdWF
 /ylEqtTXIM9X3VEy/JkgVZQg0tl0DKToRRe5Q6aUz/LK4Gkvabg=
 =zAdn
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmS6bh4ACgkQYKtH/8kJ
 Uif1BhAAyfocU8BQ7KcQ+Nuhky+/2Xz9D6PzKSwcTeo3w+Drb/wrCzr3WyJXyYsR
 S92uEa/NRswWVmJkmPT9FeS5wjVJRnEWwUWLEdbPgzQcfcX+1R2jOJABGno7lLCB
 mlHJw0p7v0AjmddcgFawou/wgmhct7jdGZ1+X9JlyCBAjB8uFyYs5GVdFBHx3CP0
 dKqm8SoZ8XLHjgkgCSUMykxiZYT3jhrmHHkxTjvinzB/YjFARrHl3/AApkZoSj8A
 oCHhE8AhdSH2wkrnZ59bpNr22+6cGlG0BbnQdXsAoY7q+hRLGQ7zgZDrP4bgxEus
 fATsRwMyVW8bdLbWkdXoi0P9o9blOCR+L/LjRpL374bkpktB15U8tUiKoGxJR0KS
 heRaxdtj7TSbOmS/rBiHK8F8QDJGVncCUIDWjiRop80ca1dlCy67aj8q2oinBU+f
 Ql/Bw2JeJVWS+J/tXzXsMrdW85k9URq9oDd6ujrubuXqx7FTm0YqiitirsZ9nfYI
 u1JSE+3WvqM4BtbmJkeNRbZfzg0lTDvwx6/StARi0dXJX9qW/8HIGnmWtHSUjHID
 0rL3s6xPjl1eFsg71sjwe0HeRb4uyQ8IHSCs8BTnxL+Ty5fmLCYf7ymQpMRZcO+V
 eAtzy/EfFm2giErGZEbuShCLA4yBgpK1mq5f571tz/8woZybNJ0=
 =gWV7
 -----END PGP SIGNATURE-----

Merge tag 'juno-fix-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes

Armv8 Juno/Vexpress DTS fix for v6.5

A single simple fix removing dangling symlink left as part of arm dts
files movement to vendor sub-directories. It is harmless and causes no
issue for the build but scripts copying files see errors/failures.

* tag 'juno-fix-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux:
  arm64: dts: arm: Remove the dangling vexpress-v2m-rs1.dtsi symlink

Link: https://lore.kernel.org/r/20230721112359.3369716-1-sudeep.holla@arm.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-07-21 13:38:06 +02:00
Mark Brown
d4d5be94a8 arm64/fpsimd: Ensure SME storage is allocated after SVE VL changes
When we reconfigure the SVE vector length we discard the backing storage
for the SVE vectors and then reallocate on next SVE use, leaving the SME
specific state alone. This means that we do not enable SME traps if they
were already disabled. That means that userspace code can enter streaming
mode without trapping, putting the task in a state where if we try to save
the state of the task we will fault.

Since the ABI does not specify that changing the SVE vector length disturbs
SME state, and since SVE code may not be aware of SME code in the process,
we shouldn't simply discard any ZA state. Instead immediately reallocate
the storage for SVE, and disable SME if we change the SVE vector length
while there is no SME state active.

Disabling SME traps on SVE vector length changes would make the overall
code more complex since we would have a state where we have valid SME state
stored but might get a SME trap.

Fixes: 9e4ab6c891 ("arm64/sme: Implement vector length configuration prctl()s")
Reported-by: David Spickett <David.Spickett@arm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230720-arm64-fix-sve-sme-vl-change-v2-1-8eea06b82d57@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
2023-07-21 11:11:09 +01:00
Oliver Upton
733c758e50 KVM: arm64: Rephrase percpu enable/disable tracking in terms of hyp
kvm_arm_hardware_enabled is rather misleading, since it doesn't track
the state of all hardware resources needed for running a VM. What it
actually tracks is whether or not the hyp cpu context has been
initialized.

Since we're now at the point where vgic + timer irq management has
been separated from kvm_arm_hardware_enabled, rephrase it (and the
associated helpers) to make it clear what state is being tracked.

Acked-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230719231855.262973-1-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
2023-07-20 17:17:32 +00:00
Raghavendra Rao Ananta
c718ca0e99 KVM: arm64: Fix hardware enable/disable flows for pKVM
When running in protected mode, the hyp stub is disabled after pKVM is
initialized, meaning the host cannot enable/disable the hyp at
runtime. As such, kvm_arm_hardware_enabled is always 1 after
initialization, and kvm_arch_hardware_enable() never enables the vgic
maintenance irq or timer irqs.

Unconditionally enable/disable the vgic + timer irqs in the respective
calls, instead relying on the percpu bookkeeping in the generic code
to keep track of which cpus have the interrupts unmasked.

Fixes: 466d27e48d ("KVM: arm64: Simplify the CPUHP logic")
Reported-by: Oliver Upton <oliver.upton@linux.dev>
Suggested-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Raghavendra Rao Ananta <rananta@google.com>
Link: https://lore.kernel.org/r/20230719175400.647154-1-rananta@google.com
Acked-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
2023-07-20 17:16:56 +00:00
Zhen Lei
71e06e1ace arm64: vdso: Clear common make C=2 warnings
make C=2 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- xxx.o

When I use the command above to do a 'make C=2' check on any object file,
the following warnings are always output:

  CHECK   arch/arm64/kernel/vdso/vgettimeofday.c
arch/arm64/kernel/vdso/vgettimeofday.c:9:5: warning:
 symbol '__kernel_clock_gettime' was not declared. Should it be static?
arch/arm64/kernel/vdso/vgettimeofday.c:15:5: warning:
 symbol '__kernel_gettimeofday' was not declared. Should it be static?
arch/arm64/kernel/vdso/vgettimeofday.c:21:5: warning:
 symbol '__kernel_clock_getres' was not declared. Should it be static?

Therefore, the declaration of the three functions is added to eliminate
these common warnings to provide a clean output.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Link: https://lore.kernel.org/r/20230713115831.777-1-thunder.leizhen@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
2023-07-20 11:48:26 +01:00
Nikhil V
a8bd38dbc5 arm64: mm: Make hibernation aware of KFENCE
In the restore path, swsusp_arch_suspend_exit uses copy_page() to
over-write memory. However, with features like KFENCE enabled, there could
be situations where it may have marked some pages as not valid, due to
which it could be reported as invalid accesses.

Consider a situation where page 'P' was part of the hibernation image.
Now, when the resume kernel tries to restore the pages, the same page 'P'
is already in use in the resume kernel and is kfence protected, due to
which its mapping is removed from linear map. Since restoring pages happens
with the resume kernel page tables, we would end up accessing 'P' during
copy and results in kernel pagefault.

The proposed fix tries to solve this issue by marking PTE as valid for such
kfence protected pages.

Co-developed-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
Signed-off-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
Signed-off-by: Nikhil V <quic_nprakash@quicinc.com>
Link: https://lore.kernel.org/r/20230713070757.4093-1-quic_nprakash@quicinc.com
Signed-off-by: Will Deacon <will@kernel.org>
2023-07-20 11:44:50 +01:00