From patchwork Sat Oct 29 02:00:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 1696572 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=flygoat.com header.i=@flygoat.com header.a=rsa-sha256 header.s=fm1 header.b=aNUtgI5f; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=LXwPkXx9; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MzjN209csz23lS for ; Sat, 29 Oct 2022 13:02:07 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oobA6-00006a-DL; Fri, 28 Oct 2022 22:01:26 -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 1oobA1-000068-MR for qemu-devel@nongnu.org; Fri, 28 Oct 2022 22:01:22 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oob9y-0002Zy-OP for qemu-devel@nongnu.org; Fri, 28 Oct 2022 22:01:21 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id BA9B2320094C; Fri, 28 Oct 2022 22:01:16 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 28 Oct 2022 22:01:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1667008876; x=1667095276; bh=OW jlQO5apEQ/S/jgZSIjj73D/4GHqGSzssO5cICT754=; b=aNUtgI5fP7C0l3DmIC DjWXZNIRpyDw7P/vcKEgmNYmVIH3W8kL7qjU1lpGKhBA9nd0jNVbnAy81hKFdAPX WM29c0jotyhSZVBN6GCUgPn+JItQDp2keGqRcIM5lWCPg5ph6xUVc2s2kC7NAA42 gJdte9DyLkf7QJa4naW5o33T+rgOdieik4VVJCyh8UWxbBwANvU5ew81An6il5fN chzUIrKMMOXrKcgJQPNGJLH5OT9/Xkdf1Wyk/wQaKqFY7d5zD4HZgBpXPYu/f6el QIoRLy54gUj0WWDmNyFT7vDloEouzb+cEsq8mi2FZtRZHMBhOfidwCwb3XssGxAb gGWA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1667008876; x=1667095276; bh=OWjlQO5apEQ/S /jgZSIjj73D/4GHqGSzssO5cICT754=; b=LXwPkXx92QVFdSm7b8l+B0Wr5GvNz 4KtLFpEUMQWjyB94c4ybryrwW1MGaPEY6JgzxnswLGxYTWnNtqg0GgP2CuP59aY0 4g59c9wv8/0OZ+I6ZROAtizJHJA4EwtnD9MRDANfVIN1W1VJi47GO8kdJzF+0+UZ Jmkz14MMspz4FJXWOICYbBAx23wlSylVQI/tJ89LgWeA7THOYlgGw0yOckTN+2Or ssNJSgTWbREHg94AJNslCvCiH02/vNx1NCC+9kycuKWUjyXh5dV+E8YOSkniE7tG PXmHQ/4/wcQawNYfAW5EgV/dE00c+zkEAZ2psn3CoCVUamrMIgFYE4oJA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrtdejgdehfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgjfhgggfestdekre dtredttdenucfhrhhomheplfhirgiguhhnucgjrghnghcuoehjihgrgihunhdrhigrnhhg sehflhihghhorghtrdgtohhmqeenucggtffrrghtthgvrhhnpeefledufeehgedvuedvvd egkefgvddttedtleeiiefhgeetudegkefhvdfhjeeftdenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjihgrgihunhdrhigrnhhgsehflhihgh horghtrdgtohhm X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 28 Oct 2022 22:01:15 -0400 (EDT) From: Jiaxun Yang To: f4bug@amsat.org Cc: qemu-devel@nongnu.org, pavel.dovgalyuk@ispras.ru, Jiaxun Yang Subject: [PATCH 1/3] target/mips: Set CP0St_{KX, SX, UX} for Loongson-2F Date: Sat, 29 Oct 2022 03:00:28 +0100 Message-Id: <20221029020030.13936-2-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) In-Reply-To: <20221029020030.13936-1-jiaxun.yang@flygoat.com> References: <20221029020030.13936-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=64.147.123.24; envelope-from=jiaxun.yang@flygoat.com; helo=wout1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org As per "Loongson-2F processor user manual", CP0St_{KX, SX, UX} should is not writeable and hardcoded to 1. Without those bits set, kernel is unable to access XKPHYS address segmant. So just set them up on CPU reset. Signed-off-by: Jiaxun Yang Acked-by: Richard Henderson --- target/mips/cpu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index d0a76b95f7..a870901bfa 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -304,6 +304,12 @@ static void mips_cpu_reset(DeviceState *dev) env->CP0_EntryHi_ASID_mask = (env->CP0_Config5 & (1 << CP0C5_MI)) ? 0x0 : (env->CP0_Config4 & (1 << CP0C4_AE)) ? 0x3ff : 0xff; env->CP0_Status = (1 << CP0St_BEV) | (1 << CP0St_ERL); + if (env->insn_flags & INSN_LOONGSON2F) { + /* Loongson-2F has those bits hardcoded to 1 */ + env->CP0_Status |= (1 << CP0St_KX) | (1 << CP0St_SX) | + (1 << CP0St_UX); + } + /* * Vectored interrupts not implemented, timer on int 7, * no performance counters. From patchwork Sat Oct 29 02:00:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 1696574 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=flygoat.com header.i=@flygoat.com header.a=rsa-sha256 header.s=fm1 header.b=pq2lVl4k; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=tyoPerQz; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MzjN13vTqz23kl for ; Sat, 29 Oct 2022 13:02:07 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oobAB-00007l-ND; Fri, 28 Oct 2022 22:01:31 -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 1oobA1-000069-QG for qemu-devel@nongnu.org; Fri, 28 Oct 2022 22:01:22 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oobA0-0002aD-4m for qemu-devel@nongnu.org; Fri, 28 Oct 2022 22:01:21 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id C29833200065; Fri, 28 Oct 2022 22:01:18 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 28 Oct 2022 22:01:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1667008878; x=1667095278; bh=Kz 7Z7k+bPnmutGT2CzsqAfsbFsWvfGVl+CZZN4GvZxc=; b=pq2lVl4k0FC70fcGSK WqSsc1eMNpKYLue4pEDo51vsMI+cb+1bh1Qh4//vjTe19a0DOYns/Cy+rCYHnz0T B7uoDKqZYswdWncLW5MVrI/N1djxIzse5XSb3DZXMKM4u6OD8nVzsXsaPI6vcoYl RZmSy8pjEy9SzduhSTfHW0Mlcl89475s+ro8sw7BE62UDqGoShVNgkF6wHzFvmLT r3e/8Z25bWgT1q7pXldXnyT/fMOPaTSTR8IdYwwCTOz3P81JzPJahcwTNz9EVNYG 9kIcXEn7jpJ3qsXBYuh33FBSMtxRxyjMCwuEctpGhtv6YbRJNHpDdH09uIACoSrM KSUg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1667008878; x=1667095278; bh=Kz7Z7k+bPnmut GT2CzsqAfsbFsWvfGVl+CZZN4GvZxc=; b=tyoPerQz4UBItBBM/x3QxmOm8HlPZ tXhJD68O8xJuNCyMx+ERKscZmhiT5VQUbceCQVuBBCaT4eAoCojBbEXpS6GdI7Xs Gdk4UY/l3iPqO5aVzAzZp61cLdtlkqULDKvwJWfK882+zeIfOY2WnRT7ACBq8oKM sgGd49rk7Ms5w0ah/X03RZQIk5ULOPec39M3OiHDYhmcUPBc4udJws+51YbJmhqL x+IreQmpGa3kcynTbzenyQYB3Rb9Ww5mtmhQu90iCJ8948ZUwx9CsgeAayOadyKQ 7cKIy2hSyMJcL5IYkt5EIeh6lx/xhq9kjWH/aUVMfxfjnRBc/7AcY5vJg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrtdejgdehfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgjfhgggfestdekre dtredttdenucfhrhhomheplfhirgiguhhnucgjrghnghcuoehjihgrgihunhdrhigrnhhg sehflhihghhorghtrdgtohhmqeenucggtffrrghtthgvrhhnpeefledufeehgedvuedvvd egkefgvddttedtleeiiefhgeetudegkefhvdfhjeeftdenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjihgrgihunhdrhigrnhhgsehflhihgh horghtrdgtohhm X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 28 Oct 2022 22:01:17 -0400 (EDT) From: Jiaxun Yang To: f4bug@amsat.org Cc: qemu-devel@nongnu.org, pavel.dovgalyuk@ispras.ru, Jiaxun Yang Subject: [PATCH 2/3] target/mips: Cast offset field of Octeon BBIT to int16_t Date: Sat, 29 Oct 2022 03:00:29 +0100 Message-Id: <20221029020030.13936-3-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) In-Reply-To: <20221029020030.13936-1-jiaxun.yang@flygoat.com> References: <20221029020030.13936-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=64.147.123.24; envelope-from=jiaxun.yang@flygoat.com; helo=wout1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org As per "Cavium Networks OCTEON Plus CN50XX Hardware Reference Manual" offset field is signed 16 bit value. However arg_BBIT.offset is unsigned. We need to cast it as signed to do address calculation. Signed-off-by: Jiaxun Yang --- target/mips/tcg/octeon_translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/mips/tcg/octeon_translate.c b/target/mips/tcg/octeon_translate.c index 6a207d2e7e..e8f2277c51 100644 --- a/target/mips/tcg/octeon_translate.c +++ b/target/mips/tcg/octeon_translate.c @@ -38,7 +38,7 @@ static bool trans_BBIT(DisasContext *ctx, arg_BBIT *a) } ctx->hflags |= MIPS_HFLAG_BC; - ctx->btarget = ctx->base.pc_next + 4 + a->offset * 4; + ctx->btarget = ctx->base.pc_next + 4 + (int16_t)a->offset * 4; ctx->hflags |= MIPS_HFLAG_BDS32; tcg_temp_free(t0); From patchwork Sat Oct 29 02:00:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 1696575 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=flygoat.com header.i=@flygoat.com header.a=rsa-sha256 header.s=fm1 header.b=iec1lwTo; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=DMZb6Y5Y; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MzjNJ08Dgz23kl for ; Sat, 29 Oct 2022 13:02:24 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oobAC-00008A-7D; Fri, 28 Oct 2022 22:01:32 -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 1oobA4-00006k-Uy for qemu-devel@nongnu.org; Fri, 28 Oct 2022 22:01:25 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oobA2-0002ac-Pf for qemu-devel@nongnu.org; Fri, 28 Oct 2022 22:01:24 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id EE94432001AB; Fri, 28 Oct 2022 22:01:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 28 Oct 2022 22:01:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1667008880; x=1667095280; bh=ZK rNGBecz8aAEAcaJv+m93cMiW6DA6iUj0D1ODVQagg=; b=iec1lwTovbyiiyNgGE 1FL3XZy0cI+DLQK4htxPBzk3nktRetBIFW3fAZE4tMPwyEvAfsXTMy3G5zVMmFHS Tdgbbwgqp/8Lu/caHOwA1x95Ens9Ex2lW0+URjwqjeLz6Oq/FJC28NlKsK6RNVCX v9VQ2TQkTMdRI+dVvnOhto9hwvT0LOVUW5Pm3xFr9AK2RjkrMBnF3/idfX9fcCj7 E9SE12u3pOH/XOhHQqz3VFHHDv8vmNi0ANFSPFPyZd1V0fCasoLasH1tjJIOTGYu SQX9cdZjbAsMxWwOzrql2rPdyuYUjI5aC+qkIKeHOxBxFkB5/R+02U+tCWYWHvKs 0Wrg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1667008880; x=1667095280; bh=ZKrNGBecz8aAE AcaJv+m93cMiW6DA6iUj0D1ODVQagg=; b=DMZb6Y5YTFPRqrTWGKI4Qo+/erq1X A+Hk3gKPr5Bq/nUvOWExwCoGSkM/Kj29aJRgHZg1964iLbtkt9Bd15KnDj1JjGZ/ AMlSylQ0ZDu7zOXxM9PVh6i4FJNwAb+FFjSTmUOC46Yty2o1LzWDN8mT9224lBIK IZgXv9gGIxmwKFjprqwD19qiDSHj6e7m7hmhDeX+T3+n6/Zv8yDhqIALKlKC4EYJ gMvgL943BWHNVl+flfzc0D6MWHDMQDH/0DD74aSfg+wvYOBWBk77s+ImM7sHgxgG r4cs8V1AV2Kj0tDRRBVGKEAnvAwNLsV/5dN2ljXGTCNoE++1AzcTIdz5w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrtdejgdehfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgjfhgggfestdekre dtredttdenucfhrhhomheplfhirgiguhhnucgjrghnghcuoehjihgrgihunhdrhigrnhhg sehflhihghhorghtrdgtohhmqeenucggtffrrghtthgvrhhnpeefledufeehgedvuedvvd egkefgvddttedtleeiiefhgeetudegkefhvdfhjeeftdenucevlhhushhtvghrufhiiigv pedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehjihgrgihunhdrhigrnhhgsehflhihgh horghtrdgtohhm X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 28 Oct 2022 22:01:19 -0400 (EDT) From: Jiaxun Yang To: f4bug@amsat.org Cc: qemu-devel@nongnu.org, pavel.dovgalyuk@ispras.ru, Jiaxun Yang Subject: [PATCH 3/3] target/mips: Disable DSP ASE for Octeon68XX Date: Sat, 29 Oct 2022 03:00:30 +0100 Message-Id: <20221029020030.13936-4-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) In-Reply-To: <20221029020030.13936-1-jiaxun.yang@flygoat.com> References: <20221029020030.13936-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=64.147.123.24; envelope-from=jiaxun.yang@flygoat.com; helo=wout1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org I don't have access to Octeon68XX hardware but accroading to my investigation Octeon never had DSP ASE support. As per "Cavium Networks OCTEON Plus CN50XX Hardware Reference Manual" CP0C3_DSPP is reserved bit and read as 0. Also I do have access to a Ubiquiti Edgerouter 4 which has Octeon CN7130 processor and I can confirm CP0C3_DSPP is read as 0 on that processor. Further more, in linux kernel: arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h cpu_has_dsp is overridden as 0. So I believe we shouldn't emulate DSP in QEMU as well. Signed-off-by: Jiaxun Yang Acked-by: Richard Henderson --- target/mips/cpu-defs.c.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/mips/cpu-defs.c.inc b/target/mips/cpu-defs.c.inc index 7f53c94ec8..480e60aeec 100644 --- a/target/mips/cpu-defs.c.inc +++ b/target/mips/cpu-defs.c.inc @@ -934,7 +934,7 @@ const mips_def_t mips_defs[] = (1 << CP0C1_DS) | (4 << CP0C1_DL) | (1 << CP0C1_DA) | (1 << CP0C1_PC) | (1 << CP0C1_WR) | (1 << CP0C1_EP), .CP0_Config2 = MIPS_CONFIG2, - .CP0_Config3 = MIPS_CONFIG3 | (1 << CP0C3_LPA) | (1 << CP0C3_DSPP) , + .CP0_Config3 = MIPS_CONFIG3 | (1 << CP0C3_LPA), .CP0_Config4 = MIPS_CONFIG4 | (1U << CP0C4_M) | (0x3c << CP0C4_KScrExist) | (1U << CP0C4_MMUExtDef) | (3U << CP0C4_MMUSizeExt), @@ -946,7 +946,7 @@ const mips_def_t mips_defs[] = .CP0_Status_rw_bitmask = 0x12F8FFFF, .SEGBITS = 42, .PABITS = 49, - .insn_flags = CPU_MIPS64R2 | INSN_OCTEON | ASE_DSP, + .insn_flags = CPU_MIPS64R2 | INSN_OCTEON, .mmu_type = MMU_TYPE_R4000, },