public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] RISC-V: hwprobe: Introduce which-cpus
@ 2023-10-20 13:05 Andrew Jones
  2023-10-20 13:05 ` [PATCH v2 1/6] RISC-V: hwprobe: Clarify cpus size parameter Andrew Jones
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Andrew Jones @ 2023-10-20 13:05 UTC (permalink / raw)
  To: linux-riscv; +Cc: paul.walmsley, palmer, aou, evan, conor.dooley, apatel

This series introduces a flag for the hwprobe syscall which effectively
reverses its behavior from getting the values of keys for a set of cpus
to getting the cpus for a set of key-value pairs. The series is based on
the patch pointed out with the tag below.

Based-on: https://lore.kernel.org/all/20231010165101.14942-2-ajones@ventanamicro.com/

Changes since v1[1]:
 - Dropped copyrights when splitting hwprobe out of sys_riscv.c [Conor]
 - Improved documentation [Evan]
 - Fixed a bug where the set of cpus could get changed to the set of all
   online cpus [Evan]
 - Added check for empty set of cpus in the vdso function [Evan, drew]
 - Replaced memset with a for-loop in the vdso function because we don't
   have memset there [drew]
 - Added an r-b from Conor

Changes since the RFC[2]:
 - Split hwprobe out of sys_riscv.c into its own file [Palmer]
 - Split the which-cpus functionality out of do_riscv_hwprobe() [Palmer]
 - Rename hwprobe_key_is_map to hwprobe_key_is_bitmask [Evan]
 - Move the homogeneous_cpus logic into the vDSO function [Evan]
 - Rework logic to not need to allocate any memory
 - Honor cpu affinity in the which-cpus selftests utility
 - Picked up some r-b's

[1] https://lore.kernel.org/all/20231011135610.122850-8-ajones@ventanamicro.com/
[2] https://lore.kernel.org/all/20230921125518.175428-7-ajones@ventanamicro.com/

Andrew Jones (6):
  RISC-V: hwprobe: Clarify cpus size parameter
  RISC-V: Move the hwprobe syscall to its own file
  RISC-V: hwprobe: Introduce which-cpus flag
  RISC-V: selftests: Statically link hwprobe test
  RISC-V: selftests: Convert hwprobe test to kselftest API
  RISC-V: selftests: Add which-cpus hwprobe test

 Documentation/riscv/hwprobe.rst               |  28 +-
 arch/riscv/include/asm/hwprobe.h              |  24 ++
 arch/riscv/include/uapi/asm/hwprobe.h         |   3 +
 arch/riscv/kernel/Makefile                    |   1 +
 arch/riscv/kernel/sys_hwprobe.c               | 357 ++++++++++++++++++
 arch/riscv/kernel/sys_riscv.c                 | 267 -------------
 arch/riscv/kernel/vdso/hwprobe.c              |  86 ++++-
 .../testing/selftests/riscv/hwprobe/Makefile  |   7 +-
 .../testing/selftests/riscv/hwprobe/hwprobe.c |  64 +---
 .../testing/selftests/riscv/hwprobe/hwprobe.h |  15 +
 .../selftests/riscv/hwprobe/which-cpus.c      | 154 ++++++++
 .../selftests/riscv/vector/vstate_prctl.c     |  10 +-
 12 files changed, 676 insertions(+), 340 deletions(-)
 create mode 100644 arch/riscv/kernel/sys_hwprobe.c
 create mode 100644 tools/testing/selftests/riscv/hwprobe/hwprobe.h
 create mode 100644 tools/testing/selftests/riscv/hwprobe/which-cpus.c

-- 
2.41.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [PATCH v2 0/6] RISC-V: Enable cbo.zero in usermode
@ 2023-08-30 16:49 Andrew Jones
  2023-08-30 16:49 ` [PATCH v2 4/6] RISC-V: selftests: Statically link hwprobe test Andrew Jones
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Jones @ 2023-08-30 16:49 UTC (permalink / raw)
  To: linux-riscv; +Cc: paul.walmsley, palmer, aou, evan, conor.dooley, apatel

