Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp897069rwn; Thu, 8 Sep 2022 10:12:59 -0700 (PDT) X-Google-Smtp-Source: AA6agR6Fk9jLtYmRTeYvfuSrRBKXrMgghS493qAzo+Doz6R5bD5QsgoDgNt+4n7cjPud51e8c2hf X-Received: by 2002:a63:fb56:0:b0:429:983f:b91e with SMTP id w22-20020a63fb56000000b00429983fb91emr8712329pgj.399.1662657179365; Thu, 08 Sep 2022 10:12:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662657179; cv=none; d=google.com; s=arc-20160816; b=Lcv6zsIrs1+t+qG063HDAkTXZ0vKlgRRgux9tPmn61UlCbyTL9bV/sw6qL3ikG2W+9 dyu9S1pelP4idkvo42aR3OeryBj+sidT7c+ojOVu6wNxHOZnqQadMJAWT24vqr0bluPP AMHNOTZo6w0Li5H1wshWfhpkg1NYULleUl3j1VRFfWKHGSqtjXxcX47nETNM1fK/myoC HLYw+ZF13WQpy0IDLiYMY6yteRRqjC9v4BUgHY26jkA4/L6/UceRj9FcEZw1Nmyr+b/C nVNroMCNHoui6nKVMzsKd3iLCtJJJmZqAfkm0j2PG/7kan+1tnwanyZq4ZiP83cWGEG9 VxrA== 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=HYkXg+VQoVJj6IeGT/00BbjRESyJ1qTq+hPTwfNkG3M=; b=iO/ZTRZM94G0Ja5IjtWTuTJa1ILwtiPD5AMyP7Pk3gUM56XgHTC2d3Pee2NXUT2GyZ B/2T6oh7u926uQig+XVsI6K9rigHbKwYFIWA1cAto1DQYZ/3vGxIqmEmqjXEwJ7+3y7h osyLIPCNVWztdk2QAgxGXTQ/KLtqJ23dWivm4Lu9iJJ9btt6k9KwoTRhNFe0rK0SRdU8 4S6zN1fQ6QbfiTfI7DNKfm3vW8oS8/4usABanb6blyME4TZ4lc+N2LZ1rnuDqGlWXE93 tL3+7o6kgvuZ1doDmrfys/HhY1sQyC8YoHLrfgmUMm6idJ1cpO/5Q/A13bBf5hLzPlR0 5HKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=hVzEqYOp; 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 oa18-20020a17090b1bd200b00200229edcd1si313890pjb.55.2022.09.08.10.12.48; Thu, 08 Sep 2022 10:12:59 -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; dkim=pass header.i=@ventanamicro.com header.s=google header.b=hVzEqYOp; 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 S229535AbiIHQ4V (ORCPT + 99 others); Thu, 8 Sep 2022 12:56:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231940AbiIHQzl (ORCPT ); Thu, 8 Sep 2022 12:55:41 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C1E53889 for ; Thu, 8 Sep 2022 09:54:28 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id b16so25336880edd.4 for ; Thu, 08 Sep 2022 09:54:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; 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; bh=HYkXg+VQoVJj6IeGT/00BbjRESyJ1qTq+hPTwfNkG3M=; b=hVzEqYOplJiXNR0qXrqsMYGZoQbw587ASqutE/A55+sAOSlXgJ6GspWw2Ym+KjLXka fiaxTttTHvmbRlwxo1yprNkcGenIVm6v2Nx49Qv2Zm4QSy9S8vifjUDjmK3oX8Z98Yo8 bXcHGCio0UTdcRTGn8wGqD+Uoj25XuP7XM2ccT4/Qbk5b3NKgr+0h4Wa+bgePeLKzxiL 0STAI6oYqdIVxDXN6v5uRIXR/ozWRqSQ13UusKfeaHj4taFCEbCOxSPG21ZaNBMSR07O deGGGFuhD+92QUnaNMRrtxFDvv/JvmWyyGNsKNedGV5QaxIuI7Rzn4JNlNN+3SsVpdbb WvGA== 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; bh=HYkXg+VQoVJj6IeGT/00BbjRESyJ1qTq+hPTwfNkG3M=; b=UGg+TH6rDh4zMKcHG6Otmx005keSZA/TvTp+ccV08TUki4jWtylH7v1BR8M6nP7tb1 pNFk2ScafiwyZ9V4aJ5rtuykqKfZQAMKOpMrK1QbNTSarfYAtWGk2hoc+EsYCBJdUGbS oTP3CLJlxfPfZTVwkRg/O1SXijL/Dv7piAsoDecFYi2nLk9znPJlcYheFfH7i0NFJNTM 7Vh8ffTEX0QBYW0MpiNSpmxbvhZjuANTfKPN7xGsofgAkxUmnrDyuHrwy4iE8jgWcgo1 CA2YKJ37WHlzhkTH5XkQ+CgZvBtxj90pXtYd4sya/tjq7rj/I2dgbwIRLItefpliw054 7RoQ== X-Gm-Message-State: ACgBeo2affbfNBjQTgMcQ7P/h9WkfjUSbO3aoMMxEk21AfW7A6Q/k2ZU O1Iz0Zte+DG6iKdK+4aLOF8TRQ== X-Received: by 2002:a05:6402:d05:b0:425:b5c8:faeb with SMTP id eb5-20020a0564020d0500b00425b5c8faebmr7831185edb.273.1662656066618; Thu, 08 Sep 2022 09:54:26 -0700 (PDT) Received: from localhost (cst2-173-61.cust.vodafone.cz. [31.30.173.61]) by smtp.gmail.com with ESMTPSA id eh13-20020a0564020f8d00b0044f0c01196esm3628593edb.65.2022.09.08.09.54.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Sep 2022 09:54:26 -0700 (PDT) Date: Thu, 8 Sep 2022 18:54:25 +0200 From: Andrew Jones To: Heiko =?utf-8?Q?St=C3=BCbner?= Cc: linux-riscv@lists.infradead.org, kvm-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, anup@brainfault.org, mchitale@ventanamicro.com Subject: Re: [PATCH v2 2/4] riscv: Introduce support for defining instructions Message-ID: <20220908165425.ikiyrmhtbwkmko23@kamzik> References: <20220831172500.752195-1-ajones@ventanamicro.com> <20220831172500.752195-3-ajones@ventanamicro.com> <3006889.o7ts2hSHzF@diego> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3006889.o7ts2hSHzF@diego> 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,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 Thu, Sep 08, 2022 at 05:49:44PM +0200, Heiko St?bner wrote: ... > > +#define OPCODE(v) __ASM_STR(v) > > +#define FUNC3(v) __ASM_STR(v) > > +#define FUNC7(v) __ASM_STR(v) > > +#define RD(v) __ASM_STR(v) > > +#define RS1(v) __ASM_STR(v) > > +#define RS2(v) __ASM_STR(v) > > you might want some sort of prefix here > RISCV_RS1(v) ? > > While trying to adapt this for the cmo stuff I ran into the issue > of bpf complaining that "IMM" is already defined there. > > And names above are generic enough that these also > might conflict with other stuff. > Ah, thanks for the heads up. Indeed, if this gets included in another header, which gets widely included, then we have a good chance of bumping into something. It's a pity, but, as you suggest, we probably need prefixes and __ isn't likely enough alone. I also see __REG is used elsewhere. Thanks, drew > > > > > +#define __REG(v) __ASM_STR(x ## v) > > +#define __RD(v) __REG(v) > > +#define __RS1(v) __REG(v) > > +#define __RS2(v) __REG(v) > > + > > +#endif /* __ASM_INSN_DEF_H */ > > > > > >