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 lists1p.gnu.org (lists1p.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 91A08C43458 for ; Mon, 13 Jul 2026 03:52:06 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wj7hv-0006q1-Oq; Sun, 12 Jul 2026 23:51:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wj7hu-0006pP-R3 for qemu-riscv@nongnu.org; Sun, 12 Jul 2026 23:51:50 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wj7ht-0001MW-7G for qemu-riscv@nongnu.org; Sun, 12 Jul 2026 23:51:50 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-848595b338cso3010930b3a.0 for ; Sun, 12 Jul 2026 20:51:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1783914708; x=1784519508; 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:content-type; bh=ZpEZ+qwUWzKX/pdopbU/v27JKSx+5w4HgXw/8RsqiZk=; b=DCQVOgtMEDExJvXc9FBDzismug7X2lk1Hz182p+A+JEtuPgSK52Ga63WgToH+VeyNZ kBDCq9VHy75pT5lmdrhUM/v9UmSp8k5vbffMgBZ0GXmmzZPUiC40W926s3+eWB60d5lH FS2DuSAn889BDI7StdRpxIb/krL/X87s9WBHeppw/meHvmffODQncdHOot24AJbFOeNP lSQ2aBi1ewejRqkXx5eYTws2UpDNQqknbRWRxK5aMPwkJ6XGKEn2TvfICSgz+GQtDv6H QMhfNnub4CYKVbXGDq5ttBLtjlHMvloKZrPcIImUErKDxBvuVAAPwxJtbQTtQ3iCbOUx usOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783914708; x=1784519508; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=ZpEZ+qwUWzKX/pdopbU/v27JKSx+5w4HgXw/8RsqiZk=; b=qeFNpt7+zDRuf7ByFNrqfmNieYwCrHQrOKEHlLKvUdpVkM33N+MEUdCjj2p/SV8nuz wSOfvtsj7SMV1juABRZG5FgoN5mV5Ebj77oTDng57BIHSxCiwV3boBFaMgMK9T66XQBn cANxntsh93yijHZcRVFRatY8rGqg6yqnjbtZUkqa5Pygkh7b8/9ashIqL92fkbP3+72Q eUPtSXMdJ5x9RhQ5UciItFl2kfdsak54QhqGAAzJ2FbX+VkvbPh3N1btaxm0JyXMoacB uU/FaAx7xykbzKpGrL+Vgvudsg9YbFaea+56aE9Sg2aidMXmWD5wpKw7WQm1DlEAA91e bcNQ== X-Forwarded-Encrypted: i=1; AHgh+Rog8ZHgbEyds/GmQZm4EZsohdDF5EE8bELRHqKq78nuIvMmX0tpiQIPHx7J5EVc2PlPHLpThmm+zSSz@nongnu.org X-Gm-Message-State: AOJu0YxonaEnQbvXtWFIsG9uQBbP/eJhMcWQWdTyQ6l2c5fzI1MWb/B5 piFd8GGK/e8uZRee5ZHweKg6Kdzbh93HAauUI0/eqhOiXMGyZKV4PilrV30BbkvF42Y= X-Gm-Gg: AfdE7ck5ohBBBBGepuv7vaNyr7KTOTAyE69ESvXuhHm9tmdiQD5Ua1EIgTB0Gs90s7U bXNH291AdBxydUElC+rMDTKRHZsEpAEYa5BaUbKooOdnMez0PlE00ppje7xpuVAUmfCm0BjIaKP N+R0FiPZZTMo2QbGz7oNc6ZNgPMHnz/1fI+Z+G/iWC4iSHnrNm8+so0qn+gh+9mj4wqNLImLoP7 jkS+YjRVLn3xUsA3EP9JCiU5BWfxAQv5nX+0nW50oIKf/RNcF8qNueX5QHsNw1fpgiB4o0AtXZn bdLukMg0MuleROB3nJ1D9sm9M5y29uV1nD977ZfHCebbFALawCJglo42RALLGey2yr0gueO124G 1/jzFmFtGhnoJ3zEzwxqlU/I3Lzq0+g2xGk3A2Mzf3/56pxVYAajf0IfQC1tSKImEMN3F0epUTx fK5xCC6WghW2gh9zcZT83QHpZJmBMruph25jC/epY= X-Received: by 2002:a05:6a00:1881:b0:847:8ccc:d7cd with SMTP id d2e1a72fcca58-8488974b0f2mr6660748b3a.37.1783914707719; Sun, 12 Jul 2026 20:51:47 -0700 (PDT) Received: from hsinchu16.internal.sifive.com ([210.176.154.34]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-ca5b3162d3csm7739884a12.18.2026.07.12.20.51.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jul 2026 20:51:46 -0700 (PDT) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Cc: Alistair Francis , Palmer Dabbelt , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , qemu-riscv@nongnu.org (open list:SiFive Machines), Frank Chang , Alistair Francis Subject: [PATCH v6 2/6] target/riscv: Enable Zicclsm for the compatible CPUs Date: Mon, 13 Jul 2026 11:51:31 +0800 Message-ID: <20260713035135.3996990-3-frank.chang@sifive.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260713035135.3996990-1-frank.chang@sifive.com> References: <20260713035135.3996990-1-frank.chang@sifive.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=frank.chang@sifive.com; helo=mail-pf1-x429.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 From: Frank Chang To support Zicclsm, let's enable Zicclsm for the following compatible CPUs: - Base 32 CPU (to be backward compatible) - Base 64 CPU (to be backward compatible) - XuanTie (T-Head) C908 - Tenstorrent Ascalon - Ventana Veyron V1 - XiangShan Kunminghu - MIPS P8700 (ISA doesn't include Zicclsm, but their datasheet claims that it has unaligned load/store support in hardware) Signed-off-by: Frank Chang Acked-by: Alistair Francis --- target/riscv/cpu.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 5a82e6563bf..7ee89f6fc4b 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -3268,6 +3268,7 @@ static const TypeInfo riscv_cpu_type_infos[] = { .cfg.ext_zicbom = true, .cfg.ext_zicbop = true, .cfg.ext_zicboz = true, + .cfg.ext_zicclsm = true, .cfg.ext_zicntr = true, .cfg.ext_zicsr = true, .cfg.ext_zifencei = true, @@ -3340,6 +3341,7 @@ static const TypeInfo riscv_cpu_type_infos[] = { .cfg.ext_zicbom = true, .cfg.ext_zicbop = true, .cfg.ext_zicboz = true, + .cfg.ext_zicclsm = true, .cfg.ext_zicntr = true, .cfg.ext_zicsr = true, .cfg.ext_zifencei = true, @@ -3426,6 +3428,7 @@ static const TypeInfo riscv_cpu_type_infos[] = { .cfg.ext_zbs = true, .cfg.ext_zkt = true, .cfg.ext_zbkc = true, + .cfg.ext_zicclsm = true, .cfg.ext_zicsr = true, .cfg.ext_zifencei = true, .cfg.ext_zihintpause = true, @@ -3469,6 +3472,7 @@ static const TypeInfo riscv_cpu_type_infos[] = { .cfg.ext_zicbom = true, .cfg.ext_zicbop = true, .cfg.ext_zicboz = true, + .cfg.ext_zicclsm = true, .cfg.ext_zicntr = true, .cfg.ext_zicond = true, .cfg.ext_zicsr = true, @@ -3518,6 +3522,7 @@ static const TypeInfo riscv_cpu_type_infos[] = { /* ISA extensions */ .cfg.mmu = true, + .cfg.ext_zicclsm = true, .cfg.ext_zifencei = true, .cfg.ext_zicsr = true, .cfg.pmp = true, @@ -3577,6 +3582,7 @@ static const TypeInfo riscv_cpu_type_infos[] = { * The RISC-V Instruction Set Manual: Volume I * Unprivileged Architecture */ + .cfg.ext_zicclsm = true, .cfg.ext_zicntr = true, .cfg.ext_zihpm = true, .cfg.ext_zihintntl = true, @@ -3633,6 +3639,7 @@ static const TypeInfo riscv_cpu_type_infos[] = { .misa_ext = RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU, .priv_spec = PRIV_VERSION_1_12_0, .cfg.max_satp_mode = VM_1_10_SV48, + .cfg.ext_zicclsm = true, .cfg.ext_zifencei = true, .cfg.ext_zicsr = true, .cfg.mmu = true, -- 2.43.0