From nobody Mon May 20 04:53:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.52 as permitted sender) client-ip=209.85.221.52; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f52.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1622307287; cv=none; d=zohomail.com; s=zohoarc; b=gP/iL5af+K6CIMT1UqYfX+TYe4kzquyy2++jrYwG7SC8P0unaJVcF0MHgwHLcb465B9BwUgZ3f1Ob1qkDfH1NnPqswi33q1THpSwKkdmnom+m0ota2lRoJeDY2HMkCVN536n0e1enmL0Z0dBQ3UJ46XaeBwlq6Fy55/DvLTltGM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622307287; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Sender:Subject:To; bh=H/j00hEbe6+E9TUrgGoJ4busYCQdPM+IW6semZPtYG4=; b=C42emGJYr0zN12xLw8oSXMUIH6AERLrvOz2AsEg/FjE1mIr1QN9P/uTlVlTXIa70rpALWFWKi7YZp26zoGYajnS5Kdb3NDYo/5hYVMKv+ryUEg1I4zpWyPyijZqpdugGgj6ml+evl9wZI0WvZwxIg2LXCKT31OGe7fu9ILnTvLQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by mx.zohomail.com with SMTPS id 1622307287668472.0450933652827; Sat, 29 May 2021 09:54:47 -0700 (PDT) Received: by mail-wr1-f52.google.com with SMTP id z8so1218283wrp.12 for ; Sat, 29 May 2021 09:54:47 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (235.red-83-57-168.dynamicip.rima-tde.net. [83.57.168.235]) by smtp.gmail.com with ESMTPSA id z5sm10956187wrn.69.2021.05.29.09.54.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 May 2021 09:54:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=H/j00hEbe6+E9TUrgGoJ4busYCQdPM+IW6semZPtYG4=; b=sn+YCOf2BhZB8M9EYzyu/HdkiwbgV6ZGIp9ABRQf+EfCOZsMEGEXRJhH0y+D7Hntfl S0mHaf/uOyCbQ1aAU5+eG48u6UWOVcyj0se9aExnrLXRE03Br80dbt6MZZ/0g0lgv98I /WCxIFoP++0JPRgfAKq+ZeTXJt06nIdeATXWr+GVoWYoRcmHCz3NxpxzjUtPv0I3sfFb V8TvskGMSsyqrADP0Dl2sWYmevuCXsWRi7npVevL1T2Nzhf4UpOmgO906055R2yAi1hS ms1/sAcV+IhjeJ4a57FLbTmh4x0HPyfnFfj4ho9IaLOiRL2B6WV44FuidhnTLLT+l0Q8 tbHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=H/j00hEbe6+E9TUrgGoJ4busYCQdPM+IW6semZPtYG4=; b=C3Eiyyv0SkIdPwfV12vimMSkq97piIi1PxqDd46spjQJXPubIVU4eP4wLlbdnS3+4u WuQrclT6UME6KCMtPtZOR/Y/GbQrYbOloroB0ct4cROg2kbn+5DGRvC4KYT042EMVenI W/O9ghEu/xb0mc2dUWWxdkJ3UkYnc7pu62P1PRFn5QeKGS2lQ9gHHAvlJWSCjt3m8IZi 5edGIUN4XJDLgfwMK6RUEJWXVYTeo4PnnonxwmhZ38W2cxtENIXMsMLdFOcjrljezVcK NzGw6iATv/TyveM2vDqkSqaoNKLgsjxvP25HRsSOJE3G9DAffwEvRq38+mLmbLFf8hvW pB7w== X-Gm-Message-State: AOAM532aX6C6bI8kpkAXPe9ILopPQoXK/lYG8yapvEXR8+xTc5XL0jKy pY1B5vgVp76306uggEUVWqk= X-Google-Smtp-Source: ABdhPJztxKmfKDOS6oU8LX+ghLTQOBdrkBDnKaGu19rQPqY/bx6L0iLzgH/tj6e8SZHDi0X+yXOqFw== X-Received: by 2002:a5d:5745:: with SMTP id q5mr14447900wrw.56.1622307285906; Sat, 29 May 2021 09:54:45 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Aleksandar Rikalo , Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Richard Henderson , Jia Liu Subject: [PATCH] target/mips: Raise exception when DINSV opcode used with DSP disabled Date: Sat, 29 May 2021 18:54:43 +0200 Message-Id: <20210529165443.1114402-1-f4bug@amsat.org> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Per the "MIPS=C2=AE DSP Module for MIPS64 Architecture" manual, rev. 3.02, Table 5.3 "SPECIAL3 Encoding of Function Field for DSP Module": If the Module/ASE is not implemented, executing such an instruction must cause a Reserved Instruction Exception. The DINSV instruction lists the following exceptions: - Reserved Instruction - DSP Disabled If the MIPS core doesn't support the DSP module, or the DSP is disabled, do not handle the '$rt =3D $0' case as a no-op but raise the proper exception instead. Cc: Jia Liu Fixes: 1cb6686cf92 ("target-mips: Add ASE DSP bit/manipulation instructions= ") Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/mips/tcg/translate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index c03a8ae1fed..6ccba34c050 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -24373,10 +24373,11 @@ static void decode_opc_special3_legacy(CPUMIPSSta= te *env, DisasContext *ctx) { TCGv t0, t1; =20 + check_dsp(ctx); + if (rt =3D=3D 0) { break; } - check_dsp(ctx); =20 t0 =3D tcg_temp_new(); t1 =3D tcg_temp_new(); --=20 2.26.3