From patchwork Mon Jun 15 18:49:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 49922 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3CBE8211FD for ; Mon, 15 Jun 2015 18:49:53 +0000 (UTC) Received: by wibdt2 with SMTP id dt2sf23490353wib.3 for ; Mon, 15 Jun 2015 11:49:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=jHBMtd0eUpAlhDw5x0eA1KF0Lp45pspKZmsf9TrY0kg=; b=YY6ncZn5lVlcZ/CMHD+8/ndfqR4RZiL36MjSqfMSGExlOBTljV0Q+bISSwXTOpmviX TvcEB4/IEOd8s0GAMRqBYTKDxc/ZuUcag8dd2QWq2tpMQbmH0PM1VCcB1l+OY5dpKF6H 28o9HQvs/SdAhStUjqVm9US5gx0YS/dO8QGa9InbJO6f9g2t+9WSO5kWKV48MlafgRn6 0ZMfP6jlEASzfqlZU84O5ctS+kzwLTQtuf3WTqSlexsFM72sCsapQwv72+KWIvdDqvad 2jsBLzbgInR/CMiz2reni2w8Hs3P+M2aQJsZGeuDaTlrqWuxOHlx3YC5fe1LXs/YpIzu n6SA== X-Gm-Message-State: ALoCoQlaZbaIhiagNyWGQnR0TuM1QJUuAfh9C30CXovzZShgKKcvo7oJL2OKDzcDqlSeIZxOEz7Q X-Received: by 10.112.189.131 with SMTP id gi3mr1394321lbc.6.1434394192489; Mon, 15 Jun 2015 11:49:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.121.98 with SMTP id lj2ls865508lab.94.gmail; Mon, 15 Jun 2015 11:49:52 -0700 (PDT) X-Received: by 10.152.37.102 with SMTP id x6mr17919519laj.69.1434394192349; Mon, 15 Jun 2015 11:49:52 -0700 (PDT) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id ld2si5524867lbb.19.2015.06.15.11.49.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jun 2015 11:49:52 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by lblr1 with SMTP id r1so32822832lbl.0 for ; Mon, 15 Jun 2015 11:49:52 -0700 (PDT) X-Received: by 10.152.22.99 with SMTP id c3mr29127655laf.32.1434394192132; Mon, 15 Jun 2015 11:49:52 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1606721lbb; Mon, 15 Jun 2015 11:49:51 -0700 (PDT) X-Received: by 10.180.11.239 with SMTP id t15mr15452474wib.63.1434394191392; Mon, 15 Jun 2015 11:49:51 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id ew7si23501934wjc.139.2015.06.15.11.49.51 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 15 Jun 2015 11:49:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1Z4ZSA-0003bl-Cd; Mon, 15 Jun 2015 19:49:50 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, =?UTF-8?q?Alex=20Z=C3=BCpke?= Subject: [PATCH 2/2] target-arm: Implement YIELD insn to yield in ARM and Thumb translators Date: Mon, 15 Jun 2015 19:49:50 +0100 Message-Id: <1434394190-13837-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1434394190-13837-1-git-send-email-peter.maydell@linaro.org> References: <1434394190-13837-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Implement the YIELD instruction in the ARM and Thumb translators to actually yield control back to the top level loop rather than being a simple no-op. (We already do this for A64.) Signed-off-by: Peter Maydell --- target-arm/translate.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/target-arm/translate.c b/target-arm/translate.c index ead08f4..05da26b 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -4080,6 +4080,10 @@ static void gen_rfe(DisasContext *s, TCGv_i32 pc, TCGv_i32 cpsr) static void gen_nop_hint(DisasContext *s, int val) { switch (val) { + case 1: /* yield */ + gen_set_pc_im(s, s->pc); + s->is_jmp = DISAS_YIELD; + break; case 3: /* wfi */ gen_set_pc_im(s, s->pc); s->is_jmp = DISAS_WFI; @@ -11459,6 +11463,9 @@ static inline void gen_intermediate_code_internal(ARMCPU *cpu, case DISAS_WFE: gen_helper_wfe(cpu_env); break; + case DISAS_YIELD: + gen_helper_yield(cpu_env); + break; case DISAS_SWI: gen_exception(EXCP_SWI, syn_aa32_svc(dc->svc_imm, dc->thumb), default_exception_el(dc));