From patchwork Mon Jan 28 22:31:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 156904 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3962436jaa; Mon, 28 Jan 2019 14:46:53 -0800 (PST) X-Google-Smtp-Source: AHgI3IYYMHxAkGaoNbLfo5z7YLI4JsfI499waUy69069Oj+QVQXGKXW7tU3Jyd4UfmbAJprK9bd1 X-Received: by 2002:adf:fd81:: with SMTP id d1mr15902003wrr.105.1548715613669; Mon, 28 Jan 2019 14:46:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548715613; cv=none; d=google.com; s=arc-20160816; b=ckdbgVRbka87Vkk6CU0jcfgVM6lBKZFdSe/gdTrjSftKMRbG5wEiVqcv1juVIhZfKd No0Un8HXwNhr4KeKjRffI/QDyAUFtxveMTBFRRgyJLEImzst+GjBOwbCYJ5mW2zpMSZb f2mr2KH5xcoaslB5zP/ohd62PhgBGs4z6NSRhI7fzf6ivGTragoK4MH51HbX+RBlHzry CbK+XM4A889iuCeJSAc5Pmhu4d46rNjGSd78wLijHnnSgFGEnr99fScZvYOlSXQnW58z 7xBOCoVrixi6u0rMSLMtqDwVE5Qc3vBXQAzspodHmaRtVOHylZlEa7LqkYPXiEfp5OU6 ezbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=g/wlaoP5e340Ci6J1OFniSrZU/3oGYMfCDfo8IwBy0Y=; b=HB/iUSs5Ps2H7U2kxsq54XW3KYi1KB3JntAuYOVgwXPjb3ZkL9oQsTiyF5weZY5Zus L3Eo3FCRocgbWKi6bvzNlN7RomrqBv3CajwOHIwxDZSxAzimoje1XSVidSZ1v8uDhgEp S32DdrC9E0va2cwbOTtTHOmEk9Tr0lLIzUJoDwYLi/fviuW7HDSsgbSxn5LA+35sizWc 9Gm3uTURgurs1K8mGMyuIuQMvToLcLX5vbEErbWpFTKT0Rne07ZhjDkyuDsKwFiThafh oMAeGgXQWrITCyAzACL5P+nwfyF13+5ksRhM6mztvIhvH4ACwl8UslIW56lmqEU6SzDG 5YXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BI4HhTc4; 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=fail (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 s11si531118wms.57.2019.01.28.14.46.53 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 28 Jan 2019 14:46:53 -0800 (PST) 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=fail header.i=@linaro.org header.s=google header.b=BI4HhTc4; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:39659 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goFg4-0001Hj-I7 for patch@linaro.org; Mon, 28 Jan 2019 17:46:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goFcC-0006iZ-4F for qemu-devel@nongnu.org; Mon, 28 Jan 2019 17:42:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1goFRI-0006EL-HK for qemu-devel@nongnu.org; Mon, 28 Jan 2019 17:31:40 -0500 Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]:33122) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1goFRG-0006DJ-QN for qemu-devel@nongnu.org; Mon, 28 Jan 2019 17:31:36 -0500 Received: by mail-ot1-x341.google.com with SMTP id i20so16202603otl.0 for ; Mon, 28 Jan 2019 14:31:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=g/wlaoP5e340Ci6J1OFniSrZU/3oGYMfCDfo8IwBy0Y=; b=BI4HhTc4xKOxmY35izj+YJxBCtSf+DdfUtMBhEupQKEfHFJUi2uBZ6jY99ZJSbvwRY 344EveFisW39/lCGiXN1WLAR/BfeXGbhGBj4VAeK9/6PlptBajtqTmqh90iIVVgEklP/ oIfxWC2J1FSX1iH3Qn7Y2ZK27RavZRo+0ELv4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=g/wlaoP5e340Ci6J1OFniSrZU/3oGYMfCDfo8IwBy0Y=; b=YECwWh5wehO2JrQjeJapll+S8h9Q6OCvT8W3gQSWBcmCrOaDqhC15Pn+zDDCpZgeVd 6oW+FhSOZ/Gc4gGJC2iN5ZLUq55JrPe3jLkknLMRO/uUrRlnp0iUgTGo9ucC6f/KVSuh G6ZbB1U7aaIlroN5xnvJVwj916tkyiGHz+Xa1tvrIa3SsLPrSwhjbvetatrmmyf7Ry4x s9hZfZwhlS8Tmyfag7VYTPuHHRUrkd6e0cm/CwRxZgCSO7gqQNcss8xLG/q/DXKXEpKW aozsfo41Q+m7a3uENK33hwbAX5JoQUyc5sxdEsWq/8ZENba5ESbSp/XC9MKKF37r/Q2P Q8Hw== X-Gm-Message-State: AJcUukdk1Tkfy01oYrjbwaMsAP9J1olhqH9PoLlrWPY1szSIR6qkn/YS keWAfyoAzqTuHFCbhG95AFuMBQ8no6w= X-Received: by 2002:a9d:6a1a:: with SMTP id g26mr18305385otn.172.1548714693253; Mon, 28 Jan 2019 14:31:33 -0800 (PST) Received: from cloudburst.twiddle.net ([12.227.73.85]) by smtp.gmail.com with ESMTPSA id v3sm7460438oib.57.2019.01.28.14.31.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Jan 2019 14:31:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 28 Jan 2019 14:31:13 -0800 Message-Id: <20190128223118.5255-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190128223118.5255-1-richard.henderson@linaro.org> References: <20190128223118.5255-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::341 Subject: [Qemu-devel] [PATCH v2 07/12] target/arm: Reset btype for direct branches X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is all of the non-exception cases of DISAS_NORETURN. Signed-off-by: Richard Henderson --- v2: Do not reset byte for syscalls --- target/arm/translate-a64.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.17.2 Reviewed-by: Peter Maydell diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index bb64a47c0f..dbac09743c 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -1362,6 +1362,7 @@ static void disas_uncond_b_imm(DisasContext *s, uint32_t insn) } /* B Branch / BL Branch with link */ + reset_btype(s); gen_goto_tb(s, 0, addr); } @@ -1386,6 +1387,7 @@ static void disas_comp_b_imm(DisasContext *s, uint32_t insn) tcg_cmp = read_cpu_reg(s, rt, sf); label_match = gen_new_label(); + reset_btype(s); tcg_gen_brcondi_i64(op ? TCG_COND_NE : TCG_COND_EQ, tcg_cmp, 0, label_match); @@ -1415,6 +1417,8 @@ static void disas_test_b_imm(DisasContext *s, uint32_t insn) tcg_cmp = tcg_temp_new_i64(); tcg_gen_andi_i64(tcg_cmp, cpu_reg(s, rt), (1ULL << bit_pos)); label_match = gen_new_label(); + + reset_btype(s); tcg_gen_brcondi_i64(op ? TCG_COND_NE : TCG_COND_EQ, tcg_cmp, 0, label_match); tcg_temp_free_i64(tcg_cmp); @@ -1441,6 +1445,7 @@ static void disas_cond_b_imm(DisasContext *s, uint32_t insn) addr = s->pc + sextract32(insn, 5, 19) * 4 - 4; cond = extract32(insn, 0, 4); + reset_btype(s); if (cond < 0x0e) { /* genuinely conditional branches */ TCGLabel *label_match = gen_new_label(); @@ -1605,6 +1610,7 @@ static void handle_sync(DisasContext *s, uint32_t insn, * a self-modified code correctly and also to take * any pending interrupts immediately. */ + reset_btype(s); gen_goto_tb(s, 0, s->pc); return; default: