From patchwork Mon May 9 16:04:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 570997 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:66c4:0:0:0:0 with SMTP id x4csp4129095mal; Mon, 9 May 2022 09:06:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVYxcqHEhu/Zt55JYzrTR4JJq/VjSWQzWkd8i9lSqkBBfvk286pppSYM0yCXco6PXy0nIP X-Received: by 2002:a37:66d8:0:b0:69f:be4d:208b with SMTP id a207-20020a3766d8000000b0069fbe4d208bmr12258073qkc.83.1652112397067; Mon, 09 May 2022 09:06:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652112397; cv=none; d=google.com; s=arc-20160816; b=stkXNjUBptNCiMq6CA2P/sf+Cp7aMyAmZ8AQvlRUFMq+jXD7dM8yiAljeT9pUgRJyj TzrkCIRoJe7gJlvGD0smJObyYQiAG3l+QwScWYcOu+qtmsvIj7mzj+QiKOPcHPHS3Dvx SU9JOZG7xtrzGKHqOuwMOROcuEPFYUhEaK1vkrG3NLa3fbJDb+KtXYH80YNck/25eEsB 7IRmQNDNWvXQyQ8ivTD0VBQK/nJMgD8hwkF7aLDQtF7koPNr3gMJ5rRqID8r3caKoBdX VNkiS81hRbu6/sqJUGHhHZDzzbLvSvCaTm2zQq9nDSLatY8jfurMab2p1les3OSBURYy hqFw== 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:message-id:date:subject:to:from:dkim-signature; bh=zU5rFGkB281ja2vWi3yVV9+Cb4HIS2VI2BddL4/fCzI=; b=CPXOhMK8TJ68klLd+h8l86f37irozUDNGJn2v2MCB3XFeqDRUawxX8PzuDNuzMZoUZ V4ohw/t2a6CXUOTc9QBrC8hq9cG9tYgh2C5yaSeRMeKwvI/jHz9//gi6MQbLrpO7J02u yiBcuOl+NTzYLNfCiRYruWlo5T95PGy7hpIaH6GeX4D6Z8xZXyiN9JcNMLJgf+IKbmLz nRI/kn+Unzg+xHELyjl1Nnp0S56XPAuXdYgqaOqHMvzeHlFOpyK7k3iiViRiVHQ7hcen 4UVJtn8RWamilSH66R5uoB9aHY5Cy/FdsnlsoctjJJ3XC+tCrGlpzgoMdz2awS5bkW0d YKew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HPpNTaEq; 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 f4-20020ac87f04000000b002f3cb25faf2si6039284qtk.102.2022.05.09.09.06.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 May 2022 09:06:37 -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=HPpNTaEq; 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]:34452 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1no5u8-00025K-Lx for patch@linaro.org; Mon, 09 May 2022 12:06:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1no5sO-00024q-NP for qemu-devel@nongnu.org; Mon, 09 May 2022 12:04:49 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:40601) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1no5sN-0003jW-1v for qemu-devel@nongnu.org; Mon, 09 May 2022 12:04:48 -0400 Received: by mail-wr1-x429.google.com with SMTP id e2so20121499wrh.7 for ; Mon, 09 May 2022 09:04:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=zU5rFGkB281ja2vWi3yVV9+Cb4HIS2VI2BddL4/fCzI=; b=HPpNTaEq6Rj3dVlatTP2gUm2Qzox784qn64vpnJWdFy9Soi0G1R/7W0/avtnNcNFpR sA+2OjDA971MgMvCtn0V/CXKB+bfufyVydMu5qzdd9r5tJIJdMoKvFX70IerAdxMk8f2 w20fFOl9Lie65PiRcHK2oQAonofDwqnaQoHGPV8JzMbBDJi4LQms6xA/KrcUcvhMFazc 3MQGMZpfrz0CzUnW3MJsXjrLOKeNYOz3EABBF5Equ9vt6ox5YkBdK4vi3zb2Zer1fxXZ AUSHK2cntNQVUJIfzAZC6GASEOkGPMjdE+uuVC3stms44ZSnq9Nnmi6eA72kGnLIi/Ug crOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=zU5rFGkB281ja2vWi3yVV9+Cb4HIS2VI2BddL4/fCzI=; b=2W9b0TCnz9NZciMUA2CnTzaWad0TKRaw4d1FVzSf/RpTEgXmE3Yw6zNQZvSZ3o66o2 9nkTH9tpq2mDqJa/CAAeVmdRE0PUsbg4PR+8nWc/qgUGwu5Goa4CUhykwP8BDmkPsWvz VfNhkxrD6mdmFqivpiyOgxcllZkanDx0Unu+KnBPgO9mZv/dTvXl1hmlKA1noxoaLtSK dgGoQUDXAA4nEzS3zF8sUCeSnk/cCp6vhWIqynRJ6u9LDBLiUbUDCvmMMurlK6I7Rxoy V1lXPEeGsOYF7jqJX5cuLPGo6spGgNc2EgCOk+TgPOhUHSyBRauZkjpOZVOdGFrUwnJi 5bow== X-Gm-Message-State: AOAM531lqvmq/qZqxMoNizxSaJLJ97qbEoMncMjBOfbA0ErMZ/hjEUEe 3Rc3Wthbxp5xudtl+x0iiz49Sg== X-Received: by 2002:adf:e0cc:0:b0:207:b690:acb8 with SMTP id m12-20020adfe0cc000000b00207b690acb8mr14229965wri.412.1652112285141; Mon, 09 May 2022 09:04:45 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id a7-20020a05600c348700b003942a244ed7sm12431408wmq.28.2022.05.09.09.04.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 09:04:44 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH] target/arm: Drop unsupported_encoding() macro Date: Mon, 9 May 2022 17:04:43 +0100 Message-Id: <20220509160443.3561604-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x429.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, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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" The unsupported_encoding() macro logs a LOG_UNIMP message and then generates code to raise the usual exception for an unallocated encoding. Back when we were still implementing the A64 decoder this was helpful for flagging up when guest code was using something we hadn't yet implemented. Now we completely cover the A64 instruction set it is barely used. The only remaining uses are for five instructions whose semantics are "UNDEF, unless being run under external halting debug": * HLT (when not being used for semihosting) * DCPSR1, DCPS2, DCPS3 * DRPS QEMU doesn't implement external halting debug, so for us the UNDEF is the architecturally correct behaviour (because it's not possible to execute these instructions with halting debug enabled). The LOG_UNIMP doesn't serve a useful purpose; replace these uses of unsupported_encoding() with unallocated_encoding(), and delete the macro. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/arm/translate-a64.h | 9 --------- target/arm/translate-a64.c | 8 ++++---- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/target/arm/translate-a64.h b/target/arm/translate-a64.h index 38884158aab..f2e8ee0ee1f 100644 --- a/target/arm/translate-a64.h +++ b/target/arm/translate-a64.h @@ -18,15 +18,6 @@ #ifndef TARGET_ARM_TRANSLATE_A64_H #define TARGET_ARM_TRANSLATE_A64_H -#define unsupported_encoding(s, insn) \ - do { \ - qemu_log_mask(LOG_UNIMP, \ - "%s:%d: unsupported instruction encoding 0x%08x " \ - "at pc=%016" PRIx64 "\n", \ - __FILE__, __LINE__, insn, s->pc_curr); \ - unallocated_encoding(s); \ - } while (0) - TCGv_i64 new_tmp_a64(DisasContext *s); TCGv_i64 new_tmp_a64_local(DisasContext *s); TCGv_i64 new_tmp_a64_zero(DisasContext *s); diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index b80313670f9..290ad6cbb27 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -2085,13 +2085,13 @@ static void disas_exc(DisasContext *s, uint32_t insn) * with our 32-bit semihosting). */ if (s->current_el == 0) { - unsupported_encoding(s, insn); + unallocated_encoding(s); break; } #endif gen_exception_internal_insn(s, s->pc_curr, EXCP_SEMIHOST); } else { - unsupported_encoding(s, insn); + unallocated_encoding(s); } break; case 5: @@ -2100,7 +2100,7 @@ static void disas_exc(DisasContext *s, uint32_t insn) break; } /* DCPS1, DCPS2, DCPS3 */ - unsupported_encoding(s, insn); + unallocated_encoding(s); break; default: unallocated_encoding(s); @@ -2265,7 +2265,7 @@ static void disas_uncond_b_reg(DisasContext *s, uint32_t insn) if (op3 != 0 || op4 != 0 || rn != 0x1f) { goto do_unallocated; } else { - unsupported_encoding(s, insn); + unallocated_encoding(s); } return;