Received: by 2002:a19:3859:0:0:0:0:0 with SMTP id d25csp3744290lfj; Mon, 9 May 2022 09:06:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwya7T14bg1ya8KT4JHuX1MtNIHa7Uv71Chx7QHNVX0OcGjFKDUAms7DnfYmjghsIcAcw6m X-Received: by 2002:a05:622a:591:b0:2f3:d8fc:1967 with SMTP id c17-20020a05622a059100b002f3d8fc1967mr5781760qtb.353.1652112361228; Mon, 09 May 2022 09:06:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652112361; cv=none; d=google.com; s=arc-20160816; b=uePdz1l65sK5jJa+AKknmMdRm+oc4GUAmxp8ExfqtaK8qDBCIvb7PNRpBEbhbY/KvW 0YMmHWuO0d95M8irMWrz05W7a6j7bKwp6EpzGddD/TTK6o/tm/kwPkJcVjOaz3eTf1QE Mng1VhMBMd4CXOB4DCVB71A7qsb3PTHKva7Vvoyfw5djokP8nGajIiKf5QZQ0Zw81GX5 QLZcIiNoxVbkI+PA0WK437QnZPS9Up7srtvWGn5bZ17NbKjDCvwYqNrX0isPM4o+IHiL t/TtR2j8dneCo00dJM6RujkJSuYKhc/yOZ4WQdqW89Lz33VqX8b4ulxo7/VqdZjKbpR7 7wxw== 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=ZyH0Q4cGm5LUaFmGmka0/RUoaqpy+AwPTOHN/7Z7yR7VUBuTLbIXi8uKeuOuU3vBqR qwSH74LC5IN3whse4iFCb+skLYNvx8rZaYnFGs5P44lhP41Yj9/8ppaUeAB3TWYHqVZB KWj9GtL4esP1RHayMX2gM8iPGylWWyEOnZcNPJmvGW3d6BVRGg3GkHLxh1RgHb160ufz maEFb+rPa1iO2G6keKw/mlLxvvq8S+wEXOwsQpIbMIJLmuXZg9WkavxnpL9oQPdLgN13 CxhtCLtZA81zZ1Sh0+Xs3jpkj+f3HjV3wnIx2CeXuEd5XWkjHUTZeJA50t1YZTCNjrin 5iaA== 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-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=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 y15-20020a05622a164f00b002f3a81a7cefsi8096437qtj.123.2022.05.09.09.06.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 May 2022 09:06:01 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=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-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1no5tY-000259-Np for alex.bennee@linaro.org; Mon, 09 May 2022 12:06:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1no5sO-00024p-Kc for qemu-arm@nongnu.org; Mon, 09 May 2022 12:04:48 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:45997) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1no5sM-0003jU-R0 for qemu-arm@nongnu.org; Mon, 09 May 2022 12:04:48 -0400 Received: by mail-wr1-x436.google.com with SMTP id w4so20094700wrg.12 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=KLorXIA5nvCdxFxX3jiJ5rDQYFXMia48vR5c1DaVXfMl6odON50hQMmgIGhwGjKetm G2y/rm8hfM8CQttGMa/UA5BipD0yHYlfRwHRnctVypjp6mckKW5JYADHSYAk93n00hfR oBussMcCvilYxwzc7UGw+2/lllBq+w/DpRBUIwd09afvFIl1k6qagxIKYExi4HeCbOlM +kxcQtlfgFHBHxeDE5dAyvijzw0EW507tripVbSvOzCuYporWudqHRGRhEy30c/FTgSh ZDi8K/DmndidZLPaBx9uzbu57qvIM2FyanSKio//qJMFSuCENjZevW2xodwbHnTlV771 i+zg== X-Gm-Message-State: AOAM531oFeorzEFFpELyUQ4rkfKdOgtMy7osCGGYxjhHyLRQQHYUUr58 Lm1+DzyokL7vs3wlJnkiG6t/UYVOC6vfIQ== 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 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x436.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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@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-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: 9YInzCFxnib6 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 --- 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; -- 2.25.1