From nobody Thu Oct 31 23:12:42 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 ARC-Seal: i=1; a=rsa-sha256; t=1689195637; cv=none; d=zohomail.com; s=zohoarc; b=fNMM3LWN2+Ot2CLJguz7DLLjlbi91YSHVF+ips62W0WULmvSZXTx+LTMXc32fdgS1DWVCpjF/nGuq4pv74l1rC5uF2TF2R5XXmt3QX479qal1qo9ZehEN8oO2YzsyfGABsh8i/o/rxnno7U0Pz1BktrKE6rWpGWRM6q/hGYdfus= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689195637; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4RiSgAfEWU0a1sAwwC0juXw9kQhptA+n3m54/TaSZbs=; b=YMf/B6msbIM4LHGelpT2u8yUG2WA8Dl4fsRp9F6jdueRGw3VwFzEcdrR1JAGPg2dyeW73zRCdI7P4fgm0t1BJ7URbhDfvBktUqyEXKkSgc1pFfAEpWlH73Jc/EDWPFINT2EmmBn1ALv+ZcfSDsr7vumktgP1RbaD81P5RdjUq2A= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1689195637539510.38991716473674; Wed, 12 Jul 2023 14:00:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qJgua-0000FI-Rn; Wed, 12 Jul 2023 16:58:12 -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 1qJguZ-0000E4-AI for qemu-devel@nongnu.org; Wed, 12 Jul 2023 16:58:11 -0400 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qJguV-0005TU-F7 for qemu-devel@nongnu.org; Wed, 12 Jul 2023 16:58:11 -0400 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-6b7206f106cso6075614a34.1 for ; Wed, 12 Jul 2023 13:58:07 -0700 (PDT) Received: from grind.. (201-69-66-19.dial-up.telesp.net.br. [201.69.66.19]) by smtp.gmail.com with ESMTPSA id i2-20020a056870344200b001a9911765efsm2359904oah.40.2023.07.12.13.58.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 13:58:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1689195486; x=1691787486; 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=4RiSgAfEWU0a1sAwwC0juXw9kQhptA+n3m54/TaSZbs=; b=fU460uijgNZaLaLOWDQFqKo99CtIS/FdRuzldPCobm977BVNzxIrdn98bljeep61b1 HF4uqqDI7yytKedhzNDKjLV7w8N7iHWfd2ONzw9tcwPrp6OoHD89TV7JiKp7wQ2S6ZjY +D/JKPK7EOpa5ZdNvZl33mh0Iruj5JeHWnfeZ1HRqhF+vKniu8oFFSWpYAULTSmcT8/1 egAdTHU361VwZkWYKDBZxG8Ef3xODQTHLHvZPFBlz5MwJxxsSusuEsr3Y5hNMdsSYpBC ffjFy3gJsXQi2FGRH9xs0eUz/U0+Pk/tC+63WS9ir4u8Ic+MG1gCaayMHchSWel7BG4t s9uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689195486; x=1691787486; 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=4RiSgAfEWU0a1sAwwC0juXw9kQhptA+n3m54/TaSZbs=; b=ZlBgWRH+HCAQDKrB+Cab6cqRBO4VGuLTSIKHNKW441HlLluLxMviF3VSIklkg+lAAk GTT8qGFcIoyItDr8zVO5ld60aOrIhjXNJ0s2dxWsWn+MiUB9nArN796FzorVgWKIt6Js U50Wy5mIcppjz2/y3KD1apCq26KS6Ni+Y/s8xQlN2v4cxzREwfcx35Wdpg6JQmDz/xE8 it5KGea29F4t98ZDhYBirc/Th1F4zl7Hpyun1A72k9+E0t9E+2ZxnSNsM+vvQH6dlYLT 9LHoAeIvO8F8wRdlNpQ9SgYZKO87vLSdy1Z1ZNp2H8eUayiQyhVfWgq7FNfn5tB6GZ9f 0JWA== X-Gm-Message-State: ABy/qLbhVpaFZLdf41PJcmh9HB0fS5Z8HPWHEGrERc1F8ucYi1WFdSfc opHnRi7ikSrTQwifwJKjwK0er13rD0W9BwV++o4= X-Google-Smtp-Source: APBJJlGV4ZXVyx7X5652hXvBHOlve8oo7+ixM6IJDWHq64LuXa1qpgI8j/N9tjP/g4p41sC+Y4Lj+w== X-Received: by 2002:a05:6870:8a09:b0:1b0:449e:cff9 with SMTP id p9-20020a0568708a0900b001b0449ecff9mr21151422oaq.57.1689195485941; Wed, 12 Jul 2023 13:58:05 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com, bmeng@tinylab.org, liweiwei@iscas.ac.cn, zhiwei_liu@linux.alibaba.com, palmer@rivosinc.com, Daniel Henrique Barboza Subject: [PATCH for-8.2 v2 1/7] target/riscv/cpu.c: split CPU options from riscv_cpu_extensions[] Date: Wed, 12 Jul 2023 17:57:42 -0300 Message-ID: <20230712205748.446931-2-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230712205748.446931-1-dbarboza@ventanamicro.com> References: <20230712205748.446931-1-dbarboza@ventanamicro.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::32a; envelope-from=dbarboza@ventanamicro.com; helo=mail-ot1-x32a.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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ventanamicro.com) X-ZM-MESSAGEID: 1689195637845100001 Content-Type: text/plain; charset="utf-8" We'll add a new CPU type that will enable a considerable amount of extensions. To make it easier for us we'll do a few cleanups in our existing riscv_cpu_extensions[] array. Start by splitting all CPU non-boolean options from it. Create a new riscv_cpu_options[] array for them. Add all these properties in riscv_cpu_add_user_properties() as it is already being done today. No functional changes made. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 9339c0241d..cdf9eeeb6b 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1751,7 +1751,6 @@ static void riscv_cpu_add_misa_properties(Object *cpu= _obj) =20 static Property riscv_cpu_extensions[] =3D { /* Defaults for standard extensions */ - DEFINE_PROP_UINT8("pmu-num", RISCVCPU, cfg.pmu_num, 16), DEFINE_PROP_BOOL("sscofpmf", RISCVCPU, cfg.ext_sscofpmf, false), DEFINE_PROP_BOOL("Zifencei", RISCVCPU, cfg.ext_ifencei, true), DEFINE_PROP_BOOL("Zicsr", RISCVCPU, cfg.ext_icsr, true), @@ -1767,11 +1766,6 @@ static Property riscv_cpu_extensions[] =3D { DEFINE_PROP_BOOL("pmp", RISCVCPU, cfg.pmp, true), DEFINE_PROP_BOOL("sstc", RISCVCPU, cfg.ext_sstc, true), =20 - DEFINE_PROP_STRING("priv_spec", RISCVCPU, cfg.priv_spec), - DEFINE_PROP_STRING("vext_spec", RISCVCPU, cfg.vext_spec), - DEFINE_PROP_UINT16("vlen", RISCVCPU, cfg.vlen, 128), - DEFINE_PROP_UINT16("elen", RISCVCPU, cfg.elen, 64), - DEFINE_PROP_BOOL("smstateen", RISCVCPU, cfg.ext_smstateen, false), DEFINE_PROP_BOOL("svadu", RISCVCPU, cfg.ext_svadu, true), DEFINE_PROP_BOOL("svinval", RISCVCPU, cfg.ext_svinval, false), @@ -1802,9 +1796,7 @@ static Property riscv_cpu_extensions[] =3D { DEFINE_PROP_BOOL("zhinxmin", RISCVCPU, cfg.ext_zhinxmin, false), =20 DEFINE_PROP_BOOL("zicbom", RISCVCPU, cfg.ext_icbom, true), - DEFINE_PROP_UINT16("cbom_blocksize", RISCVCPU, cfg.cbom_blocksize, 64), DEFINE_PROP_BOOL("zicboz", RISCVCPU, cfg.ext_icboz, true), - DEFINE_PROP_UINT16("cboz_blocksize", RISCVCPU, cfg.cboz_blocksize, 64), =20 DEFINE_PROP_BOOL("zmmul", RISCVCPU, cfg.ext_zmmul, false), =20 @@ -1848,6 +1840,20 @@ static Property riscv_cpu_extensions[] =3D { DEFINE_PROP_END_OF_LIST(), }; =20 +static Property riscv_cpu_options[] =3D { + DEFINE_PROP_UINT8("pmu-num", RISCVCPU, cfg.pmu_num, 16), + + DEFINE_PROP_STRING("priv_spec", RISCVCPU, cfg.priv_spec), + DEFINE_PROP_STRING("vext_spec", RISCVCPU, cfg.vext_spec), + + DEFINE_PROP_UINT16("vlen", RISCVCPU, cfg.vlen, 128), + DEFINE_PROP_UINT16("elen", RISCVCPU, cfg.elen, 64), + + DEFINE_PROP_UINT16("cbom_blocksize", RISCVCPU, cfg.cbom_blocksize, 64), + DEFINE_PROP_UINT16("cboz_blocksize", RISCVCPU, cfg.cboz_blocksize, 64), + + DEFINE_PROP_END_OF_LIST(), +}; =20 #ifndef CONFIG_USER_ONLY static void cpu_set_cfg_unavailable(Object *obj, Visitor *v, @@ -1916,6 +1922,11 @@ static void riscv_cpu_add_user_properties(Object *ob= j) #endif qdev_property_add_static(dev, prop); } + + for (prop =3D riscv_cpu_options; prop && prop->name; prop++) { + qdev_property_add_static(dev, prop); + } + } =20 static Property riscv_cpu_properties[] =3D { --=20 2.41.0 From nobody Thu Oct 31 23:12:42 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 ARC-Seal: i=1; a=rsa-sha256; t=1689195578; cv=none; d=zohomail.com; s=zohoarc; b=Up/mj4mo7pk6ch3tKicBHLsW4lgoeL05JTWhz8FfJVuDK17qKc8ObaYE7UTADlW5ijF7Lzl7YKm7k5YdNoHET9MqnYRWdXjjrxQXDK9/vWbg3iKtOO9cEMFWIFFSi91/WPDpnMxjiIGTniNWAJIWSrqNxJfxPb6BNh5MmCpxsBU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689195578; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9nS2W9UaH9gghVm/aiRhSGBwZOy7l91Ih/qPzigWpPY=; b=exBhHNUzYFsrjl60K2rcswXB+aYILnKUo9gGgQF0JlQj0LK9pFDVzbAE6surxoH+Rw+dABNqKYyc0+JeYLlrQbF47Fej9eGUYXhVgYehAqZM/VUsYqD6ciKCBtZxs9Net59OAIEzttuP6CXh7KX6wHI0JG3cWc+j7Habhv2Jz0U= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1689195578049144.9358681337343; Wed, 12 Jul 2023 13:59:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qJguc-0000Fd-GG; Wed, 12 Jul 2023 16:58:14 -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 1qJgua-0000Em-H8 for qemu-devel@nongnu.org; Wed, 12 Jul 2023 16:58:12 -0400 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qJguY-0005Tg-B3 for qemu-devel@nongnu.org; Wed, 12 Jul 2023 16:58:12 -0400 Received: by mail-ot1-x330.google.com with SMTP id 46e09a7af769-6b8baa72c71so6215498a34.2 for ; Wed, 12 Jul 2023 13:58:09 -0700 (PDT) Received: from grind.. (201-69-66-19.dial-up.telesp.net.br. [201.69.66.19]) by smtp.gmail.com with ESMTPSA id i2-20020a056870344200b001a9911765efsm2359904oah.40.2023.07.12.13.58.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 13:58:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1689195489; x=1691787489; 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=9nS2W9UaH9gghVm/aiRhSGBwZOy7l91Ih/qPzigWpPY=; b=TUKiyCjt1nKZ6PJmI7aUPWoZPXNrPSNh0fC/9jKP2UHnpQQQPeMFBdrpTHPG9nNCK8 LDlsfN8eGtnnRhHU8UcNVjHWPtqJ3t7dCmKsYik45FjZTnALEXeW1T/IAQYm2uHYMT8z 909aO14nOs6cbIWBMa7G2qUb2FFhzVPrP1JXGucekHfWJFDyB+5ZKdFH6B0PZspN7HzZ Hakx85NdZdKRiJQJZC/BaR2YCW4WQxy50uWfQkYEIwf1YGzlOfIEUeHPpJr1BvUyEiDz 67feHqwiQJeS11fh2ZrRu++TKtojOUO47jpkttnLn9NKrSIDRdsiadgn5tluDaTUIWis bXiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689195489; x=1691787489; 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=9nS2W9UaH9gghVm/aiRhSGBwZOy7l91Ih/qPzigWpPY=; b=TNANnEjcs/ey98jmAGzCoP2UH91h4wuxrUxcm5PPK5ptGHPiJIE7i8Cu0dzqvy5zrQ taHRwiqp7N0qPWueu3/af+flYXRJLZdLuJGMFhaFRPSJi3f13SQWT/VLIIBMXe1orC+3 /TELXGKn2e+owG769Zz2UQPBhLIrBrPcnD8zt613J8Kq6DBvVLrQ57mXBdtyxc9pqG2O dzybyFD17Us6TdCTf0YjBR5br3qyyiwzihf12V/u3/PewQ+jdESx7/D+BYBvA+qqQbLl N+6c5q7VWZnPVqe8uLqBwFDun4nCTVLEbI0adiCpVJ9NdzrCho4VpunU6n+ic8PXYW+P J2Vw== X-Gm-Message-State: ABy/qLa7or7ECUdL5aFOyrKQic0g8sZ8MBFs+8eZ5lAAbdWgBNuTtEwe q3MCh6SWGLaDK7P2lDxuQMPc7jlrJj3AlsCASZs= X-Google-Smtp-Source: APBJJlFfGhPZzKcZ5pGkI2oesvfOC7HPco7Qzh7iLjNHWBQX7TkwOGpBwHHZNj5c4wvyf85v3jgceg== X-Received: by 2002:a05:6870:1714:b0:1b7:16f3:d37f with SMTP id h20-20020a056870171400b001b716f3d37fmr11456777oae.17.1689195488921; Wed, 12 Jul 2023 13:58:08 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com, bmeng@tinylab.org, liweiwei@iscas.ac.cn, zhiwei_liu@linux.alibaba.com, palmer@rivosinc.com, Daniel Henrique Barboza Subject: [PATCH for-8.2 v2 2/7] target/riscv/cpu.c: skip 'bool' check when filtering KVM props Date: Wed, 12 Jul 2023 17:57:43 -0300 Message-ID: <20230712205748.446931-3-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230712205748.446931-1-dbarboza@ventanamicro.com> References: <20230712205748.446931-1-dbarboza@ventanamicro.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::330; envelope-from=dbarboza@ventanamicro.com; helo=mail-ot1-x330.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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ventanamicro.com) X-ZM-MESSAGEID: 1689195579920100001 Content-Type: text/plain; charset="utf-8" After the introduction of riscv_cpu_options[] all properties in riscv_cpu_extensions[] are booleans. This check is now obsolete. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index cdf9eeeb6b..735e0ed793 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1907,17 +1907,11 @@ static void riscv_cpu_add_user_properties(Object *o= bj) * Set the default to disabled for every extension * unknown to KVM and error out if the user attempts * to enable any of them. - * - * We're giving a pass for non-bool properties since they're - * not related to the availability of extensions and can be - * safely ignored as is. */ - if (prop->info =3D=3D &qdev_prop_bool) { - object_property_add(obj, prop->name, "bool", - NULL, cpu_set_cfg_unavailable, - NULL, (void *)prop->name); - continue; - } + object_property_add(obj, prop->name, "bool", + NULL, cpu_set_cfg_unavailable, + NULL, (void *)prop->name); + continue; } #endif qdev_property_add_static(dev, prop); --=20 2.41.0 From nobody Thu Oct 31 23:12:42 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 ARC-Seal: i=1; a=rsa-sha256; t=1689195552; cv=none; d=zohomail.com; s=zohoarc; b=fx/l/i6Uo5c3pZAw5usq2YP7gJuDFGAKX758jkik80gh9jrRMtCYOInufXZQWda2fPeKahW1INoWQjd6r8BCBjANJwIGTNo78EHH6RGvVXOPbadlYhzu4PzbV4d/gwEnoJMlxU4iU9zu8q/I3iDn9gDZRmgUA11gcrHuXOkO8VU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689195552; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=s5kfyjMJSLHvJ1gc5dHqkhz0kAEnFcjYnR+16wCW8gg=; b=RN9N3Pf0dZgWYOjx4r8oVdY/bNUWpCVvk9EGDWFFrT7dMzxDfVMfgRh9+1sItyoTGbQvd7XawA/8qd01bFsxHn5lDrmn2xL5Zvz285lfyEojBXwv8Mi6MLaOTRSP5sW1D1PxoGQDymfHJhpBpvuKxdUuSe4IO2uolcufcIo1B0w= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1689195552966296.9772138318458; Wed, 12 Jul 2023 13:59:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qJguf-0000IM-3d; Wed, 12 Jul 2023 16:58:17 -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 1qJguc-0000Fi-Va for qemu-devel@nongnu.org; Wed, 12 Jul 2023 16:58:15 -0400 Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qJgub-0005Uk-80 for qemu-devel@nongnu.org; Wed, 12 Jul 2023 16:58:14 -0400 Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-6b5d57d7db9so6214920a34.3 for ; Wed, 12 Jul 2023 13:58:12 -0700 (PDT) Received: from grind.. (201-69-66-19.dial-up.telesp.net.br. [201.69.66.19]) by smtp.gmail.com with ESMTPSA id i2-20020a056870344200b001a9911765efsm2359904oah.40.2023.07.12.13.58.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 13:58:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1689195492; x=1691787492; 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=s5kfyjMJSLHvJ1gc5dHqkhz0kAEnFcjYnR+16wCW8gg=; b=P6GSkWvH4rJM0v7tNVsvMaoVVDLgNlpwvGdiZ0kH+2Hh9OCX1ADJo5dMXpdmfL3/0i ubrQxIcdKrpXtarAZL2X5ZyrWeOVQHbS9xZIRRpm2RkKL7neewQJTk+/1wn1VBqNOkoF Vym+VjPPqw9tByUUEpPLdr35nUBu3cgoBatjjVREIAHEqLsmsVX5uhBYN8pcDjXHXi6l //j0tAmIvmQnfOlSYz5uFnBF8Ujm6jQAF3RORZ3u++aAuPzohJ+/Z7+0H4WD9S2IRgWx piyRQ7CbLtRtwIlHLIGoJ1G3o6J16gzBJU5K8hOqAL0FqDd+HFYSR6sVRmFno2sNWWQY i36w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689195492; x=1691787492; 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=s5kfyjMJSLHvJ1gc5dHqkhz0kAEnFcjYnR+16wCW8gg=; b=lPYG662cWR57TYUwZAzc3j2fg8iuZc1YsZqHS/W0Z0Nzv/VHVMngwE1kGD+QgStkjQ Ws0Yn/lq6yLrf7zcdgPFs4QX3BWYzbX5TBgrAB/MdeZMEJtdq3gjPUNdPMKXU5GYMLNu WUHbt3OvVMA2SdiATvwQJvF3JlJbfCz5vJHqXfDN8oCHmkMo9a9uS6WHQoUmXbcCL7lM weuRmkenTWYjfwkCIBMYn+cHOyyXi5M8vMmCtcwdxGUC1fOomSLwRfyZWO2TCkKE0/7c 20QCWO1FeLqL+O8GiFTUu4w7TKNQvIYrVkD/xEIYCuVxGfXsCcxmblhZ9bZu93WPDtkR 0Acg== X-Gm-Message-State: ABy/qLYsCG0XBl32Tj4ChUksR4Y2gv3wxLlZoRYuh3njSm3gn9oSIKC7 7+mcaXJDT8f9y1R0ztbwn5ium85MidaTpz3DaoM= X-Google-Smtp-Source: APBJJlF3PNO7CDyTBm0rOK8mVEKpn+Ba1EwOktXB7WeGwl+iIdIAIfZElWT0joNbZd6G8Km3G48jYg== X-Received: by 2002:a05:6870:8194:b0:1b0:2de8:f14a with SMTP id k20-20020a056870819400b001b02de8f14amr19337945oae.28.1689195491871; Wed, 12 Jul 2023 13:58:11 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com, bmeng@tinylab.org, liweiwei@iscas.ac.cn, zhiwei_liu@linux.alibaba.com, palmer@rivosinc.com, Daniel Henrique Barboza Subject: [PATCH for-8.2 v2 3/7] target/riscv/cpu.c: split vendor exts from riscv_cpu_extensions[] Date: Wed, 12 Jul 2023 17:57:44 -0300 Message-ID: <20230712205748.446931-4-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230712205748.446931-1-dbarboza@ventanamicro.com> References: <20230712205748.446931-1-dbarboza@ventanamicro.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::336; envelope-from=dbarboza@ventanamicro.com; helo=mail-ot1-x336.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, 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 @ventanamicro.com) X-ZM-MESSAGEID: 1689195554168100001 Content-Type: text/plain; charset="utf-8" Our goal is to make riscv_cpu_extensions[] hold only ratified, non-vendor extensions. Create a new riscv_cpu_vendor_exts[] array for them, changing riscv_cpu_add_user_properties() accordingly. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 735e0ed793..9bbdc46126 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1808,20 +1808,6 @@ static Property riscv_cpu_extensions[] =3D { DEFINE_PROP_BOOL("zcmp", RISCVCPU, cfg.ext_zcmp, false), DEFINE_PROP_BOOL("zcmt", RISCVCPU, cfg.ext_zcmt, false), =20 - /* Vendor-specific custom extensions */ - DEFINE_PROP_BOOL("xtheadba", RISCVCPU, cfg.ext_xtheadba, false), - DEFINE_PROP_BOOL("xtheadbb", RISCVCPU, cfg.ext_xtheadbb, false), - DEFINE_PROP_BOOL("xtheadbs", RISCVCPU, cfg.ext_xtheadbs, false), - DEFINE_PROP_BOOL("xtheadcmo", RISCVCPU, cfg.ext_xtheadcmo, false), - DEFINE_PROP_BOOL("xtheadcondmov", RISCVCPU, cfg.ext_xtheadcondmov, fal= se), - DEFINE_PROP_BOOL("xtheadfmemidx", RISCVCPU, cfg.ext_xtheadfmemidx, fal= se), - DEFINE_PROP_BOOL("xtheadfmv", RISCVCPU, cfg.ext_xtheadfmv, false), - DEFINE_PROP_BOOL("xtheadmac", RISCVCPU, cfg.ext_xtheadmac, false), - DEFINE_PROP_BOOL("xtheadmemidx", RISCVCPU, cfg.ext_xtheadmemidx, false= ), - DEFINE_PROP_BOOL("xtheadmempair", RISCVCPU, cfg.ext_xtheadmempair, fal= se), - DEFINE_PROP_BOOL("xtheadsync", RISCVCPU, cfg.ext_xtheadsync, false), - DEFINE_PROP_BOOL("xventanacondops", RISCVCPU, cfg.ext_XVentanaCondOps,= false), - /* These are experimental so mark with 'x-' */ DEFINE_PROP_BOOL("x-zicond", RISCVCPU, cfg.ext_zicond, false), =20 @@ -1840,6 +1826,23 @@ static Property riscv_cpu_extensions[] =3D { DEFINE_PROP_END_OF_LIST(), }; =20 +static Property riscv_cpu_vendor_exts[] =3D { + DEFINE_PROP_BOOL("xtheadba", RISCVCPU, cfg.ext_xtheadba, false), + DEFINE_PROP_BOOL("xtheadbb", RISCVCPU, cfg.ext_xtheadbb, false), + DEFINE_PROP_BOOL("xtheadbs", RISCVCPU, cfg.ext_xtheadbs, false), + DEFINE_PROP_BOOL("xtheadcmo", RISCVCPU, cfg.ext_xtheadcmo, false), + DEFINE_PROP_BOOL("xtheadcondmov", RISCVCPU, cfg.ext_xtheadcondmov, fal= se), + DEFINE_PROP_BOOL("xtheadfmemidx", RISCVCPU, cfg.ext_xtheadfmemidx, fal= se), + DEFINE_PROP_BOOL("xtheadfmv", RISCVCPU, cfg.ext_xtheadfmv, false), + DEFINE_PROP_BOOL("xtheadmac", RISCVCPU, cfg.ext_xtheadmac, false), + DEFINE_PROP_BOOL("xtheadmemidx", RISCVCPU, cfg.ext_xtheadmemidx, false= ), + DEFINE_PROP_BOOL("xtheadmempair", RISCVCPU, cfg.ext_xtheadmempair, fal= se), + DEFINE_PROP_BOOL("xtheadsync", RISCVCPU, cfg.ext_xtheadsync, false), + DEFINE_PROP_BOOL("xventanacondops", RISCVCPU, cfg.ext_XVentanaCondOps,= false), + + DEFINE_PROP_END_OF_LIST(), +}; + static Property riscv_cpu_options[] =3D { DEFINE_PROP_UINT8("pmu-num", RISCVCPU, cfg.pmu_num, 16), =20 @@ -1921,6 +1924,9 @@ static void riscv_cpu_add_user_properties(Object *obj) qdev_property_add_static(dev, prop); } =20 + for (prop =3D riscv_cpu_vendor_exts; prop && prop->name; prop++) { + qdev_property_add_static(dev, prop); + } } =20 static Property riscv_cpu_properties[] =3D { --=20 2.41.0 From nobody Thu Oct 31 23:12:42 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 ARC-Seal: i=1; a=rsa-sha256; t=1689195548; cv=none; d=zohomail.com; s=zohoarc; b=Bwgo6MMyZBlnsVOZDnNvctmmSW0rDwnd5SVmF6kpVlh2T6sqypYFc4ELLVe/o7Wc6XTQpgdVY/CkgFLhp7cYVMJUGVWm7Cdm1e1DtzBkvaTnaLvb/+3lCx8jiHZxd/Mlhrx0mj/NbyaiYTFNiA7crwSn4xqYCins6d3ANvUO3Qc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689195548; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GVucVXFNkJSGKig816k3fMRcU2cBqg0nqnC1rOrLG+w=; b=inbdt/cBOLnUYBsMoDmJZ6FA41W2E/3iXehfyffAMskNgkS0f1vaxim3ZLGy3Go+9HbGn2633BJAobWKcNkIvPLiByrgwZr4TueneRg/QIouiDP39g/9kyBDp2geGufx6xseI8LJ5m7HNAKHnez2vlqooqQRA7QWNg1r22aOu0o= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1689195548593126.53444485797434; Wed, 12 Jul 2023 13:59:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qJgui-0000Jg-Ob; Wed, 12 Jul 2023 16:58:20 -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 1qJgug-0000IV-7L for qemu-devel@nongnu.org; Wed, 12 Jul 2023 16:58:18 -0400 Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qJgue-0005VE-IO for qemu-devel@nongnu.org; Wed, 12 Jul 2023 16:58:17 -0400 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-1b0419f758eso768457fac.1 for ; Wed, 12 Jul 2023 13:58:16 -0700 (PDT) Received: from grind.. (201-69-66-19.dial-up.telesp.net.br. [201.69.66.19]) by smtp.gmail.com with ESMTPSA id i2-20020a056870344200b001a9911765efsm2359904oah.40.2023.07.12.13.58.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 13:58:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1689195495; x=1691787495; 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=GVucVXFNkJSGKig816k3fMRcU2cBqg0nqnC1rOrLG+w=; b=jMlK2RgwYmBYpFOX9+mBllD3yvywiYTR8UdCrvC6ikjfBwCa+U8tc0XEf2kcLIOlqz T1iQkwus9h3EYzwLdYJQIvGduj3Vj9ExvmGCV18CIvjqgNDYUlAkDsPtsUzH4b4Zb+KV hZnMbS33gel8/q9lnrQjLfh+Vczk/xXBS3ZZ2SI/NxvgqYmn1ndGHa5QOxRZ8VPXtEoT q5qhRCnfeWByu+ZWe4gzc1aE9txVM3DTKxDcceJnLynHst/7xEho4qzCoexXXIPWNQBe fISlx6jX3yRzv/9PCaTENQeWZW7tOlRwhSzF+bA8IB9L5+Qppqy1cijxOjYgiWU5yBNA hjZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689195495; x=1691787495; 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=GVucVXFNkJSGKig816k3fMRcU2cBqg0nqnC1rOrLG+w=; b=FMxMVbT3dbS/zh6TJs8Ys7xeew8GoQPBWVk1Qrws2IQkMiaMVlMnGmdBG6ggxL0MPh ywbdlicRZ6w+HYoj3xm1CypSqpRNXaN3+JBwIDPvfYDf/u7R3Syf/6AMgr4BXWaC35wG 1QKiyXtEopR/01MfqSbXaVRJA60VPnR8QfQBB9I9WrxBQKR5tsfO9PcQ9RxQoAFG2Y+1 Dq1wp1rKE2A9OHHGVgahD17zFGOPR9EM3vR4m2bQrutF5P4WqLeEEo/KF0smx52jYIBo Ip7UAgACCj6NcCbFeU+LasnfCBaLi5cZiUrW/pKdVMPgvpHG6saeKnXAHe1VY3O3rbh3 ez4g== X-Gm-Message-State: ABy/qLaKr7TWVO83s2gIGIvzDQ6REChh1XpPcsQFG1Mhi7U4tvkpTccw IKbbSz0erVOBtXII8WZtL4yDG8BnWXN+UigYBQs= X-Google-Smtp-Source: APBJJlGfKyn0wT+0tLmJFEQy1lQEVG0znR+YbwlDT34UbGXtMyVG2yK2wurps6bWGRU+CU5iw8fpqA== X-Received: by 2002:a05:6870:f10f:b0:1b7:8957:bfe0 with SMTP id k15-20020a056870f10f00b001b78957bfe0mr206122oac.20.1689195495001; Wed, 12 Jul 2023 13:58:15 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com, bmeng@tinylab.org, liweiwei@iscas.ac.cn, zhiwei_liu@linux.alibaba.com, palmer@rivosinc.com, Daniel Henrique Barboza Subject: [PATCH for-8.2 v2 4/7] target/riscv/cpu.c: split non-ratified exts from riscv_cpu_extensions[] Date: Wed, 12 Jul 2023 17:57:45 -0300 Message-ID: <20230712205748.446931-5-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230712205748.446931-1-dbarboza@ventanamicro.com> References: <20230712205748.446931-1-dbarboza@ventanamicro.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=2001:4860:4864:20::36; envelope-from=dbarboza@ventanamicro.com; helo=mail-oa1-x36.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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ventanamicro.com) X-ZM-MESSAGEID: 1689195550580100005 Content-Type: text/plain; charset="utf-8" Create a new riscv_cpu_experimental_exts[] to store the non-ratified extensions properties. Once they are ratified we'll move them back to riscv_cpu_extensions[]. Change riscv_cpu_add_user_properties to keep adding them to users. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 9bbdc46126..c0826b449d 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1808,21 +1808,6 @@ static Property riscv_cpu_extensions[] =3D { DEFINE_PROP_BOOL("zcmp", RISCVCPU, cfg.ext_zcmp, false), DEFINE_PROP_BOOL("zcmt", RISCVCPU, cfg.ext_zcmt, false), =20 - /* These are experimental so mark with 'x-' */ - DEFINE_PROP_BOOL("x-zicond", RISCVCPU, cfg.ext_zicond, false), - - /* ePMP 0.9.3 */ - DEFINE_PROP_BOOL("x-epmp", RISCVCPU, cfg.epmp, false), - DEFINE_PROP_BOOL("x-smaia", RISCVCPU, cfg.ext_smaia, false), - DEFINE_PROP_BOOL("x-ssaia", RISCVCPU, cfg.ext_ssaia, false), - - DEFINE_PROP_BOOL("x-zvfh", RISCVCPU, cfg.ext_zvfh, false), - DEFINE_PROP_BOOL("x-zvfhmin", RISCVCPU, cfg.ext_zvfhmin, false), - - DEFINE_PROP_BOOL("x-zfbfmin", RISCVCPU, cfg.ext_zfbfmin, false), - DEFINE_PROP_BOOL("x-zvfbfmin", RISCVCPU, cfg.ext_zvfbfmin, false), - DEFINE_PROP_BOOL("x-zvfbfwma", RISCVCPU, cfg.ext_zvfbfwma, false), - DEFINE_PROP_END_OF_LIST(), }; =20 @@ -1843,6 +1828,25 @@ static Property riscv_cpu_vendor_exts[] =3D { DEFINE_PROP_END_OF_LIST(), }; =20 +/* These are experimental so mark with 'x-' */ +static Property riscv_cpu_experimental_exts[] =3D { + DEFINE_PROP_BOOL("x-zicond", RISCVCPU, cfg.ext_zicond, false), + + /* ePMP 0.9.3 */ + DEFINE_PROP_BOOL("x-epmp", RISCVCPU, cfg.epmp, false), + DEFINE_PROP_BOOL("x-smaia", RISCVCPU, cfg.ext_smaia, false), + DEFINE_PROP_BOOL("x-ssaia", RISCVCPU, cfg.ext_ssaia, false), + + DEFINE_PROP_BOOL("x-zvfh", RISCVCPU, cfg.ext_zvfh, false), + DEFINE_PROP_BOOL("x-zvfhmin", RISCVCPU, cfg.ext_zvfhmin, false), + + DEFINE_PROP_BOOL("x-zfbfmin", RISCVCPU, cfg.ext_zfbfmin, false), + DEFINE_PROP_BOOL("x-zvfbfmin", RISCVCPU, cfg.ext_zvfbfmin, false), + DEFINE_PROP_BOOL("x-zvfbfwma", RISCVCPU, cfg.ext_zvfbfwma, false), + + DEFINE_PROP_END_OF_LIST(), +}; + static Property riscv_cpu_options[] =3D { DEFINE_PROP_UINT8("pmu-num", RISCVCPU, cfg.pmu_num, 16), =20 @@ -1927,6 +1931,10 @@ static void riscv_cpu_add_user_properties(Object *ob= j) for (prop =3D riscv_cpu_vendor_exts; prop && prop->name; prop++) { qdev_property_add_static(dev, prop); } + + for (prop =3D riscv_cpu_experimental_exts; prop && prop->name; prop++)= { + qdev_property_add_static(dev, prop); + } } =20 static Property riscv_cpu_properties[] =3D { --=20 2.41.0 From nobody Thu Oct 31 23:12:42 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 ARC-Seal: i=1; a=rsa-sha256; t=1689195548; cv=none; d=zohomail.com; s=zohoarc; b=ZN4F1qa2tsGtLJlkPoSDd/8l8JfldS9Fl3SvynZb56hal1H3KU3n2N1vpKSb0cTkHDsz0w1GbS8HIXzocgi2jIoYVD8mbQ/2fBWK2Xhptalir81qnxlxKZzar8N4hNeRHj6/BBRSpRb6BLCSPfPkm1aLok51v66lxoylx+7vdC8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689195548; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ISGp9WhmlakO4roPRO9/GdVvd2qgHOTCTKibkwihSgI=; b=M5IiQpipdj5/xCp/eqXNTDM1020kPNscs2tJ16NwQURZT+gJYOaHpqf8z48D6+ufOKK4+ueBu1OE6wrEoJbGq9HHfUAWqrbk3+ujbnQw+qo2j9YqPcW/DDNpHdlUeFiX+1HUaCVrjMLspRFRfU2ACmrFqVMrdrZUTWF9H3Bf3RY= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1689195548283813.998584385676; Wed, 12 Jul 2023 13:59:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qJgul-0000K2-0R; Wed, 12 Jul 2023 16:58:23 -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 1qJgui-0000Jj-TN for qemu-devel@nongnu.org; Wed, 12 Jul 2023 16:58:20 -0400 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qJguh-0005Vb-GD for qemu-devel@nongnu.org; Wed, 12 Jul 2023 16:58:20 -0400 Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-6b9a2416b1cso786067a34.2 for ; Wed, 12 Jul 2023 13:58:19 -0700 (PDT) Received: from grind.. (201-69-66-19.dial-up.telesp.net.br. [201.69.66.19]) by smtp.gmail.com with ESMTPSA id i2-20020a056870344200b001a9911765efsm2359904oah.40.2023.07.12.13.58.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 13:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1689195498; x=1691787498; 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=ISGp9WhmlakO4roPRO9/GdVvd2qgHOTCTKibkwihSgI=; b=Gc2GcR7nLluyhXshVVdJDUmOiUmvU7PjkIioThKiRVXMpj8dtSKZgNWoqPgcxwXvpP 6pN8I9+CmwV9ipJL8NDNtDlTTkGjcbDe0Zs/BhlJ7U11xnctSxCQqrW7MHUPoEQEcQfQ M+ZuZ7e/Q+O0A9Kq7ahrLLECWPZljuaYCffqJKpMEzpadKTy8aWgF1tSKYkFe3pbMX50 XsZ1nhnSK6UUf1IpcZ+7JFo+5CMp87n0Mgfr6Pmv2RHLX2YZ+ZG4RAbla7IzQh4KH9sm hqSIdz2h7e+nGe561rfq2TGcQ41MZM02gSpc+J783JhTfhgDXu2rwqh2VJ3GQmNHNlqH RUig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689195498; x=1691787498; 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=ISGp9WhmlakO4roPRO9/GdVvd2qgHOTCTKibkwihSgI=; b=ZaYduyeXwOW9qbClk2ZJeG/vT+P805FldQwkbewTquVgussSb5iP5gOsysNAGx11Lt 7x0Oz5QZkMB+8j9XLDuVWulIQY9CeXPVIt9Mt/7RE3vQ718ZP7QC7lLbM5vBJ8jLJVvT dxX+IX4HBFRh7N0+u4/RZuTrus2Xx3avM1ghK7z6Bz3KqmT3qVmxWuyWoB6DFgXsfDBx HRzdVZssYoObQpO7JZruGATLtgXnuSopE/5PDkguK8wW26Pw0CNWbLjfm29RhwHinU/T R8gKoK8UORp5S1+hQxUXjLaIUYUh73s9rQhkEK4hhiE7MZAN41dNByvqTZ1lurD4DSxH 2oiQ== X-Gm-Message-State: ABy/qLaIMp5pYcPU/mcXacEENN53qJ4QLhgAWMWalAUCa4KSIz5h+W43 ffIGpdFrY/yhpNe36riwFDejzmZrCfRHjPAKdFw= X-Google-Smtp-Source: APBJJlGH7FvDLF1LVRoFijzNwq+l3AFh9wSJMmGpgNkGWdnL3IeacfR9nKcm/EmuaxjKILVy19R0dQ== X-Received: by 2002:a05:6871:b2a:b0:19f:9495:95ff with SMTP id fq42-20020a0568710b2a00b0019f949595ffmr25104798oab.27.1689195498176; Wed, 12 Jul 2023 13:58:18 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com, bmeng@tinylab.org, liweiwei@iscas.ac.cn, zhiwei_liu@linux.alibaba.com, palmer@rivosinc.com, Daniel Henrique Barboza Subject: [PATCH for-8.2 v2 5/7] target/riscv/cpu.c: add a ADD_CPU_PROPERTIES_ARRAY() macro Date: Wed, 12 Jul 2023 17:57:46 -0300 Message-ID: <20230712205748.446931-6-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230712205748.446931-1-dbarboza@ventanamicro.com> References: <20230712205748.446931-1-dbarboza@ventanamicro.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::32e; envelope-from=dbarboza@ventanamicro.com; helo=mail-ot1-x32e.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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ventanamicro.com) X-ZM-MESSAGEID: 1689195549917100001 Content-Type: text/plain; charset="utf-8" The code inside riscv_cpu_add_user_properties() became quite repetitive after recent changes. Add a macro to hide the repetition away. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index c0826b449d..b61465c8c4 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1881,6 +1881,11 @@ static void cpu_set_cfg_unavailable(Object *obj, Vis= itor *v, } #endif =20 +#define ADD_CPU_PROPERTIES_ARRAY(_dev, _array) \ + for (prop =3D _array; prop && prop->name; prop++) { \ + qdev_property_add_static(_dev, prop); \ + } \ + /* * Add CPU properties with user-facing flags. * @@ -1924,17 +1929,9 @@ static void riscv_cpu_add_user_properties(Object *ob= j) qdev_property_add_static(dev, prop); } =20 - for (prop =3D riscv_cpu_options; prop && prop->name; prop++) { - qdev_property_add_static(dev, prop); - } - - for (prop =3D riscv_cpu_vendor_exts; prop && prop->name; prop++) { - qdev_property_add_static(dev, prop); - } - - for (prop =3D riscv_cpu_experimental_exts; prop && prop->name; prop++)= { - qdev_property_add_static(dev, prop); - } + ADD_CPU_PROPERTIES_ARRAY(dev, riscv_cpu_options); + ADD_CPU_PROPERTIES_ARRAY(dev, riscv_cpu_vendor_exts); + ADD_CPU_PROPERTIES_ARRAY(dev, riscv_cpu_experimental_exts); } =20 static Property riscv_cpu_properties[] =3D { --=20 2.41.0 From nobody Thu Oct 31 23:12:42 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 ARC-Seal: i=1; a=rsa-sha256; t=1689195628; cv=none; d=zohomail.com; s=zohoarc; b=FL8os45c3pCaBINyPPvd+qm+g+acqA5R4I4fjsZHXOX35pf9sWbiwSvkfwL6Hb0EA6mA2r60/ns6B9A8qCZUW4UHstpGOmzcWizYm/csReNcR+962eaF8gDsCUIcMiXf637G9GlzDxB0bz+YpUiiYI8NBZCLc3UN7QGWXwp1KzY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689195628; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gbij3fCsSGBNGo69giNI+z6YJ+Sk9DaLY9krqFrXyhs=; b=MIPUrMrXr/2M32no3wT3+BZizGcS/lrl3QyYzHPrOOYRfYZha5WV+VXNlv6pW2U2uDx0vdSf8vInbzJIy/EyPZuVD5W8chmfBxBNsR8yRe3XZ2qXMfWcRRpUUb2zpRXVjEk3/xWDpCTUUJhSuIz6wukxigOofN0SoIepWjK7sd8= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1689195628239162.72397534712582; Wed, 12 Jul 2023 14:00:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qJguq-0000L8-CN; Wed, 12 Jul 2023 16:58:28 -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 1qJgum-0000KW-GY for qemu-devel@nongnu.org; Wed, 12 Jul 2023 16:58:25 -0400 Received: from mail-oa1-x2a.google.com ([2001:4860:4864:20::2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qJguk-0005W1-PC for qemu-devel@nongnu.org; Wed, 12 Jul 2023 16:58:24 -0400 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-1b0606bee45so6561076fac.3 for ; Wed, 12 Jul 2023 13:58:22 -0700 (PDT) Received: from grind.. (201-69-66-19.dial-up.telesp.net.br. [201.69.66.19]) by smtp.gmail.com with ESMTPSA id i2-20020a056870344200b001a9911765efsm2359904oah.40.2023.07.12.13.58.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 13:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1689195501; x=1691787501; 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=gbij3fCsSGBNGo69giNI+z6YJ+Sk9DaLY9krqFrXyhs=; b=JYs1Wv004AGDUoI1qUEkNmxD1R7sUvsZr93mBvCL3QAEX0pN1xPRnogdyoTfQ9S44k 89FB10/zQI1VWLDEa0r1YhV+9y2pl8/Xgeyge3CM0+BCP6ThmFWchg6mPGhkOaCuJHbw RPaF2UBknVA7aYJcv/h7UDOlT6JlK8cPoSovwnWPoSSghUWnICZx1OJqE6Kkz3UbpvAm 17kbl86EqYwNHzukGm7dzMQFJ1TrH2w/OUWxtXCnSeAygHlwJ2heFMGlFZWp7N7k3YZw 8eM5XzBl9kFW6ZGV7uOAWyLUoQePcExXVaZUD+5uadzLu3evRDeUZkuVFWjVwY8Gqs5+ sohA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689195501; x=1691787501; 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=gbij3fCsSGBNGo69giNI+z6YJ+Sk9DaLY9krqFrXyhs=; b=EHEoT/C3s7ZKWS+PhbN98waKwjaAnygW6N16/tU6mHBevS5TTJxFl2klsGp7zU0fN1 rFM3wQJfDunv7Dn+XZ/sxipdc5O8U7DNv4U8uW60oJXTz3VMKjoacHPYioi1ptW/Gs5r L6GS6+Qfj069sLUTvrlnkGveOHlFpfyFftIZdbmlK9bkJJSFXM3vqPbB01nwxeWgScfh mIXzXJL1j/+Tj44mbKEE5lBWbcJWrcEPlJ+a0HsqznvWwSP+CMMG0+mq2WXPJOp4dEK2 vQ30Ho9n0Hnh3asKyjRifPWHf52sX7J2dEcLdSYS+yk5WL/tqLQUFbrNqyHSrsJ30DZx x7cg== X-Gm-Message-State: ABy/qLZ475JqevRDV0VowCQ3rdtNnL5eg+4OwRIw6qsFRcO0ZoBEd4dh 0vNp4LR1h8Xl67NBZ5Thu837ADRY1fQWsUTYrj4= X-Google-Smtp-Source: APBJJlHEw+H0M1SMs+S8fKLHrwiuWGkMeEhtCa9CZDa1JuDtLizc27G8AW7rkrPfcpeEb0Fe2CyKIw== X-Received: by 2002:a05:6870:438c:b0:1b0:2686:5b31 with SMTP id r12-20020a056870438c00b001b026865b31mr23887918oah.48.1689195501063; Wed, 12 Jul 2023 13:58:21 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com, bmeng@tinylab.org, liweiwei@iscas.ac.cn, zhiwei_liu@linux.alibaba.com, palmer@rivosinc.com, Daniel Henrique Barboza Subject: [PATCH for-8.2 v2 6/7] target/riscv: add 'max' CPU type Date: Wed, 12 Jul 2023 17:57:47 -0300 Message-ID: <20230712205748.446931-7-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230712205748.446931-1-dbarboza@ventanamicro.com> References: <20230712205748.446931-1-dbarboza@ventanamicro.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=2001:4860:4864:20::2a; envelope-from=dbarboza@ventanamicro.com; helo=mail-oa1-x2a.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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ventanamicro.com) X-ZM-MESSAGEID: 1689195630205100001 Content-Type: text/plain; charset="utf-8" The 'max' CPU type is used by tooling to determine what's the most capable CPU a current QEMU version implements. Other archs such as ARM implements this type. Let's add it to RISC-V. What we consider "most capable CPU" in this context are related to ratified, non-vendor extensions. This means that we want the 'max' CPU to enable all (possible) ratified extensions by default. The reasoning behind this design is (1) vendor extensions can conflict with each other and we won't play favorities deciding which one is default or not and (2) non-ratified extensions are always prone to changes, not being stable enough to be enabled by default. All this said, we're still not able to enable all ratified extensions due to conflicts between them. Zfinx and all its dependencies aren't enabled because of a conflict with RVF. zce, zcmp and zcmt are also disabled due to RVD conflicts. When running with 64 bits we're also disabling zcf. MISA bits RVG, RVJ and RVV are also being set manually since they're default disabled. This is the resulting 'riscv,isa' DT for this new CPU: rv64imafdcvh_zicbom_zicboz_zicsr_zifencei_zihintpause_zawrs_zfa_ zfh_zfhmin_zca_zcb_zcd_zba_zbb_zbc_zbkb_zbkc_zbkx_zbs_zk_zkn_zknd_ zkne_zknh_zkr_zks_zksed_zksh_zkt_zve32f_zve64f_zve64d_ smstateen_sscofpmf_sstc_svadu_svinval_svnapot_svpbmt Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu-qom.h | 1 + target/riscv/cpu.c | 53 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/target/riscv/cpu-qom.h b/target/riscv/cpu-qom.h index 04af50983e..f3fbe37a2c 100644 --- a/target/riscv/cpu-qom.h +++ b/target/riscv/cpu-qom.h @@ -30,6 +30,7 @@ #define CPU_RESOLVING_TYPE TYPE_RISCV_CPU =20 #define TYPE_RISCV_CPU_ANY RISCV_CPU_TYPE_NAME("any") +#define TYPE_RISCV_CPU_MAX RISCV_CPU_TYPE_NAME("max") #define TYPE_RISCV_CPU_BASE32 RISCV_CPU_TYPE_NAME("rv32") #define TYPE_RISCV_CPU_BASE64 RISCV_CPU_TYPE_NAME("rv64") #define TYPE_RISCV_CPU_BASE128 RISCV_CPU_TYPE_NAME("x-rv128") diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index b61465c8c4..5172566cda 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -248,6 +248,7 @@ static const char * const riscv_intr_names[] =3D { }; =20 static void riscv_cpu_add_user_properties(Object *obj); +static void riscv_init_max_cpu_extensions(Object *obj); =20 const char *riscv_cpu_get_trap_name(target_ulong cause, bool async) { @@ -374,6 +375,25 @@ static void riscv_any_cpu_init(Object *obj) cpu->cfg.pmp =3D true; } =20 +static void riscv_max_cpu_init(Object *obj) +{ + RISCVCPU *cpu =3D RISCV_CPU(obj); + CPURISCVState *env =3D &cpu->env; + RISCVMXL mlx =3D MXL_RV64; + +#ifdef TARGET_RISCV32 + mlx =3D MXL_RV32; +#endif + set_misa(env, mlx, 0); + riscv_cpu_add_user_properties(obj); + riscv_init_max_cpu_extensions(obj); + env->priv_ver =3D PRIV_VERSION_LATEST; +#ifndef CONFIG_USER_ONLY + set_satp_mode_max_supported(RISCV_CPU(obj), mlx =3D=3D MXL_RV32 ? + VM_1_10_SV32 : VM_1_10_SV57); +#endif +} + #if defined(TARGET_RISCV64) static void rv64_base_cpu_init(Object *obj) { @@ -1934,6 +1954,38 @@ static void riscv_cpu_add_user_properties(Object *ob= j) ADD_CPU_PROPERTIES_ARRAY(dev, riscv_cpu_experimental_exts); } =20 +/* + * The 'max' type CPU will have all possible ratified + * non-vendor extensions enabled. + */ +static void riscv_init_max_cpu_extensions(Object *obj) +{ + RISCVCPU *cpu =3D RISCV_CPU(obj); + CPURISCVState *env =3D &cpu->env; + Property *prop; + + /* Enable RVG, RVJ and RVV that are disabled by default */ + set_misa(env, env->misa_mxl, env->misa_ext | RVG | RVJ | RVV); + + for (prop =3D riscv_cpu_extensions; prop && prop->name; prop++) { + object_property_set_bool(obj, prop->name, true, NULL); + } + + /* Zfinx is not compatible with F. Disable it */ + object_property_set_bool(obj, "zfinx", false, NULL); + object_property_set_bool(obj, "zdinx", false, NULL); + object_property_set_bool(obj, "zhinx", false, NULL); + object_property_set_bool(obj, "zhinxmin", false, NULL); + + object_property_set_bool(obj, "zce", false, NULL); + object_property_set_bool(obj, "zcmp", false, NULL); + object_property_set_bool(obj, "zcmt", false, NULL); + + if (env->misa_mxl !=3D MXL_RV32) { + object_property_set_bool(obj, "zcf", false, NULL); + } +} + static Property riscv_cpu_properties[] =3D { DEFINE_PROP_BOOL("debug", RISCVCPU, cfg.debug, true), =20 @@ -2272,6 +2324,7 @@ static const TypeInfo riscv_cpu_type_infos[] =3D { .abstract =3D true, }, DEFINE_DYNAMIC_CPU(TYPE_RISCV_CPU_ANY, riscv_any_cpu_init), + DEFINE_DYNAMIC_CPU(TYPE_RISCV_CPU_MAX, riscv_max_cpu_init), #if defined(CONFIG_KVM) DEFINE_CPU(TYPE_RISCV_CPU_HOST, riscv_host_cpu_init), #endif --=20 2.41.0 From nobody Thu Oct 31 23:12:42 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 ARC-Seal: i=1; a=rsa-sha256; t=1689195628; cv=none; d=zohomail.com; s=zohoarc; b=KTgPcbWPYlFclHWbKhKB9LZKKSdqgknH+gC9xQnUKJpv4NdCjDc5m8IRwkfAhujsEuNaRcFbShJgv4pi6sz0CGu3UhCaU4xJ4QPkElqaDOAuxqsWGwKfCZ4nWj3YdiUXNNZIpSNUk7/qcV4sE+5ILGmVADz2uP/60Z1RlsUYgY0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689195628; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+mkt2khv3HlTYD2I5HX8C8vkoqmlMW0ZXesjrMFYxT0=; b=aoWsm6NThMpffvza+TLbppE1BOYu+lAJQu1Q5k78GxjegMI5vmM8WX5WXzhKXkOOZveZeyHasNRG/k0K8FVxzE2nRcln4BfF6VshD07VGIlvP6+Uo7blh1pEU5ZElqjytT/tmtpeb37uI+0IwkzKPTmxVYyBlj77CpKZINN5ht8= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1689195628627387.4697758502631; Wed, 12 Jul 2023 14:00:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qJguv-0000Ln-Be; Wed, 12 Jul 2023 16:58:35 -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 1qJgup-0000Kv-Cp for qemu-devel@nongnu.org; Wed, 12 Jul 2023 16:58:27 -0400 Received: from mail-oa1-x35.google.com ([2001:4860:4864:20::35]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qJgun-0005WW-UB for qemu-devel@nongnu.org; Wed, 12 Jul 2023 16:58:27 -0400 Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-1b00b0ab0daso5922437fac.0 for ; Wed, 12 Jul 2023 13:58:25 -0700 (PDT) Received: from grind.. (201-69-66-19.dial-up.telesp.net.br. [201.69.66.19]) by smtp.gmail.com with ESMTPSA id i2-20020a056870344200b001a9911765efsm2359904oah.40.2023.07.12.13.58.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 13:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1689195504; x=1691787504; 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=+mkt2khv3HlTYD2I5HX8C8vkoqmlMW0ZXesjrMFYxT0=; b=dv+KQL0XUJQo80ID0u72tJkpAn25dst0wkyS54sIRWKtrZ0tIZ0FxxjoxCuNS6HxhL 6shG4Vs3us0LcGafhbAy2qeL/07cZuxaUKUZooNmcEOMnW7U5A5Exk8BM8bcvCGyMqtL b6RzKxrJ6zm+GCfTYBDAvHHzdYhV3hJSN5dhVxT69SFMHlHsjbisknplfVa2QRfpkeiQ nIlrRe3eQYnrBg810PHhhLe8T6VY2Hrx25b4BKGUcuSmc0TN9xekLs3mjcYG/hws2zdy jBma32cy/iK1rThNJLIuzH9uOrgTjO9q0WuuMM5SXEua7mI/PrjTtxynbj8g/AbTcNrc 55cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689195504; x=1691787504; 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=+mkt2khv3HlTYD2I5HX8C8vkoqmlMW0ZXesjrMFYxT0=; b=B10AlxXwfp6au7DtJx9FGHw2KZcedwnyr9rqV5vQoim/kmmR3Kz/ZHu3A12uTalgeh Bl3WFsoR2JZgjg8WZHna8+ycfR4jEK12gNxhtG1fl92bCC1LYH580vuOXTLOiWX5PGGu XqyiQ6a3Z9C4iCqUiCPhTqbN5BLlq93w6DyQUTyZUtZwllfP7KBFAZCi/qJLfC/vPSF5 a3jNuvgp4ee+/sKEFqZlTLYY6j4SNz1HcvjsFc3forahrOz+B+Wrn/07ud5d5fIrtdG2 ZoI95cxZanWU0GTHjPPSUHXQl8lEkbV7X2SnDd6rCHaPXKR2dC0yRckOVaGJyyT3UKni 6urA== X-Gm-Message-State: ABy/qLbGtwEkuIRa31OIQ84v53/gxhz/fL0g5kPcfCKnNzVYPfeU3hrx nNQNRb7ftEThLkrnCjQDqNf2GwZ+8HojTWLxREA= X-Google-Smtp-Source: APBJJlEWaCVDggVkiEwU37G+2srhNvj+lHucIXiseQwj83LSd3ooSTowCRQzm5fmxJYEAT6846h0Cw== X-Received: by 2002:a05:6870:1f91:b0:1b7:6158:621a with SMTP id go17-20020a0568701f9100b001b76158621amr5216803oac.47.1689195504025; Wed, 12 Jul 2023 13:58:24 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com, bmeng@tinylab.org, liweiwei@iscas.ac.cn, zhiwei_liu@linux.alibaba.com, palmer@rivosinc.com, Daniel Henrique Barboza Subject: [PATCH for-8.2 v2 7/7] avocado, risc-v: add opensbi tests for 'max' CPU Date: Wed, 12 Jul 2023 17:57:48 -0300 Message-ID: <20230712205748.446931-8-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230712205748.446931-1-dbarboza@ventanamicro.com> References: <20230712205748.446931-1-dbarboza@ventanamicro.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=2001:4860:4864:20::35; envelope-from=dbarboza@ventanamicro.com; helo=mail-oa1-x35.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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ventanamicro.com) X-ZM-MESSAGEID: 1689195630509100004 Content-Type: text/plain; charset="utf-8" Add smoke tests to ensure that we'll not break the 'max' CPU type when adding new ratified extensions to be enabled. Signed-off-by: Daniel Henrique Barboza --- tests/avocado/riscv_opensbi.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/avocado/riscv_opensbi.py b/tests/avocado/riscv_opensbi.py index bfff9cc3c3..15fd57fe51 100644 --- a/tests/avocado/riscv_opensbi.py +++ b/tests/avocado/riscv_opensbi.py @@ -61,3 +61,19 @@ def test_riscv64_virt(self): :avocado: tags=3Dmachine:virt """ self.boot_opensbi() + + def test_riscv32_virt_maxcpu(self): + """ + :avocado: tags=3Darch:riscv32 + :avocado: tags=3Dmachine:virt + :avocado: tags=3Dcpu:max + """ + self.boot_opensbi() + + def test_riscv64_virt_maxcpu(self): + """ + :avocado: tags=3Darch:riscv64 + :avocado: tags=3Dmachine:virt + :avocado: tags=3Dcpu:max + """ + self.boot_opensbi() --=20 2.41.0