From patchwork Sun Oct 22 23:27:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 737015 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1282112wrl; Sun, 22 Oct 2023 16:30:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHwhpL5f2OIsVea6eOD1epKSf45p1pD0TGoOQME9ksiUoqwwJH0oTA6ggA4hazhG6J4znTJ X-Received: by 2002:a67:b802:0:b0:458:47f8:262b with SMTP id i2-20020a67b802000000b0045847f8262bmr7112017vsf.20.1698017447765; Sun, 22 Oct 2023 16:30:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698017447; cv=none; d=google.com; s=arc-20160816; b=ZkYSr0TsiY+4+YUurnq1L0VmGUyl5tCPgvcCaadlGxbKX65lxCQT7TQt5M2lxZzMSK s6/JJ7bQyCc3VcrGoMkhpkzK7NL296njAnEnj5yfZxEBjXbK3Mt+hp/TfWZsHSFQr44v IASvUr2868cXqU4YZN9btroFPOfympLr/x467ApBT+IB0Wq34qtAMkxFWiO3zSg6Opxz UjD2KIaAgPXLyWpXb/bedOVdau2nZfiLq/grKYRo66QchArfpZ6KhfydlfcNa8zqDGs5 WfFx/HQ9upPUGNPv3el9yFrLJJcWuDq6kRNpw5tGMdeaWoNh5TTZdbi95x807JWOPCur Wi6Q== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XJ6RCYZtqS9hM9/RkJUGxHsAy/nMvqiERtpBq5MiRjQ=; fh=tZJ625WOV7jgOfp8Y+f3bhkxwtNCMo5ecPunHzXn1rY=; b=QCtGyUUSD5A8XEWt1gAINVMBx6kNzR1gGGW/+7t2u/s1dxpG8tT1xM30MZaEv/+55i 4ijIXpEgPkBm+O+BHo//xQdYyflSM7d5Xk1AEF2Ca/8YDm+u89qb7sotg4BxViQ8mXAk R7nNU9EWsyTklAXVGnDGp7WC9ePOMJj++GdaaAgsdBJeXSFD+SKJyi2tLg4d1YAijX1s 3+LbT4t1cBqUQtol2TFrdLW1Q4P+9R5yon/CjZj0wZ60A4hW+tY9IpstB4DQvwGfF8fu UXRt4rBf8GekKpR0Nw8KfPjywDFuhmWBcp1iXWjh35ayK6C6TITIBTGe6cyUwWBujJJm HQZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OH8rUh1C; 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 u8-20020a0562140b0800b0066d1e737d52si4720606qvj.53.2023.10.22.16.30.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Oct 2023 16:30:47 -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=OH8rUh1C; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quhtF-000766-62; Sun, 22 Oct 2023 19:29:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1quhtC-00075X-Iz for qemu-devel@nongnu.org; Sun, 22 Oct 2023 19:29:46 -0400 Received: from mail-oo1-xc2f.google.com ([2607:f8b0:4864:20::c2f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quht3-0006gG-P0 for qemu-devel@nongnu.org; Sun, 22 Oct 2023 19:29:45 -0400 Received: by mail-oo1-xc2f.google.com with SMTP id 006d021491bc7-57f0f81b2aeso1641873eaf.3 for ; Sun, 22 Oct 2023 16:29:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698017375; x=1698622175; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XJ6RCYZtqS9hM9/RkJUGxHsAy/nMvqiERtpBq5MiRjQ=; b=OH8rUh1ClYJuLUbU+LRh0hH66dklX5bibvgqkUs17l1QeJmkgrUVkW88v4xQqM6NQt 963IR04hNLAwXppyOc+0MHVFuzYJgWtDflFSZlY3FyZ6R5KqkDPSq2XROczzY1zMXpTZ 3MEWaKQwIoN4kaKjMa0DedfU64hWXdBU7pVvMqwmJvXxi3/0sWXYGDcLym27Wjcvabh2 BLjwniQSnk6qCqc6kIbBJCwRZ4mU7o2sYHvWSRIFPgI/szQu7jOOW7x05XDMwKAh17fk aOGn8f5/nDjIX/qGDUDwtyQ+AehdCemDVaK9JKKCowki983nCowVPfuL8enl4jsRsMSy Vtuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698017375; x=1698622175; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XJ6RCYZtqS9hM9/RkJUGxHsAy/nMvqiERtpBq5MiRjQ=; b=v9yjbbI14hxybMAURM22MupkXjjDSXhZDl4pICBq2qvAEYN0SBLGew25dYt6fiH1BC fSARqPMDjMGjdf+prQoiTF9MYPPOdtVmHjB6ZD+Q/DTy8u9VoX183rJLc5Kn810J28HH SFNAgZTjHx3EBsRqHKRTT365yjGP8zMiKaD+N9HyHjK+1MOdtE9/ZK/xJP0m4D9+5K6J jEpvfRTdS65cnBSWMFyhdPXmhPwLUBpHa2U8yOfZdTnnW0pc8Ejvkif0x61zzItl6uUO scRVh4IJ4SbIa0Sl8iJ49BmLzl6eXv3rMTvtJymwE2TmkZOjts8PLLy5f4lqnDic8597 gBdw== X-Gm-Message-State: AOJu0Yy/bXKkOPjK2xLqJJ1LKx4FklbF2mHwGm2pIuugdQLEfuSWJ1g4 6Ksn/gV55YBGf712gRx9D3N2Yzj+e7bhrX8GY5U= X-Received: by 2002:a05:6871:459b:b0:1e9:de31:8000 with SMTP id nl27-20020a056871459b00b001e9de318000mr10717807oab.9.1698017375040; Sun, 22 Oct 2023 16:29:35 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k26-20020a63ba1a000000b005b25a04cf8bsm4023772pgf.12.2023.10.22.16.29.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 16:29:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, qemu-stable@nongnu.org Subject: [PATCH v5 01/94] target/sparc: Clear may_lookup for npc == DYNAMIC_PC Date: Sun, 22 Oct 2023 16:27:59 -0700 Message-Id: <20231022232932.80507-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231022232932.80507-1-richard.henderson@linaro.org> References: <20231022232932.80507-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c2f; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2f.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 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-bounces+patch=linaro.org@nongnu.org With pairs of jmp+rett, pc == DYNAMIC_PC_LOOKUP and npc == DYNAMIC_PC. Make sure that we exit for interrupts. Cc: qemu-stable@nongnu.org Fixes: 633c42834c7 ("target/sparc: Introduce DYNAMIC_PC_LOOKUP") Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- target/sparc/translate.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index f92ff80ac8..8fabed28fd 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -5654,10 +5654,10 @@ static void sparc_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) break; } + may_lookup = true; if (dc->pc & 3) { switch (dc->pc) { case DYNAMIC_PC_LOOKUP: - may_lookup = true; break; case DYNAMIC_PC: may_lookup = false; @@ -5667,10 +5667,24 @@ static void sparc_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) } } else { tcg_gen_movi_tl(cpu_pc, dc->pc); - may_lookup = true; } - save_npc(dc); + if (dc->npc & 3) { + switch (dc->npc) { + case JUMP_PC: + gen_generic_branch(dc); + break; + case DYNAMIC_PC: + may_lookup = false; + break; + case DYNAMIC_PC_LOOKUP: + break; + default: + g_assert_not_reached(); + } + } else { + tcg_gen_movi_tl(cpu_npc, dc->npc); + } if (may_lookup) { tcg_gen_lookup_and_goto_ptr(); } else {