Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1581218pxb; Mon, 8 Mar 2021 00:45:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJyF+L349Lxs939sJ52aUioyu/P/ziO5ATp5szuuFBMN0hMj9oc/ty97Demw2DAROEdFfH2J X-Received: by 2002:a17:906:12db:: with SMTP id l27mr13732974ejb.500.1615193159397; Mon, 08 Mar 2021 00:45:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615193159; cv=none; d=google.com; s=arc-20160816; b=qR6K5DdIn0Gt2DyLyll60YV4AK/lhLEvwv9PxvARsNAT3DU2xMmMxvMK8K3EBAbC6i 7ga1ae9WCtrk+heh4a+cRd0DpXX/5CYp1oJGPOLdBRzAQiCgR0nVBN4dUAS7tUVysMqq dsRbmv/XSBKea/y5IMUhFC5CM/m2Tw9Vb8LKzTByGm/wQRXe+oiEewq0AI9IvUJIeT7U YAl+vIkusX94xAgs4Pve4uu0l7he35MoysdwJz6gHDT+K0hxvLbO7DWHJP6eK4fCHCNT I8Jc/4LrIUVk7pxHrM/cmYTXrNx3LdLWLkkeKtU0NnaWiwKiBdA2rStJZRMNKBjeirYD Fhqg== 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=35KjzI8H1oyETbm3EJBElOyyMkIyjKEhTf5PaBQsSuc=; b=X3evl9vm+oIdY48fyVJlfvOtpR6Hayqs9KyXewXDZQCv1uD0RsHQnvTI1JKOz3Hzzv vGJaftTvNt0ejJkEzYet0d8be4E5q72gf/wx/rPwlTV2jlcTCQSISRstiiJ5fGGaGNBi Rq0YgBD/gGNNMXsL2AOEe3gx/cdSd2Y4MXK1FS9KAtr+HRBPDWZIrtHsEzQbFp6yrbPy STxnrLmUtiFDMKj95XAy6u1gfmjO3MgXg+Fkw+MdY8F180m2GXcknooRmxV8QK3PemrH eyQd+r0BI26228mixy2K8VcnBA/ncx7CSD0H3eeC7vxXYiIcHVyI8+aovLsYuctqaicf 6Kbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@atishpatra.org header.s=google header.b=N440It6Z; 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 s20si6439440eji.61.2021.03.08.00.45.36; Mon, 08 Mar 2021 00:45:59 -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=@atishpatra.org header.s=google header.b=N440It6Z; 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 S230078AbhCHIET (ORCPT + 99 others); Mon, 8 Mar 2021 03:04:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230034AbhCHIDy (ORCPT ); Mon, 8 Mar 2021 03:03:54 -0500 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 485B0C06174A for ; Mon, 8 Mar 2021 00:03:54 -0800 (PST) Received: by mail-il1-x12f.google.com with SMTP id z9so8059111iln.1 for ; Mon, 08 Mar 2021 00:03:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atishpatra.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=35KjzI8H1oyETbm3EJBElOyyMkIyjKEhTf5PaBQsSuc=; b=N440It6ZjtVHQoZ0CL+Skb7nhMpnbFvAXTNuFhabhdfJ6oi6sNGZh1UBsx2X4Lfx/s h73OpZMkI74nnbntL7In8jM9f2ba8jGZt3vUiF7ZmwQHyemFf5FIwzI6XWrXq6jvcxSo y9UtMF+emMvGtGG246bTOyq+xAIENGVbUmGFA= 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=35KjzI8H1oyETbm3EJBElOyyMkIyjKEhTf5PaBQsSuc=; b=thzmeytXBT6aXMtz4iJxIjRhkfIP89C+TsNLPKop6REOnLumuxdmspe1+5MyYOxF7B mp6+EEqgUHvVNC+kVFom+jCZMsTOGS9GxV9V4s959tAG5GuJBeHLC4Yl3SyBYXlJlZIO 1jxHnvtRy/YXBRZhkU/fZw3EL+pZpERwCLwKg/2IMCyuZEPDYSrwljIM+NuMTjfFjHFF c/uUhIy0wAqbuwOUvfQGRoWV2+ZekNaCHbPn/ChlA0a9fKgJ7FTs0vtLQLcFYLbedxsD oL+THfLFxvPPKz/WRzMqdNjHOTMENIX4kI8zD7Vq5jZnwmLU/jKQNleXFiNAaZc73Wko bLBA== X-Gm-Message-State: AOAM532S6X+YbSyMj692qFVTc0qS+UJDR2ZtiobYMgwiRwe2X3bMLM0V m9Nk76LeuALyNmIBUM0YfkVg5a9gVypP/NQrWCJG X-Received: by 2002:a05:6e02:1a68:: with SMTP id w8mr18952717ilv.147.1615190633454; Mon, 08 Mar 2021 00:03:53 -0800 (PST) MIME-Version: 1.0 References: <20210306054801.18263-1-xypron.glpk@gmx.de> In-Reply-To: From: Atish Patra Date: Mon, 8 Mar 2021 00:03:42 -0800 Message-ID: Subject: Re: [PATCH 1/1] RISC-V: correct enum sbi_ext_rfence_fid To: Anup Patel 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 Sun, Mar 7, 2021 at 11:49 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 ? > We do need to notify RustSBI & Diosix authors about this change in case we decide to do so. However, RustSBI added rfence support a few weeks back only [1]. I could not find any rfence reference in Diosix. Thus, the impact should be very minimal if the spec is fixed. [1] https://github.com/luojia65/rustsbi/commit/6e06b4e8e96e05b69157dd5477d433cc932c8a64 > > 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 -- Regards, Atish