From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9FD8C433B4 for ; Wed, 12 May 2021 14:48:28 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 33E3B61001 for ; Wed, 12 May 2021 14:48:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 33E3B61001 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:50258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgq9y-0000Wf-Vw for qemu-devel@archiver.kernel.org; Wed, 12 May 2021 10:48:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgq96-0007To-KH; Wed, 12 May 2021 10:47:32 -0400 Received: from mail-yb1-xb35.google.com ([2607:f8b0:4864:20::b35]:35446) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lgq8r-0006En-HL; Wed, 12 May 2021 10:47:27 -0400 Received: by mail-yb1-xb35.google.com with SMTP id i4so31039652ybe.2; Wed, 12 May 2021 07:47:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TIhpazb+NZwwpQ8jJjDfqBzDHPawsuNSMAGKROJQWBM=; b=QHxCMOU7/ea0UUliE8mBYTDKRGOmdPkh+6MFGT7Cc2McRZu1V9S/LBGSzrKz+r3HHZ WssEiSB9gfXNERkh56Ordns+N3v9BmEvlEr7gHlj5hg1Ha4nuUnkuRjoXIslsnDPC21K p8Ez31VtiQK00LFiYDvGwdz0fU00vjicBIcaYNkRt3XRKMRvXkpzxqTLonmrRG+Firh0 yfKczWp2Yv5k12dLNOgzxYNviorwI7YqcCggKWKOCraFSP2XnuYgaqliz9OPyC35E9HY MdaPfqZhr15kATwFTZTOUuxgAeSq9w8Mq4HJPfn2SaOiDvZGnIAGg3JzJQ034Gt+o7IY TJ/Q== 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=TIhpazb+NZwwpQ8jJjDfqBzDHPawsuNSMAGKROJQWBM=; b=KVJw+JG0wU8uGyndkDQx5lKEpdZkS9ODmExXapgdvZ1YF6zRMtK3WeEVOiSZ0J3qr2 2wDt0N4oTCyVF+60hamcChWoIKv5/0mRXK7RCtzgPmH2qwLoMLhyJSvL1Va0f/duZn1P VVOyH0DUS5+w5ZKnOHvwy/8WLo3Wwza7TtOk8hqgC4/vUFReZ3vxrYZyyD2L2fQUkeCn KIdJVG1oiZCP51Yp66jfXjV2SXEgoPQSTjBlQfeNvFf31mD5ErbyzHo06aSUIvl6Hv9E TagLK2Mjnczlzc9oozmOvsV17LEpg7slgp+tNzDfoLyF/AQue8EEfSodcEnGrb5+/zOQ oLgA== X-Gm-Message-State: AOAM531eHG39Rr3Z4t7t4BXnMenK/gUwXnUe3f+Z7wHOcZislB7BqLN4 G55htfjl507p4XD+JNYIZjyDygmqS1hn2gy7G1U= X-Google-Smtp-Source: ABdhPJxfbB4vPpMocbdSYvmTp9EotJnR00RUSjBYLAbmmnXqVRY1aOlMjPcyLgoLhvK80trS+h0KLpSrOWSX1e9ITig= X-Received: by 2002:a25:99c1:: with SMTP id q1mr47340264ybo.517.1620830834041; Wed, 12 May 2021 07:47:14 -0700 (PDT) MIME-Version: 1.0 References: <20210511100722.18065-1-ruinland@andestech.com> In-Reply-To: From: Bin Meng Date: Wed, 12 May 2021 22:47:02 +0800 Message-ID: Subject: Re: [PATCH V2 0/2] Proposing custom CSR handling logic To: Alistair Francis Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::b35; envelope-from=bmeng.cn@gmail.com; helo=mail-yb1-xb35.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dylan Jhong , "open list:RISC-V" , "Alan Quey-Liang Kao\(\(\(\(\(\(\(\(\(\(\)" , wangjunqiang , Bin Meng , "qemu-devel@nongnu.org Developers" , Ruinland Chuan-Tzu Tsai Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Wed, May 12, 2021 at 2:03 PM Alistair Francis wrote: > > On Tue, May 11, 2021 at 8:07 PM Ruinland Chuan-Tzu Tsai > wrote: > > > > Hi all, > > > > My sincere apology that I missed the patch to include our own CSR table > > into the patch series and there were plenty of typos. > > Thus I'm sending out V2 of these tiny patches. > > > > I agree with Alistair's comment on not introducing intrusive code which > > will interfere the generic code structure. Yet since there are > > possibilities that some custom CSRs/instructions could be once drafted/ > > proposed by vendors at first, and made themselves into the standard > > as the implementation become widely adopted. > > > > So in this patch set, we humbly utilzed a glib hash table for inserting > > the `struct riscv_custom_csr_operations`, check if the CSR is a non > > standard one, and then proceed the desired behavior. > > > > Once the non-standard CSRs make themselves into the specification, > > people could easily plug-and-use the code into CSR operation table > > inside `csr.c`. > > > > Ones may have concerns regarding the check code would introduce > > further overhead. For those considerations, I guess it could be solved > > by introducing a build option such as '--enable-riscv-vendor-features' > > to toggle the code. > > > > Cordially yours, > > Ruinland ChuanTzu Tsai > > > > Ruinland Chuan-Tzu Tsai (2): > > Adding premliminary support for custom CSR handling mechanism > > Adding custom Andes CSR table. > > Thanks for the patches. > > Can you please include: > wangjunqiang@iscas.ac.cn > qemu-devel@nongnu.org > bin.meng@windriver.com > > on future patches so everyone is included. Thanks Alistair! > > > > > target/riscv/cpu.c | 28 ++++++++ > > target/riscv/cpu.h | 12 +++- > > target/riscv/cpu_bits.h | 115 ++++++++++++++++++++++++++++++++ > > target/riscv/csr.c | 107 ++++++++++++++++++++++++++++-- > > target/riscv/csr_andes.inc.c | 125 +++++++++++++++++++++++++++++++++++ > > 5 files changed, 381 insertions(+), 6 deletions(-) I didn't see the original patch set in the ML, nor does it show up on patchwork. I wonder is it posted on the ML? Regards, Bin