Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2814847pxb; Tue, 9 Mar 2021 11:30:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzGH7WfQdUDfQ/Kepc7Z5Tp2cQzDnlV4SE5+AmtBUkEYzzorr/b8cOgxDA2f0QTvtCegNvv X-Received: by 2002:a05:6402:520b:: with SMTP id s11mr5981191edd.212.1615318249899; Tue, 09 Mar 2021 11:30:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615318249; cv=none; d=google.com; s=arc-20160816; b=DQ4j3QuwJiRwLE4dBGW/JOK3bEN+2nqUxQa/PFEv4r02wtDnCogzlJ0664v/S8TU5L 7BLIJiGQLoyEJETpxHuP4OaZWsaUVuSqs5wIINL6fr/FLbwvhbhRh3nMQlG22wU/v1EC x2r2YJR4jQDKZM8T6/wy9xP7OwrdwbS5ZUpQ8V8ezWMQJBf4T1QSxV76mq7i6MgrDYAz R3BL9WIC7UHprIUpK3+KqX9jJtA5P53Qr1Ox3vBzDbK4A1DlRS87lDpTgJeoaDbDu4bH fzf/FLgSfYMwR+tbe2HHep45UZont+wUHj0ZO1GTjxpcRQIdnmLz0YRVx5+JS1VborY6 QxZQ== 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=nRYlUnr4w7NdPjwA3KubW4AmoT2UPgChOLUTL/VtfPk=; b=ZhRf+6gUBnr3k3DKwYsHBYQKwLfuy3IAtlOg2vBvwb+puB2YqQ0yfb3ys3xEriLioH cD2T2FFzm1arZkQMtpBlxEjLJn/p3vCBksnoR6tEvMEk4VNrg48zpJ15+K5gRfPbVloY SrPMBjsDxzA9Q/Y7vmIRDFhdNnLL1V9cQW+iBAL46OxrOTV2C64T4AU5ghpdB2t9k47N Jv/2KRAcj3uZD89Vc819ntvKeP1UkU8f4v3Wf2gMg8hUjU6uIxEPIupMSk8A1V0NRdai dW3BrlnIAyrIrO9D/Dnh8oJLrVeuBGQ/GiIGvNlAN8J1GRrR49lDVtvF0DO8s7IUqEo9 kg3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@atishpatra.org header.s=google header.b=mDWExY0W; 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 n21si9972067edv.569.2021.03.09.11.30.26; Tue, 09 Mar 2021 11:30:49 -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=mDWExY0W; 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 S231138AbhCIT3F (ORCPT + 99 others); Tue, 9 Mar 2021 14:29:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231366AbhCIT2u (ORCPT ); Tue, 9 Mar 2021 14:28:50 -0500 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4324C06174A for ; Tue, 9 Mar 2021 11:28:50 -0800 (PST) Received: by mail-io1-xd33.google.com with SMTP id o9so15212777iow.6 for ; Tue, 09 Mar 2021 11:28:50 -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=nRYlUnr4w7NdPjwA3KubW4AmoT2UPgChOLUTL/VtfPk=; b=mDWExY0WeRXBWotEc5uhp04JfsILSL83l5gzcO5ozwbdx+tNRC2Laxeiuq3wXWniPp ZLay7OdgkMkNqiTs7pwLT4+NmtICkqcCnYGjjRFtZwyZvdMfhdYMGze2N3oGbYdt4qlN TpJMQoyTTaMZpyleyudvwlHN0EcxA819hFLEI= 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=nRYlUnr4w7NdPjwA3KubW4AmoT2UPgChOLUTL/VtfPk=; b=FERRNMlzN6m02QUopS2dSOTMWJRlkG3UjnOJ3YpD2Kj1VhJ+Cm21XgGTdmUvvlGz3z T1wT0z7l8M3VcR1FsIZY/twxAS8lXPP6N536Mts6tASVw0PmzIiwP+o+4yQI6VVw16F6 CwbfgLwm8AamIetMnqGU3U6aZv42qKs1My3NFqiGQ6V1AXrZEe30DeFp+9UxzN/rSGwK QhYHA1CUUEJQJSlCD/shfyCsuyG2kinfc5EdpnhKBJZngSSaa2KQz3EjMqJjDBY0gtjs KKnEhCE17teFieeXG5qp2rEuTtMhpjnYmRZWIuNyVBPuj5XC//VTtse5Fy35YNJ0AlDK EGVQ== X-Gm-Message-State: AOAM5307VtY+he6C7kGtIip2qtSXLtPELxsxD0HWyFDpJJw4aQOMaazw NsGu4FPE5KVuvNvMssFUzsUNnEDaKx3Tn6r3kTl1 X-Received: by 2002:a6b:3c1a:: with SMTP id k26mr24050777iob.113.1615318130243; Tue, 09 Mar 2021 11:28:50 -0800 (PST) MIME-Version: 1.0 References: <20210306054801.18263-1-xypron.glpk@gmx.de> In-Reply-To: From: Atish Patra Date: Tue, 9 Mar 2021 11:28:39 -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 Mon, Mar 8, 2021 at 2:55 AM Anup Patel wrote: > > 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 > > > Reviewed-by: Atish Patra > > > 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. > Fair enough. > We have to be more careful in software to follow the spec correctly. > Agreed. Apologies for the slip up. > 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 -- Regards, Atish