Received: by 2002:a05:7208:3003:b0:81:def:69cd with SMTP id f3csp151216rba; Tue, 26 Mar 2024 11:43:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCViEUjv5D5FR/DzAHtqtLFLL+L39B0CqNfE2KhAbNGIbXuBLHyiy16XP/dC0IV1tiEMbFHE2YRc0WmXjZCxn9PVE8/PutLVzOltbc/j2Q== X-Google-Smtp-Source: AGHT+IEVcxeTBEgpRjJwY25r0Kt3+CNzgqoNaOTxW3E9T+fwfXIyUd7BlmXMkty8ocoakYL6HlNh X-Received: by 2002:a05:620a:5608:b0:78a:3964:6006 with SMTP id vu8-20020a05620a560800b0078a39646006mr11686506qkn.5.1711478631667; Tue, 26 Mar 2024 11:43:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711478631; cv=pass; d=google.com; s=arc-20160816; b=bEL9XC1pBjzrH9RrFV5Y/nSRfwi9mPaMT4UFJrB7i+G6r6Vss+xJaYWx5s17YAjwWP wB9wcMHuK8rhPHxBTOgShsatj5OIAn9Xu2Fwu7Rb9/gpBIhHtXTdi+CqUJoYsjpV08RT qVxGI7ZFTwVmbxpHXJwn33Indgt7EIzIL3SWh3aEK1gCxMzC2QzYHhDLbFIFwV/voNj9 9OOdbdBKTjvzrINzpGsrXbTj6GlRN6aaZoJ1L/bMX3mnS5sLwn/I3k0WZ41FvpjiFeuL 4J1SyFhuFo2Fb0jQWXMOg/PIT+Urx66S9I5iNE58xV+RBG7SayD5bQ5GcPzqdn8ofeLV nY2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=gCbuLPXZV7f4HtDotQOVlsWjRbL83vanguZwrs1s50s=; fh=KnT0a/vTC2nsINvCZ5m/4s5KKIUCchTKkCw/qxtPixg=; b=AsolYFUZaTUT/jUCWnriCZ7IKm8rhoz/5qyqNyv74muqdSovZcuqaRHMaow5M61PeR B9fvxfuwIEmxcpwFKCFBRU7l+Kx8Ae6wH2ds6B+H6vS36wQWOfSurKJx66c7+XcuI4XY WYiA/ut4LskQ07NLskd4SojbCJAle1tG0vtzdbVnrKBOJ90huvhW06qXZVmGT4KxKnY9 au6WyB6m1XhEZdM48uVkFmPkcyXKklLqf6J1foy+y8Xuu+T98r7ujacoKzYIpwZjXBYh 1o+xt+s56tvgML2qXsKe0Ee6eTt4wpuFO9M1j2msrzeWXao53dzg2gWXNu7I+VOCCIvD EgdA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=ghiti.fr); spf=pass (google.com: domain of linux-kernel+bounces-119697-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119697-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z22-20020a05620a261600b0078a52f0d116si6566822qko.148.2024.03.26.11.43.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 11:43:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-119697-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=ghiti.fr); spf=pass (google.com: domain of linux-kernel+bounces-119697-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119697-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 356851C35226 for ; Tue, 26 Mar 2024 18:43:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 90E92130AC3; Tue, 26 Mar 2024 18:43:45 +0000 (UTC) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21D44127B6A for ; Tue, 26 Mar 2024 18:43:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.197 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711478625; cv=none; b=gTMei/gLUzPOkQKEauo4XYfogJqBaSoPOCvVtgI5XJAEamV9bg92BAiMRnk/74mw9QUk1TIUQv6q/M2L/XK6ML3H1aakv0HwVHvvKcX57It5wRKrO8JGDYzpKrh9gRoCyDcwrMlpuGRvAIfFyUdNdEuzq8l06eWyCibBzuhp9cU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711478625; c=relaxed/simple; bh=gnJurj1Z7nnKBazwQ+DpwwKiZ9LcAzlxixav3jk144Q=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qFBj/ZH6ph/l+BGAfvPVLZ9PKlxtwlSH6vzBGVx5d2LxK51VCyqgQiPNE9/SfKu1s3kImID6Kmck4GS8Cynd8tNRSwoIDQLMnp2FzTK90EUCwVZyxAH37Wwk5X407DfWzerr3fY+uLLgCAw+SK6uqJM4WNV6BNgdw9xk6qS+29Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ghiti.fr; spf=pass smtp.mailfrom=ghiti.fr; arc=none smtp.client-ip=217.70.183.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ghiti.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ghiti.fr Received: by mail.gandi.net (Postfix) with ESMTPSA id 8811B1C0006; Tue, 26 Mar 2024 18:43:36 +0000 (UTC) Message-ID: Date: Tue, 26 Mar 2024 19:43:35 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] riscv: Mark __se_sys_* functions __used Content-Language: en-US To: Sami Tolvanen , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: Kees Cook , linux-riscv@lists.infradead.org, llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Linux Kernel Functional Testing References: <20240326153712.1839482-2-samitolvanen@google.com> From: Alexandre Ghiti In-Reply-To: <20240326153712.1839482-2-samitolvanen@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-GND-Sasl: alex@ghiti.fr Hi Sami, On 26/03/2024 16:37, Sami Tolvanen wrote: > Clang doesn't think ___se_sys_* functions used even though they are > aliased to __se_sys_*, resulting in -Wunused-function warnings when > building rv32. For example: > > mm/oom_kill.c:1195:1: warning: unused function '___se_sys_process_mrelease' [-Wunused-function] > 1195 | SYSCALL_DEFINE2(process_mrelease, int, pidfd, unsigned int, flags) > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/linux/syscalls.h:221:36: note: expanded from macro 'SYSCALL_DEFINE2' > 221 | #define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__) > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/linux/syscalls.h:231:2: note: expanded from macro 'SYSCALL_DEFINEx' > 231 | __SYSCALL_DEFINEx(x, sname, __VA_ARGS__) > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > arch/riscv/include/asm/syscall_wrapper.h:81:2: note: expanded from macro '__SYSCALL_DEFINEx' > 81 | __SYSCALL_SE_DEFINEx(x, sys, name, __VA_ARGS__) \ > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > arch/riscv/include/asm/syscall_wrapper.h:40:14: note: expanded from macro '__SYSCALL_SE_DEFINEx' > 40 | static long ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__)) > | ^~~~~~~~~~~~~~~~~~~~ > :30:1: note: expanded from here > 30 | ___se_sys_process_mrelease > | ^~~~~~~~~~~~~~~~~~~~~~~~~~ > 1 warning generated. > > Mark the functions __used explicitly to fix the Clang warnings. > > Fixes: a9ad73295cc1 ("riscv: Fix syscall wrapper for >word-size arguments") > Reported-by: Linux Kernel Functional Testing Do you have the link of the report? So we can add a Closes tag. > Tested-by: Linux Kernel Functional Testing > Signed-off-by: Sami Tolvanen > --- > arch/riscv/include/asm/syscall_wrapper.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/riscv/include/asm/syscall_wrapper.h b/arch/riscv/include/asm/syscall_wrapper.h > index 980094c2e976..ac80216549ff 100644 > --- a/arch/riscv/include/asm/syscall_wrapper.h > +++ b/arch/riscv/include/asm/syscall_wrapper.h > @@ -36,7 +36,8 @@ asmlinkage long __riscv_sys_ni_syscall(const struct pt_regs *); > ulong) \ > __attribute__((alias(__stringify(___se_##prefix##name)))); \ > __diag_pop(); \ > - static long noinline ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \ > + static long noinline ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \ > + __used; \ > static long ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__)) > > #define SC_RISCV_REGS_TO_ARGS(x, ...) \ > > base-commit: 4cece764965020c22cff7665b18a012006359095 You can add: Reviewed-by: Alexandre Ghiti As the commit fixed here was merged in 6.9, this should go into fixes. Thanks, Alex