In order for usermode to issue cbo.zero, it needs privilege granted to
issue the extension instruction (patch 2) and to know that the extension
is available and its block size (patch 3). Patch 1 could be separate from
this series (it just fixes up some error messages), patches 4-5 convert
the hwprobe selftest to a statically-linked, TAP test and patch 6 adds a
new hwprobe test for the new information as well as testing CBO
instructions can or cannot be issued as appropriate.

Thanks,
drew

v2:
  - fixed build of the vector selftest
  - changed this-cpu wrappers to just cpu wrappers and then pass
    smp_processor_id() at the callsite
  - added comment to EXT_KEY macro
  - picked up a couple r-b's

Andrew Jones (6):
  RISC-V: Make zicbom/zicboz errors consistent
  RISC-V: Enable cbo.zero in usermode
  RISC-V: hwprobe: Expose Zicboz extension and its block size
  RISC-V: selftests: Statically link hwprobe test
  RISC-V: selftests: Convert hwprobe test to kselftest API
  RISC-V: selftests: Add CBO tests

 Documentation/riscv/hwprobe.rst               |   6 +
 arch/riscv/include/asm/cpufeature.h           |   2 +
 arch/riscv/include/asm/csr.h                  |   1 +
 arch/riscv/include/asm/hwcap.h                |  16 ++
 arch/riscv/include/asm/hwprobe.h              |   2 +-
 arch/riscv/include/uapi/asm/hwprobe.h         |   2 +
 arch/riscv/kernel/cpufeature.c                |  10 +-
 arch/riscv/kernel/setup.c                     |   4 +
 arch/riscv/kernel/smpboot.c                   |   4 +
 arch/riscv/kernel/sys_riscv.c                 |  46 +++--
 .../testing/selftests/riscv/hwprobe/Makefile  |   9 +-
 tools/testing/selftests/riscv/hwprobe/cbo.c   | 162 ++++++++++++++++++
 .../testing/selftests/riscv/hwprobe/hwprobe.c |  64 +++----
 .../testing/selftests/riscv/hwprobe/hwprobe.h |  15 ++
 14 files changed, 280 insertions(+), 63 deletions(-)
 create mode 100644 tools/testing/selftests/riscv/hwprobe/cbo.c
 create mode 100644 tools/testing/selftests/riscv/hwprobe/hwprobe.h

-- 
2.41.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-10-20 13:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-20 13:05 [PATCH v2 0/6] RISC-V: hwprobe: Introduce which-cpus Andrew Jones
2023-10-20 13:05 ` [PATCH v2 1/6] RISC-V: hwprobe: Clarify cpus size parameter Andrew Jones
2023-10-20 13:05 ` [PATCH v2 2/6] RISC-V: Move the hwprobe syscall to its own file Andrew Jones
2023-10-20 13:27   ` Conor Dooley
2023-10-20 13:05 ` [PATCH v2 3/6] RISC-V: hwprobe: Introduce which-cpus flag Andrew Jones
2023-10-20 13:05 ` [PATCH v2 4/6] RISC-V: selftests: Statically link hwprobe test Andrew Jones
2023-10-20 13:05 ` [PATCH v2 5/6] RISC-V: selftests: Convert hwprobe test to kselftest API Andrew Jones
2023-10-20 13:05 ` [PATCH v2 6/6] RISC-V: selftests: Add which-cpus hwprobe test Andrew Jones
  -- strict thread matches above, loose matches on Subject: below --
2023-08-30 16:49 [PATCH v2 0/6] RISC-V: Enable cbo.zero in usermode Andrew Jones
2023-08-30 16:49 ` [PATCH v2 4/6] RISC-V: selftests: Statically link hwprobe test Andrew Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox