From nobody Thu Nov 14 07:10:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1704877522; cv=none; d=zohomail.com; s=zohoarc; b=CgYvu8+wbI40i+qvVQ54JpgEhC7Ttk1bDxQuxQMPTcnZRxf3MGk1HGKEVArhIfpJRvL7Jg4OgnbGpTUPM8o04Nyz6q2kUQiaFKTVmleOj0ZwI7pkskIerR36rjdWyY6jphClpxz1Hl+H8bkU2sHsniB0xAKwbUqqyj8zHIz/5Ow= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704877522; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=J2uXWynn6N0F+UvNP0b2mp7dSx1OcBiLsy3KzCT7kHQ=; b=Ld/kP4j8FMfR327mYFFYYVRkSG8Rj9A7fVKjgtUQ/b9NRvVi4sbIWpx5t8L85dZJMFZQWgMAdmWEm0F/fE9WtOSAcmlL+A3mEad40wGFV812T4Umh3Isc5ghsHeOaQj4uX5Q/0bCIN0V8Atykrsl4kFzmzzekYsukOnHlXGM4n4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704877522424726.1945826916559; Wed, 10 Jan 2024 01:05:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNUSW-0002lh-L4; Wed, 10 Jan 2024 04:01:13 -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 1rNUST-0002eu-Vn for qemu-devel@nongnu.org; Wed, 10 Jan 2024 04:01:10 -0500 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNUSS-0005LT-1h for qemu-devel@nongnu.org; Wed, 10 Jan 2024 04:01:09 -0500 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-5c66b093b86so3292183a12.0 for ; Wed, 10 Jan 2024 01:01:07 -0800 (PST) Received: from toolbox.alistair23.me (2403-580b-97e8-0-321-6fb2-58f1-a1b1.ip6.aussiebb.net. [2403:580b:97e8:0:321:6fb2:58f1:a1b1]) by smtp.gmail.com with ESMTPSA id t65-20020a628144000000b006d9879ba6besm3223814pfd.170.2024.01.10.01.01.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 01:01:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704877266; x=1705482066; 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=J2uXWynn6N0F+UvNP0b2mp7dSx1OcBiLsy3KzCT7kHQ=; b=hUFce5BgZ8ceTUilPUiFgcqdMBKUYw5ehSO3RqV+rgZooPBcVxIzEIaPibBX7Wv71i 1sUWWujhGljzWMKtjHyMk57JsQTygNoB3BYtVbFLRWAaJBNXm9FZiT1sPHLhWcjz9a9x sG9RIcrMH4hkFgL4/sNnxlLeRaS7bH6OI0AyyB2lpQtYnlbrq95BqcjXj5ZdaFL+jXAl J7mdJM4EgORuGQW9XIYLaLaFWCOVECKMei6n3ltkxcrBOmzWNtg+KEpkRzWA2vIou8iP LECcw6btsLzPbqngViT0bP4cK9RiaPR6yzgoG0x1TabCodD5khlXP3LgPK1nyxvU9o9c aghQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704877266; x=1705482066; 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=J2uXWynn6N0F+UvNP0b2mp7dSx1OcBiLsy3KzCT7kHQ=; b=Yk3gYYAzdDj6hykm9JBBHnTP6bRKQJan/lCNbgn1ebM0zzDC+c35fwZfjWqOV4kq9U RnhdUVcrdE3ANlP0kXfEt5qEs2ppMSWCsVyurvCAfeAiVLSbriiD7+9MkOuNjTsLzSor bGFJTWoAGzlVOybQ15QDlwHGJ4EFFqbBUyUUWZrrf2E0NN6w82etzGj+5eUx6+AyCnSj tpwCOK9mJ7rR+C8S5UUKcCVnI1I94mf4wtLuKS2TwvfLW4s0NIaoUDkiDo6igD/TaQnZ ZkEwVhXm2p+1SnHyNl+vxO3DzmjYQCal4k/K6R6jiiO8+g9kzCsMIJevpXiqkptPj768 V9bQ== X-Gm-Message-State: AOJu0YwCf9XY/B8a3hE2wvbwax/1V7CLREgvzz6fVYQojXgZnDlx2rfb YCTtsTTNdVkK0sMYZxbEd53khU8voySEfhUF X-Google-Smtp-Source: AGHT+IFUTFqvuUjwVkw+li79WZzZhZSRIUAgyQqMUIHG3SxtJ0afgkL9U67wdHgUXIXKvNYYBAtD8A== X-Received: by 2002:a05:6a21:3d84:b0:197:6bec:42aa with SMTP id bj4-20020a056a213d8400b001976bec42aamr1003534pzc.12.1704877266374; Wed, 10 Jan 2024 01:01:06 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: qemu-devel@nongnu.org Cc: alistair23@gmail.com, Daniel Henrique Barboza , Andrew Jones , Alistair Francis Subject: [PULL 53/65] target/riscv: add RVA22S64 profile Date: Wed, 10 Jan 2024 18:57:21 +1000 Message-ID: <20240110085733.1607526-54-alistair.francis@wdc.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240110085733.1607526-1-alistair.francis@wdc.com> References: <20240110085733.1607526-1-alistair.francis@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=alistair23@gmail.com; helo=mail-pg1-x52b.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, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1704877524179100021 Content-Type: text/plain; charset="utf-8" From: Daniel Henrique Barboza The RVA22S64 profile consists of the following: - all mandatory extensions of RVA22U64; - priv spec v1.12.0; - satp mode sv39; - Ssccptr, a cache related named feature that we're assuming always enable since we don't implement a cache; - Other named features already implemented: Sstvecd, Sstvala, Sscounterenw; - the new Svade named feature that was recently added. Most of the work is already done, so this patch is enough to implement the profile. After this patch, the 'rva22s64' user flag alone can be used with the rva64i CPU to boot Linux: -cpu rv64i,rva22s64=3Dtrue This is the /proc/cpuinfo with this profile enabled: # cat /proc/cpuinfo processor : 0 hart : 0 isa : rv64imafdc_zicbom_zicbop_zicboz_zicntr_zicsr_zifencei_zihintpause_zi= hpm_zfhmin_zca_zcd_zba_zbb_zbs_zkt_svinval_svpbmt mmu : sv39 Signed-off-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones Reviewed-by: Alistair Francis Message-ID: <20231218125334.37184-26-dbarboza@ventanamicro.com> Signed-off-by: Alistair Francis --- target/riscv/cpu.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 616b091303..a8f4081922 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1559,8 +1559,40 @@ static RISCVCPUProfile RVA22U64 =3D { } }; =20 +/* + * As with RVA22U64, RVA22S64 also defines 'named features'. + * + * Cache related features that we consider enabled since we don't + * implement cache: Ssccptr + * + * Other named features that we already implement: Sstvecd, Sstvala, + * Sscounterenw + * + * Named features that we need to enable: svade + * + * The remaining features/extensions comes from RVA22U64. + */ +static RISCVCPUProfile RVA22S64 =3D { + .parent =3D &RVA22U64, + .name =3D "rva22s64", + .misa_ext =3D RVS, + .priv_spec =3D PRIV_VERSION_1_12_0, + .satp_mode =3D VM_1_10_SV39, + .ext_offsets =3D { + /* rva22s64 exts */ + CPU_CFG_OFFSET(ext_zifencei), CPU_CFG_OFFSET(ext_svpbmt), + CPU_CFG_OFFSET(ext_svinval), + + /* rva22s64 named features */ + CPU_CFG_OFFSET(svade), + + RISCV_PROFILE_EXT_LIST_END + } +}; + RISCVCPUProfile *riscv_profiles[] =3D { &RVA22U64, + &RVA22S64, NULL, }; =20 --=20 2.43.0