Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp25177440rwd; Sun, 2 Jul 2023 11:56:18 -0700 (PDT) X-Google-Smtp-Source: APBJJlGCw8VTjVMsjdG0Bnl4xANgOpi5hlCiVSZw+uTLTrt1LiW62LXtbwcaCMwNKRYKmuUmwP5p X-Received: by 2002:a17:90a:19d2:b0:263:ac72:455b with SMTP id 18-20020a17090a19d200b00263ac72455bmr4138426pjj.43.1688324178622; Sun, 02 Jul 2023 11:56:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688324178; cv=none; d=google.com; s=arc-20160816; b=XiYh4JhcsdWQSXx76mRIYyJADv87gpXcthfE7fCRdZAtnNCXOoSrC6vbqv/PwzdhHt +6aaco8MH0wQkXnO7oNKBmRgxj7XyUyQdm8O+Gs3L9Wa2WViMatuP/08sRmYevJdBagT /zF7fIehF+utsb894ycNtK8pBBzOehyi2vB9Id/fdKj/G02ERd+UXapGidBhO70+Cxig 0WkjP0dEY6RCFDvtTyYown+Zk3oifHcmCMD4RHTDmgSh31kCPIW/oKZ5H5/Y9JKDOv5N bsAtH1wY6Ew3fDpzoJ9631CdrI9JmY2pLH+qh1tJcbtf3FMfwzMagz8iJywlu0yiE5YE u66g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=vOFqqT3KP8Tphzlq8RqT6uFxjKAmKLIPCV6N9ab5RyQ=; fh=5Q8QI6WNR7p/0THTqj1PEFDsdN5oaVk4zWg9deckm6o=; b=CKxp3iQYkOR7Xjm5F6u1+SwcL753gtwJYBoI4vGxC1j6RrwLTHO8uobT+c4xrZLE3c 9SArMuJJKZk6mfwV5o0O/M2FVCFBDIUUdXgFdfkTUCGHD0S93Um46VmW7p4zsI+mJ5QH kHvtnwtmkxFPN5vF4tt9NLrEkx0SvqwSz5Rss4HSsZtrUF0cdtyCE8tbfXiSnxKYgy7/ n8I/4BTZHiubB/jYcnum1b7U/2gPXfgkAk3lg+MtEKn0EpQ28UeU+TN+P3M9KjAhPUxU MwJ3doIe2YiDsk+aDgWtRnj7JoLbfvKWrHXuqvTSQzaUuZK0W5rLY9PPXy8BkWsWcLRJ /vwQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z61-20020a17090a6d4300b00262ba8af80dsi16799785pjj.78.2023.07.02.11.56.06; Sun, 02 Jul 2023 11:56:18 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230061AbjGBSvT (ORCPT + 99 others); Sun, 2 Jul 2023 14:51:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229894AbjGBSvS (ORCPT ); Sun, 2 Jul 2023 14:51:18 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DAFABC6; Sun, 2 Jul 2023 11:51:12 -0700 (PDT) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 362Ioxts017366; Sun, 2 Jul 2023 20:50:59 +0200 Date: Sun, 2 Jul 2023 20:50:59 +0200 From: Willy Tarreau To: Zhangjin Wu Cc: thomas@t-8ch.de, arnd@arndb.de, david.laight@aculab.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH v5 07/14] tools/nolibc: arch-loongarch.h: shrink with SYSCALL_CLOBBERLIST Message-ID: <20230702185059.GG16233@1wt.eu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Wed, Jun 28, 2023 at 09:22:21PM +0800, Zhangjin Wu wrote: > my_syscall share a same long clobber list, define a macro for them. > > Signed-off-by: Zhangjin Wu > --- > tools/include/nolibc/arch-loongarch.h | 25 +++++++++++-------------- > 1 file changed, 11 insertions(+), 14 deletions(-) > > diff --git a/tools/include/nolibc/arch-loongarch.h b/tools/include/nolibc/arch-loongarch.h > index 292d6a58dc87..fbb4844f7993 100644 > --- a/tools/include/nolibc/arch-loongarch.h > +++ b/tools/include/nolibc/arch-loongarch.h > @@ -23,6 +23,10 @@ > */ > #define __ARCH_WANT_SYS_PSELECT6 > > +#define SYSCALL_CLOBBERLIST \ > + "memory", "$t0", "$t1", "$t2", "$t3", \ > + "$t4", "$t5", "$t6", "$t7", "$t8" > + That's a good idea, but please be careful when adding macro definitions, we're in code that is used by user space we have no control on, and we're polluting the end user's macro namespace with plenty of names. While one could argue that it's unlikely that some program already defines and uses SYSCALL_CLOBBERLIST, actually with low-level code it's fairly possible. Till now most of the definitions were for stuff that user-space really needs (e.g. STDIN_FILENO, various integer limits). If we start to declare random macros for internal use, at least we should probably prefix them with _NOLIBC_ or something like this to avoid the risk of collision. Willy