From nobody Tue Feb 10 17:34:58 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) client-ip=209.85.221.50; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f50.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1624613032; cv=none; d=zohomail.com; s=zohoarc; b=BZrDh7+nzkVI98C5rZIw2tKiPYODBkljHYkTrIpasBhJ9Ytk56VtNdluIArbzphvyXQwQppHH5Ikz/nTaJwIPR2nCuk3arWDGwayGsKsoT1R/u4Nt9AiBqu03Sg2GxErkC7Syg/8ShBg4r0FJK9ANPsiZ/a6r2E8+ejxoY2htL0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624613032; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vux3pRxRjKycdWHxcdq6t2Uw4/zpg6Clkow+InjP29Q=; b=mNvR0M5FVDO3Ity8ELOVqEwC7yZkB2N6PfSzxUJzhEiLL23fgo6aPD2iIIz/ucoSUOP21fNUpJ13+xWTaw4YU3k/Rl4u5FFet/SHy4giCUSQa5Iai/ABHpWlfZdq/yFAxPMm2NcPbOE/y1fybO5ZowFtwHWsic7r28mW/FKBiCQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mx.zohomail.com with SMTPS id 1624613032927823.2871771787486; Fri, 25 Jun 2021 02:23:52 -0700 (PDT) Received: by mail-wr1-f50.google.com with SMTP id f15so9814914wro.8 for ; Fri, 25 Jun 2021 02:23:52 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id n7sm10503951wmq.37.2021.06.25.02.23.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Jun 2021 02:23:50 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=vux3pRxRjKycdWHxcdq6t2Uw4/zpg6Clkow+InjP29Q=; b=mFJBwGdydAYfpQyoRXJrQCUfQ/BHdeVZs/1l+VVgftCQRSSjK/8gEQQ2HLql1z3Qrn yuUiW05o9AcH1UQ0tk0sszsoGDU2k0RGzi5CFcgtV34lewr1l50DHbCz+HjU20GomztN WLadwpdgKNeutQabIjjnh57mhjaKv6sUZkdOnLRKiIvYcsL2Gw8rcJPYOxGZF5e6cS6K +M5opfO44GJ+hI1O6DAqF2AKI+s98FuRL+MyY/rStgBTDQa0IUB2jFOX0FQo3urSEYq+ n4QhM9BgLDIUuQEqj8mLJRwDgasdhXmHSr4SuQ7g5Cgz/zD42UMDs9GoXNNhwWZEALcB uokA== 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 :in-reply-to:references:mime-version:content-transfer-encoding; bh=vux3pRxRjKycdWHxcdq6t2Uw4/zpg6Clkow+InjP29Q=; b=CtP+0S/HREbj2+wSmtyeULWThthxhjtqzl32qLO6q/pvTy3zEnkMdrQssb9N9p7a9j JDb8maeuoyKQ4EDmpymWodwOGC9wiIcLXMetpF/1bcF9WvjqDP3diwAkGovU6GOnX6uA awHsLWc0WeTTNRvWM1Olkd9DGeXw4pwfSvQXUJujfUDeWtmTfixQFeOh6xTyiOVMiFaj lapeJzPZfOzHVzHErS+aZQjaZFkO0PYhM+GsY7EzeFj/UuIVTpMCVEqEOEg3EZBc+k7B YYrUiyZkhL3gdhqjsPcUMKXLCDIkAEp9DCRJXsNCMk0/mIh9puYEbSm6eIK+K+DtBKXJ Hw1Q== X-Gm-Message-State: AOAM531W+eInUJFfWxiWnhBVDx0PwbZ6g1H2DgyzRA38fc/l8S8C0VUn mb3XEuZeKqnYicAdCyKJ9MU= X-Google-Smtp-Source: ABdhPJyACY5tC87R5tPnFolNYvIu7yaY7tTMWDt+fiNi6JxP/2yIKKpUhV1zoQg9sJUFAkLvTdpb+A== X-Received: by 2002:a05:6000:1245:: with SMTP id j5mr9677750wrx.371.1624613031263; Fri, 25 Jun 2021 02:23:51 -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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Jiaxun Yang , Aurelien Jarno , Jia Liu , Richard Henderson Subject: [PULL 04/15] target/mips: Raise exception when DINSV opcode used with DSP disabled Date: Fri, 25 Jun 2021 11:23:18 +0200 Message-Id: <20210625092329.1529100-5-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210625092329.1529100-1-f4bug@amsat.org> References: <20210625092329.1529100-1-f4bug@amsat.org> 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 Message-Id: <20210529165443.1114402-1-f4bug@amsat.org> --- 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 09b19262c8c..3fd0c48d772 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -24379,10 +24379,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.31.1