lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260127070259.2720468-1-dapeng1.mi@linux.intel.com>
Date: Tue, 27 Jan 2026 15:02:56 +0800
From: Dapeng Mi <dapeng1.mi@...ux.intel.com>
To: Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...hat.com>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Namhyung Kim <namhyung@...nel.org>,
	Ian Rogers <irogers@...gle.com>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
	John Garry <john.g.garry@...cle.com>,
	Will Deacon <will@...nel.org>,
	James Clark <james.clark@...aro.org>,
	Mike Leach <mike.leach@...aro.org>,
	Guo Ren <guoren@...nel.org>,
	Paul Walmsley <pjw@...nel.org>,
	Palmer Dabbelt <palmer@...belt.com>,
	Albert Ou <aou@...s.berkeley.edu>,
	Alexandre Ghiti <alex@...ti.fr>
Cc: linux-perf-users@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	linux-csky@...r.kernel.org,
	linux-riscv@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	Zide Chen <zide.chen@...el.com>,
	Falcon Thomas <thomas.falcon@...el.com>,
	Dapeng Mi <dapeng1.mi@...el.com>,
	Xudong Hao <xudong.hao@...el.com>,
	Dapeng Mi <dapeng1.mi@...ux.intel.com>
Subject: [Patch v2 0/3] Perf tools: remove arch-specific __weak

This patch-set remove the below three architecture specific __weak
functions and converted them into the general architecture specific
functions which are dispatched base on "em_machine".

uint64_t arch__intr_reg_mask(void);
uint64_t arch__user_reg_mask(void);
int arch_sdt_arg_parse_op(char *old_op, char **new_op);

The advantage of this conversion is that these architectural functions
can be called even for a different architecture with host instead of
only called on the host architecture.

Although the converted functions shown below can be called on any
architecture, currently they are still only called for the host
architecture (EM_HOST).

int perf_sdt_arg_parse_op(uint16_t e_machine, char *old_op, char **new_op);
uint64_t perf_intr_reg_mask(uint16_t e_machine);
uint64_t perf_user_reg_mask(uint16_t e_machine);

No functional changes are intended in this patch-set.

Please notice this patchset depends on Ian's two patchset,
[1] https://lore.kernel.org/lkml/20260117052849.2205545-1-irogers@google.com/
[2] https://lore.kernel.org/all/20260121021735.3625244-1-irogers@google.com/

Tests:
  * This patch-set is only tested on x86 platforms. No issues are found
    for both intr-regs and user-regs options.
  * Tests on other architectures are welcomed and appreciated.

Changes:
 v1 -> v2:
  * Fixing "PERF_REG_EXTENDED_MASK" redefinition building error by
    changing the "asm/perf_regs.h" header path to relative UAPI path.
    (Patch 1/3)
  * Spliting xxx_reg_mask() and xxx_sdt_arg_parse_op() conversion into 2
    patches.

History:
  v1: https://lore.kernel.org/all/20260123090938.2222960-1-dapeng1.mi@linux.intel.com/


Dapeng Mi (3):
  perf arch: Update arch headers to use relative UAPI paths
  perf regs: Remove __weak attributive arch__xxx_reg_mask() functions
  perf regs: Remove __weak attributive arch_sdt_arg_parse_op() function

 tools/perf/arch/arm/include/perf_regs.h       |   2 +-
 tools/perf/arch/arm/util/Build                |   2 -
 tools/perf/arch/arm/util/perf_regs.c          |  13 -
 tools/perf/arch/arm64/include/perf_regs.h     |   2 +-
 tools/perf/arch/arm64/util/Build              |   1 -
 tools/perf/arch/arm64/util/perf_regs.c        | 141 ---------
 tools/perf/arch/csky/Build                    |   1 -
 tools/perf/arch/csky/include/perf_regs.h      |   1 +
 tools/perf/arch/csky/util/Build               |   1 -
 tools/perf/arch/csky/util/perf_regs.c         |  13 -
 tools/perf/arch/loongarch/include/perf_regs.h |   2 +-
 tools/perf/arch/loongarch/util/Build          |   1 -
 tools/perf/arch/loongarch/util/perf_regs.c    |  13 -
 tools/perf/arch/mips/include/perf_regs.h      |   2 +-
 tools/perf/arch/mips/util/Build               |   1 -
 tools/perf/arch/mips/util/perf_regs.c         |  13 -
 tools/perf/arch/powerpc/include/perf_regs.h   |   2 +-
 tools/perf/arch/powerpc/util/Build            |   1 -
 tools/perf/arch/powerpc/util/perf_regs.c      | 172 -----------
 tools/perf/arch/riscv/include/perf_regs.h     |   9 +-
 tools/perf/arch/riscv/util/Build              |   1 -
 tools/perf/arch/riscv/util/perf_regs.c        |  13 -
 tools/perf/arch/s390/include/perf_regs.h      |   2 +-
 tools/perf/arch/s390/util/Build               |   1 -
 tools/perf/arch/s390/util/perf_regs.c         |  13 -
 tools/perf/arch/x86/include/perf_regs.h       |   2 +-
 tools/perf/arch/x86/util/Build                |   1 -
 tools/perf/arch/x86/util/perf_regs.c          | 283 ------------------
 tools/perf/util/evsel.c                       |   4 +-
 tools/perf/util/parse-regs-options.c          |   2 +-
 .../util/perf-regs-arch/perf_regs_aarch64.c   | 137 ++++++++-
 .../perf/util/perf-regs-arch/perf_regs_arm.c  |   7 +-
 .../perf/util/perf-regs-arch/perf_regs_csky.c |   7 +-
 .../util/perf-regs-arch/perf_regs_loongarch.c |   7 +-
 .../perf/util/perf-regs-arch/perf_regs_mips.c |   7 +-
 .../util/perf-regs-arch/perf_regs_powerpc.c   | 176 ++++++++++-
 .../util/perf-regs-arch/perf_regs_riscv.c     |   7 +-
 .../perf/util/perf-regs-arch/perf_regs_s390.c |   7 +-
 .../perf/util/perf-regs-arch/perf_regs_x86.c  | 281 ++++++++++++++++-
 tools/perf/util/perf_regs.c                   | 103 ++++++-
 tools/perf/util/perf_regs.h                   |  27 +-
 tools/perf/util/probe-file.c                  |   3 +-
 42 files changed, 767 insertions(+), 717 deletions(-)
 delete mode 100644 tools/perf/arch/arm/util/perf_regs.c
 delete mode 100644 tools/perf/arch/arm64/util/perf_regs.c
 delete mode 100644 tools/perf/arch/csky/Build
 delete mode 100644 tools/perf/arch/csky/util/Build
 delete mode 100644 tools/perf/arch/csky/util/perf_regs.c
 delete mode 100644 tools/perf/arch/loongarch/util/perf_regs.c
 delete mode 100644 tools/perf/arch/mips/util/perf_regs.c
 delete mode 100644 tools/perf/arch/powerpc/util/perf_regs.c
 delete mode 100644 tools/perf/arch/riscv/util/perf_regs.c
 delete mode 100644 tools/perf/arch/s390/util/perf_regs.c
 delete mode 100644 tools/perf/arch/x86/util/perf_regs.c

-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