From patchwork Wed Jan 8 02:08:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13930044 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 47C87E77197 for ; Wed, 8 Jan 2025 02:28:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Vr1AmSpAXQaPMTqNcGDOgGl9O+bLngonO0DcMs8xKEA=; b=nR53nMJT8yfa3UoRickZ3Ilw9N hbRDmKHJFwUGI3Ta+lalFiMCRSD8DTuXSlnsCESp7iJx9A66WeASi/N8pUtqCbfQBDl2uWyLlVv/e qlPlQh/4rY16o1wLJLwa4UBK8/Z5zZN0t/fKaVrO7Gkw92ai29ZHkOKWmm1A5we6RHDNEXNtTsRYr 1VlhKytfRPIC9RJPctxXgHaas1rQ9DSoKvREUskiSHdWBlA4RvODKRBlxxV/PCXzyR0MNcXeY/ywq O8nVyn4Mx4vQ7velWkL02YOnckcXXDUGbGF9uEp+lbitrvuki6y/Q95Aa2Pobg1bGEg0ig52Cns43 QqRbdIpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tVLoB-00000006tmR-0wBG; Wed, 08 Jan 2025 02:28:35 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tVLV0-00000006p1g-0KTa for linux-arm-kernel@lists.infradead.org; Wed, 08 Jan 2025 02:08:48 +0000 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-2161eb94cceso169105895ad.2 for ; Tue, 07 Jan 2025 18:08:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1736302125; x=1736906925; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Vr1AmSpAXQaPMTqNcGDOgGl9O+bLngonO0DcMs8xKEA=; b=HJIBzA9ai7qFZir0iMZItDV3TLYcnv9JjCWSdKaXXQ3ZBcDIjU6xO4QCoJwQ3/ovsJ HCI5akVVwFNh37kUWfNwL9R+PO0rt/KuOLoE+oBqkLxZGRwJFNDdh64bY/rLmqQW6faj O9O36K+rYU81x9U4mNLzPDOIWPaOpcM0m8JwxU6QgTCAC9+G21iiwJjX+8g+6uJL7PuB 1nPNpWZtn3ZCXTH7BpqUTvyCj+l4rcrJ2yB2p4qcHxFjHsiQgzQsPxQdnXa28N3CTHcZ YuO4ca/ynGbhFcD9loadF1KLMFPq58o+UDgnCme9hENepdQEG0ZBBLCauHEOAY1yqomy 9D4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736302125; x=1736906925; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Vr1AmSpAXQaPMTqNcGDOgGl9O+bLngonO0DcMs8xKEA=; b=a3R/bCa8QZLrRcFv3ToKq2h7CN7+UACfc/69BXQKriLd2HbwTQEafywdDU7uO2ODhO ob5pj+JTm0F0oAiJLTyjoCtu55bbaDcKyY5Y00TfE4EGXyU5eOuhSyT+bxYUZ6aHQQH+ CAISkpAHKy+cEPBcwoqANgRpHnIaqKA6gFf4oYH/BD3bn7upgZn3yI1907v+9ua1ft20 /Z6jG2pfNX7b7mRvFn2ANWVijCd0tfvXMiVjQTTBEKy4qPedUennhYoFhjSk+gG26XOk wLSlI7Lnzsk0vXaN4m6HeO36DDxbeJfy1xYSVH5ITYYuVwRo8mP3w8qEhR94YzKXCtMk Y1VQ== X-Forwarded-Encrypted: i=1; AJvYcCVdcU9pg81Sp0TaqKkNCDtXwvOI3cVw/lQPYktrs6uT3Ldj5tw+yPaub56H8taupOL4SYLT4d7FzNXTlshtdcJU@lists.infradead.org X-Gm-Message-State: AOJu0Yyy5YkBdvlBr8eLcN0465YkKKu47akl50fYQPmZItKhEhJf2/de pVRyI6hKQVh6urEL2yZS+C/AfuFYfHpbWRoDTLmhKkONO2sAGxiEsLX1APacao4= X-Gm-Gg: ASbGnctmZC1m4tml5KTl7bl1H4YAm+CCdv4UK85rsQ9nM4YLJMR0M5FdrmCqdn97h1T O3NvLj9YgDZcz7LrZcBsWCxi3KnEUGWXoPYSKn2kNDzvtVRFAY69DWvjQiDEoXpX+p2E0NkGz29 G9GQ15dO0zClMQytgeDtG9fwHLLNV1IStH2cSE4Aj5pvKwpo/Aw+Glf/oFau73xlQ671kcXgXmi ZwnWFAqpbMYyEAKWHg8NihHmn7SPKYnPuFnznoO+y++n56hgsM1DfNVgppxvoYGzkUf7TIR X-Google-Smtp-Source: AGHT+IHFCV6DoMxpthinrRcTWbfIS/h/v2ZDYtOGvPB+QgXmKxtEYUP/pj8/+spK4fFqnVlk80B97A== X-Received: by 2002:a17:902:d4c4:b0:215:9ea1:e95e with SMTP id d9443c01a7336-21a83f591c3mr17725325ad.13.1736302125552; Tue, 07 Jan 2025 18:08:45 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dca0282fsm316662405ad.259.2025.01.07.18.08.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2025 18:08:44 -0800 (PST) From: Charlie Jenkins Date: Tue, 07 Jan 2025 18:08:03 -0800 Subject: [PATCH v5 15/16] perf tools: s390: Use generic syscall table scripts MIME-Version: 1.0 Message-Id: <20250107-perf_syscalltbl-v5-15-935de46d3175@rivosinc.com> References: <20250107-perf_syscalltbl-v5-0-935de46d3175@rivosinc.com> In-Reply-To: <20250107-perf_syscalltbl-v5-0-935de46d3175@rivosinc.com> To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnt?= =?utf-8?q?her_Noack?= , Christian Brauner , Guo Ren , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Jonathan Corbet , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, linux-csky@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=6102; i=charlie@rivosinc.com; h=from:subject:message-id; bh=WUFZcwWRoAiXUoWOaiOcPbkuOTuGd1/b8k7miYOj5aI=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ3rtPZbS41VKn73rYrle5x5Qnbf3HLfECb7Cn0dz7Zo9z uwryUnrKGVhEONgkBVTZOG51sDceke/7Kho2QSYOaxMIEMYuDgFYCKcdxj+Z81/I6K6zlLBN/FZ /P1dhi+a0u5K3s840s71V9RzpXNREcP/iG6lw01fsvTtxPRd+J/aHLDdf0vy2BJlTfUdUeoGbq5 MAA== X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250107_180846_125664_8B0B0AF2 X-CRM114-Status: GOOD ( 17.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use the generic scripts to generate headers from the syscall table instead of the custom ones for s390. Signed-off-by: Charlie Jenkins --- tools/perf/Makefile.config | 6 +--- tools/perf/Makefile.perf | 2 +- tools/perf/arch/s390/Makefile | 21 -------------- tools/perf/arch/s390/entry/syscalls/Kbuild | 2 ++ .../arch/s390/entry/syscalls/Makefile.syscalls | 5 ++++ tools/perf/arch/s390/entry/syscalls/mksyscalltbl | 32 ---------------------- tools/perf/arch/s390/include/syscall_table.h | 2 ++ tools/perf/util/syscalltbl.c | 6 +--- 8 files changed, 12 insertions(+), 64 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 7213f6d806e5497309524cacb16bd8313e9bc5cb..feb61be7c4f93d7ebe0530839aebcd03ab8ec425 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -31,10 +31,6 @@ $(call detected_var,SRCARCH) ifneq ($(NO_SYSCALL_TABLE),1) NO_SYSCALL_TABLE := 1 - ifeq ($(SRCARCH),s390) - NO_SYSCALL_TABLE := 0 - endif - # architectures that use the generic syscall table scripts ifneq ($(filter $(SRCARCH), $(generic_syscall_table_archs)),) NO_SYSCALL_TABLE := 0 @@ -90,7 +86,7 @@ ifeq ($(SRCARCH),loongarch) endif ifeq ($(ARCH),s390) - CFLAGS += -fPIC -I$(OUTPUT)arch/s390/include/generated + CFLAGS += -fPIC endif ifeq ($(ARCH),mips) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 0e30da3b781b5a51ea179ab15993391ff7055635..8081adf0e02354b9662a4e3c8493d6b1cec9fe25 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -311,7 +311,7 @@ FEATURE_TESTS := all endif endif # architectures that use the generic syscall table -generic_syscall_table_archs := riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch mips powerpc +generic_syscall_table_archs := riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch mips powerpc s390 ifneq ($(filter $(SRCARCH), $(generic_syscall_table_archs)),) include $(srctree)/tools/perf/scripts/Makefile.syscalls endif diff --git a/tools/perf/arch/s390/Makefile b/tools/perf/arch/s390/Makefile index c431c21b11ef824535c1b9fb6ca4246d666fc97b..0033698a65ce5d5d7ebcc280399957561dd9d2c6 100644 --- a/tools/perf/arch/s390/Makefile +++ b/tools/perf/arch/s390/Makefile @@ -1,24 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only HAVE_KVM_STAT_SUPPORT := 1 PERF_HAVE_JITDUMP := 1 - -# -# Syscall table generation for perf -# - -out := $(OUTPUT)arch/s390/include/generated/asm -header := $(out)/syscalls_64.c -sysprf := $(srctree)/tools/perf/arch/s390/entry/syscalls -sysdef := $(sysprf)/syscall.tbl -systbl := $(sysprf)/mksyscalltbl - -# Create output directory if not already present -$(shell [ -d '$(out)' ] || mkdir -p '$(out)') - -$(header): $(sysdef) $(systbl) - $(Q)$(SHELL) '$(systbl)' $(sysdef) > $@ - -clean:: - $(call QUIET_CLEAN, s390) $(RM) $(header) - -archheaders: $(header) diff --git a/tools/perf/arch/s390/entry/syscalls/Kbuild b/tools/perf/arch/s390/entry/syscalls/Kbuild new file mode 100644 index 0000000000000000000000000000000000000000..9a41e3572c3afd4f202321fd9e492714540e8fd3 --- /dev/null +++ b/tools/perf/arch/s390/entry/syscalls/Kbuild @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0 +syscall-y += syscalls_64.h diff --git a/tools/perf/arch/s390/entry/syscalls/Makefile.syscalls b/tools/perf/arch/s390/entry/syscalls/Makefile.syscalls new file mode 100644 index 0000000000000000000000000000000000000000..9762d7abf17c3f79a6213e7306a5f7b56e833a78 --- /dev/null +++ b/tools/perf/arch/s390/entry/syscalls/Makefile.syscalls @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 + +syscall_abis_64 += renameat rlimit memfd_secret + +syscalltbl = $(srctree)/tools/perf/arch/s390/entry/syscalls/syscall.tbl diff --git a/tools/perf/arch/s390/entry/syscalls/mksyscalltbl b/tools/perf/arch/s390/entry/syscalls/mksyscalltbl deleted file mode 100755 index 52eb88a77c94727aeb8c15427cdd43dfe5f9f2bd..0000000000000000000000000000000000000000 --- a/tools/perf/arch/s390/entry/syscalls/mksyscalltbl +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 -# -# Generate system call table for perf -# -# Copyright IBM Corp. 2017, 2018 -# Author(s): Hendrik Brueckner -# - -SYSCALL_TBL=$1 - -if ! test -r $SYSCALL_TBL; then - echo "Could not read input file" >&2 - exit 1 -fi - -create_table() -{ - local max_nr nr abi sc discard - - echo 'static const char *const syscalltbl_s390_64[] = {' - while read nr abi sc discard; do - printf '\t[%d] = "%s",\n' $nr $sc - max_nr=$nr - done - echo '};' - echo "#define SYSCALLTBL_S390_64_MAX_ID $max_nr" -} - -grep -E "^[[:digit:]]+[[:space:]]+(common|64)" $SYSCALL_TBL \ - |sort -k1 -n \ - |create_table diff --git a/tools/perf/arch/s390/include/syscall_table.h b/tools/perf/arch/s390/include/syscall_table.h new file mode 100644 index 0000000000000000000000000000000000000000..b53e31c15805319a01719c22d489c4037378b02b --- /dev/null +++ b/tools/perf/arch/s390/include/syscall_table.h @@ -0,0 +1,2 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#include diff --git a/tools/perf/util/syscalltbl.c b/tools/perf/util/syscalltbl.c index 8869fed1a58946c590484816354d8c74aff52ee3..210f61b0a7a264a427ebb602185d3a9da2f426f4 100644 --- a/tools/perf/util/syscalltbl.c +++ b/tools/perf/util/syscalltbl.c @@ -14,11 +14,7 @@ #include #include "string2.h" -#if defined(__s390x__) -#include -const int syscalltbl_native_max_id = SYSCALLTBL_S390_64_MAX_ID; -static const char *const *syscalltbl_native = syscalltbl_s390_64; -#elif defined(GENERIC_SYSCALL_TABLE) +#if defined(GENERIC_SYSCALL_TABLE) #include const int syscalltbl_native_max_id = SYSCALLTBL_MAX_ID; static const char *const *syscalltbl_native = syscalltbl;