From patchwork Sun May 25 01:08:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 352208 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 62E01140083 for ; Sun, 25 May 2014 11:22:46 +1000 (EST) Received: from localhost ([::1]:49946 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WoN9A-00051E-8M for incoming@patchwork.ozlabs.org; Sat, 24 May 2014 21:22:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WoN8I-0003XJ-Bo for qemu-devel@nongnu.org; Sat, 24 May 2014 21:21:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WoN8D-0007Zr-IY for qemu-devel@nongnu.org; Sat, 24 May 2014 21:21:50 -0400 Received: from mail-we0-x22b.google.com ([2a00:1450:400c:c03::22b]:40265) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WoN8D-0007Zn-Bm for qemu-devel@nongnu.org; Sat, 24 May 2014 21:21:45 -0400 Received: by mail-we0-f171.google.com with SMTP id w62so6400400wes.2 for ; Sat, 24 May 2014 18:21:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=O8wQQbn/PX92RQWjVTDukGoVwBn/QzoEUnm3qHr+8cs=; b=d07xKwYe0oBA91LMRcRRah3EsfOT5mWVePv3KZWscvieynOhgmQwVAtVUnQd07kln1 SiXONpit8ZhPEHuQVHYdWuO2oj5KE7AM97gsOZEkGieT1SqBAZ1XQR287CJl8lZZJ2rz t0psEr8dWf491BJwanlcDljdzK/RTTzCK9ARlHRfw8yWi9Ewr35nOhpqSCcHXOMuUPGQ rQ/RCqn5g95GqyIrOOEh0+lBPIR6pflUdycdE3vVLKh2xAU7EsiQK3veP9HiIGHMkNOu xGdl4IxNa4pnBAyld+U+HBaKkWX6AEvXtv3m+GoJq/DQtPV0qWJQj8mhnnWTQy8O0O0e LyCQ== X-Received: by 10.180.108.106 with SMTP id hj10mr9988180wib.53.1400980904612; Sat, 24 May 2014 18:21:44 -0700 (PDT) Received: from localhost ([203.126.243.116]) by mx.google.com with ESMTPSA id mw4sm14177134wib.12.2014.05.24.18.21.39 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 24 May 2014 18:21:44 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Sun, 25 May 2014 11:08:47 +1000 Message-Id: <1400980132-25949-19-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1400980132-25949-1-git-send-email-edgar.iglesias@gmail.com> References: <1400980132-25949-1-git-send-email-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c03::22b Cc: rob.herring@linaro.org, peter.crosthwaite@xilinx.com, aggelerf@ethz.ch, agraf@suse.de, john.williams@xilinx.com, greg.bellows@linaro.org, alex.bennee@linaro.org, christoffer.dall@linaro.org, rth@twiddle.net Subject: [Qemu-devel] [PATCH v5 18/23] target-arm: A64: Trap ERET from EL0 at translation time X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Edgar E. Iglesias" Suggested-by: Peter Maydell Signed-off-by: Edgar E. Iglesias --- target-arm/translate-a64.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c index bfd139a..ec6a39d 100644 --- a/target-arm/translate-a64.c +++ b/target-arm/translate-a64.c @@ -1507,6 +1507,10 @@ static void disas_uncond_b_reg(DisasContext *s, uint32_t insn) tcg_gen_movi_i64(cpu_reg(s, 30), s->pc); break; case 4: /* ERET */ + if (s->current_pl == 0) { + unallocated_encoding(s); + return; + } gen_helper_exception_return(cpu_env); s->is_jmp = DISAS_JUMP; return;