From patchwork Mon Nov 29 03:02:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Chang X-Patchwork-Id: 12643321 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C7CDDC433F5 for ; Mon, 29 Nov 2021 03:10:30 +0000 (UTC) Received: from localhost ([::1]:37232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mrX3l-0005io-Pq for qemu-devel@archiver.kernel.org; Sun, 28 Nov 2021 22:10:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43384) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mrWxm-0000bX-Hv for qemu-devel@nongnu.org; Sun, 28 Nov 2021 22:04:18 -0500 Received: from [2607:f8b0:4864:20::62e] (port=37885 helo=mail-pl1-x62e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mrWxk-0008Oy-FP for qemu-devel@nongnu.org; Sun, 28 Nov 2021 22:04:18 -0500 Received: by mail-pl1-x62e.google.com with SMTP id n8so10994674plf.4 for ; Sun, 28 Nov 2021 19:04:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VLQVCed6ybkZddngnPVpusUEwjUjBPVUL9+pI0YvcSI=; b=keVWVN5bYPaZuF9lec18WJ5SBIarBdxhQ1gwFrpCe+TXxKtDxyAgRZtXxQy6GPPDQi QOGfRTZKLARVwohj2kvDgby4TJg1aE7OHgu8Q3/hLSClez1SCL72k5Ib9jnnKTnJbaFr dP3oyaMbnA7tH2swzGoZK8hYBYbQu3PsRNwe8Zh+p5eBwJwZEXkxlQvyLjDs/oBYTotN y1OYwEc2y6i0T0MlRK6+Or2Va7M/Vggfu/BxIjteg5WL+qiR6VtZF3YpoHmWgwx15y56 HRZfzTBDLQAuW9NNYI4cJLh/mmyvZkpbXlOt1wvAIrzd+FCBGQIq4Bd22qz3icQteVpT 1Qjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VLQVCed6ybkZddngnPVpusUEwjUjBPVUL9+pI0YvcSI=; b=z/AiNLjPbLjBwYy01u3IksFbl97rxuhjn/ReG9B2Ypcgfy0YE3ITCvtiVqB32mWdg6 ZYVbl97HLMzHMbpSWrZr2i96CKMg1l6QplTQ6fo1FdFTeQ3wmIr0JHzMutxT1WPwSBu/ pihBCNFVFaWDOtoYLDbE/p5OFbiq5Bg/YALxfQtqfZJkrrgwJI+ApWlB2iJ+D7lwfNJz yiSC0b/Z+oBTIbWLiOgEnw9DuNwszhSxQIMpbueziJTYPBqKGOOL+r4WN3L5I6/LcQIt a3J3Usn2r++Q0XjWhEWTOVFa33K74hiRPksCeFkr00dplOEQIqnmsVUiL/BLqa+SbzcM bIoQ== X-Gm-Message-State: AOAM53123Vt9rBIwPLsqVmX4+4ng/FfS+g71v8S1ohBJUepnJnVdTZ7/ Z293WMDgJULVe3sdoYgn0AYXq+v+NARCpGWo X-Google-Smtp-Source: ABdhPJwsuZuyYFE/FYgjZIPHTVXTMwNejaiQ7t3ctciz0OQ8Dx+Pzi4+cj3nbwsZ85ISxtNMoW30Aw== X-Received: by 2002:a17:90a:f2c2:: with SMTP id gt2mr27535367pjb.178.1638155055201; Sun, 28 Nov 2021 19:04:15 -0800 (PST) Received: from frankchang-ThinkPad-T490.internal.sifive.com (59-124-168-89.hinet-ip.hinet.net. [59.124.168.89]) by smtp.gmail.com with ESMTPSA id oj11sm17904040pjb.46.2021.11.28.19.04.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Nov 2021 19:04:15 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Subject: [PATCH v10 06/77] target/riscv: rvv-1.0: introduce writable misa.v field Date: Mon, 29 Nov 2021 11:02:26 +0800 Message-Id: <20211129030340.429689-7-frank.chang@sifive.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211129030340.429689-1-frank.chang@sifive.com> References: <20211129030340.429689-1-frank.chang@sifive.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62e (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=frank.chang@sifive.com; helo=mail-pl1-x62e.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-riscv@nongnu.org, Frank Chang , Bin Meng , Richard Henderson , Alistair Francis , Palmer Dabbelt Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Frank Chang Implementations may have a writable misa.v field. Analogous to the way in which the floating-point unit is handled, the mstatus.vs field may exist even if misa.v is clear. Signed-off-by: Frank Chang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/csr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/csr.c b/target/riscv/csr.c index 83f4dbd8241..bc149add6ce 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -643,7 +643,7 @@ static RISCVException write_misa(CPURISCVState *env, int csrno, val &= env->misa_ext_mask; /* Mask extensions that are not supported by QEMU */ - val &= (RVI | RVE | RVM | RVA | RVF | RVD | RVC | RVS | RVU); + val &= (RVI | RVE | RVM | RVA | RVF | RVD | RVC | RVS | RVU | RVV); /* 'D' depends on 'F', so clear 'D' if 'F' is not present */ if ((val & RVD) && !(val & RVF)) {