From patchwork Sun Oct 22 23:28:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 737035 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1282649wrl; Sun, 22 Oct 2023 16:33:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHaODkVM4CF6F4ZDM1Tz2VM4YWzm+urlhsFveVKzw9oulUSJ1sHwIOxhEp9JAowvGJbO2z1 X-Received: by 2002:a9d:63d0:0:b0:6c6:4e73:f83d with SMTP id e16-20020a9d63d0000000b006c64e73f83dmr8347279otl.32.1698017585883; Sun, 22 Oct 2023 16:33:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698017585; cv=none; d=google.com; s=arc-20160816; b=P0xpLsz+2WYz3lq182A4yjryLaH1kIp4al3oObrNPTuNvh6TvADadqfF6zDSexBYOM luHIX6a4bqnQFJL63b+lPPrvAa0i9ZYF+zN5h6DFna0lH0HREgddTA9GG5ZotnoeZCB9 kHW6XoTrcNubmd/EORAWrEtmPokO53x+R698CLOKlRAIUxed8GbgA7tQ0E2SWUK0GSXa 3EcHjubkPYZZQtGKY8Eog20ASzo6STcf9a9rHoiMV6zGQ7WjzRt9SceujTdyBhwPVhJ1 islQPRPowAQlIq9rcv+rZunSxNfdW/3R33X+0FON/Dcn7kV4IU5eW3yzohYTVTuuCHBW LqVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lVqtOTdE26FeikcQeSUZ6gzaDd5J2ZKDmGo0pFRcFos=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=SyiGWgHwZlTdyWdQM0uQsmf8E3jRwijCmacS24iLUIA0h8bRhICyzv54ekMXOqO+pl 4sq3SlPU4QANPKum93UtGdfpV3EaE1C80T85t/gbDxMJKh0qfN3z6cxkGty4c8u81qiP UcKva9mB4LO7YG3m/AmmD8CalRP8Qu6PTsjd86anOWmytuuAEJLM1exTudPQkFdo5fJO 292uk/CQyEiirNT+61pIhTBhh5w1hoCOKKH6WUgYILef6+gg1hXZGz7PZ4TwxqlBALO5 QPi5A/jdRXJrdbjRCx/sejjytuy7dKP0MtXyqSXOGRuPyuPe/6akXsu8mym7mxyOsUUP n2Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tA0pdSxj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id if5-20020a0562141c4500b0065cfd573687si5071579qvb.292.2023.10.22.16.33.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Oct 2023 16:33:05 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tA0pdSxj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quhtP-00079l-EX; Sun, 22 Oct 2023 19:29:59 -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 1quhtF-00076M-HK for qemu-devel@nongnu.org; Sun, 22 Oct 2023 19:29:51 -0400 Received: from mail-oa1-x32.google.com ([2001:4860:4864:20::32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quhtA-0006ih-9a for qemu-devel@nongnu.org; Sun, 22 Oct 2023 19:29:48 -0400 Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-1e9c9d181d6so1984606fac.0 for ; Sun, 22 Oct 2023 16:29:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698017382; x=1698622182; 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=lVqtOTdE26FeikcQeSUZ6gzaDd5J2ZKDmGo0pFRcFos=; b=tA0pdSxj2MERrl9TszD7r1vCPHYfVJIE+UGINGcwOqK9ZVk0dK7biYs146psjfzZwH v59mWe1bopPnJzYNY/pgUxGLPIPVv3nsES8cPG40y4RE9nMIOyPDCwt97kW9xpZGOzGB Ak2Ub458rQ821vCfvPZnDEaFCn3W5Uh6m4wGuznkY5XPxncN6uY37GM8pM5u3qHkHnkL zc/NgXaZArLYuQKQSfXEnX3MKhWgGERjqIpKFSzgKZ1ZYvenCJ9oAUpgPRSXbm+OWdHX tABzG+VN/S8dYQM44EUagxtuACdKeKUyC5NkM6owSCkLkSupm5RCaDEvZ515OCuWP99D oxKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698017382; x=1698622182; 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=lVqtOTdE26FeikcQeSUZ6gzaDd5J2ZKDmGo0pFRcFos=; b=vjNKM2p/UP2RJdhyBwwTZw98zX5GhhymWpbcBV/ndlo/X65Z32G3o9ZiGHjG0poUWb WIHMomwvur9DNCE9RlYat3IIXDZ58iiX+BbWI4OaZADOtWY3A6H4fT8RIHYAnfNpdT+q qHDt5+QjSATU9lrUOJnSzRn+2ba0/Ic9pM1BpPbbi0IFa8N0zdQOD9E6rbVesHd5yx8s lfJulM9CjEjLTGA7hX/BKln+YwlehtPEbC0RT/Lv2CTRy8MC2xr+aG3JqIcwajq1TpBq l9VhwRaMti341p4FWSOQ6XFL6G8iMPajidUtj6elVdYA3Mr+lWdWFzuUie1sUfAZMAD2 T4cA== X-Gm-Message-State: AOJu0YyyA39GP1XdsnVVMVFHCeZbVphOmI+p/MHD8luy2qgKd1n3X947 rwDViJb22RxCXWKgx6ul0t5bvJAr2m3H/pvdZN8= X-Received: by 2002:a05:6870:f212:b0:1e9:e975:4418 with SMTP id t18-20020a056870f21200b001e9e9754418mr9950515oao.53.1698017382027; Sun, 22 Oct 2023 16:29:42 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k26-20020a63ba1a000000b005b25a04cf8bsm4023772pgf.12.2023.10.22.16.29.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 16:29:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v5 09/94] target/sparc: Partition cpu features Date: Sun, 22 Oct 2023 16:28:07 -0700 Message-Id: <20231022232932.80507-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231022232932.80507-1-richard.henderson@linaro.org> References: <20231022232932.80507-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::32; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x32.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, T_SPF_TEMPERROR=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org In the sparc32 binaries, do not advertise features only available to sparc64, so they cannot be enabled. In the sparc64 binaries, do not advertise features mandatory in v9, so they cannot be disabled. Signed-off-by: Richard Henderson --- target/sparc/cpu.c | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index f527244aa4..bb1a155510 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -546,14 +546,17 @@ static const sparc_def_t sparc_defs[] = { /* This must match sparc_cpu_properties[]. */ static const char * const feature_name[] = { [CPU_FEATURE_BIT_FLOAT128] = "float128", - [CPU_FEATURE_BIT_MUL] = "mul", - [CPU_FEATURE_BIT_DIV] = "div", - [CPU_FEATURE_BIT_VIS1] = "vis1", - [CPU_FEATURE_BIT_VIS2] = "vis2", - [CPU_FEATURE_BIT_FSMULD] = "fsmuld", - [CPU_FEATURE_BIT_HYPV] = "hypv", +#ifdef TARGET_SPARC64 [CPU_FEATURE_BIT_CMT] = "cmt", [CPU_FEATURE_BIT_GL] = "gl", + [CPU_FEATURE_BIT_HYPV] = "hypv", + [CPU_FEATURE_BIT_VIS1] = "vis1", + [CPU_FEATURE_BIT_VIS2] = "vis2", +#else + [CPU_FEATURE_BIT_MUL] = "mul", + [CPU_FEATURE_BIT_DIV] = "div", + [CPU_FEATURE_BIT_FSMULD] = "fsmuld", +#endif }; static void print_features(uint32_t features, const char *prefix) @@ -832,22 +835,25 @@ static PropertyInfo qdev_prop_nwindows = { static Property sparc_cpu_properties[] = { DEFINE_PROP_BIT("float128", SPARCCPU, env.def.features, CPU_FEATURE_BIT_FLOAT128, false), - DEFINE_PROP_BIT("mul", SPARCCPU, env.def.features, - CPU_FEATURE_BIT_MUL, false), - DEFINE_PROP_BIT("div", SPARCCPU, env.def.features, - CPU_FEATURE_BIT_DIV, false), - DEFINE_PROP_BIT("vis1", SPARCCPU, env.def.features, - CPU_FEATURE_BIT_VIS1, false), - DEFINE_PROP_BIT("vis2", SPARCCPU, env.def.features, - CPU_FEATURE_BIT_VIS2, false), - DEFINE_PROP_BIT("fsmuld", SPARCCPU, env.def.features, - CPU_FEATURE_BIT_FSMULD, false), - DEFINE_PROP_BIT("hypv", SPARCCPU, env.def.features, - CPU_FEATURE_BIT_HYPV, false), +#ifdef TARGET_SPARC64 DEFINE_PROP_BIT("cmt", SPARCCPU, env.def.features, CPU_FEATURE_BIT_CMT, false), DEFINE_PROP_BIT("gl", SPARCCPU, env.def.features, CPU_FEATURE_BIT_GL, false), + DEFINE_PROP_BIT("hypv", SPARCCPU, env.def.features, + CPU_FEATURE_BIT_HYPV, false), + DEFINE_PROP_BIT("vis1", SPARCCPU, env.def.features, + CPU_FEATURE_BIT_VIS1, false), + DEFINE_PROP_BIT("vis2", SPARCCPU, env.def.features, + CPU_FEATURE_BIT_VIS2, false), +#else + DEFINE_PROP_BIT("mul", SPARCCPU, env.def.features, + CPU_FEATURE_BIT_MUL, false), + DEFINE_PROP_BIT("div", SPARCCPU, env.def.features, + CPU_FEATURE_BIT_DIV, false), + DEFINE_PROP_BIT("fsmuld", SPARCCPU, env.def.features, + CPU_FEATURE_BIT_FSMULD, false), +#endif DEFINE_PROP_UNSIGNED("iu-version", SPARCCPU, env.def.iu_version, 0, qdev_prop_uint64, target_ulong), DEFINE_PROP_UINT32("fpu-version", SPARCCPU, env.def.fpu_version, 0),