Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1646815pxb; Mon, 8 Mar 2021 02:56:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJylTxL1a5yrCZWdJ9qqykDbVou9LK1blvKh9PHoJ51CsSkX+LQCulAj7o69AGwOcQ5bNwaB X-Received: by 2002:a05:6402:31b7:: with SMTP id dj23mr21837602edb.245.1615200998884; Mon, 08 Mar 2021 02:56:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615200998; cv=none; d=google.com; s=arc-20160816; b=sWI/avyi5WTpgSwtd61iFBzfj2RSdcyf3YhzNwIVKW/OCQXPyKUFfzTpWdAYtCjPF9 WKD5gTM5jTxN9t2/cjDR6OyGVoxJ/mJag88kO7rM8rBf6p3wYE/TY0HN48mG+Pgzaj98 ztzIVeFwb5Hye1Mr3umWesh4XIScf8rCqeQgUNNvnTTKSZ6ucFaFlx223iOXcJDZvOoH fLZc+EevVWPjRgGulqP+yZeakCmGWNjvq+lqbKerAMsK/cbBIn/StaNmTlKw44akn122 9w5s+gywZFF2XM/xJhNvBcOaOxaYcY8jD1u+x3pbKwB/xFXERF4fw6fSpbwUcbegCqTu RJrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=zDjtQNZmAQRPgQIJYVRtA4TD1wRJeRY/dIfm2pzVt5g=; b=F2KJUVyPz8dTOrzfRwZbIAmas23yCGMw8b6YPXUFfMSmZzhkNIbV9Cf2RP/YjmZNdc EaaEY189KMbxsUPwKo+Q4PelgfhcGhf1gm3eDoyYGTld900PlFF70lTthTuwcsZje+vR fzqATr9ZHawLbGz2RqYDWBdypH3ZIADHDjyhJoEtyxLfHIVoaNbCGTF1sfFLo3atl7OU iCnaDZiC63/cntYemx82/5Zzpi/tq4kbEKBz+nA1K/JUVhIchhUSuKSSUqtOR1mkMqQX P6HmxOG1mYW38vi/g3/aXaHbYfiSt4YAQnXwHPmLSZHAvzw61uCosgYFkdz9U/WlvTIG 8h3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b="TSg+/m/5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a22si6690846ejp.696.2021.03.08.02.56.16; Mon, 08 Mar 2021 02:56:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b="TSg+/m/5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231411AbhCHKzP (ORCPT + 99 others); Mon, 8 Mar 2021 05:55:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231445AbhCHKzN (ORCPT ); Mon, 8 Mar 2021 05:55:13 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20AC0C06174A for ; Mon, 8 Mar 2021 02:55:13 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id d15so10947547wrv.5 for ; Mon, 08 Mar 2021 02:55:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zDjtQNZmAQRPgQIJYVRtA4TD1wRJeRY/dIfm2pzVt5g=; b=TSg+/m/5UJGeJ9QQlUITU26UTedPS5x8JOFoSSBWAHRXgDJ7pYCIHhPRe2W5FnvzyF q1Dib0oqd1htD8PjdT9JjI5ZcsgeBtbxZqeCRHOfcb9PFw9IY1SAc7NNHAvCgUsq9JPP gUluhBJCV6iaBSFN6BCdx1ZXRoOL1X5E43wLU/G3PtaByAW5Xy7MUf4iHBb53XZHVoD0 bV9cdkJY9gERa3yDgr+stdLQFNJ2kTVWC09m+c8xgqRwyomAONNoTlznS180sj2TK6V1 6pHvK3xMjVfZ1PcWAF5bP81dgxmjy2ppGJ0FC1PGbMP7Xcn5EGPLw0TxdXEEJSFQF+PG jVcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zDjtQNZmAQRPgQIJYVRtA4TD1wRJeRY/dIfm2pzVt5g=; b=VugCpYCF3cCz4HZlLqvfhYSeJu8uVhElkfUP+XqyD8OmHAylhUntBqz9qzEGlCWH60 2MaUJoCucVTyX9NeIVucEBY4243skBlCaXYFsF+Q4ueAlCcS3FBYTb/qhKtXWEZXItoo ogOgVvAdJq3UfcTTGmBTsBv1l9UaWRX+L6NARqdahSohWN3JKH9UiLIDjB+3stydGDKe +ylaaUzlfw9hzbIpCwf4r4DsmHv6OEkRQ1l6SXvuODhrRfLee7EQtaz7SdrAWzrMP2kq k+enPeeipCRlHkMiPgNkNmNpmdWcVJA3H3pg44M2dFkBgKQZVthE6n1kuxQdV73vRUzw c/ZQ== X-Gm-Message-State: AOAM532wxNbc48apDNLL1i6UC7NwDZ6efeToopd1gJus3XIq/jhYhCdi znLLdgqc3QXhCpRDI6oNX9+gKla1dDXilMLWGvtWaA== X-Received: by 2002:adf:d236:: with SMTP id k22mr22289991wrh.144.1615200911703; Mon, 08 Mar 2021 02:55:11 -0800 (PST) MIME-Version: 1.0 References: <20210306054801.18263-1-xypron.glpk@gmx.de> In-Reply-To: From: Anup Patel Date: Mon, 8 Mar 2021 16:25:00 +0530 Message-ID: Subject: Re: [PATCH 1/1] RISC-V: correct enum sbi_ext_rfence_fid To: Atish Patra Cc: Heinrich Schuchardt , Paul Walmsley , Palmer Dabbelt , Albert Ou , Atish Patra , Anup Patel , Kefeng Wang , linux-riscv , "linux-kernel@vger.kernel.org List" , Sean Anderson Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 8, 2021 at 1:19 PM Atish Patra wrote: > > On Sat, Mar 6, 2021 at 4:12 AM Anup Patel wrote: > > > > On Sat, Mar 6, 2021 at 11:19 AM Heinrich Schuchardt wrote: > > > > > > The constants in enum sbi_ext_rfence_fid should match the SBI > > > specification. See > > > https://github.com/riscv/riscv-sbi-doc/blob/master/riscv-sbi.adoc#78-function-listing > > > > > > | Function Name | FID | EID > > > | sbi_remote_fence_i | 0 | 0x52464E43 > > > | sbi_remote_sfence_vma | 1 | 0x52464E43 > > > | sbi_remote_sfence_vma_asid | 2 | 0x52464E43 > > > | sbi_remote_hfence_gvma_vmid | 3 | 0x52464E43 > > > | sbi_remote_hfence_gvma | 4 | 0x52464E43 > > > | sbi_remote_hfence_vvma_asid | 5 | 0x52464E43 > > > | sbi_remote_hfence_vvma | 6 | 0x52464E43 > > > > > > Fixes: ecbacc2a3efd ("RISC-V: Add SBI v0.2 extension definitions") > > > Reported-by: Sean Anderson > > > Signed-off-by: Heinrich Schuchardt > > > > Good catch. > > > > I guess we never saw any issues because these calls are only used by > > KVM RISC-V which is not merged yet. Further for KVM RISC-V, the HFENCE > > instruction is emulated as flush everything on FPGA, QEMU, and Spike so > > we did not notice any issue with KVM RISC-V too. > > > > OpenSBI & Xvisor also define the same order as Linux kernel. The > existing order(in Linux kernel) > makes more sense w.r.to Lexicographic order as well. > > Should we just fix the spec instead ? I would not recommend that because RFENCE is part of the released SBI v0.2 spec. We have to be more careful in software to follow the spec correctly. Regards, Anup > > > Looks good to me. > > > > Reviewed-by: Anup Patel > > > > Regards, > > Anup > > > > > --- > > > arch/riscv/include/asm/sbi.h | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h > > > index 99895d9c3bdd..d7027411dde8 100644 > > > --- a/arch/riscv/include/asm/sbi.h > > > +++ b/arch/riscv/include/asm/sbi.h > > > @@ -51,10 +51,10 @@ enum sbi_ext_rfence_fid { > > > SBI_EXT_RFENCE_REMOTE_FENCE_I = 0, > > > SBI_EXT_RFENCE_REMOTE_SFENCE_VMA, > > > SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID, > > > - SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA, > > > SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID, > > > - SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA, > > > + SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA, > > > SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID, > > > + SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA, > > > }; > > > > > > enum sbi_ext_hsm_fid { > > > -- > > > 2.30.1 > > > > > > > > > _______________________________________________ > > > linux-riscv mailing list > > > linux-riscv@lists.infradead.org > > > http://lists.infradead.org/mailman/listinfo/linux-riscv > > > > _______________________________________________ > > linux-riscv mailing list > > linux-riscv@lists.infradead.org > > http://lists.infradead.org/mailman/listinfo/linux-riscv > > > > -- > Regards, > Atish