From patchwork Thu Mar 12 19:41:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 184510 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp954391ile; Thu, 12 Mar 2020 12:46:33 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs4ii6beD4IJWRbPxKGuBg49WzKNJDMQzcuN6/Dinp4cmLjiWhWuCmG4ZZaqlYJs/qIppy4 X-Received: by 2002:a37:987:: with SMTP id 129mr9642992qkj.83.1584042393498; Thu, 12 Mar 2020 12:46:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584042393; cv=none; d=google.com; s=arc-20160816; b=tEdIT5EgQxX93lA6X38kG/EGdHYxIRI8Gu7NkRKqP/Ldcq/doiMuRWKbDjcnRZ+zwm Haq7ka1ZiD1q9r+rn7xDatYDqfPNpTorSPOW9d8zoAn0lC1LXxewZq9+sgHEBfdOv0bs s2vHYPE6Hgdsp2dbKwtmVhgCZJnG5IL7Fy1JX0W2vPOS+/x8XC+DHoF0AyIK9NMDjN5p FprQykVaOH4LKPg6H1Y8usyKNokNuRwe9+lm8PK7xyYRYbmcLtHgZx1igVi1LRSbiyjj xsOlBB94lfgMCTYYAvrbAFNYern9nvpFgQMuyWLZ9xVEmkwv76wBBF2woNGoLXOrd+2M bWvA== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=h7AXraeqjBa9vhULwB29oPSWKU7V90nxWGB/AHNXvVI=; b=e//ogcodXaMnpKAuXDQ5c0mAsbzRFPOxFJp3YR2hDmFRgaUFcZ2mstX/MwsgiZJFkW kOPUYUzmfjYIP0tCakAx5QuvfPAWt3G+9Iqyzd1pgiHbUzk78rqO0RFVInPDzHA9oZnp k2yH6palHI68cO1Ityl6owgjGWEU/r4bT30GuOrAFLLUWVpkHXJ6KFv3YmjG9dJBVSRo z9g6HaqFgc9W/+oGuePvauT/DaCUsW79JA8zzHNeQ6+DUA0E+yEWRlX4c31yVkWDIuhL xuJChRpKxWaYiJ636QTqvUgd8Yi3kiOyKOiIK5MamZ4ZV9h2v9VgIwLMA9/UYMZdru0/ Xeew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Rb1015ft; 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 b77si3708394qkg.179.2020.03.12.12.46.33 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Mar 2020 12:46:33 -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=Rb1015ft; 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]:49252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCTmr-0008OT-0E for patch@linaro.org; Thu, 12 Mar 2020 15:46:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45094) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCTix-0004rl-IH for qemu-devel@nongnu.org; Thu, 12 Mar 2020 15:42:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCTiw-0001lT-FZ for qemu-devel@nongnu.org; Thu, 12 Mar 2020 15:42:31 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:37767) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jCTiw-0001ko-9I for qemu-devel@nongnu.org; Thu, 12 Mar 2020 15:42:30 -0400 Received: by mail-pl1-x642.google.com with SMTP id f16so3074903plj.4 for ; Thu, 12 Mar 2020 12:42:30 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=h7AXraeqjBa9vhULwB29oPSWKU7V90nxWGB/AHNXvVI=; b=Rb1015ftymYuwi5nTcC4KlYDcTKVvlM5tuCW27x3uGhpkLiwc7K/EOQ5RAGy9ZN4tP E8qAkqyCaUFpLTRz31eS9m6OlLWP4jYsk75gz7xKdjnWDFj1k7B6G0T2Yp6IzyGg4uTm DHGShFuAeQwfQftD5Ui7k7fknncwhQX1LUQwTo3zUbcOIhtzAdLsEpXvJk7GS7aUI9KP P/cHam5CKveouVSU8dDb6hpAPkoUTzige9TSusj5sE2At8ZG1zK2lLnRFqzkt++LbRoP UW23tJCEZSnRdJxP6wBzI69zeikNO07+vHa8rjol1ptCBsLDrwBvB23W93uC9F5iDxfj PAbQ== 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:mime-version:content-transfer-encoding; bh=h7AXraeqjBa9vhULwB29oPSWKU7V90nxWGB/AHNXvVI=; b=hAfmGQkZwvAfFKv/57KWutpKvMORZy/MULt7dvmpbmUx++e94dnXYwNscebkZ5ksp9 bkiIICWKR5smNkHcwqeErftSUrZ9Dwwkh8g+8RwrW7WXewA30sdHUF0O4mXmBaRrJOa8 k+C+z4eIq7AylBgTTkpL8KwdUhMkVFPBDnNsklWg7UaScakk33xOQv/WL5bgG1iFo7H6 p8LSWB9qbkWSs38ZuGhvZ9BHHwRhQIQo37GZPMIoPWLOmJGuH58FxzEQ8PrB9NRVcK1u pXLLJ9GbcS4C913L0Xx6XS2DliyLIIFtG9Li1EKrDhtwSs6gT0S5tIIMVRUFC0gy9Bcs ptKw== X-Gm-Message-State: ANhLgQ2lvmtUwrpK28gL5lnB721ojLxw+TxJx3o7dPPZkyd50Hv0UyHj ue2S+TqbNP0O+zG5mAxzOdK1py4/Erk= X-Received: by 2002:a17:90a:8d81:: with SMTP id d1mr5772884pjo.63.1584042148865; Thu, 12 Mar 2020 12:42:28 -0700 (PDT) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id g69sm6824842pje.34.2020.03.12.12.42.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 12:42:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v6 06/42] target/arm: Add DISAS_UPDATE_NOCHAIN Date: Thu, 12 Mar 2020 12:41:43 -0700 Message-Id: <20200312194219.24406-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200312194219.24406-1-richard.henderson@linaro.org> References: <20200312194219.24406-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::642 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Add an option that writes back the PC, like DISAS_UPDATE_EXIT, but does not exit back to the main loop. Signed-off-by: Richard Henderson --- target/arm/translate.h | 2 ++ target/arm/translate-a64.c | 3 +++ target/arm/translate.c | 4 ++++ 3 files changed, 9 insertions(+) -- 2.20.1 diff --git a/target/arm/translate.h b/target/arm/translate.h index 41d6cc8db5..dbbb167174 100644 --- a/target/arm/translate.h +++ b/target/arm/translate.h @@ -173,6 +173,8 @@ static inline void disas_set_insn_syndrome(DisasContext *s, uint32_t syn) * return from cpu_tb_exec. */ #define DISAS_EXIT DISAS_TARGET_9 +/* CPU state was modified dynamically; no need to exit, but do not chain. */ +#define DISAS_UPDATE_NOCHAIN DISAS_TARGET_10 #ifdef TARGET_AARCH64 void a64_translate_init(void); diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index a793ec9ee1..943d6034de 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -14462,6 +14462,9 @@ static void aarch64_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) case DISAS_EXIT: tcg_gen_exit_tb(NULL, 0); break; + case DISAS_UPDATE_NOCHAIN: + gen_a64_set_pc_im(dc->base.pc_next); + /* fall through */ case DISAS_JUMP: tcg_gen_lookup_and_goto_ptr(); break; diff --git a/target/arm/translate.c b/target/arm/translate.c index 5a21766cce..33a26287f7 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -11420,6 +11420,7 @@ static void arm_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) case DISAS_NEXT: case DISAS_TOO_MANY: case DISAS_UPDATE_EXIT: + case DISAS_UPDATE_NOCHAIN: gen_set_pc_im(dc, dc->base.pc_next); /* fall through */ default: @@ -11443,6 +11444,9 @@ static void arm_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) case DISAS_TOO_MANY: gen_goto_tb(dc, 1, dc->base.pc_next); break; + case DISAS_UPDATE_NOCHAIN: + gen_set_pc_im(dc, dc->base.pc_next); + /* fall through */ case DISAS_JUMP: gen_goto_ptr(); break;