From nobody Sat Apr 5 01:39:31 2025 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=pass (i=1 dmarc=pass fromdomain=htecgroup.com); dmarc=pass(p=reject dis=none) header.from=htecgroup.com ARC-Seal: i=2; a=rsa-sha256; t=1739554767; cv=pass; d=zohomail.com; s=zohoarc; b=evQHr4biv1TQpISzVHoA8AzDIkHEArbV25QJx9C6b2zZtib4MZ1Ma4x44oTkKh3U9eE3twsn4qu66tC0RhWvzjVY/mQbNCMbH2x+W7TTTxkrxux3Cx4iovMdTxzuRjcr9mLVtDBqn3ogp9GC0OY/uO2nPlP5pc660R13Pi2p/5g= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1739554767; h=Content-Type: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=2h+HLz8wLJ75mUnulh9yDjdvRrCuCzXbJlCtqWuCWkE=; b=eLZKT92qvWrFNj24Yt6OuddSKfjMm2Hv7qMVrapvwmM7368Il6N6PlbKO29/HuR4KPkHx5LEG28UiZLKShZZUR3tbftOAgDMja0B9v0VhEybze6WkD/y8tIw18zCJV2FLIOuam9pJy+17uXR9UslgYBoXXFmpF7nyLv9ulSiV2U= ARC-Authentication-Results: i=2; 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=pass (i=1 dmarc=pass fromdomain=htecgroup.com); dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1739554767855692.2371888653073; Fri, 14 Feb 2025 09:39:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tizeA-0001Mp-Gi; Fri, 14 Feb 2025 12:38:38 -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 1tize1-0001Lw-GO for qemu-devel@nongnu.org; Fri, 14 Feb 2025 12:38:31 -0500 Received: from mail-am7eur03on2072b.outbound.protection.outlook.com ([2a01:111:f403:260e::72b] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tizdx-0005Gi-JX for qemu-devel@nongnu.org; Fri, 14 Feb 2025 12:38:27 -0500 Received: from PA4PR09MB4864.eurprd09.prod.outlook.com (2603:10a6:102:ed::17) by PR3PR09MB4329.eurprd09.prod.outlook.com (2603:10a6:102:3c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8445.17; Fri, 14 Feb 2025 17:37:47 +0000 Received: from PA4PR09MB4864.eurprd09.prod.outlook.com ([fe80::a02b:9d5c:eca5:e024]) by PA4PR09MB4864.eurprd09.prod.outlook.com ([fe80::a02b:9d5c:eca5:e024%6]) with mapi id 15.20.8445.017; Fri, 14 Feb 2025 17:37:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iV1AkS48LEnI7mZlLGc5ZOGfLVEHn4Kx0JK6SJG2kuZYiCGz4P6xRHQKdCKeuIkhzf03KhT2E32AINhc4S49PgPhgSR4gKGi8vpP1dSz1UwlDYs1phrMJ3WNy3BvFitoKKgrHYCY/UW9VFTk5GrbBkkiCZ8JrvBDV2eVeeFykmrAIMubvOxaNxUZiu0dnhAlhfdRo02JI3TqrER+V1RBa8noBKhDjw4syT3Tfdopp526jwKT/e0hSPOMyRZtveGcUSz15rPPdozJM1ud5lqntzqShJXHtYxYHeK+b8HXJDC7nx52xIVApvcK3Mg2rwkypFnNLL2vBe7k2MGc6XnJjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2h+HLz8wLJ75mUnulh9yDjdvRrCuCzXbJlCtqWuCWkE=; b=AhIVVmt2CVVxw+jqJi1+T2L0GdqAHynXoPV3jKQQN07xhO+pXaRp7C22chSOuo78pKJKVkTf/f2yb0MLzql3LLL92xv5CQdUqmBlUDEOhGgbTLt6JIXMVQ0lG4Dvb+LfcBVisX1fZEkPlXfzri9l3Qy9RP26VWSmZTB7eS5c1vMgXMbZP/3HE2B0GKRVtKvaVlUqXpEVm9feK5DswtYVa861gxOvnLBrq9+TQy5cZKyfT4d7rHMNjMPhWBasu2Rh/l8ffo9EtZxPgvXsIk3cJlfIofpF6LYKeXh/7JBdAQP20BaJ8smzC/gP1Dso1O9bfXkI0VdpP/X9zFbx7ewjFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=htecgroup.com; dmarc=pass action=none header.from=htecgroup.com; dkim=pass header.d=htecgroup.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=htecgroup.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2h+HLz8wLJ75mUnulh9yDjdvRrCuCzXbJlCtqWuCWkE=; b=iD/1KTZ7l6SoHu/4hXs4opy5q0Skiy1kIvebcQOH1Zfv6EYXIsyE6zRMxOaWGCW8Uh08swlvsI1cQTvt3sxpB42ZGgvsVtzCiuBJojRNOUxCZmqXiP6e6LIexwvjf9ynd1TSt+yHgCJ2rbIlYYji2VbheVjDucRQcMOmnxiG1XCBziYgA/2nSs1rfoLNHIFpNf4v62lTI6HIwMY3mTzZo0Yy+h0am0v3sgm/Y2VnAi8WDTI0o28Dh/M9zTBWehBB2H7E4cwf+jR1NlfQKCGt9biF6ia60u7aSIVObruFc/0vAallP1EhQkC6Ho7OF4PZX8GR7gDoYidY3o49J6A4Fg== From: Aleksandar Rakic To: "qemu-devel@nongnu.org" CC: "cfu@mips.com" , Djordje Todorovic , "arikalo@gmail.com" , "philmd@linaro.org" , "peter.maydell@linaro.org" , Aleksandar Rakic Subject: [PATCH v4 3/3] target/mips: Enable MSA ASE using a CLI flag Thread-Topic: [PATCH v4 3/3] target/mips: Enable MSA ASE using a CLI flag Thread-Index: AQHbfwcpy+xBSuMOjkuTAxsblrR2yQ== Date: Fri, 14 Feb 2025 17:37:47 +0000 Message-ID: <20250214173702.2308488-5-aleksandar.rakic@htecgroup.com> References: <20250214173702.2308488-1-aleksandar.rakic@htecgroup.com> In-Reply-To: <20250214173702.2308488-1-aleksandar.rakic@htecgroup.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=htecgroup.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PA4PR09MB4864:EE_|PR3PR09MB4329:EE_ x-ms-office365-filtering-correlation-id: 67706647-4f3d-452a-e64b-08dd4d1e4c2a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|1800799024|376014|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?Q?MEmIWXe+n+H1G7uKeJT/FQqTFMjyDwhjCHanjMSiES4YUE4tUItQmosxPw?= =?iso-8859-1?Q?hC+h+x/A/p10D/mkPTyTuwIHfGvUgl0slG0J8g4W4ixtueYh1aJkKf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dkQ68Y8NNI+PUPBIt2/fFcm2vCKZo?= =?iso-8859-1?Q?VZHOOxqxw5ZfPQtIVTx17fU8xf3PekNlsKynsVX9uhCc4rN5d9lPLpseOf?= =?iso-8859-1?Q?oYTCpx4wUCRJx+MFQ8orRoe+26Sr/tAKsycDmtvRvp3TMdh2Bw84Cj4/EW?= =?iso-8859-1?Q?sxNn1KU4L7pFJGZQowbfUrlpoCLV/DcWSNLCMTBhuseTSsSGNAoo2SEBpb?= =?iso-8859-1?Q?jBOuTJsjHjnC5QMxQ+mmr+orE2t0lV2k/K0DclvhqZA3xR1WIScEeqxt4S?= =?iso-8859-1?Q?V1mXL4CdZJwmsiu2QP5niBRGtwY+ryUwD1QviQtnlXxN4YFCJfnQzmkQBA?= =?iso-8859-1?Q?HY7u/AQCrdhsIRMH0IBFWzZgIAs4iHkDRPWW169XONHyUu8W7ye9K1qod1?= =?iso-8859-1?Q?aHHWLoGCDbho/EmZhlkzqOUa2J6FvbdLJ5sYcCbV02tE7WEVANTcUOtgfu?= =?iso-8859-1?Q?11M/hzmh1y25Xnm17r2Wx3nzn318PqBdp7Yt0HNeDv5Cmrbr/CmvFHKEr5?= =?iso-8859-1?Q?c=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR09MB4864.eurprd09.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?4oW+7GgTujqwXFgdFoTtVZrwuuQLR8KmeAHzRigIbldldi8/I3GTqpizq1?= =?iso-8859-1?Q?zcgP5nsxUFrmgC4aKcguZkgWEfaJHiS11YM4XzRgnkdgiNuLzl1detIXhO?= =?iso-8859-1?Q?6/z3ZeMDqKKu7AI/mrOziMeoeGPNA3Z330CPc4+SVH6PHgdH5rO4igZgvK?= =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fSmMg70ljI9EvbvnqqjEZ5KwY?= =?iso-8859-1?Q?WSb2agFWz4oZad6GmkN2rRdJ7THdBU708teGG83TIQiMgKft8R9DkyNOPw?= =?iso-8859-1?Q?duT4LT2UQS4DtuRin2RfMvv8q1CBiZHUWwN6O2g/td3kxArzVp+MzDRgcz?= =?iso-8859-1?Q?utT3miXWzrmhhDkALaWQZ3qYgHJM1WtQVh402gCn5CLZumMbnf07BsHsId?= =?iso-8859-1?Q?QczzUwRlOHpNbvBtwp54WUs/ZKr1spwf+DbrWFtqOJQU9d1I/lYltEPnJi?= =?iso-8859-1?Q?uWEtJzu1WJDgqCmujPNtpwUAaycosYsWakgZcUmZh9U+5PxiTXbDM+c3XW?= =?iso-8859-1?Q?Fjam/wc0K692aU3tYZvmXBT3ms62k6Jp72RqVkA+HzXTPNHlnqGKMWvw1J?= =?iso-8859-1?Q?wbubBPaN3ZpV8Bw3BjLpIzi0dDir9PLgIV+EdRDeh6vJFH+LrTLiOdTmNF?= =?iso-8859-1?Q?wj+Ziy6ISvXlJSO3vUgf1FyxwsyJcz23ZGqNvxziEBQtuKldO5g6bNtjuy?= =?iso-8859-1?Q?wAUMzfMI0e3hytm0oGy9cmmKHeACtjZcHFXhfdKSB6dWfyu9xqY8SEDzGz?= =?iso-8859-1?Q?LWw9i+lJ4m5Lg9Rx0jvXpW6nW9HyC5pqnkm1h+umz1GJaduk62vEQ5xAbx?= =?iso-8859-1?Q?mQuW+IEFLpyhdQJgsx8=3D?= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: htecgroup.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PA4PR09MB4864.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 67706647-4f3d-452a-e64b-08dd4d1e4c2a X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Feb 2025 17:37:47.8207 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9f85665b-7efd-4776-9dfe-b6bfda2565ee X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 5TYTx78uJa2JJaBbbeVxhv9SCUuGL+pWsid1L6bKJo0VfH1g2C/sDDrQum3fjQlVeyqD3ceS4uSw3znwJhaIsWRBjffze5bGAZ/2LFyrzHg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR09MB4329 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=2a01:111:f403:260e::72b; envelope-from=aleksandar.rakic@htecgroup.com; helo=EUR03-AM7-obe.outbound.protection.outlook.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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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 @htecgroup.com) X-ZM-MESSAGEID: 1739554769843019100 Content-Type: text/plain; charset="utf-8" From: Aleksandar Rakic Enable MSA ASE using a CLI flag -cpu ,msa=3Don. Signed-off-by: Aleksandar Rakic --- target/mips/cpu.c | 16 ++++++++++++++++ target/mips/cpu.h | 1 + target/mips/internal.h | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index d0a43b6d5c..8e12d303de 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -494,8 +494,24 @@ static void mips_cpu_realizefn(DeviceState *dev, Error= **errp) mcc->parent_realize(dev, errp); } =20 +static bool mips_get_msa_on(Object *obj, Error **errp) +{ + MIPSCPU *cpu =3D MIPS_CPU(obj); + CPUMIPSState *env =3D &cpu->env; + return env->msa_on; +} + +static void mips_set_msa_on(Object *obj, bool value, Error **errp) +{ + MIPSCPU *cpu =3D MIPS_CPU(obj); + CPUMIPSState *env =3D &cpu->env; + env->msa_on =3D value; +} + static void mips_cpu_initfn(Object *obj) { + object_property_add_bool(obj, "msa", mips_get_msa_on, mips_set_msa_on); + object_property_set_bool(obj, "msa", false, NULL); MIPSCPU *cpu =3D MIPS_CPU(obj); CPUMIPSState *env =3D &cpu->env; MIPSCPUClass *mcc =3D MIPS_CPU_GET_CLASS(obj); diff --git a/target/mips/cpu.h b/target/mips/cpu.h index f6877ece8b..3e636535c6 100644 --- a/target/mips/cpu.h +++ b/target/mips/cpu.h @@ -1191,6 +1191,7 @@ typedef struct CPUArchState { QEMUTimer *timer; /* Internal timer */ Clock *count_clock; /* CP0_Count clock */ target_ulong exception_base; /* ExceptionBase input to the core */ + bool msa_on; /* Enable MSA using a CLI flag -cpu ...,msa=3Don/off */ } CPUMIPSState; =20 /** diff --git a/target/mips/internal.h b/target/mips/internal.h index 91c786cff8..bbe2acffe2 100644 --- a/target/mips/internal.h +++ b/target/mips/internal.h @@ -399,7 +399,7 @@ static inline void compute_hflags(CPUMIPSState *env) } } if (ase_msa_available(env)) { - if (env->CP0_Config5 & (1 << CP0C5_MSAEn)) { + if ((env->CP0_Config5 & (1 << CP0C5_MSAEn)) || (env->msa_on)) { env->hflags |=3D MIPS_HFLAG_MSA; } } --=20 2.34.1