Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6537438rwb; Mon, 12 Dec 2022 03:18:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf6jbayiXXaoZAufIbqML6L/yk/hry1OmgViE4PXHXkNHahVTa5w8CWJbiJ58WuY/LwZt9c0 X-Received: by 2002:a05:6a00:1a53:b0:56c:a62f:b9da with SMTP id h19-20020a056a001a5300b0056ca62fb9damr18922965pfv.27.1670843910816; Mon, 12 Dec 2022 03:18:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670843910; cv=none; d=google.com; s=arc-20160816; b=w0UyL9KEzlfL2JpmSOtFBiTcrOeAg0nBxKZ0guc5OQrbEdq6EBO/2VyNtTSaTEmxkv 6Oor7mUlx6pKhDRtEhV5M3cSki+fCIKNq8WIulQqRs0Qbhs/giwSTuldB5jJEjok0tMB IPK2sJpjZdU6RHOtqSAnpTaMIFTrHrx/PySBK7lbBCIlfJk0dcxW68re+fmCRcLL+HUw PA2QAd8npCBF+EcM5Zb+8zetRC/groS9IZRczx1yWbPQNpR78f1ap9UJciO9QnFUO6uU Vx32wWFgIAi9FXHztSQEn1qwRKMcJoKf/9L+Qyp5eQ9ssCN6hKFOSIj32D2/hVTy9Vvf 3W0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=E/x5RVB0C4ixDlrmRoy61hoV7zGh5kz89ZwW+bn5qGc=; b=X452UmlS8C/550LJkquzoMerDTfOTCvGwB7hyxRxyPbrG4IBKJ0ok0AVtHsNGWUgQE DH8sjh5Zn4oyWD/9JZEPoDrAyIXzFBgNq/PEgIlrr9os/QBGbsytpunbeBw+Pez8TLTs jvVVfSwcc47VzWTJJbM8KwjXnVvWjCUuYt2l4XcEsiUs4DUOy/8woyyyBie9vC9LOJzu mEAd0kzUG0nvw1t2y8jWlx4ftdPHHJA1/zyzMixXxzSC3cWtlpjWX9MXYkNlVEHUxyV1 0ruqERTwsMS9Gz6cpxb3CduAYMETpZaMzbvTsjknXUUZoQqPKyL/hL3dfP9x4EvQe+2N NQtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EG+HYXmL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f7-20020a056a001ac700b00571fe971a74si9411311pfv.41.2022.12.12.03.18.17; Mon, 12 Dec 2022 03:18:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EG+HYXmL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232102AbiLLLHA (ORCPT + 76 others); Mon, 12 Dec 2022 06:07:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231737AbiLLLGY (ORCPT ); Mon, 12 Dec 2022 06:06:24 -0500 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 675B3F5B0 for ; Mon, 12 Dec 2022 02:52:26 -0800 (PST) Received: by mail-pl1-x636.google.com with SMTP id g10so11647053plo.11 for ; Mon, 12 Dec 2022 02:52:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=E/x5RVB0C4ixDlrmRoy61hoV7zGh5kz89ZwW+bn5qGc=; b=EG+HYXmLQxSZjmx5POY+EmrROaM/1qWS18m7mSDvPTzKp7L4UfKD6s+aDktkD8GY08 Ke/a8tma2erKDbfcmaE/No/xAsty8J4/QwU3jCQVYem51lRwhYxpAwdkKF0pmOe8wymn nWFt35X3CTwfHAXN7Br6PVblEDiyeRa7mnubm0m7YEha9DDbU1YzpyKrIG+oprdPyJNI XUpnQQPf6v8s5GxeXghmqhfEEs6fHRR7IfpZpp+MTuWKCN9d0yAF6u1ecOQC3XxIpJ10 P9augjeyRqJS+kcMja1aIC4IvqaK8sBkErcwgkRICnVCurSdbqA2SmoZRtrLWd/PAqdg D2wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=E/x5RVB0C4ixDlrmRoy61hoV7zGh5kz89ZwW+bn5qGc=; b=VA1vMJctR8XCW0uKkL8bA1yjJEdz4anTPRmfd0sVUIiuIofNYXrfywUMjEQQ7Gj25+ 65tpIylVNjdLsNBYZkFkSN7PSEhPumQ8IZE2PxY4zW1p0uaYExOUJ5mZPZiBe2Zn9Nc+ I0tNXNKqR6ou57RkXYpxSIh1TvDcTL3z57eMDw+L/izX/YqL31GgKfaWlQdR+sPnr4dH OTjHK0j3MfspVRbA1rZcd13o33yzrChBX2hHvZhEMWgEb4vaNMJva0HYAr3FSlrd5QId Xib/0nQW9RHOiQz39sWuJjw3svUAhzVUkRNN6bB19cxkihvuEuY8jhcfqQ/MOo/LBh2P I+Dg== X-Gm-Message-State: ANoB5pm107tGHovcEaHs4NMFlzwRZWvmPmIDMAtnjs22m/W3rGsaEgNA OfCmpbvMZkgvJj9MBPX5KbYRIg== X-Received: by 2002:a17:902:e811:b0:189:d8fb:152d with SMTP id u17-20020a170902e81100b00189d8fb152dmr22283049plg.25.1670842345779; Mon, 12 Dec 2022 02:52:25 -0800 (PST) Received: from leoy-yangtze.lan ([152.70.116.104]) by smtp.gmail.com with ESMTPSA id jh19-20020a170903329300b001811a197797sm6008738plb.194.2022.12.12.02.52.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Dec 2022 02:52:24 -0800 (PST) Date: Mon, 12 Dec 2022 18:52:16 +0800 From: Leo Yan To: Arnd Bergmann Cc: Vincent Whitchurch , Arnaldo Carvalho de Melo , Hans-Peter Nilsson , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, John Garry , Will Deacon , Mathieu Poirier , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Kim Phillips Subject: Re: [PATCH] perf arm64: Fix mksyscalltbl, don't lose syscalls due to sort -nu Message-ID: References: <20201228023941.E0DE2203B5@pchp3.se.axis.com> <20201229030933.GC28115@leoy-ThinkPad-X240s> <98978f82-eb78-4fa7-901e-76c3070362e3@app.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <98978f82-eb78-4fa7-901e-76c3070362e3@app.fastmail.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, On Fri, Nov 25, 2022 at 02:56:31PM +0100, Arnd Bergmann wrote: > On Fri, Nov 25, 2022, at 13:54, Leo Yan wrote: > > On Fri, Nov 25, 2022 at 12:53:10PM +0100, Vincent Whitchurch wrote: > > >> It looks like this patch was never applied? AFAICS it is still needed > >> on current HEAD and it still applies cleanly. > > > > Thanks a lot for bringing up this. > > > > Before there have a discussion [1] for refactoring Arm64 system call > > table but it didn't really happen. > > I actually worked on this last week and did a new series to convert > the old asm-generic/unistd.h header into the syscall.tbl format, > and change arm64 to use that. > > You can find my work in the 'syscall-tbl' branch of my asm-generic > tree [1]. This has only seen light build testing so far, and is > probably still buggy, but most of the work is there. The missing > bits are the Makefiles for the other seven architectures using > asm-generic/unistd.h, and checking the output to ensure the > contents are still the same. Thanks a lot for sharing the patch set. I went through the whole patch set, below are several things I observed: - I did a quick compilation but found building failure, this failure is caused by the first patch "arm64: convert unistd_32.h to syscall.tbl format", it removes the macro __NR_compat_syscalls. In file included from ./include/vdso/const.h:5, from ./include/linux/const.h:4, from ./arch/arm64/include/asm/alternative-macros.h:5, from ./arch/arm64/include/asm/alternative.h:5, from ./arch/arm64/include/asm/lse.h:15, from ./arch/arm64/include/asm/cmpxchg.h:14, from ./arch/arm64/include/asm/atomic.h:16, from ./include/linux/atomic.h:7, from ./include/linux/refcount.h:95, from kernel/seccomp.c:18: ./arch/arm64/include/asm/seccomp.h:27:33: error: ‘__NR_compat_syscalls’ undeclared here (not in a function); did you mean ‘in_compat_syscall’? 27 | # define SECCOMP_ARCH_COMPAT_NR __NR_compat_syscalls | ^~~~~~~~~~~~~~~~~~~~ ./include/uapi/linux/const.h:34:40: note: in definition of macro ‘__KERNEL_DIV_ROUND_UP’ 34 | #define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) | ^ ./include/linux/types.h:11:28: note: in expansion of macro ‘BITS_TO_LONGS’ 11 | unsigned long name[BITS_TO_LONGS(bits)] | ^~~~~~~~~~~~~ kernel/seccomp.c:168:9: note: in expansion of macro ‘DECLARE_BITMAP’ 168 | DECLARE_BITMAP(allow_compat, SECCOMP_ARCH_COMPAT_NR); | ^~~~~~~~~~~~~~ kernel/seccomp.c:168:38: note: in expansion of macro ‘SECCOMP_ARCH_COMPAT_NR’ 168 | DECLARE_BITMAP(allow_compat, SECCOMP_ARCH_COMPAT_NR); | ^~~~~~~~~~~~~~~~~~~~~~ - The patch set breaks git bisection, when I use "git bisect" I can find more building failures caused by middle patches. - The patch "arm64: generate 64-bit syscall.tbl" removes macros: __ARCH_WANT_RENAMEAT __ARCH_WANT_NEW_STAT __ARCH_WANT_SET_GET_RLIMIT __ARCH_WANT_TIME32_SYSCALLS __ARCH_WANT_SYS_CLONE3 __ARCH_WANT_MEMFD_SECRET Seems to me we still need to enable these macros so can enable Arm64 specific system calls? - We also need to update the header files: tools/include/uapi/asm-generic/unistd.h You are welcome to CC me when you send out formal patches to mailing list and I can test it (and look if can refine perf code for this). Thanks, Leo