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 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 EC31AC25B77 for ; Wed, 15 May 2024 07:48:54 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s79N2-0006e1-6O; Wed, 15 May 2024 03:48:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s79Mx-0006YM-Gr for qemu-riscv@nongnu.org; Wed, 15 May 2024 03:48:13 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s79Mu-0000BV-AP for qemu-riscv@nongnu.org; Wed, 15 May 2024 03:48:10 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-6f44a2d1e3dso5830110b3a.3 for ; Wed, 15 May 2024 00:48:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1715759286; x=1716364086; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ud73vz92nOsf2EEwTWRfZlN26yWfMncbzbCqjllYE+Q=; b=gb3vubuQ67TXuEGB0E3zPiPrFM7hFIQARfW0LxY6UkA2YUcNvr6JjRiZ8wLn5qUbRw JWWnNuERgHPVSd4ctbAeU9SyKKJGHtCipHl6Thu5nTw4VVZtP/tKL8dBP3YQ2Vin92xq qv/feSwYbfwhESRTr+N1Cs7R9BWn/BaVZlCzyiprynl58q3FEMxX/6Og+Up+mKiHPO9V GlwBycFP7fx5WMKbmv1nxzNB4o2QJoP+2/HZgzqvaza9HTrjc2s4zcu8yOjmRXRa2Ehq 7mmlfl39mfQNJg9wtSpviCWD39WTrKE4u3W2T7DpvNNFs4r0UgjcDRt2bbEqxj+AD+/+ TCLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715759286; x=1716364086; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ud73vz92nOsf2EEwTWRfZlN26yWfMncbzbCqjllYE+Q=; b=H48J/hbrDWGLoek1Ig81dqnex3f1GD1+g7aaWnPWPB2FR1tRn6Flppch5pTzbv132n Rewix5WB5uNEXiTXpuN+Be4Ox8RdYk/SgBXHQQfxXIKt48/qfV+s4VpNhqgzySsV/6a8 vwsNYJeKAJkP+Gv6106NyPQ4c+rYg/byPxekUaWxRHN2lB2NemydHh/X3pYLpwAwMMd2 cxMzPsOfOeBMCxBLbvjmxmKoaa4TGKSu4tQZnxltEXjPUmxEk2k+M2Atn+Mm5W6595QE LlaKw4dLZOZIB4BI9DaGVV+m/98vvBAU+lfBSfpYmxcY1HprQVsti43iWTJ0gNB+MOou IznQ== X-Forwarded-Encrypted: i=1; AJvYcCX/al0bUqswYBswDLHhzStntBusncKBgY3+nZ6r72SjQtJDrrfmhgrEbRRBtwKM36WUPyb8s5xesYJHT8JCZYNfSqDUmnw= X-Gm-Message-State: AOJu0YxaQUnHxnpp8hY+YGq5FDa8WV0yt/pkRPgo06XmcFh3U9ppxRbi +uUcJ7+pMUtRsi669cJwdpS70k6tZnvCbLC2OykV5O81gzy1fiBtj3P9fky64aE= X-Google-Smtp-Source: AGHT+IFzXvh+bJ+HptFSKTibqFddAo04I/2H1d9HYbARcJRKgbKNb2WAu+uoIjxYim+tBTGH9DXd4w== X-Received: by 2002:a05:6a00:9285:b0:6e6:98bf:7b62 with SMTP id d2e1a72fcca58-6f4e02ac4cdmr18180011b3a.8.1715759286091; Wed, 15 May 2024 00:48:06 -0700 (PDT) Received: from hsinchu36-syssw02.internal.sifive.com (59-124-168-89.hinet-ip.hinet.net. [59.124.168.89]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f4d2af2bafsm10389060b3a.162.2024.05.15.00.48.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 00:48:05 -0700 (PDT) From: "Fea.Wang" To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Cc: "Fea.Wang" Subject: [PATCH v2 0/5] target/riscv: Support RISC-V privilege 1.13 spec Date: Wed, 15 May 2024 15:53:31 +0800 Message-Id: <20240515075340.2675136-1-fea.wang@sifive.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=fea.wang@sifive.com; helo=mail-pf1-x42b.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, 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-riscv@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-riscv-bounces+qemu-riscv=archiver.kernel.org@nongnu.org Sender: qemu-riscv-bounces+qemu-riscv=archiver.kernel.org@nongnu.org Based on the change log for the RISC-V privilege 1.13 spec, add the support for ss1p13. Ref:https://github.com/riscv/riscv-isa-manual/blob/a7d93c9/src/priv-preface.adoc?plain=1#L40-L72 Lists what to do without clarification or document format. * Redefined misa.MXL to be read-only, making MXLEN a constant.(Skip, implementation ignored) * Added the constraint that SXLEN≥UXLEN.(Skip, implementation ignored) * Defined the misa.V field to reflect that the V extension has been implemented.(Skip, existed) * Defined the RV32-only medelegh and hedelegh CSRs.(Done in these patches) * Defined the misaligned atomicity granule PMA, superseding the proposed Zam extension..(Skip, implementation ignored) * Allocated interrupt 13 for Sscofpmf LCOFI interrupt.(Skip, existed) * Defined hardware error and software check exception codes.(Done in these patches) * Specified synchronization requirements when changing the PBMTE fields in menvcfg and henvcfg.(Skip, implementation ignored) * Incorporated Svade and Svadu extension specifications.(Skip, existed) Fea.Wang (4): target/riscv: Support the version for ss1p13 target/riscv: Add 'P1P13' bit in SMSTATEEN0 target/riscv: Add MEDELEGH, HEDELEGH csrs for RV32 target/riscv: Reserve exception codes for sw-check and hw-err Jim Shu (1): target/riscv: Reuse the conversion function of priv_spec target/riscv/cpu.c | 8 ++++++-- target/riscv/cpu.h | 5 ++++- target/riscv/cpu_bits.h | 5 +++++ target/riscv/cpu_cfg.h | 1 + target/riscv/csr.c | 39 ++++++++++++++++++++++++++++++++++++++ target/riscv/tcg/tcg-cpu.c | 17 ++++++++--------- 6 files changed, 63 insertions(+), 12 deletions(-) -- 2.34.1