From patchwork Tue Jan 23 11:10:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Bradford X-Patchwork-Id: 13527259 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 24336C47258 for ; Tue, 23 Jan 2024 11:11:59 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSEgC-00035J-PZ; Tue, 23 Jan 2024 06:10:56 -0500 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 1rSEfx-0002nt-HV for qemu-devel@nongnu.org; Tue, 23 Jan 2024 06:10:44 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSEfs-0004NT-HA for qemu-devel@nongnu.org; Tue, 23 Jan 2024 06:10:41 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-336c8ab0b20so4223211f8f.1 for ; Tue, 23 Jan 2024 03:10:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1706008234; x=1706613034; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sCDXVKioSoKA0NfjKMALDl2Tvtb69LxP0DpxP284A0o=; b=knKj+4m4jnxafw8/SRXNYM/aHDWYE9bi24dGWO/mt5zCvaI5Ml+ES8Jia2PrQVS0q8 Hs7dXYyVKUINS9wSbU2PXlTDiXW6UNQvF5hm3wLyqMwsol9MMUU/RQbhrGKOZjhgd/7F GKZDAwgkigEBDwv+CSANtgD9S9KUXIoUP6BWVlWm39zwram8nPg7dhw/p5jY5MLm5yog +MOgbkdXy48/Qz/n+L8D/stwYHBvC4ZM/H0v0WZuB6RNinyM0DzU/LAd9gcem/AOdqvd VZhiGXoKJs3AMk3Ne1FQI8y7YDFwm2pD0zGWCGaZ+vU6SI8/+wLAG4wO84yLTSF/l50O FjTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706008234; x=1706613034; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sCDXVKioSoKA0NfjKMALDl2Tvtb69LxP0DpxP284A0o=; b=uJefEYic5NSOOcJ0EdBzcdgJctNumxcLF1asRZT4S0Dy3eueu9UcyMLBnGF1hDqIIZ q185Vx3F5OJxPcMaRbHK+OSmJxEDzc0y+N0ZTrj0v9SSWhk9A2VWgvDpOJD1m60zgJJw c1sWlcGvdkWiUTb/URral0k0IXM05HB8WeZ2VsCh7zId9VJtPdHkLSwqVL+K/83aeHik NS/iPzUYbDI2c/DmOuygEoQDvAUdJWyDXbnLNKcBE/eolkPgvR+CTYk2fOYQl4iefhVL 9OEG6fLoCGLoDUbSDj2NUbinppe26yc481JfaedN5+nMi0HGRJbkarbSbAGCmsG+V+4G Yf9Q== X-Gm-Message-State: AOJu0Yz43zUZ8D6hTCJIYZeW5/qqXKOj57tai7tv5vIvwzijfp8oZEA1 zikYYL4wT5RFLLjbsiaolzAhkgiPEne7GWGjZqj9PU3mesLLF5/KtJgh5z38w4ZkmeYxAUPznWP uUMQ= X-Google-Smtp-Source: AGHT+IHV/RrF5fWLMHwROfzABbl3BvjiiDxUP+n2rZgY7CqF4wVkzw8UjWkzohsfLuAuinLuvv+1pA== X-Received: by 2002:a05:6000:1086:b0:337:c8ac:1942 with SMTP id y6-20020a056000108600b00337c8ac1942mr3232187wrw.9.1706008234158; Tue, 23 Jan 2024 03:10:34 -0800 (PST) Received: from rockhopper.. (214.11.169.217.in-addr.arpa. [217.169.11.214]) by smtp.gmail.com with ESMTPSA id n15-20020a5d4c4f000000b00337d6f0013esm12288013wrt.107.2024.01.23.03.10.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 03:10:33 -0800 (PST) From: Rob Bradford To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, atishp@rivosinc.com, palmer@dabbelt.com, alistair.francis@wdc.com, bin.meng@windriver.com, liwei1518@gmail.com, dbarboza@ventanamicro.com, zhiwei_liu@linux.alibaba.com, Rob Bradford Subject: [PATCH v3 1/3] target/riscv: Add Zaamo and Zalrsc extension infrastructure Date: Tue, 23 Jan 2024 11:10:28 +0000 Message-ID: <20240123111030.15074-2-rbradford@rivosinc.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240123111030.15074-1-rbradford@rivosinc.com> References: <20240123111030.15074-1-rbradford@rivosinc.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=rbradford@rivosinc.com; helo=mail-wr1-x42d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org These extensions represent the atomic operations from A (Zaamo) and the Load-Reserved/Store-Conditional operations from A (Zalrsc) Signed-off-by: Rob Bradford Reviewed-by: Daniel Henrique Barboza --- target/riscv/cpu_cfg.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/riscv/cpu_cfg.h b/target/riscv/cpu_cfg.h index fea14c275f..cc4c30244c 100644 --- a/target/riscv/cpu_cfg.h +++ b/target/riscv/cpu_cfg.h @@ -78,7 +78,9 @@ struct RISCVCPUConfig { bool ext_svnapot; bool ext_svpbmt; bool ext_zdinx; + bool ext_zaamo; bool ext_zacas; + bool ext_zalrsc; bool ext_zawrs; bool ext_zfa; bool ext_zfbfmin; From patchwork Tue Jan 23 11:10:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Bradford X-Patchwork-Id: 13527261 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 245AEC47258 for ; Tue, 23 Jan 2024 11:12:35 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSEgE-0003AE-KO; Tue, 23 Jan 2024 06:10:58 -0500 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 1rSEfz-0002qu-Js for qemu-devel@nongnu.org; Tue, 23 Jan 2024 06:10:45 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSEfw-0004Nf-2k for qemu-devel@nongnu.org; Tue, 23 Jan 2024 06:10:43 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3392d417a9fso1487043f8f.1 for ; Tue, 23 Jan 2024 03:10:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1706008235; x=1706613035; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ecnCqjTLfYnZuQfJNBUJ4tk5GBJDgWj5pyxdn7gFen4=; b=IA3/OisnSICUyVbGmbwUlTVwlp0JbO4hzOjPqnrgYhDcziF27pOovd5twsGcW1kRVa yZ4xHnDNVNeDNaKvZ2IozC2lihyroy+VBYMh+8o5t1sisM9blR1RP3s778+yIPepQucu mHkzHZRtq94AjvZGwuOUu4E+PgNJdM7Bic+vIsyrY8MVo1OF3zMxfMD8iZI0gaVqx9Ht PxgQowZqCG6wYBlHCTtUA9GZ/u29nnWBeOV4jJRtezM4pDt46hK/+JJdHDZApYe+Ylm3 dKtI4PUHIRky4MgENWsTElvffpi33hKum8Lnyjs436wZYq5GCchGgSEMRoRf/4a0jNOB t7/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706008235; x=1706613035; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ecnCqjTLfYnZuQfJNBUJ4tk5GBJDgWj5pyxdn7gFen4=; b=pm6OKmgbjA813xk7oggSxrRRB0Ci0Ftx87K8nEK2dBDfEiPxffOQoIhneAJ/o27rQ8 3alUqtfvL+GyLGv+bvM8qsSEJNGYPKicIcxrOgwjC3rRFQBnMAuqkST3py4Mip+S9m6f eX8ikOhI4/6niBez83bsiI6uRPT9D8P9OTLVBcod+Tu/PFXj5iG4cFvghRwnIga6WdO6 dKni95V6vjtqkHPch8C2sIYrl5l0femiXOYntuS4tlSvI8TW3mfdOUKx8ui8sr8iHnk4 z9WXpJ02fHFZ7DN1A6NQDxND6BwQfXTkQ4L/+pSUXz46OXwwpfAutPAPx2gBQDqPN3Qf kfOA== X-Gm-Message-State: AOJu0YzHcxoYlhm6GEUAZEzTKiTv+XKz83maiNU1A8NNn1mdyVWYmTXz x/UQBPqHDcsSbi9rJLgxT+T0yT5CgbNPeGfPUoRJdSLv9cOosGw5ark2Py9QZgnZNPPwQDh+qnL Blno= X-Google-Smtp-Source: AGHT+IGPPkysfIR6MvUpExF4K7S59++cGtcoHVzpNu9BR7tHZv27apgpVSJ+6v6huD93DMJtFsGpLQ== X-Received: by 2002:a05:6000:184c:b0:337:bd04:8c26 with SMTP id c12-20020a056000184c00b00337bd048c26mr3695655wri.105.1706008235010; Tue, 23 Jan 2024 03:10:35 -0800 (PST) Received: from rockhopper.. (214.11.169.217.in-addr.arpa. [217.169.11.214]) by smtp.gmail.com with ESMTPSA id n15-20020a5d4c4f000000b00337d6f0013esm12288013wrt.107.2024.01.23.03.10.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 03:10:34 -0800 (PST) From: Rob Bradford To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, atishp@rivosinc.com, palmer@dabbelt.com, alistair.francis@wdc.com, bin.meng@windriver.com, liwei1518@gmail.com, dbarboza@ventanamicro.com, zhiwei_liu@linux.alibaba.com, Rob Bradford Subject: [PATCH v3 2/3] target/riscv: Check 'A' and split extensions for atomic instructions Date: Tue, 23 Jan 2024 11:10:29 +0000 Message-ID: <20240123111030.15074-3-rbradford@rivosinc.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240123111030.15074-1-rbradford@rivosinc.com> References: <20240123111030.15074-1-rbradford@rivosinc.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=rbradford@rivosinc.com; helo=mail-wr1-x42f.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Following the pattern for 'M' and Zmmul check if either the 'A' extension is enabled or the appropriate split extension for the instruction. Signed-off-by: Rob Bradford Reviewed-by: Daniel Henrique Barboza --- target/riscv/insn_trans/trans_rva.c.inc | 56 +++++++++++++++---------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/target/riscv/insn_trans/trans_rva.c.inc b/target/riscv/insn_trans/trans_rva.c.inc index f0368de3e4..267930e5bc 100644 --- a/target/riscv/insn_trans/trans_rva.c.inc +++ b/target/riscv/insn_trans/trans_rva.c.inc @@ -18,6 +18,18 @@ * this program. If not, see . */ +#define REQUIRE_A_OR_ZAAMO(ctx) do { \ + if (!ctx->cfg_ptr->ext_zaamo && !has_ext(ctx, RVA)) { \ + return false; \ + } \ +} while (0) + +#define REQUIRE_A_OR_ZALRSC(ctx) do { \ + if (!ctx->cfg_ptr->ext_zalrsc && !has_ext(ctx, RVA)) { \ + return false; \ + } \ +} while (0) + static bool gen_lr(DisasContext *ctx, arg_atomic *a, MemOp mop) { TCGv src1; @@ -96,143 +108,143 @@ static bool gen_amo(DisasContext *ctx, arg_atomic *a, static bool trans_lr_w(DisasContext *ctx, arg_lr_w *a) { - REQUIRE_EXT(ctx, RVA); + REQUIRE_A_OR_ZALRSC(ctx); return gen_lr(ctx, a, (MO_ALIGN | MO_TESL)); } static bool trans_sc_w(DisasContext *ctx, arg_sc_w *a) { - REQUIRE_EXT(ctx, RVA); + REQUIRE_A_OR_ZALRSC(ctx); return gen_sc(ctx, a, (MO_ALIGN | MO_TESL)); } static bool trans_amoswap_w(DisasContext *ctx, arg_amoswap_w *a) { - REQUIRE_EXT(ctx, RVA); + REQUIRE_A_OR_ZAAMO(ctx); return gen_amo(ctx, a, &tcg_gen_atomic_xchg_tl, (MO_ALIGN | MO_TESL)); } static bool trans_amoadd_w(DisasContext *ctx, arg_amoadd_w *a) { - REQUIRE_EXT(ctx, RVA); + REQUIRE_A_OR_ZAAMO(ctx); return gen_amo(ctx, a, &tcg_gen_atomic_fetch_add_tl, (MO_ALIGN | MO_TESL)); } static bool trans_amoxor_w(DisasContext *ctx, arg_amoxor_w *a) { - REQUIRE_EXT(ctx, RVA); + REQUIRE_A_OR_ZAAMO(ctx); return gen_amo(ctx, a, &tcg_gen_atomic_fetch_xor_tl, (MO_ALIGN | MO_TESL)); } static bool trans_amoand_w(DisasContext *ctx, arg_amoand_w *a) { - REQUIRE_EXT(ctx, RVA); + REQUIRE_A_OR_ZAAMO(ctx); return gen_amo(ctx, a, &tcg_gen_atomic_fetch_and_tl, (MO_ALIGN | MO_TESL)); } static bool trans_amoor_w(DisasContext *ctx, arg_amoor_w *a) { - REQUIRE_EXT(ctx, RVA); + REQUIRE_A_OR_ZAAMO(ctx); return gen_amo(ctx, a, &tcg_gen_atomic_fetch_or_tl, (MO_ALIGN | MO_TESL)); } static bool trans_amomin_w(DisasContext *ctx, arg_amomin_w *a) { - REQUIRE_EXT(ctx, RVA); + REQUIRE_A_OR_ZAAMO(ctx); return gen_amo(ctx, a, &tcg_gen_atomic_fetch_smin_tl, (MO_ALIGN | MO_TESL)); } static bool trans_amomax_w(DisasContext *ctx, arg_amomax_w *a) { - REQUIRE_EXT(ctx, RVA); + REQUIRE_A_OR_ZAAMO(ctx); return gen_amo(ctx, a, &tcg_gen_atomic_fetch_smax_tl, (MO_ALIGN | MO_TESL)); } static bool trans_amominu_w(DisasContext *ctx, arg_amominu_w *a) { - REQUIRE_EXT(ctx, RVA); + REQUIRE_A_OR_ZAAMO(ctx); return gen_amo(ctx, a, &tcg_gen_atomic_fetch_umin_tl, (MO_ALIGN | MO_TESL)); } static bool trans_amomaxu_w(DisasContext *ctx, arg_amomaxu_w *a) { - REQUIRE_EXT(ctx, RVA); + REQUIRE_A_OR_ZAAMO(ctx); return gen_amo(ctx, a, &tcg_gen_atomic_fetch_umax_tl, (MO_ALIGN | MO_TESL)); } static bool trans_lr_d(DisasContext *ctx, arg_lr_d *a) { REQUIRE_64BIT(ctx); - REQUIRE_EXT(ctx, RVA); + REQUIRE_A_OR_ZALRSC(ctx); return gen_lr(ctx, a, MO_ALIGN | MO_TEUQ); } static bool trans_sc_d(DisasContext *ctx, arg_sc_d *a) { REQUIRE_64BIT(ctx); - REQUIRE_EXT(ctx, RVA); + REQUIRE_A_OR_ZALRSC(ctx); return gen_sc(ctx, a, (MO_ALIGN | MO_TEUQ)); } static bool trans_amoswap_d(DisasContext *ctx, arg_amoswap_d *a) { REQUIRE_64BIT(ctx); - REQUIRE_EXT(ctx, RVA); + REQUIRE_A_OR_ZAAMO(ctx); return gen_amo(ctx, a, &tcg_gen_atomic_xchg_tl, (MO_ALIGN | MO_TEUQ)); } static bool trans_amoadd_d(DisasContext *ctx, arg_amoadd_d *a) { REQUIRE_64BIT(ctx); - REQUIRE_EXT(ctx, RVA); + REQUIRE_A_OR_ZAAMO(ctx); return gen_amo(ctx, a, &tcg_gen_atomic_fetch_add_tl, (MO_ALIGN | MO_TEUQ)); } static bool trans_amoxor_d(DisasContext *ctx, arg_amoxor_d *a) { REQUIRE_64BIT(ctx); - REQUIRE_EXT(ctx, RVA); + REQUIRE_A_OR_ZAAMO(ctx); return gen_amo(ctx, a, &tcg_gen_atomic_fetch_xor_tl, (MO_ALIGN | MO_TEUQ)); } static bool trans_amoand_d(DisasContext *ctx, arg_amoand_d *a) { REQUIRE_64BIT(ctx); - REQUIRE_EXT(ctx, RVA); + REQUIRE_A_OR_ZAAMO(ctx); return gen_amo(ctx, a, &tcg_gen_atomic_fetch_and_tl, (MO_ALIGN | MO_TEUQ)); } static bool trans_amoor_d(DisasContext *ctx, arg_amoor_d *a) { REQUIRE_64BIT(ctx); - REQUIRE_EXT(ctx, RVA); + REQUIRE_A_OR_ZAAMO(ctx); return gen_amo(ctx, a, &tcg_gen_atomic_fetch_or_tl, (MO_ALIGN | MO_TEUQ)); } static bool trans_amomin_d(DisasContext *ctx, arg_amomin_d *a) { REQUIRE_64BIT(ctx); - REQUIRE_EXT(ctx, RVA); + REQUIRE_A_OR_ZAAMO(ctx); return gen_amo(ctx, a, &tcg_gen_atomic_fetch_smin_tl, (MO_ALIGN | MO_TEUQ)); } static bool trans_amomax_d(DisasContext *ctx, arg_amomax_d *a) { REQUIRE_64BIT(ctx); - REQUIRE_EXT(ctx, RVA); + REQUIRE_A_OR_ZAAMO(ctx); return gen_amo(ctx, a, &tcg_gen_atomic_fetch_smax_tl, (MO_ALIGN | MO_TEUQ)); } static bool trans_amominu_d(DisasContext *ctx, arg_amominu_d *a) { REQUIRE_64BIT(ctx); - REQUIRE_EXT(ctx, RVA); + REQUIRE_A_OR_ZAAMO(ctx); return gen_amo(ctx, a, &tcg_gen_atomic_fetch_umin_tl, (MO_ALIGN | MO_TEUQ)); } static bool trans_amomaxu_d(DisasContext *ctx, arg_amomaxu_d *a) { REQUIRE_64BIT(ctx); - REQUIRE_EXT(ctx, RVA); + REQUIRE_A_OR_ZAAMO(ctx); return gen_amo(ctx, a, &tcg_gen_atomic_fetch_umax_tl, (MO_ALIGN | MO_TEUQ)); } From patchwork Tue Jan 23 11:10:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Bradford X-Patchwork-Id: 13527260 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 A0B82C47E49 for ; Tue, 23 Jan 2024 11:11:59 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSEgC-00036l-UP; Tue, 23 Jan 2024 06:10:56 -0500 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 1rSEfz-0002qt-Jh for qemu-devel@nongnu.org; Tue, 23 Jan 2024 06:10:45 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSEfw-0004Nm-50 for qemu-devel@nongnu.org; Tue, 23 Jan 2024 06:10:42 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-338aca547d9so3308876f8f.0 for ; Tue, 23 Jan 2024 03:10:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1706008235; x=1706613035; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=a6UoAAKm1BSVru2djWDEvJDwpv7xKurDJDJjWffjIbA=; b=DcAkNhnYQUEA1KZukWTKB3AmzF7Zj8nqeFywO0L5/Fa3MSZtmpCVIdVVVIZnUvyVlO 7J3z43vT4LfsMhBcLsNRxSzY0woANDtoMeFwmxsmWKa3lvni7RB+sIPD8x3j6ZNo/3Va m65rQtr9lV61Hb4WYViMlK5fppuOIkoLHSB5or2oqAK2IIqkVLZHvwVrmX51P4epQuuY E9he1lYJPuL9uKrT5J/KodpIshmfwvAfkYdFdjBN3ZQnu1hfm0cKSRE83t4hEJCwB7fV Sy6gey1JsVzF3aZf+XrLG//Jl7v6Hxf+GcxLhbC6FZMPQ5P3/P5eHTE8AVp7Z6z/Ia14 +sHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706008235; x=1706613035; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a6UoAAKm1BSVru2djWDEvJDwpv7xKurDJDJjWffjIbA=; b=qhDYxzQi9Ixu7HViqq1fSYBneZHySwde8ZNQ0yx5Yatwpp+ti08RrF6cHyOGRGgpod Qlz3fxLGuUHUQuyQySDlr20Yk+I9x+f3+yyIvFTnTu2hy3DA7if3v1n8eMVi7kiqEuUf Bka2I9GVmYLI6sq6LL6+xN+MxaoFvSMUIV6uL2b1ACuxR9FdT66QTqh8h3Km1i62jt6b o4+ObB5+ZlIGQ/iPbiH4vjr0Tmq8mYJ++qbIhi69F5cLaLzSgid35ExA5wg3PUug52I8 IKdk8G9x2NG9TrolBXmyjgUAX+WN8jNpaNYy0rjre0aUlw+u9f9owjInvbKAtA0diLar JoRA== X-Gm-Message-State: AOJu0Yxtb/qXuGG0xPygTZvctpO98lzNVNq+frvI9kpWbv6IP7R1FciJ z5bswv3RQJMSVV0CIUOM/ZJLRzRqkTyMMipw5h5ay8ZL3uVF+bRJIJbij843ezziuvrAiQnDFTM yEjk= X-Google-Smtp-Source: AGHT+IGXQ9R9gZGixdo57qdApxgwlFBEkkow5z3BRcUSXlogUwHnrwj53SC89qJ6MRyFXrZrKKC5ow== X-Received: by 2002:a05:6000:108a:b0:337:bfd9:bd48 with SMTP id y10-20020a056000108a00b00337bfd9bd48mr1568534wrw.62.1706008235559; Tue, 23 Jan 2024 03:10:35 -0800 (PST) Received: from rockhopper.. (214.11.169.217.in-addr.arpa. [217.169.11.214]) by smtp.gmail.com with ESMTPSA id n15-20020a5d4c4f000000b00337d6f0013esm12288013wrt.107.2024.01.23.03.10.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 03:10:35 -0800 (PST) From: Rob Bradford To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, atishp@rivosinc.com, palmer@dabbelt.com, alistair.francis@wdc.com, bin.meng@windriver.com, liwei1518@gmail.com, dbarboza@ventanamicro.com, zhiwei_liu@linux.alibaba.com, Rob Bradford Subject: [PATCH v3 3/3] target/riscv: Expose Zaamo and Zalrsc extensions Date: Tue, 23 Jan 2024 11:10:30 +0000 Message-ID: <20240123111030.15074-4-rbradford@rivosinc.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240123111030.15074-1-rbradford@rivosinc.com> References: <20240123111030.15074-1-rbradford@rivosinc.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=rbradford@rivosinc.com; helo=mail-wr1-x434.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Expose the newly added extensions to the guest and allow their control through the CPU properties. Signed-off-by: Rob Bradford Reviewed-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 8d3ec74a1c..604baf53c8 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -103,7 +103,9 @@ const RISCVIsaExtData isa_edata_arr[] = { ISA_EXT_DATA_ENTRY(zihintpause, PRIV_VERSION_1_10_0, ext_zihintpause), ISA_EXT_DATA_ENTRY(zihpm, PRIV_VERSION_1_12_0, ext_zihpm), ISA_EXT_DATA_ENTRY(zmmul, PRIV_VERSION_1_12_0, ext_zmmul), + ISA_EXT_DATA_ENTRY(zaamo, PRIV_VERSION_1_12_0, ext_zaamo), ISA_EXT_DATA_ENTRY(zacas, PRIV_VERSION_1_12_0, ext_zacas), + ISA_EXT_DATA_ENTRY(zalrsc, PRIV_VERSION_1_12_0, ext_zalrsc), ISA_EXT_DATA_ENTRY(zawrs, PRIV_VERSION_1_12_0, ext_zawrs), ISA_EXT_DATA_ENTRY(zfa, PRIV_VERSION_1_12_0, ext_zfa), ISA_EXT_DATA_ENTRY(zfbfmin, PRIV_VERSION_1_12_0, ext_zfbfmin), @@ -1491,6 +1493,9 @@ const RISCVCPUMultiExtConfig riscv_cpu_experimental_exts[] = { MULTI_EXT_CFG_BOOL("x-smaia", ext_smaia, false), MULTI_EXT_CFG_BOOL("x-ssaia", ext_ssaia, false), + MULTI_EXT_CFG_BOOL("x-zaamo", ext_zaamo, false), + MULTI_EXT_CFG_BOOL("x-zalrsc", ext_zalrsc, false), + MULTI_EXT_CFG_BOOL("x-zvfh", ext_zvfh, false), MULTI_EXT_CFG_BOOL("x-zvfhmin", ext_zvfhmin, false),