From patchwork Tue Feb 11 23:19:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 24505 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 983D5206FF for ; Tue, 11 Feb 2014 23:20:50 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id i4sf36105018oah.3 for ; Tue, 11 Feb 2014 15:20:49 -0800 (PST) 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:date :message-id:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=XSoIslFgy1qgw6tVYZEjXyyZvKlA1epn6kUHpXeQws0=; b=ZJ/eUuRj1yJZ2D3dR/6N3d4PqEPnoD2h38cMSa2LL2NOCklPR5K3EEq6qnDZ9VQuAg j6cDzBESsH38/YOfeG5O/XtR3mb1jFgdbAUaPZ2G3OXD/G/p3HylWeiUlxoj3eac01ET Dii+9D+FgCTJyQmUGwnkJSw3U/Xbp/DaGNpG2SXFMP0uwLZnl57b/RHkN1EAe4/2IZw7 lcgwwTQt3n6OdzQ/dUFwvL3bOLqbzbc37gcCpp5RYFHhylprn89rkjMhGaKEQP/B3rsp irMpezpbLnrJnuWUXZg5WvrdWyTqssYYLjpt++rQ+Z3BjOEyJvZPXM8EXwbefd1HlHe6 C+PQ== X-Gm-Message-State: ALoCoQlfGnqQFPI+GqBISwd/2UqkABQDOODMpMjV4520RNzlHOHxiBEJh9tH8DNpJCkMjzYwrSkl X-Received: by 10.50.253.196 with SMTP id ac4mr444436igd.6.1392160849277; Tue, 11 Feb 2014 15:20:49 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.47.9 with SMTP id l9ls2666570qga.13.gmail; Tue, 11 Feb 2014 15:20:49 -0800 (PST) X-Received: by 10.58.86.230 with SMTP id s6mr30072514vez.16.1392160849125; Tue, 11 Feb 2014 15:20:49 -0800 (PST) Received: from mail-ve0-x232.google.com (mail-ve0-x232.google.com [2607:f8b0:400c:c01::232]) by mx.google.com with ESMTPS id p9si6549580vdv.135.2014.02.11.15.20.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Feb 2014 15:20:49 -0800 (PST) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::232 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::232; Received: by mail-ve0-f178.google.com with SMTP id oy12so6626159veb.23 for ; Tue, 11 Feb 2014 15:20:49 -0800 (PST) X-Received: by 10.58.200.229 with SMTP id jv5mr29814281vec.15.1392160849022; Tue, 11 Feb 2014 15:20:49 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp8598vcz; Tue, 11 Feb 2014 15:20:48 -0800 (PST) X-Received: by 10.140.32.98 with SMTP id g89mr58804656qgg.37.1392160848487; Tue, 11 Feb 2014 15:20:48 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id d67si13753779qgf.125.2014.02.11.15.20.48 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 11 Feb 2014 15:20:48 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:36451 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDMdD-0003Ji-Su for patch@linaro.org; Tue, 11 Feb 2014 18:20:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDMcZ-000314-W3 for qemu-devel@nongnu.org; Tue, 11 Feb 2014 18:20:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDMcU-0006jO-Lt for qemu-devel@nongnu.org; Tue, 11 Feb 2014 18:20:07 -0500 Received: from mail-ob0-x232.google.com ([2607:f8b0:4003:c01::232]:33154) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDMcU-0006iW-FW for qemu-devel@nongnu.org; Tue, 11 Feb 2014 18:20:02 -0500 Received: by mail-ob0-f178.google.com with SMTP id wn1so9609586obc.37 for ; Tue, 11 Feb 2014 15:20:01 -0800 (PST) X-Received: by 10.182.33.35 with SMTP id o3mr9986034obi.15.1392160801616; Tue, 11 Feb 2014 15:20:01 -0800 (PST) Received: from localhost.localdomain (65-36-73-129.dyn.grandenetworks.net. [65.36.73.129]) by mx.google.com with ESMTPSA id ru3sm47960606obc.2.2014.02.11.15.20.00 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Feb 2014 15:20:01 -0800 (PST) From: Rob Herring To: Peter Maydell , qemu-devel@nongnu.org Date: Tue, 11 Feb 2014 17:19:21 -0600 Message-Id: <1392160761-20752-1-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.8.3.2 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c01::232 Cc: Rob Herring Subject: [Qemu-devel] [PATCH] target-arm: make smc behave as a nop 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Original-Sender: robherring2@gmail.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::232 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=fail header.i=@gmail.com; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Rob Herring Several platforms make smc calls for things such as PL310 cache setup. In these cases, making smc a nop rather than an illegal instruction is sufficient for qemu to work. Signed-off-by: Rob Herring --- target-arm/translate.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/target-arm/translate.c b/target-arm/translate.c index e701c0f..ab4cd56 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -7518,16 +7518,18 @@ static void disas_arm_insn(CPUARMState * env, DisasContext *s) store_reg(s, rd, tmp); break; case 7: - /* SMC instruction (op1 == 3) - and undefined instructions (op1 == 0 || op1 == 2) - will trap */ - if (op1 != 1) { - goto illegal_op; + if (op1 == 3) { + ARCH(6K); + /* nop */ + break; + } else if (op1 == 1) { + /* bkpt */ + ARCH(5); + gen_exception_insn(s, 4, EXCP_BKPT); + break; } - /* bkpt */ - ARCH(5); - gen_exception_insn(s, 4, EXCP_BKPT); - break; + /* Undefined instructions will trap */ + goto illegal_op; case 0x8: /* signed multiply */ case 0xa: case 0xc: