Commit Graph

1184651 Commits

Author SHA1 Message Date
Linus Torvalds 7df047b3f0 VFIO updates for v6.4-rc1
- Expose and allow R/W access to the PCIe DVSEC capability through
    vfio-pci, as we already do with the legacy vendor capability.
    (K V P Satyanarayana)
 
  - Fix kernel-doc issues with structure definitions. (Simon Horman)
 
  - Clarify ordering of operations relative to the kvm-vfio device for
    driver dependencies against the kvm pointer. (Yi Liu)
 -----BEGIN PGP SIGNATURE-----
 
 iQJPBAABCAA5FiEEQvbATlQL0amee4qQI5ubbjuwiyIFAmRRPjAbHGFsZXgud2ls
 bGlhbXNvbkByZWRoYXQuY29tAAoJECObm247sIsiePoQAJkUBO4bN3BvTG3iOkh1
 vGrD3llhoUeD3AetT+5Y7pX0ml6wx9SLjcuFIUyYDMomLebpFXQAlI3gjE5eGbnf
 PVfn6zJDrcA5w2tFwkJHUnN+RgcaPW5tiviP6XkRFpS95HCQRsFdp9GhI2U3X7q7
 1G1pTV4Fb6BPhU0zAOueW1HKovTFDi3qbzaG5JjosdZc8V32/USQ6ekkXSGMbuzN
 HsqLi2ujrtwAYluNKGxsuiDKXBFT8z8Mji7S9Z8RqoR0IF9q8JMUC0UMImn/XhKN
 4XgCsibPt4o+RSStAf3vUPoP1l3I5J+3dE4ynLiHN8mNmbJ2gCLzQx18Dfww3V9n
 Ao8wdwZvvskfc+gkEJAh47OFf9GvCvvHtg3uZS9KPDidS3uY8K4ooIr4Pv1F+QMh
 rcnjZRFCakPB2tijmtg+1/0dY5/YEAn0mYWQ8ph5Ips36q30WBrbhBLJ47wE6PZ0
 bsChcCU+4wK9e20lzMewa9QYnrRkvjGbmIo3GnjyPt4aG0VM08orIePy7ZVen3S3
 +ieXBbuW61BLN/fZBFrDB4IxmekWq2TkkxSQCe8rn+jgs7qUUlFzn34Iqna6QTQV
 pG+O3pyflULZGZHkij4lOn1i2SqqbLxZofYose9hHq5r6ALD5EFNg3QVLuiAc7Tb
 3ctmfePHowrzKMyHMlXb8DE7
 =Ylh5
 -----END PGP SIGNATURE-----

Merge tag 'vfio-v6.4-rc1' of https://github.com/awilliam/linux-vfio

Pull VFIO updates from Alex Williamson:

 - Expose and allow R/W access to the PCIe DVSEC capability through
   vfio-pci, as we already do with the legacy vendor capability
   (K V P Satyanarayana)

 - Fix kernel-doc issues with structure definitions (Simon Horman)

 - Clarify ordering of operations relative to the kvm-vfio device for
   driver dependencies against the kvm pointer (Yi Liu)

* tag 'vfio-v6.4-rc1' of https://github.com/awilliam/linux-vfio:
  docs: kvm: vfio: Suggest KVM_DEV_VFIO_GROUP_ADD vs VFIO_GROUP_GET_DEVICE_FD ordering
  vfio: correct kdoc for ops structures
  vfio/pci: Add DVSEC PCI Extended Config Capability to user visible list.
2023-05-02 11:56:43 -07:00
Linus Torvalds 21d2be6460 AFS fixes
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEqG5UsNXhtOCrfGQP+7dXa6fLC2sFAmRRU+QACgkQ+7dXa6fL
 C2ujORAAgYRY+jNv0a4xV2tgekLL/Y3N6ARMm+85X+luLYtPRehDhhroO/85Bnc+
 ajxUGObY1aNLZBXu4Oz8XAzb/EAwjLbvXqMzVuNqNq/a8YzysPYlSByKLzORU9dl
 ZCFMa3O+etV3LxkjLUCgQ/7MAR94vniIrqcHLg5pcMV4dUXSXVEJqZktntISQvRV
 bMgktcGo65q8/diCL0VX3D+3/eemWOIMUHLP4yhm0G1RKVv1QDdTf9gq7/JqjkMR
 02+e/HD0Ezt0OXoP72tUR2d+6DUiifRJjWpB2hPHaab1eKJWvG2Y4Iy+A5oZJQGZ
 2+Tmq5nJkbF82sgQQ9BwqK6dtLzibKFQlddcDZlSEm/yYxrv45hVrqSjvsDp1YKP
 ZH6vJqVMiQh8hXYYL9J+AtyIhPil6u7hxoyLosmrbECZhJzJd/gOO5U4XMfYPY73
 zdeKSFpCmJ7E9EbW1F55zuQeZcRX3m0hSvfdfQ/65z7K777O8NlUWMeefzYqMwt5
 VRKr5XY0Pkdp4cF8tAuMe9PT+9ZFrIOn6l6rqGsHvGv3N25T+0FVZd98WxF8mOrE
 6L+9WQoGM4XTuAEviVSOJJacZv/mErPrau0O4jmN26RYAacLI7jD+SgozFeahck1
 PKXStSx2PF7M7/sOnS+JSwph9qsx25icrby7hJkvpv4fGAqJ4Zs=
 =tpZl
 -----END PGP SIGNATURE-----

Merge tag 'afs-fixes-20230502' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs

Pull AFS updates from David Howells:
 "Three fixes to AFS directory handling:

   - Make sure that afs_read_dir() sees any increase in file size if the
     file unexpectedly changed on the server (e.g. due to another client
     making a change).

   - Make afs_getattr() always return the server's dir file size, not
     the locally edited one, so that pagecache eviction doesn't cause
     the dir file size to change unexpectedly.

   - Prevent afs_read_dir() from getting into an endless loop if the
     server indicates that the directory file size is larger than
     expected"

* tag 'afs-fixes-20230502' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
  afs: Avoid endless loop if file is larger than expected
  afs: Fix getattr to report server i_size on dirs, not local size
  afs: Fix updating of i_size with dv jump from server
2023-05-02 11:23:08 -07:00
Linus Torvalds d7b3ffe2d7 - Fix-ups
- Add / improve Device Tree bindings
    - Convert (int) .remove functions to (void) .remove_new
    - Rid 'defined but not used' warnings
    - Remove ineffective casts and pointer stubs
    - Use specifically crafted API for testing DT property presence
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmRROoEACgkQUa+KL4f8
 d2EVfg/+Jo98pBsZYdXFDgO7pbucan4c9KdybW+XCeTw6zGNVINjnB+6Ne+w57Mz
 YPRrWwUmSfKl0PUSF+xc2LoS9mLTLqpnvUPyppyEhNZOpHUdrgBcvzVfkZNk7gYF
 sRBCxCBbRauVcktixoNJsHWGntXz2XkKgOgOrcz8N7SoLAZdsHZ1YHcDwRy5z0ZX
 D18hGX2N8JD+5cKeEp2GiUCCymB9rwYUbNmot3JGyQ5WuDY65qgfZCM9ucWm/8OY
 44a7xT+MVIfxRUXifcvKetlJs9a/zDtUmsgblG8Un66hut2iz19110awB5hjm6qn
 2/4HmJU9nPn3gLN/lLqE8fMQWcvrngwm+xaeb/p0YhYdMFKa1EbuO/VMWSE3b0q6
 NQOq/eSaeRb+OK1tL7Hl2aRFmsTFtDZytNt3SPSJRJJs9XLDfHGqh5HtEcu+Y5Zm
 MQPqT12ruQXTIrxM6qo4Pc2lLDMCnLlfFYcDOf90ohAxzd1Jn/UWJhQDeAvlAZc5
 QegQXGNJgPs92ZP3ybHGoTcOttZ9Iq/ojn5m7Md5DcSG+XMe2pa+cLu6Mo5dWMs0
 xcMdmR+hXkjFDQTxBzi1QFrogSP5ghctH+6aihHRHS4+qcpw12jfAv6/VVN21jNB
 W2tguz5PuxkHEsTcrTDYQJhBOpVRuAFohGnZ3ivjPEoTZ6bJzpo=
 =rzcx
 -----END PGP SIGNATURE-----

Merge tag 'backlight-next-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight

Pull backlight updates from Lee Jones:
 "Fix-ups:
   - Add / improve Device Tree bindings
   - Convert (int) .remove functions to (void) .remove_new
   - Rid 'defined but not used' warnings
   - Remove ineffective casts and pointer stubs
   - Use specifically crafted API for testing DT property presence"

* tag 'backlight-next-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight:
  backlight: as3711: Use of_property_read_bool() for boolean properties
  backlight: hx8357: Use of_property_present() for testing DT property presence
  backlight: arcxcnn_bl: Drop of_match_ptr for ID table
  backlight: lp855x: Mark OF related data as maybe unused
  backlight: sky81452-backlight: Convert to platform remove callback returning void
  backlight: rt4831-backlight: Convert to platform remove callback returning void
  backlight: qcom-wled: Convert to platform remove callback returning void
  backlight: pwm_bl: Convert to platform remove callback returning void
  backlight: mt6370-backlight: Convert to platform remove callback returning void
  backlight: lp8788_bl: Convert to platform remove callback returning void
  backlight: lm3533_bl: Convert to platform remove callback returning void
  backlight: led_bl: Convert to platform remove callback returning void
  backlight: hp680_bl: Convert to platform remove callback returning void
  backlight: da9052_bl: Convert to platform remove callback returning void
  backlight: cr_bllcd: Convert to platform remove callback returning void
  backlight: adp5520_bl: Convert to platform remove callback returning void
  backlight: aat2870_bl: Convert to platform remove callback returning void
  backlight: qcom-wled: Add PMI8950 compatible
2023-05-02 10:46:11 -07:00
Linus Torvalds 3af49062b0 - New Drivers
- Add support for  Renesas RZ/G2L MTU3
 
  - New Device Support
    - Add support for Lenovo Yoga Book X90F to Intel CHT WC
    - Add support for MAX5970 and MAX5978 to Simple MFD (I2C)
    - Add support for Meteor Lake PCH-S LPSS PCI to Intel LPSS PCI
    - Add support for AXP15060 PMIC to X-Powers PMIC collection
 
  - Remove Device Support
    - Remove support for Samsung 5M8751 and S5M8763 PMIC devices
 
  - New Functionality
    - Convert deprecated QCOM IRQ Chip to config registers
    - Add support for 32-bit address spaces to Renesas SMUs
 
  - Fix-ups
    - Make use of APIs / MACROs designed to simplify and demystify
    - Add / improve Device Tree bindings
    - Memory saving struct layout optimisations
    - Remove old / deprecated functionality
    - Factor out unassigned register addresses from ranges
    - Trivial: Spelling fixes, renames and coding style fixes
    - Rid 'defined but not used' warnings
    - Remove ineffective casts and pointer stubs
 
  - Bug Fixes
    - Fix incorrectly non-inverted mask/unmask IRQs on QCOM platforms
    - Remove MODULE_*() helpers from non-tristate drivers
    - Do not attempt to use out-of-range memory addresses associated with io_base
    - Provide missing export helpers
    - Fix remap bulk read optimisation fallout
    - Fix memory leak issues in error paths
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmRROFAACgkQUa+KL4f8
 d2E9OxAAtG4Ac/I8Cp/VsTGGn5/pxxMnY/AWmdfkexp8bDQSvavKKQZ2wEwgFaTW
 GVaOIuWpG82fdoIAm1SkLs/gjPbXLnDJlxv8UcYa3kMQik/iiwrWl4zN2KBZqIIX
 qdg7fZNVAhi/qjue1YCHxKjMB80kK2LBTfwly+mbOXWMOBmoDh957oFuNBAa9W/A
 QxN9ckU/yVMjpeZQ1M97g/nUu+lKMypcCNHm1hklzqbchqgUiefdYS6t+g7zBgff
 zvwrlo+Tt0oIef95+TVmiVQBWJ+Cf8ssZphyL9I5dUH1Ft16BsNZYVvD1Eur1WGf
 N7szGDBZoqK5I6uUJ2t4+xiE4Mh1r+TIoCZuSwpDWS5IRKiWxTTZ9aDTXTKbnVKK
 Ov5SA3cdC2McXa0NCXB/47HzDTXhffH0SQ9x3JKlba2crSKt7LicVhjeflMOcHw+
 HuTzg3imeMQriLVrVcvgce+YOcF3G/bFX9jvxnp8WFY+MLKuTYCGqoUfY6EF6r4i
 F0Y6DmYDBGX3rND+zvXDVMjS+RymYTSMtY9PKOXEdY1WU9E8GAHSKhrOCyCO3aIm
 PZRC2GAzGQ5fRCkyXusk0kxJqBBxu1My/wUQ9xRjdMKszFxEgVVFIY7KLwanY5vW
 2akDnwOtu+37G9Qm4h2TpQdNLGTldZbbFcWrYGKzbNrVOjYw824=
 =EBtX
 -----END PGP SIGNATURE-----

Merge tag 'mfd-next-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
 "New Drivers:
   - Add support for  Renesas RZ/G2L MTU3

  New Device Support:
   - Add support for Lenovo Yoga Book X90F to Intel CHT WC
   - Add support for MAX5970 and MAX5978 to Simple MFD (I2C)
   - Add support for Meteor Lake PCH-S LPSS PCI to Intel LPSS PCI
   - Add support for AXP15060 PMIC to X-Powers PMIC collection

  Remove Device Support:
   - Remove support for Samsung 5M8751 and S5M8763 PMIC devices

  New Functionality:
   - Convert deprecated QCOM IRQ Chip to config registers
   - Add support for 32-bit address spaces to Renesas SMUs

  Fix-ups:
   - Make use of APIs / MACROs designed to simplify and demystify
   - Add / improve Device Tree bindings
   - Memory saving struct layout optimisations
   - Remove old / deprecated functionality
   - Factor out unassigned register addresses from ranges
   - Trivial: Spelling fixes, renames and coding style fixes
   - Rid 'defined but not used' warnings
   - Remove ineffective casts and pointer stubs

  Bug Fixes:
   - Fix incorrectly non-inverted mask/unmask IRQs on QCOM platforms
   - Remove MODULE_*() helpers from non-tristate drivers
   - Do not attempt to use out-of-range memory addresses associated with io_base
   - Provide missing export helpers
   - Fix remap bulk read optimisation fallout
   - Fix memory leak issues in error paths"

* tag 'mfd-next-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (88 commits)
  dt-bindings: mfd: ti,j721e-system-controller: Add SoC chip ID
  leds: bd2606mvv: Driver for the Rohm 6 Channel i2c LED driver
  dt-bindings: mfd: qcom,spmi-pmic: Document flash LED controller
  dt-bindings: mfd: x-powers,axp152: Document the AXP15060 variant
  mfd: axp20x: Add support for AXP15060 PMIC
  dt-bindings: mfd: x-powers,axp152: Document the AXP313a variant
  counter: rz-mtu3-cnt: Unlock on error in rz_mtu3_count_ceiling_write()
  dt-bindings: mfd: dlg,da9063: Document voltage monitoring
  dt-bindings: mfd: stm32: Remove unnecessary blank lines
  dt-bindings: mfd: qcom,spmi-pmic: Use generic ADC node name in examples
  dt-bindings: mfd: syscon: Add nuvoton,ma35d1-sys compatible
  MAINTAINERS: Add entries for Renesas RZ/G2L MTU3a counter driver
  counter: Add Renesas RZ/G2L MTU3a counter driver
  Documentation: ABI: sysfs-bus-counter: add cascade_counts_enable and external_input_phase_clock_select
  mfd: Add Renesas RZ/G2L MTU3a core driver
  dt-bindings: timer: Document RZ/G2L MTU3a bindings
  mfd: rsmu_i2c: Convert to i2c's .probe_new() again
  mfd: intel-lpss: Add Intel Meteor Lake PCH-S LPSS PCI IDs
  mfd: dln2: Fix memory leak in dln2_probe()
  mfd: axp20x: Fix axp288 writable-ranges
  ...
2023-05-02 10:41:31 -07:00
Linus Torvalds c5eb8bf767 - New Drivers
- Add support for MediaTek MT6370 LED Indicator
    - Add support for MediaTek MT6370 Flashlight
    - Add support for QCOM PMIC Flash
    - Add support for Rohm BD2606MVV Charge Pump LED
 
  - New Device Support
    - Add support for PMK8550 PWM to QCOM LPG
 
  - New Functionality
    - Add support for high resolution PWM to QCOM LPG
 
  - Fix-ups
    - Kconfig 'depends' and 'select' dependency changes
    - Remove unused / irrelevant includes
    - Remove unnecessary checks (already performed further into the call stack)
    - Trivial: Fix commentary, simplify error messages
    - Rid 'defined but not used' warnings
    - Provide documentation
    - Explicitly provide include files
 
  - Bug Fixes
    - Mark GPIO LED as BROKEN
    - Fix Kconfig entries
    - Fix various Smatch staticify reports
    - Fix error handling (or a lack there of)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmRRONwACgkQUa+KL4f8
 d2Er8w/+Iu6LK+NvxSvELKzyuUw8gsJxCmAYSTFc2ywjFKPJK91giAXYBhvFFhlv
 mduJkO+Mbz3yFdXTmG3OjTs/K9J/XIjOl0mB4FTWLsthyytJwUbZIdr9La60/LF/
 0ExWCI3lRPEFLC1kbODmgpDrBmlegqH5vzvGStmy3r4HbDvBVXl1No5ArWYXMof1
 e4W7p0tCQNOKaSDLpbQNcFzZ5682h/CY/+R6UQzTiI+6/3g+3IqHa4qqtcXGI0Tk
 7UtPuGd5f7Gm+1iQO+gxXAlOPictOI5SfHIVWJqtfAEY4RetBulyxkOaG+dw/LN3
 pp77yF6b4DU7P89jb/cKL1lD5y3SCYJpNwZrkkytGDqeS4C2J218RTPGzvrJLAtj
 tNa65SC7fM6Qh/Mv8b5A7wMrysAF2JAusP8UEBamVNlyt2jTY/MwO3EgTNVFuNGo
 um88Cia1BIQMSej0GpRFbOqflbrGEVqJjh/ag7ftGp9jnO4gmCSB5LuNN6QGhtQ8
 0T2agMZ9udd2nNKlgbfxvAM+rqGq0/KSgX6nt7XRDDfw5rOI5YZORUFNmo4IKVyx
 bfzPW8QOpL6fbtfbFktJDgndV4bKJ1zRLUgk9PhfL23tiSo3HuC+0NdFqG0UCaEy
 RnNm8k4Q5SD+OfnzstMF9Zq0cXWCjFm7QVVElRBSFs/fzP5iHfE=
 =aJQw
 -----END PGP SIGNATURE-----

Merge tag 'leds-next-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds

Pull LED updates from Lee Jones:
 "New Drivers:
   - Add support for MediaTek MT6370 LED Indicator
   - Add support for MediaTek MT6370 Flashlight
   - Add support for QCOM PMIC Flash
   - Add support for Rohm BD2606MVV Charge Pump LED

  New Device Support:
   - Add support for PMK8550 PWM to QCOM LPG

  New Functionality:
   - Add support for high resolution PWM to QCOM LPG

  Fix-ups:
   - Kconfig 'depends' and 'select' dependency changes
   - Remove unused / irrelevant includes
   - Remove unnecessary checks (already performed further into the call stack)
   - Trivial: Fix commentary, simplify error messages
   - Rid 'defined but not used' warnings
   - Provide documentation
   - Explicitly provide include files

  Bug Fixes:
   - Mark GPIO LED as BROKEN
   - Fix Kconfig entries
   - Fix various Smatch staticify reports
   - Fix error handling (or a lack there of)"

* tag 'leds-next-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds: (30 commits)
  leds: bd2606mvv: Driver for the Rohm 6 Channel i2c LED driver
  dt-bindings: leds: Add ROHM BD2606MVV LED
  docs: leds: ledtrig-oneshot: Fix spelling mistake
  leds: pwm-multicolor: Simplify an error message
  dt-bindings: leds: Convert PCA9532 to dtschema
  leds: rgb: leds-qcom-lpg: Add support for PMK8550 PWM
  leds: rgb: leds-qcom-lpg: Add support for high resolution PWM
  dt-bindings: leds-qcom-lpg: Add qcom,pmk8550-pwm compatible string
  leds: tca6507: Fix error handling of using fwnode_property_read_string
  leds: flash: Set variables mvflash_{3,4}ch_regs storage-class-specifier to static
  leds: rgb: mt6370: Correct config name to select in LEDS_MT6370_RGB
  MAINTAINERS: Add entry for LED devices documentation
  Documentation: leds: MT6370: Use bullet lists for timing variables
  Documentation: leds: mt6370: Properly wrap hw_pattern chart
  Documentation: leds: Add MT6370 doc to the toctree
  leds: rgb: mt6370: Fix implicit declaration for FIELD_GET
  docs: leds: Add MT6370 RGB LED pattern document
  leds: flash: mt6370: Add MediaTek MT6370 flashlight support
  leds: rgb: mt6370: Add MediaTek MT6370 current sink type LED Indicator support
  dt-bindings: leds: spmi-flash-led: Add pm6150l compatible
  ...
2023-05-02 10:36:02 -07:00
Carlos Bilbao cdc822dda6 docs/sp_SP: Add translation of process/adding-syscalls
Translate Documentation/process/adding-syscalls.rst into Spanish.

Co-developed-by: Mauricio Fuentes <mauriciofb@gmail.com>
Signed-off-by: Mauricio Fuentes <mauriciofb@gmail.com>
Signed-off-by: Carlos Bilbao <carlos.bilbao@amd.com>
Link: https://lore.kernel.org/r/20230315143526.1213813-1-carlos.bilbao@amd.com
2023-05-02 11:09:53 -06:00
Mat Martineau 37c95f3a3d CREDITS: Update email address for Mat Martineau
Changing my email address in CREDITS to be consistent with what's in use
in MAINTAINERS and mailmap. Also removed extra date information from the
CREDITS entry since I'm a maintainer for MPTCP again.

Signed-off-by: Mat Martineau <martineau@kernel.org>
Link: https://lore.kernel.org/r/20230502000545.2899055-1-martineau@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2023-05-02 11:00:46 -06:00
晏艳(采苓) 530421acae Documentation: update kernel stack for x86_64
Commit 6538b8ea88 ("x86_64: expand kernel stack to 16K")
expanded kernel stack for x86_64 but left the wrong documentation,
update it.

Signed-off-by: Yan Yan <yanyan.yan@antgroup.com>
Reviewed-by: Lai Jiangshan <jiangshanlai@gmail.com>
Link: https://lore.kernel.org/r/20230328072537.20188-1-yanyan.yan@antgroup.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2023-05-02 10:59:47 -06:00
Tao Liu 4a2d80ad06 docs: Remove unnecessary unicode character
There is a non-printable unicode char '\u202a' or "0xe2 0x80 0xaa" in hex
in the translation doc. It is unnecessary and should be removed for better
text formatting when using editors like vi.

Signed-off-by: Tao Liu <ltao@redhat.com>
Reviewed-by: Yanteng Si <siyanteng@loongson.cn>
Link: https://lore.kernel.org/r/20230426021452.9745-1-ltao@redhat.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2023-05-02 10:55:21 -06:00
Deming Wang be8ca5f4bc docs: fix "Reviewd" typo
Spell "Reviewed" properly in Documentation/Translations/jp/SubmittingPatches

Signed-off-by: Deming Wang <wangdeming@inspur.com>
Reviewed-by: Akira Yokosawa <akiyks@gmail.com>
Link: https://lore.kernel.org/r/20230502010157.1655-1-wangdeming@inspur.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2023-05-02 10:52:33 -06:00
Geert Uytterhoeven 4c093cbb89 Documentation: timers: hrtimers: Make hybrid union historical
Non-scalar time was removed from the ktime hybrid union in v3.17, and
the union itself followed suit in v4.10.

Make it clear that ktime_t is always a 64bit scalar type, to avoid
confusing the casual reader.

While at it, fix a spelling mistake.

Fixes: 24e4a8c3e8 ("ktime: Kill non-scalar ktime_t implementation for 2038")
Fixes: 2456e85535 ("ktime: Get rid of the union")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/59250a3d1c2c827b5c1833169a6e652ca6a784e6.1683021785.git.geert+renesas@glider.be
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2023-05-02 10:49:58 -06:00
Marc Dionne 9ea4eff4b6 afs: Avoid endless loop if file is larger than expected
afs_read_dir fetches an amount of data that's based on what the inode
size is thought to be.  If the file on the server is larger than what
was fetched, the code rechecks i_size and retries.  If the local i_size
was not properly updated, this can lead to an endless loop of fetching
i_size from the server and noticing each time that the size is larger on
the server.

If it is known that the remote size is larger than i_size, bump up the
fetch size to that size.

Fixes: f3ddee8dc4 ("afs: Fix directory handling")
Signed-off-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-afs@lists.infradead.org
2023-05-02 17:23:50 +01:00
David Howells 45f66fa03b afs: Fix getattr to report server i_size on dirs, not local size
Fix afs_getattr() to report the server's idea of the file size of a
directory rather than the local size.  The local size may differ as we edit
the local copy to avoid having to redownload it and we may end up with a
differently structured blob of a different size.

However, if the directory is discarded from the pagecache we then download
it again and the user may see the directory file size apparently change.

Fixes: 63a4681ff3 ("afs: Locally edit directory data for mkdir/create/unlink/...")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
2023-05-02 17:17:42 +01:00
Marc Dionne d7f74e9a91 afs: Fix updating of i_size with dv jump from server
If the data version returned from the server is larger than expected,
the local data is invalidated, but we may still want to note the remote
file size.

Since we're setting change_size, we have to also set data_changed
for the i_size to get updated.

Fixes: 3f4aa98181 ("afs: Fix EOF corruption")
Signed-off-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-afs@lists.infradead.org
2023-05-02 17:08:18 +01:00
Fangrui Song 0fddb79bf2 arm64: lds: move .got section out of .text
Currently, the .got section is placed within the output section .text.
However, when .got is non-empty, the SHF_WRITE flag is set for .text
when linked by lld. GNU ld recognizes .text as a special section and
ignores the SHF_WRITE flag. By renaming .text, we can also get the
SHF_WRITE flag.

The kernel has performed R_AARCH64_RELATIVE resolving very early, and can
then assume that .got is read-only. Let's move .got to the vmlinux_rodata
pseudo-segment.

As Ard Biesheuvel notes:

"This matters to consumers of the vmlinux ELF representation of the
kernel image, such as syzkaller, which disregards writable PT_LOAD
segments when resolving code symbols. The kernel itself does not care
about this distinction, but given that the GOT contains data and not
code, it does not require executable permissions, and therefore does
not belong in .text to begin with."

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Fangrui Song <maskray@google.com>
Link: https://lore.kernel.org/r/20230502074105.1541926-1-maskray@google.com
Signed-off-by: Will Deacon <will@kernel.org>
2023-05-02 13:12:45 +01:00
ndesaulniers@google.com 4df69e0df2 arm64: kernel: remove SHF_WRITE|SHF_EXECINSTR from .idmap.text
commit d54170812e ("arm64: fix .idmap.text assertion for large kernels")
modified some of the section assembler directives that declare
.idmap.text to be SHF_ALLOC instead of
SHF_ALLOC|SHF_WRITE|SHF_EXECINSTR.

This patch fixes up the remaining stragglers that were left behind.  Add
Fixes tag so that this doesn't precede related change in stable.

Fixes: d54170812e ("arm64: fix .idmap.text assertion for large kernels")
Reported-by: Greg Thelen <gthelen@google.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://lore.kernel.org/r/20230428-awx-v2-1-b197ffa16edc@google.com
Signed-off-by: Will Deacon <will@kernel.org>
2023-05-02 12:42:22 +01:00
Kristina Martsenko eda081d2ef arm64: cpufeature: Fix pointer auth hwcaps
The pointer auth hwcaps are not getting reported to userspace, as they
are missing the .matches field. Add the field back.

Fixes: 876e3c8efe ("arm64/cpufeature: Pull out helper for CPUID register definitions")
Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230428132546.2513834-1-kristina.martsenko@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
2023-05-02 12:41:45 +01:00
Conor Dooley c2d3c8441e
RISC-V: include cpufeature.h in cpufeature.c
Automation complains:
warning: symbol '__pcpu_scope_misaligned_access_speed' was not declared. Should it be static?

cpufeature.c doesn't actually include the header of the same name, as it
had not previously used anything from it.
The per-cpu variable is declared there, so include it to silence the
complaints.

Fixes: 62a31d6e38 ("RISC-V: hwprobe: Support probing of misaligned access performance")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Evan Green <evan@rivosinc.com>
Link: https://lore.kernel.org/r/20230420-wound-gizzard-2b2b589d9bea@spud
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-05-01 17:19:27 -07:00
Linus Torvalds 865fdb0819 Input updates for 6.4 merge window:
- a new driver for Novatek touch controllers
 
 - a new driver for power button for NXP BBNSM
 
 - a skeleton KUnit tests for the input core
 
 - improvements to Xpad game controller driver to support more devices
 
 - improvements to edt-ft5x06, hideep and other drivers
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQST2eWILY88ieB2DOtAj56VGEWXnAUCZFBJ4wAKCRBAj56VGEWX
 nCsZAQDg5OKPAcJEOastqdbGoq1AaPaZ4Zu92R3iiV3Lc11KlgEA0Bjf/MlqFMas
 uK4eMRq6MkqlIjS0bO9Pt0VQRajGsAg=
 =XMM5
 -----END PGP SIGNATURE-----

Merge tag 'input-for-v6.4-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

Pull input updates from Dmitry Torokhov:

 - a new driver for Novatek touch controllers

 - a new driver for power button for NXP BBNSM

 - a skeleton KUnit tests for the input core

 - improvements to Xpad game controller driver to support more devices

 - improvements to edt-ft5x06, hideep and other drivers

* tag 'input-for-v6.4-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (42 commits)
  Revert "Input: xpad - fix support for some third-party controllers"
  dt-bindings: input: pwm-beeper: convert to dt schema
  Input: xpad - fix PowerA EnWired Controller guide button
  Input: xpad - add constants for GIP interface numbers
  Input: synaptics-rmi4 - fix function name in kerneldoc
  Input: raspberrypi-ts - fix refcount leak in rpi_ts_probe
  Input: edt-ft5x06 - select REGMAP_I2C
  Input: melfas_mip4 - report palm touches
  Input: cma3000_d0x - remove unneeded code
  Input: edt-ft5x06 - calculate points data length only once
  Input: edt-ft5x06 - unify the crc check
  Input: edt-ft5x06 - convert to use regmap API
  Input: edt-ft5x06 - don't print error messages with dev_dbg()
  Input: edt-ft5x06 - remove code duplication
  Input: edt-ft5x06 - don't recalculate the CRC
  Input: edt-ft5x06 - add spaces to ensure format specification
  Input: edt-ft5x06 - remove unnecessary blank lines
  Input: edt-ft5x06 - fix indentation
  Input: tsc2007 - enable cansleep pendown GPIO
  Input: Add KUnit tests for some of the input core helper functions
  ...
2023-05-01 17:18:56 -07:00
Alexandre Ghiti 4db9e253e7
riscv: Move .rela.dyn to the init sections
The recent introduction of relocatable kernels prepared the move of
.rela.dyn to the init section, but actually forgot to do so, so do it
here.

Before this patch: "Freeing unused kernel image (initmem) memory: 2592K"
After this patch:  "Freeing unused kernel image (initmem) memory: 6288K"

The difference corresponds to the size of the .rela.dyn section:
"[42] .rela.dyn         RELA             ffffffff8197e798  0127f798
       000000000039c660  0000000000000018   A      47     0     8"

Fixes: 559d1e45a1 ("riscv: Use --emit-relocs in order to move .rela.dyn in init")
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/20230428120932.22735-1-alexghiti@rivosinc.com
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-05-01 17:00:32 -07:00
Conor Dooley 41ebfc91f7
dt-bindings: riscv: explicitly mention assumption of Zicsr & Zifencei support
The dt-binding was defined before the extraction of csr access and
fence.i into their own extensions, and thus the presence of the I
base extension implies Zicsr and Zifencei.
There's no harm in adding them obviously, but for backwards
compatibility with DTs that existed prior to that extraction, software
is unable to differentiate between "i" and "i_zicsr_zifencei" without
any further information.

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230427-fence-blurred-c92fb69d4137@wendy
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-05-01 16:57:18 -07:00
Guo Ren f9c4bbddec
riscv: compat_syscall_table: Fixup compile warning
../arch/riscv/kernel/compat_syscall_table.c:12:41: warning: initialized
field overwritten [-Woverride-init]
   12 | #define __SYSCALL(nr, call)      [nr] = (call),
      |                                         ^
../include/uapi/asm-generic/unistd.h:567:1: note: in expansion of macro
'__SYSCALL'
  567 | __SYSCALL(__NR_semget, sys_semget)

Fixes: 59c10c52f5 ("riscv: compat: syscall: Add compat_sys_call_table implementation")
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Reported-by: kernel test robot <lkp@intel.com>
Tested-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Guo Ren <guoren@kernel.org>
Signed-off-by: Drew Fustini <dfustini@baylibre.com>
Link: https://lore.kernel.org/r/20230501223353.2833899-1-dfustini@baylibre.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-05-01 15:42:34 -07:00
Dmitry Torokhov 9a87ffc99e Merge branch 'next' into for-linus
Prepare input updates for 6.4 merge window.
2023-05-01 15:20:08 -07:00
Dmitry Torokhov 53bea86b57 Revert "Input: xpad - fix support for some third-party controllers"
This reverts commit db7220c48d because it
causes crashes when trying to dereference xpad->dev->dev in xpad_probe()
which has not been set up yet.

Reported-by: syzbot+a3f758b8d8cb7e49afec@syzkaller.appspotmail.com
Reported-by: Dongliang Mu <dzm91@hust.edu.cn>
Link: https://groups.google.com/g/syzkaller-bugs/c/iMhTgpGuIbM
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2023-05-01 15:14:06 -07:00
Linus Torvalds c8c655c34e s390:
* More phys_to_virt conversions
 
 * Improvement of AP management for VSIE (nested virtualization)
 
 ARM64:
 
 * Numerous fixes for the pathological lock inversion issue that
   plagued KVM/arm64 since... forever.
 
 * New framework allowing SMCCC-compliant hypercalls to be forwarded
   to userspace, hopefully paving the way for some more features
   being moved to VMMs rather than be implemented in the kernel.
 
 * Large rework of the timer code to allow a VM-wide offset to be
   applied to both virtual and physical counters as well as a
   per-timer, per-vcpu offset that complements the global one.
   This last part allows the NV timer code to be implemented on
   top.
 
 * A small set of fixes to make sure that we don't change anything
   affecting the EL1&0 translation regime just after having having
   taken an exception to EL2 until we have executed a DSB. This
   ensures that speculative walks started in EL1&0 have completed.
 
 * The usual selftest fixes and improvements.
 
 KVM x86 changes for 6.4:
 
 * Optimize CR0.WP toggling by avoiding an MMU reload when TDP is enabled,
   and by giving the guest control of CR0.WP when EPT is enabled on VMX
   (VMX-only because SVM doesn't support per-bit controls)
 
 * Add CR0/CR4 helpers to query single bits, and clean up related code
   where KVM was interpreting kvm_read_cr4_bits()'s "unsigned long" return
   as a bool
 
 * Move AMD_PSFD to cpufeatures.h and purge KVM's definition
 
 * Avoid unnecessary writes+flushes when the guest is only adding new PTEs
 
 * Overhaul .sync_page() and .invlpg() to utilize .sync_page()'s optimizations
   when emulating invalidations
 
 * Clean up the range-based flushing APIs
 
 * Revamp the TDP MMU's reaping of Accessed/Dirty bits to clear a single
   A/D bit using a LOCK AND instead of XCHG, and skip all of the "handle
   changed SPTE" overhead associated with writing the entire entry
 
 * Track the number of "tail" entries in a pte_list_desc to avoid having
   to walk (potentially) all descriptors during insertion and deletion,
   which gets quite expensive if the guest is spamming fork()
 
 * Disallow virtualizing legacy LBRs if architectural LBRs are available,
   the two are mutually exclusive in hardware
 
 * Disallow writes to immutable feature MSRs (notably PERF_CAPABILITIES)
   after KVM_RUN, similar to CPUID features
 
 * Overhaul the vmx_pmu_caps selftest to better validate PERF_CAPABILITIES
 
 * Apply PMU filters to emulated events and add test coverage to the
   pmu_event_filter selftest
 
 x86 AMD:
 
 * Add support for virtual NMIs
 
 * Fixes for edge cases related to virtual interrupts
 
 x86 Intel:
 
 * Don't advertise XTILE_CFG in KVM_GET_SUPPORTED_CPUID if XTILE_DATA is
   not being reported due to userspace not opting in via prctl()
 
 * Fix a bug in emulation of ENCLS in compatibility mode
 
 * Allow emulation of NOP and PAUSE for L2
 
 * AMX selftests improvements
 
 * Misc cleanups
 
 MIPS:
 
 * Constify MIPS's internal callbacks (a leftover from the hardware enabling
   rework that landed in 6.3)
 
 Generic:
 
 * Drop unnecessary casts from "void *" throughout kvm_main.c
 
 * Tweak the layout of "struct kvm_mmu_memory_cache" to shrink the struct
   size by 8 bytes on 64-bit kernels by utilizing a padding hole
 
 Documentation:
 
 * Fix goof introduced by the conversion to rST
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmRNExkUHHBib256aW5p
 QHJlZGhhdC5jb20ACgkQv/vSX3jHroNyjwf+MkzDael9y9AsOZoqhEZ5OsfQYJ32
 Im5ZVYsPRU2K5TuoWql6meIihgclCj1iIU32qYHa2F1WYt2rZ72rJp+HoY8b+TaI
 WvF0pvNtqQyg3iEKUBKPA4xQ6mj7RpQBw86qqiCHmlfNt0zxluEGEPxH8xrWcfhC
 huDQ+NUOdU7fmJ3rqGitCvkUbCuZNkw3aNPR8dhU8RAWrwRzP2hBOmdxIeo81WWY
 XMEpJSijbGpXL9CvM0Jz9nOuMJwZwCCBGxg1vSQq0xTfLySNMxzvWZC2GFaBjucb
 j0UOQ7yE0drIZDVhd3sdNslubXXU6FcSEzacGQb9aigMUon3Tem9SHi7Kw==
 =S2Hq
 -----END PGP SIGNATURE-----

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

Pull kvm updates from Paolo Bonzini:
 "s390:

   - More phys_to_virt conversions

   - Improvement of AP management for VSIE (nested virtualization)

  ARM64:

   - Numerous fixes for the pathological lock inversion issue that
     plagued KVM/arm64 since... forever.

   - New framework allowing SMCCC-compliant hypercalls to be forwarded
     to userspace, hopefully paving the way for some more features being
     moved to VMMs rather than be implemented in the kernel.

   - Large rework of the timer code to allow a VM-wide offset to be
     applied to both virtual and physical counters as well as a
     per-timer, per-vcpu offset that complements the global one. This
     last part allows the NV timer code to be implemented on top.

   - A small set of fixes to make sure that we don't change anything
     affecting the EL1&0 translation regime just after having having
     taken an exception to EL2 until we have executed a DSB. This
     ensures that speculative walks started in EL1&0 have completed.

   - The usual selftest fixes and improvements.

  x86:

   - Optimize CR0.WP toggling by avoiding an MMU reload when TDP is
     enabled, and by giving the guest control of CR0.WP when EPT is
     enabled on VMX (VMX-only because SVM doesn't support per-bit
     controls)

   - Add CR0/CR4 helpers to query single bits, and clean up related code
     where KVM was interpreting kvm_read_cr4_bits()'s "unsigned long"
     return as a bool

   - Move AMD_PSFD to cpufeatures.h and purge KVM's definition

   - Avoid unnecessary writes+flushes when the guest is only adding new
     PTEs

   - Overhaul .sync_page() and .invlpg() to utilize .sync_page()'s
     optimizations when emulating invalidations

   - Clean up the range-based flushing APIs

   - Revamp the TDP MMU's reaping of Accessed/Dirty bits to clear a
     single A/D bit using a LOCK AND instead of XCHG, and skip all of
     the "handle changed SPTE" overhead associated with writing the
     entire entry

   - Track the number of "tail" entries in a pte_list_desc to avoid
     having to walk (potentially) all descriptors during insertion and
     deletion, which gets quite expensive if the guest is spamming
     fork()

   - Disallow virtualizing legacy LBRs if architectural LBRs are
     available, the two are mutually exclusive in hardware

   - Disallow writes to immutable feature MSRs (notably
     PERF_CAPABILITIES) after KVM_RUN, similar to CPUID features

   - Overhaul the vmx_pmu_caps selftest to better validate
     PERF_CAPABILITIES

   - Apply PMU filters to emulated events and add test coverage to the
     pmu_event_filter selftest

   - AMD SVM:
       - Add support for virtual NMIs
       - Fixes for edge cases related to virtual interrupts

   - Intel AMX:
       - Don't advertise XTILE_CFG in KVM_GET_SUPPORTED_CPUID if
         XTILE_DATA is not being reported due to userspace not opting in
         via prctl()
       - Fix a bug in emulation of ENCLS in compatibility mode
       - Allow emulation of NOP and PAUSE for L2
       - AMX selftests improvements
       - Misc cleanups

  MIPS:

   - Constify MIPS's internal callbacks (a leftover from the hardware
     enabling rework that landed in 6.3)

  Generic:

   - Drop unnecessary casts from "void *" throughout kvm_main.c

   - Tweak the layout of "struct kvm_mmu_memory_cache" to shrink the
     struct size by 8 bytes on 64-bit kernels by utilizing a padding
     hole

  Documentation:

   - Fix goof introduced by the conversion to rST"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (211 commits)
  KVM: s390: pci: fix virtual-physical confusion on module unload/load
  KVM: s390: vsie: clarifications on setting the APCB
  KVM: s390: interrupt: fix virtual-physical confusion for next alert GISA
  KVM: arm64: Have kvm_psci_vcpu_on() use WRITE_ONCE() to update mp_state
  KVM: arm64: Acquire mp_state_lock in kvm_arch_vcpu_ioctl_vcpu_init()
  KVM: selftests: Test the PMU event "Instructions retired"
  KVM: selftests: Copy full counter values from guest in PMU event filter test
  KVM: selftests: Use error codes to signal errors in PMU event filter test
  KVM: selftests: Print detailed info in PMU event filter asserts
  KVM: selftests: Add helpers for PMC asserts in PMU event filter test
  KVM: selftests: Add a common helper for the PMU event filter guest code
  KVM: selftests: Fix spelling mistake "perrmited" -> "permitted"
  KVM: arm64: vhe: Drop extra isb() on guest exit
  KVM: arm64: vhe: Synchronise with page table walker on MMU update
  KVM: arm64: pkvm: Document the side effects of kvm_flush_dcache_to_poc()
  KVM: arm64: nvhe: Synchronise with page table walker on TLBI
  KVM: arm64: Handle 32bit CNTPCTSS traps
  KVM: arm64: nvhe: Synchronise with page table walker on vcpu run
  KVM: arm64: vgic: Don't acquire its_lock before config_lock
  KVM: selftests: Add test to verify KVM's supported XCR0
  ...
2023-05-01 12:06:20 -07:00
Linus Torvalds d75439d64a OpenRISC update for 6.4
Two things for OpenRISC this cycle.
 
  - Small cleanup for device tree cpu iteration from Rob Herring
  - Add support for storing, restoring and accessing user space FPU state, to
    allow for libc to support the FPU on OpenRISC.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE2cRzVK74bBA6Je/xw7McLV5mJ+QFAmROv2cACgkQw7McLV5m
 J+Ty8Q//WZsiDE+KnKUO8LNfE13V9Ut1prMZqf3XDEXscN0H5koTmpbwz3k56Ssa
 evYfxwlJgKlPRoiAzo1t3MhhBRvayYTC7JFJGBNqvErjVBZsxAEL90fi5/Nk95Y9
 O1BpriMFNz1U/R4H8nU43CEVxpYlim3saimUUvnOpH2VsSQqkb+icqaOX+/FIXe0
 NE0BQ+31PN2Zg5ai9bHgxP5+yL0XnMglK/XxmvbTRh/OpWx5vCnszufsuZvBy6um
 lzQ/0qF5KrVZxLCP3M5tkyPRm4FONVeiJcfxDWlcVK62UFpAWbGo8iZpgZHpKwtj
 DGImziX7eyGo6dB910SsObsQ0CzrCbd6Sz90MyTEEmr08Tb9Cz//Ax6CTyatA3Cv
 wG8eiYFzlib8Vpyjv8LzVzqgyvQNCbGl1+LqGm60+K7irA//+ROrPb5POA7b+8XC
 wf24IGKb6sMR7Cwb6HdFev/NdNvBUs91ksP3b+ReP0Il76p71s1YNsdfo2DiKBwL
 tQYlDz3Pi5tbIatMAwMcoiasHxt1TTivZ7oaG6c2QCQOCfTOv8kg+I28RSD0Muuo
 6AMvRMPIsOMKXebv7hd70FcPn8c9RIkxxfcBJKf5igHM6Szjy19U05giCbVtSRVI
 yA/R3Z9aI2qJvC8NjoRh9RNkJibq7nZfPuVm+o0UB+z4TgIJXE0=
 =N9eu
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of https://github.com/openrisc/linux

Pull OpenRISC updates from Stafford Horne:
 "Two things for OpenRISC this cycle:

   - Small cleanup for device tree cpu iteration from Rob Herring

   - Add support for storing, restoring and accessing user space FPU
     state, to allow for libc to support the FPU on OpenRISC"

* tag 'for-linus' of https://github.com/openrisc/linux:
  openrisc: Add floating point regset
  openrisc: Support floating point user api
  openrisc: Support storing and restoring fpu state
  openrisc: Properly store r31 to pt_regs on unhandled exceptions
  openrisc: Use common of_get_cpu_node() instead of open-coding
2023-05-01 11:52:32 -07:00
Linus Torvalds 3f2a1903af RTC for 6.4
Subsystem:
  - Convert to platform remove callback returning void
 
 Drivers:
  - meson-vrtc: fix a firmware display issue
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEBqsFVZXh8s/0O5JiY6TcMGxwOjIFAmRO7EYACgkQY6TcMGxw
 OjK++RAArlqzTIy/venVvWDk9QhN63gz+z+aaFSTLA1U342rhBYdXeGTrfvr0TYr
 EMhkZixJGk/fJkJw82fyAnkn1xTh56gavv2kKG3zc0O7fDi9X+jGd+OnbAVCyXbM
 u9ThjLSjI0euoU/0Df1fLFA8EUjHgeh8ORAo3SS2aTux1VCH3Q2Y9Hd1G2sBmyBE
 6rtYClzo9sCVDIKnKsHUw2T6PJxccmmt5y/C9GSK78M3m6UTLY2JFN8k8U1n0nx6
 sn9my+lX2tHj1UUnkPWHEAp5kfl8r+p/lE14UpNWlhx2N+pIVtgLkLy9Gs1Wijrr
 zAE6nq1dEWGNLhEfraXYvkfQHA8hTmjEJ3wXvXAI7n1t2MVSnp+UDfdJmZbkXziQ
 M4VNBno3zqm6IeN0Yshf20EEBrqIuuFuWatACuhkmXu9p+eusoXwh/stm/zK1I+Q
 UWOKgKWjrZ4eHG/bl/6PywIWQWNZluFxofS7V1DeayTwM+0S1RKXpat9Z534xF0Y
 mJCum17tBdTJlQNbvVrGjSUdpm8jsWLMQT7gYsRHCTOTLf2FOcJIH45hMTXZwaa9
 tz/+rUGBmJQuVSykvtn87evvr22vi73beqf/lLiWgGaRmQ1x9fHeSbp8cH9QvICZ
 ILRJOa70J7u94EncsyxUYYlxTfTSTyTSrBYfAj1QJwKmRBgyB6A=
 =i6d0
 -----END PGP SIGNATURE-----

Merge tag 'rtc-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux

Pull RTC updates from Alexandre Belloni:
 "Not much this cycle, there is the conversion to remove_new and many
  small fixes in drivers:

  Subsystem:
   - Convert to platform remove callback returning void

  Drivers:
   - meson-vrtc: fix a firmware display issue"

* tag 'rtc-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (53 commits)
  rtc: armada38x: use devm_platform_ioremap_resource_byname()
  rtc: sunplus: use devm_platform_ioremap_resource_byname()
  rtc: jz4740: Make sure clock provider gets removed
  rtc: k3: handle errors while enabling wake irq
  rtc: meson-vrtc: Use ktime_get_real_ts64() to get the current time
  dt-bindings: rtc: Drop unneeded quotes
  rtc: pcf8523: remove unnecessary OR operation
  rtc: pcf8523: fix coding-style issues
  rtc: ds1390: mark OF related data as maybe unused
  rtc: omap: include header for omap_rtc_power_off_program prototype
  rtc: sun6i: Use of_property_present() for testing DT property presence
  rtc: mpfs: convert SOC_MICROCHIP_POLARFIRE to ARCH_MICROCHIP_POLARFIRE
  rtc: zynqmp: Convert to platform remove callback returning void
  rtc: xgene: Convert to platform remove callback returning void
  rtc: wm8350: Convert to platform remove callback returning void
  rtc: vt8500: Convert to platform remove callback returning void
  rtc: twl: Convert to platform remove callback returning void
  rtc: tps6586x: Convert to platform remove callback returning void
  rtc: tegra: Convert to platform remove callback returning void
  rtc: sunplus: Convert to platform remove callback returning void
  ...
2023-05-01 11:14:12 -07:00
Linus Torvalds e0906f1feb I3C for 6.4
Subsystem:
  - OF alias bus numbering
  - convert to platform remove callback returning void
 
 New driver: AST2600 controller, based on Synopsys DesignWare IP
 
 Drivers:
  - dw: add infrastructure to support different platform integrations
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEBqsFVZXh8s/0O5JiY6TcMGxwOjIFAmRO5S0ACgkQY6TcMGxw
 OjKFhBAAgeWIJdEPIiL0VjgaM2rcDKS4LD0qAfrrgOh9fyBZMnMt/7jg94naQ8wL
 z6IQWORO2FDbijCWOQNTw5hPQwUJWTB/rYqKtyCy3hzbmBqkz03O3HjnQsmVmna7
 iOzXWpYyvmXyiRFuKKBzmBcTyYvZxHc6d8XUzgmUlGEN0J1haIAqZJlCqDjkJ78h
 QgsqbCZM7CrEpePDStrK5DxOpaB/is1NVL1eBfl2VKWwp0diIPckAk/GBkXxSnLd
 7BLsHFyBWTWiGnxJICOYcdpPQGGpb1JGkW7Td+tGW/14h46Cqn3UZAzleQKL5ecP
 op2dw7erNGlVDjtRYAOvinpIjc6JS/PQtPsX8a3OLLFyRwY49K/NRpmmI+uW/TQk
 cijWMqXa1Q0cBB90CfRwkzHoQhwK1WhdlyvpHIJ9RZn/VP+4zzGniVeu7V3b5bWw
 EfbiDf0yhEHyLWqK9iwIcSjUMWQD5f9zEo5yvv8Fs8/nXhXYTy/BRDZ6CmM46GpD
 0nsxaEpXxx0+trtnCa2UNO2xc1R5DcJDeTezOxYpxg2X/fSWRyjFINMlmQ1RV5HY
 KmberJgqpfXc0Azr1J1LRqfqi8UqYPIG0LLG7z8+wpM2QZvsVo04ZeeEQG+Dcxh1
 mASL+rSa72NBsVx6ZaU6pMXgOrmdSY6lj/cPKsTl6eF5aPCHog0=
 =MXBr
 -----END PGP SIGNATURE-----

Merge tag 'i3c/for-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux

Pull i3c updates from Alexandre Belloni:
 "Subsystem:
   - OF alias bus numbering
   - convert to platform remove callback returning void

  New driver:
   - AST2600 controller, based on Synopsys DesignWare IP

  Driver update:
   - dw: add infrastructure to support different platform integrations"

* tag 'i3c/for-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux:
  i3c: ast2600: set variable ast2600_i3c_ops storage-class-specifier to static
  i3c: ast2600: fix register setting for 545 ohm pullups
  i3c: ast2600: enable IBI support
  i3c: dw: Add a platform facility for IBI PEC workarounds
  i3c: dw: Add support for in-band interrupts
  i3c: dw: Turn DAT array entry into a struct
  i3c: dw: Create a generic fifo read function
  i3c: Allow OF-alias-based persistent bus numbering
  i3c: ast2600: Add AST2600 platform-specific driver
  dt-bindings: i3c: Add AST2600 i3c controller
  i3c: dw: Add infrastructure for platform-specific implementations
  i3c: dw: use bus mode rather than device reg for conditional tCAS setting
  i3c: dw: Return the length from a read priv_xfer
  i3c: svc: Convert to platform remove callback returning void
  i3c: mipi-i3c-hci: Convert to platform remove callback returning void
  i3c: cdns: Convert to platform remove callback returning void
  i3c: dw: Convert to platform remove callback returning void
  i3c: Make i3c_master_unregister() return void
  i3c: dw: drop of_match_ptr for ID table
  i3c: Correct reference to the I²C device data type
2023-05-01 11:08:01 -07:00
Linus Torvalds 06936aaf49 Some ext4 regression and bug fixes for -rc1
-----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEK2m5VNv+CHkogTfJ8vlZVpUNgaMFAmROracACgkQ8vlZVpUN
 gaPqLQf/ZvzvspL4o3SNsHE/M2tKNBVY/z/vsfmAZwMgrGoK5qCkDsNA7c7+oUwE
 xjiHiVHOaYjJVWwkdODAwe7xNbWB6FoKptBaBi89fAyibMY/N7BZ8rad69NQTvyc
 JbKjorvEBc+qgsUEt2+ZpMogN9KHlVh3NJwlovesmucQtg2gWLKs8wrxW2bC7uAh
 2uR9GWUnhDrs6jHbjHkG3/lgB0aS0StLRxfsbchjZvCsniTDZymLmmgkA1ln17ce
 6iRg2ESjYUryPX09YFtUuQVvObtUTM+z8DzwyQuAJ4VfmdoPA4L6mpdqzPGFuKQc
 gJrLSB8VZJDvPoGjaHZ+Qdl1tHlFRw==
 =2SEf
 -----END PGP SIGNATURE-----

Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4

Pull ext4 fixes from Ted Ts'o:
 "Some ext4 regression and bug fixes"

* tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: clean up error handling in __ext4_fill_super()
  ext4: reflect error codes from ext4_multi_mount_protect() to its callers
  ext4: fix lost error code reporting in __ext4_fill_super()
  ext4: fix unused iterator variable warnings
  ext4: fix use-after-free read in ext4_find_extent for bigalloc + inline
  ext4: fix i_disksize exceeding i_size problem in paritally written case
2023-05-01 11:00:04 -07:00
Linus Torvalds 26c009dffc 11 smb3 client fixes, mostly cleanup
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEE6fsu8pdIjtWE/DpLiiy9cAdyT1EFAmROg4sACgkQiiy9cAdy
 T1FeNgv/S/dFaQ9RXDGp0AsO9aDUwKPMZWdZVgPtnktQF5icTI7CrYn3R2KrA6i2
 +a27pSWsefF1/RpRIGm5n0AFkEgRaClqxWIzM7VBXWtsR5oFA5GoyYzOk206qAvl
 CTvpS7Kuf091UG8NoOVqmM+AtSE8tEx4itDbh7wS9HeApoxiZKPJvblzaiCAzEeR
 mc+ehfTocUy+1UZh8xZB/epl0xHAVUr845zIkVZXE2HBQCSni/5ywPIHc3xyAQXJ
 6a5sEYi0e3wQ9457zS6POW3rMXys2ZanYlEfy6guGcfCAX6PsPt5Yl+sJtdMw08k
 XB9qJkGg111kLKncM38Ju5R1QHYCOj/tOC7gjleNhHWs/iHclMFrDrA/ZYSzibd4
 USVQpLRCjFFAwvKj/LTVmPIRw60fr3lf4n4maQGLqJCHXQkO/+Z4q/UEBqslXrot
 Y1c4+ALqJRQvMe591hCsN/uDV7S9ETy2BRePBbLyokcwji8i9PyJ+4XYONmngVyx
 OuB2KeAE
 =4iMh
 -----END PGP SIGNATURE-----

Merge tag '6.4-rc-smb3-client-fixes-part1' of git://git.samba.org/sfrench/cifs-2.6

Pull cifs fixes from Steve French:

 - deferred close fix for an important case when cached file should be
   closed immediately

 - two fixes for missing locks

 - eight minor cleanup

* tag '6.4-rc-smb3-client-fixes-part1' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: update internal module version number for cifs.ko
  smb3: move some common open context structs to smbfs_common
  smb3: make query_on_disk_id open context consistent and move to common code
  SMB3.1.1: add new tree connect ShareFlags
  cifs: missing lock when updating session status
  SMB3: Close deferred file handles in case of handle lease break
  SMB3: Add missing locks to protect deferred close file list
  cifs: Avoid a cast in add_lease_context()
  cifs: Simplify SMB2_open_init()
  cifs: Simplify SMB2_open_init()
  cifs: Simplify SMB2_open_init()
2023-05-01 10:43:44 -07:00
Linus Torvalds ed9a65e575 This PR fixes a critical bug in my first pull request. I fixed the
cherry pick issue and tested with real hardare and libvirt/qemu plus
 swtpm.
 -----BEGIN PGP SIGNATURE-----
 
 iIgEABYIADAWIQRE6pSOnaBC00OEHEIaerohdGur0gUCZE55VRIcamFya2tvQGtl
 cm5lbC5vcmcACgkQGnq6IXRrq9ILfAD+OPfN2zNx0bAmKB9iRvBulD1P6TIaFUOu
 8xrTkCyfPugA/0khCPhEz44RjMkVy8wdpDRalIdo0M4zIf3XSCFJA7oL
 =uhNB
 -----END PGP SIGNATURE-----

Merge tag 'tpmdd-v6.4-rc1-fix-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd

Pull tpm fix from Jarkko Sakkinen:
 "This fixes a critical bug in my first pull request.

  I fixed the cherry pick issue and tested with real hardare and
  libvirt/qemu plus swtpm"

* tag 'tpmdd-v6.4-rc1-fix-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd:
  tpm: Re-enable TPM chip boostrapping non-tpm_tis TPM drivers
2023-05-01 10:37:37 -07:00
Huacai Chen 2fa5ebe3bc tools/perf: Add basic support for LoongArch
Add basic support for LoongArch, which is very similar to the MIPS
version.

Signed-off-by: Ming Wang <wangming01@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-05-01 17:19:59 +08:00
Youling Tang 22f367a689 LoongArch: ftrace: Add direct call trampoline samples support
The ftrace samples need per-architecture trampoline implementations to
save and restore argument registers around the calls to my_direct_func*
and to restore polluted registers (e.g: ra).

Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
Signed-off-by: Youling Tang <tangyouling@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-05-01 17:19:53 +08:00
Youling Tang 9cdc3b6a29 LoongArch: ftrace: Add direct call support
Select the HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS to provide the
register_ftrace_direct[_multi] interfaces allowing users to register
the customed trampoline (direct_caller) as the mcount for one or more
target functions. And modify_ftrace_direct[_multi] are also provided
for modifying direct_caller.

There are a few cases to distinguish:
- If a direct call ops is the only one tracing a function AND the direct
  called trampoline is within the reach of a 'bl' instruction
  -> the ftrace patchsite jumps to the trampoline
- Else
  -> the ftrace patchsite jumps to the ftrace_regs_caller trampoline points
     to ftrace_list_ops so it iterates over all registered ftrace ops,
     including the direct call ops and calls its call_direct_funcs handler
     which stores the direct called trampoline's address in the ftrace_regs
     and the ftrace_regs_caller trampoline will return to that address
     instead of returning to the traced function

Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
Signed-off-by: Youling Tang <tangyouling@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-05-01 17:19:53 +08:00
Youling Tang 24d4f52791 LoongArch: ftrace: Implement ftrace_find_callable_addr() to simplify code
In the module processing functions, the same logic can be reused by
implementing ftrace_find_callable_addr().

Signed-off-by: Youling Tang <tangyouling@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-05-01 17:19:53 +08:00
Youling Tang 819cf65575 LoongArch: ftrace: Fix build error if DYNAMIC_FTRACE_WITH_REGS is not set
We can see the following build error if CONFIG_DYNAMIC_FTRACE_WITH_REGS
is not set on LoongArch:

arch/loongarch/kernel/ftrace_dyn.c: In function ‘ftrace_make_call’:
arch/loongarch/kernel/ftrace_dyn.c:167:23: error: implicit declaration of function ‘__get_mod’
  167 |                 ret = __get_mod(&mod, pc);
      |                       ^~~~~~~~~
arch/loongarch/kernel/ftrace_dyn.c:171:24: error: implicit declaration of function ‘get_plt_addr’
  171 |                 addr = get_plt_addr(mod, addr);
      |                        ^~~~~~~~~~~~

The reason is that the __get_mod() and get_plt_addr() may be called in
ftrace_make_{call,nop}.

Signed-off-by: Youling Tang <tangyouling@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-05-01 17:19:52 +08:00
Qing Zhang 6fbff14a63 LoongArch: ftrace: Abstract DYNAMIC_FTRACE_WITH_ARGS accesses
Add new ftrace_regs_{get,set}_*() helpers which can be used to manipulate
ftrace_regs. When CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS=y, these can always
be used on any ftrace_regs, and when CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS
=n these can be used when regs are available.

Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-05-01 17:19:52 +08:00
Tiezhu Yang 8b5ee2c66d LoongArch: Add support for function error injection
Inspired by the commit 42d038c4fb ("arm64: Add support for function
error injection") and the commit ee55ff803b ("riscv: Add support for
function error injection"), this patch supports function error injection
for LoongArch.

Mainly implement two functions:
(1) regs_set_return_value() which is used to overwrite the return value,
(2) override_function_with_return() which is used to override the probed
function returning and jump to its caller.

Here is a simple test under CONFIG_FUNCTION_ERROR_INJECTION and
CONFIG_FAIL_FUNCTION:

  # echo sys_clone > /sys/kernel/debug/fail_function/inject
  # echo 100 > /sys/kernel/debug/fail_function/probability
  # dmesg
  bash: fork: Invalid argument
  # dmesg
  ...
  FAULT_INJECTION: forcing a failure.
  name fail_function, interval 1, probability 100, space 0, times 1
  ...
  Call Trace:
  [<90000000002238f4>] show_stack+0x5c/0x180
  [<90000000012e384c>] dump_stack_lvl+0x60/0x88
  [<9000000000b1879c>] should_fail_ex+0x1b0/0x1f4
  [<900000000032ead4>] fei_kprobe_handler+0x28/0x6c
  [<9000000000230970>] kprobe_breakpoint_handler+0xf0/0x118
  [<90000000012e3e60>] do_bp+0x2c4/0x358
  [<9000000002241924>] exception_handlers+0x1924/0x10000
  [<900000000023b7d0>] sys_clone+0x0/0x4
  [<90000000012e4744>] do_syscall+0x7c/0x94
  [<9000000000221e44>] handle_syscall+0xc4/0x160

Tested-by: Hengqi Chen <hengqi.chen@gmail.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-05-01 17:19:52 +08:00
Qing Zhang d4c937c2a5 LoongArch: Add ARCH_HAS_FORTIFY_SOURCE selection
FORTIFY_SOURCE could detect various overflows at compile and run time.
ARCH_HAS_FORTIFY_SOURCE means that the architecture can be built and run
with CONFIG_FORTIFY_SOURCE. So select it in LoongArch.

See more about this feature from commit 6974f0c455 ("include/linux/
string.h: add the option of fortified string.h functions").

Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-05-01 17:19:52 +08:00
Min Zhou 2f16482202 LoongArch: crypto: Add crc32 and crc32c hw acceleration
With a blatant copy of some MIPS bits we introduce the crc32 and crc32c
hw accelerated module to LoongArch.

LoongArch has provided these instructions to calculate crc32 and crc32c:
        * crc.w.b.w    crcc.w.b.w
        * crc.w.h.w    crcc.w.h.w
        * crc.w.w.w    crcc.w.w.w
        * crc.w.d.w    crcc.w.d.w

So we can make use of these instructions to improve the performance of
calculation for crc32(c) checksums.

As can be seen from the following test results, crc32(c) instructions
can improve the performance by 58%.

                  Software implemention    Hardware acceleration
  Buffer size     time cost (seconds)      time cost (seconds)    Accel.
   100 KB                0.000845                 0.000534        59.1%
     1 MB                0.007758                 0.004836        59.4%
    10 MB                0.076593                 0.047682        59.4%
   100 MB                0.756734                 0.479126        58.5%
  1000 MB                7.563841                 4.778266        58.5%

Signed-off-by: Min Zhou <zhoumin@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-05-01 17:19:43 +08:00
Bibo Mao 69e3a6aa6b LoongArch: Add checksum optimization for 64-bit system
LoongArch platform is 64-bit system, which supports 8-bytes memory
accessing, but generic checksum functions use 4-byte memory access.
So add 8-bytes memory access optimization for checksum functions on
LoongArch. And the code comes from arm64 system.

When network hw checksum is disabled, iperf performance improves about
10% with this patch.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-05-01 17:19:43 +08:00
WANG Rui 8941e93ca5 LoongArch: Optimize memory ops (memset/memcpy/memmove)
To optimize memset()/memcpy()/memmove() and so on, we use a jump table
to dispatch cases for short data lengths; and for long data lengths, we
split the destination into head part (first 8 bytes), tail part (last 8
bytes) and middle part. The head part and tail part may be at unaligned
addresses, while the middle part is always aligned (the middle part is
allowed to overlap the head/tail part). In this way, the first and last
8 bytes may be unaligned accesses, but we can make sure the data in the
middle is processed at an aligned destination address.

We have tested micro-bench[1] on a Loongson-3C5000 16-core machine (2.2GHz):

1. memset

| length | src offset | dst offset | speed before | speed after | %       |
|--------|------------|------------|--------------|-------------|---------|
| 8      | 0          | 0          | 696.191      | 1518.785    | 118.16% |
| 8      | 0          | 1          | 696.325      | 1518.937    | 118.14% |
| 50     | 0          | 0          | 969.976      | 8053.902    | 730.32% |
| 50     | 0          | 1          | 970.034      | 8058.475    | 730.74% |
| 300    | 0          | 0          | 5876.612     | 16544.703   | 181.53% |
| 300    | 0          | 1          | 5030.849     | 16549.011   | 228.95% |
| 1200   | 0          | 0          | 11797.077    | 16752.137   | 42.00%  |
| 1200   | 0          | 1          | 5687.141     | 16645.233   | 192.68% |
| 4000   | 0          | 0          | 15723.27     | 16761.557   | 6.60%   |
| 4000   | 0          | 1          | 5906.114     | 16732.316   | 183.30% |
| 8000   | 0          | 0          | 16751.403    | 16770.002   | 0.11%   |
| 8000   | 0          | 1          | 5995.449     | 16754.07    | 179.45% |

2. memcpy

| length | src offset | dst offset | speed before | speed after | %       |
|--------|------------|------------|--------------|-------------|---------|
| 8      | 0          | 0          | 696.2        | 1670.605    | 139.96% |
| 8      | 0          | 1          | 696.325      | 1671.138    | 139.99% |
| 50     | 0          | 0          | 969.974      | 8724.999    | 799.51% |
| 50     | 0          | 1          | 970.032      | 8730.138    | 799.98% |
| 300    | 0          | 0          | 5564.662     | 16272.652   | 192.43% |
| 300    | 0          | 1          | 4670.436     | 14972.842   | 220.59% |
| 1200   | 0          | 0          | 10740.23     | 16751.728   | 55.97%  |
| 1200   | 0          | 1          | 5027.741     | 14874.564   | 195.85% |
| 4000   | 0          | 0          | 15122.367    | 16737.642   | 10.68%  |
| 4000   | 0          | 1          | 5536.918     | 14890.397   | 168.93% |
| 8000   | 0          | 0          | 16505.453    | 16553.543   | 0.29%   |
| 8000   | 0          | 1          | 5821.619     | 14841.804   | 154.94% |

3. memmove

| length | src offset | dst offset | speed before | speed after | %       |
|--------|------------|------------|--------------|-------------|---------|
| 8      | 0          | 0          | 982.693      | 1670.568    | 70.00%  |
| 8      | 0          | 1          | 983.023      | 1671.174    | 70.00%  |
| 50     | 0          | 0          | 1230.87      | 8727.625    | 609.06% |
| 50     | 0          | 1          | 1232.515     | 8730.138    | 608.32% |
| 300    | 0          | 0          | 6490.375     | 16296.993   | 151.09% |
| 300    | 0          | 1          | 4282.687     | 14972.842   | 249.61% |
| 1200   | 0          | 0          | 11742.755    | 16752.546   | 42.66%  |
| 1200   | 0          | 1          | 5039.338     | 14872.951   | 195.14% |
| 4000   | 0          | 0          | 15467.786    | 16737.09    | 8.21%   |
| 4000   | 0          | 1          | 5009.905     | 14890.542   | 197.22% |
| 8000   | 0          | 0          | 16489.664    | 16553.273   | 0.39%   |
| 8000   | 0          | 1          | 5823.786     | 14858.646   | 155.14% |

* speed: MB/s
* length: byte

[1] https://github.com/heiher/mem-bench

Signed-off-by: WANG Rui <wangrui@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-05-01 17:19:43 +08:00
Huacai Chen 2b3bd32ea3 LoongArch: Provide kernel fpu functions
Provide kernel_fpu_begin()/kernel_fpu_end() to allow the kernel itself
to use fpu. They can be used by some other kernel components, e.g., the
AMDGPU graphic driver for DCN.

Reported-by: WANG Xuerui <kernel@xen0n.name>
Tested-by: WANG Xuerui <kernel@xen0n.name>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-05-01 17:19:27 +08:00
WANG Xuerui c23e7f01cf LoongArch: Relay BCE exceptions to userland as SIGSEGV with si_code=SEGV_BNDERR
SEGV_BNDERR was introduced initially for supporting the Intel MPX, but
fell into disuse after the MPX support was removed. The LoongArch
bounds-checking instructions behave very differently than MPX, but
overall the interface is still kind of suitable for conveying the
information to userland when bounds-checking assertions trigger, so we
wouldn't have to invent more UAPI. Specifically, when the BCE triggers,
a SEGV_BNDERR is sent to userland, with si_addr set to the out-of-bounds
address or value (in asrt{gt,le}'s case), and one of si_lower or
si_upper set to the configured bound depending on the faulting
instruction. The other bound is set to either 0 or ULONG_MAX to resemble
a range with both lower and upper bounds.

Note that it is possible to have si_addr == si_lower in case of a
failing asrtgt or {ld,st}gt, because those instructions test for strict
greater-than relationship. This should not pose a problem for userland,
though, because the faulting PC is available for the application to
associate back to the exact instruction for figuring out the
expectation.

Example exception context generated by a faulting `asrtgt.d t0, t1`
(assert t0 > t1 or BCE) with t0=100 and t1=200:

> pc 00005555558206a4 ra 00007ffff2d854fc tp 00007ffff2f2f180 sp 00007ffffbf9fb80
> a0 0000000000000002 a1 00007ffffbf9fce8 a2 00007ffffbf9fd00 a3 00007ffff2ed4558
> a4 0000000000000000 a5 00007ffff2f044c8 a6 00007ffffbf9fce0 a7 fffffffffffff000
> t0 0000000000000064 t1 00000000000000c8 t2 00007ffffbfa2d5e t3 00007ffff2f12aa0
> t4 00007ffff2ed6158 t5 00007ffff2ed6158 t6 000000000000002e t7 0000000003d8f538
> t8 0000000000000005 u0 0000000000000000 s9 0000000000000000 s0 00007ffffbf9fce8
> s1 0000000000000002 s2 0000000000000000 s3 00007ffff2f2c038 s4 0000555555820610
> s5 00007ffff2ed5000 s6 0000555555827e38 s7 00007ffffbf9fd00 s8 0000555555827e38
>    ra: 00007ffff2d854fc
>   ERA: 00005555558206a4
>  CRMD: 000000b0 (PLV0 -IE -DA +PG DACF=CC DACM=CC -WE)
>  PRMD: 00000007 (PPLV3 +PIE -PWE)
>  EUEN: 00000000 (-FPE -SXE -ASXE -BTE)
>  ECFG: 0007181c (LIE=2-4,11-12 VS=7)
> ESTAT: 000a0000 [BCE] (IS= ECode=10 EsubCode=0)
>  PRID: 0014c010 (Loongson-64bit, Loongson-3A5000)

Signed-off-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-05-01 17:19:27 +08:00
WANG Xuerui 325a38b511 LoongArch: Tweak the BADV and CPUCFG.PRID lines in show_regs()
Use ISA manual names for BADV and CPUCFG.PRID lines in show_regs(), for
stylistic consistency with the other lines already touched.

While at it, also include current CPU's full name in show_regs() output.
It may be more helpful for developers looking at the resulting dumps,
because multiple distinct CPU models may share the same PRID. Not having
this info available may hide problems only found on some but not all of
the models sharing one specific PRID.

Signed-off-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-05-01 17:19:27 +08:00
WANG Xuerui 98b90ede59 LoongArch: Humanize the ESTAT line when showing registers
Example output looks like:

[   xx.xxxxxx] ESTAT: 00001000 [INT] (IS=12 ECode=0 EsubCode=0)

Signed-off-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-05-01 17:19:27 +08:00
WANG Xuerui 5e3e784d35 LoongArch: Humanize the ECFG line when showing registers
Example output looks like:

[   xx.xxxxxx]  ECFG: 00071c1c (LIE=2-4,10-12 VS=7)

Signed-off-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-05-01 17:19:27 +08:00
WANG Xuerui 9718d96c03 LoongArch: Humanize the EUEN line when showing registers
Example output looks like:

[   xx.xxxxxx]  EUEN: 00000000 (-FPE -SXE -ASXE -BTE)

Signed-off-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-05-01 17:19:27 +08:00
WANG Xuerui ce7f0b18b0 LoongArch: Humanize the PRMD line when showing registers
Example output looks like:

[   xx.xxxxxx]  PRMD: 00000004 (PPLV0 +PIE -PWE)

Signed-off-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-05-01 17:19:10 +08:00
WANG Xuerui efada2afac LoongArch: Humanize the CRMD line when showing registers
Example output looks like:

[   xx.xxxxxx]  CRMD: 000000b0 (PLV0 -IE -DA +PG DACF=CC DACM=CC -WE)

Some initial machinery for this pretty-printing format has been included
in this patch as well.

Signed-off-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-05-01 17:19:10 +08:00