Message ID | 20190731160719.11396-3-alex.bennee@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp4213026ile; Wed, 31 Jul 2019 09:08:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwTZygEbHkmO3hMgO+pHOLWc/TNbojpG+nzktawZDzaNdbHwsXWmxZ6KX8ZGqslexZOad6L X-Received: by 2002:a05:6402:8cc:: with SMTP id d12mr108181027edz.60.1564589304223; Wed, 31 Jul 2019 09:08:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564589304; cv=none; d=google.com; s=arc-20160816; b=UrUfDpI5IDmQh86TtWfvxkaoG4AAh/6PAG+D+etFHsbO7ta9I3hBKECYdOU1jAYa98 k9IC6DCdfhqpZF0V29kCPfPJ2TG0xyVPDGlX5EUD+2KNw/53oliiiP1rqAGBN3PVRih1 LBEy3HFSMRSslCkASS3jHxZyvmilFxpGQS202Y8SnAXv/2d6mHY/n1JSW71jIw8MxE/y +BaSyaiL9p3GaPsfhNfo3PT1Kcw7dc622iKBAsPuxzeCj6lv+qkQzodyBO48tUrRoBLp LxfQ5eNMwhlUTW5MfxapYz2sgtcZbZd8CW3UQU7nq3oGnktW5RjPsfrfU+nGZfw0yxnW 3Yew== 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:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=qkiw3jBwg/vICATtfRTry9vznckLVpbUV1wDKMXT5GE=; b=SSily4vZ9nLfmG4abO9RWl9mmlrRcSr0/bCjAvAuADRd54fyZwWEG29kZYsbFVKyUU VzphNVpJedxj4WVP9xab/tV+Hxq6CeEIOYx1vuY0LIJ1LZktlcwtTxQmsPO21KfOix/j J2nz59xOzud8+SEeqLjE+zWt9hz7lA4A9A+CxAlTPRVTzaQI/jPAu4Y3vlpfieKOoqLT DFriK+hR2QT+u41JL+LPdb9ZyRPZjzRz0eBvlgybtq6ljKKrx+y2KcZZdyqxilthFocA qD1ST5BjV5p4RFzKheK/ew+h7jpxCe+UWbOqVyrVFTYP9KhENFDBbOlgHP2veXdgZDvN COlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=j0ex1P+V; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b42si22072124ede.365.2019.07.31.09.08.24 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Jul 2019 09:08:24 -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=fail header.i=@linaro.org header.s=google header.b=j0ex1P+V; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from <qemu-devel-bounces+patch=linaro.org@nongnu.org>) id 1hsr9L-00023g-8c for patch@linaro.org; Wed, 31 Jul 2019 12:08:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40174) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from <alex.bennee@linaro.org>) id 1hsr8O-00021z-8B for qemu-devel@nongnu.org; Wed, 31 Jul 2019 12:07:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <alex.bennee@linaro.org>) id 1hsr8N-0000be-72 for qemu-devel@nongnu.org; Wed, 31 Jul 2019 12:07:24 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:40519) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <alex.bennee@linaro.org>) id 1hsr8M-0000aF-TY for qemu-devel@nongnu.org; Wed, 31 Jul 2019 12:07:23 -0400 Received: by mail-wr1-x442.google.com with SMTP id r1so70281970wrl.7 for <qemu-devel@nongnu.org>; Wed, 31 Jul 2019 09:07:22 -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=qkiw3jBwg/vICATtfRTry9vznckLVpbUV1wDKMXT5GE=; b=j0ex1P+VZmKuzOcUzLHFA1DkvDrTWj0nCyfYZqB2dcoD7k6OGXFl+1CPQDgL4BnlMP dhsWZuOD3zK9OAGjVmWpqF7y0EM7RUqGIHfCY2Tn/WgN4/11+QvKtz0jFGVNMxzNTlbl NQTfFeVuGO6jHkwmzAsoKHG57r74kDXgpKrLFv6g9n/vBlPRJ9OFySx8F8nbc0hieCCv 6sgXTSO5ItUEOXIZwTEha34BLvT3y1Lj9OnFrSbzv2t5ldiBMEUWYwF6BAkon/NSaJQm 5nHMGW26Zc1SakGWOAusGgqtXHGrZD7lzBqJDmAuIteCKa8foFZmcwmeI7rmW88BxoNp x8FQ== 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=qkiw3jBwg/vICATtfRTry9vznckLVpbUV1wDKMXT5GE=; b=dD+91ttFZbTicfaXNq0v462UGGY+a55o0AYK3T/lrNOjtLwwV9YI+H7CMoOIHLaZ3h Mhogk/a02ZpqZmv98fsLfS6SvPVjriyn2gsmdh2wQITVdV571XnoHq99v8DaDNvNj987 dzmqWfmPj8T3sq8zuXu/ZT4OUck7zUwC8/aJc/FfoQeWR/45oMqArHwVGCv5UkGBoy0w Vr7rb2KYDeyVtUF8eEod6fcy8WscEATpNgaep+JcZ/Q/0TeuwL8K9R6uUGhrzETj7PcM 6rAEKZ9TWuD67tWuCJguBnIhJeLrdPvIHZjuPc319gVEzPuLbkKZuNWiR88GeB9JZNOe ek9g== X-Gm-Message-State: APjAAAVSKvoJfybS84kW0A/XAojY2GF90tRaFfOwO63sjL+t1BtdJvSg tnBuUXYDuo1nAioF7cUH1rFBwQ== X-Received: by 2002:a5d:56c7:: with SMTP id m7mr13439910wrw.64.1564589240911; Wed, 31 Jul 2019 09:07:20 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id n9sm114495893wrp.54.2019.07.31.09.07.19 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 31 Jul 2019 09:07:20 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A1B441FF8F; Wed, 31 Jul 2019 17:07:19 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org> To: qemu-devel@nongnu.org Date: Wed, 31 Jul 2019 17:06:27 +0100 Message-Id: <20190731160719.11396-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190731160719.11396-1-alex.bennee@linaro.org> References: <20190731160719.11396-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 Subject: [Qemu-devel] [PATCH v4 02/54] target/arm: handle A-profile T32 semihosting at translate time X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Peter Maydell <peter.maydell@linaro.org>, Richard Henderson <richard.henderson@linaro.org>, aaron@os.amperecomputing.com, cota@braap.org, "open list:ARM TCG CPUs" <qemu-arm@nongnu.org>, bobby.prani@gmail.com, =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patch=linaro.org@nongnu.org> |
Series |
plugins for TCG
|
expand
|
diff --git a/target/arm/translate.c b/target/arm/translate.c index 0b02c520395..662d6f49115 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -10994,6 +10994,24 @@ static inline void gen_thumb_bkpt(DisasContext *s, int imm8) gen_exception_bkpt_insn(s, 2, syn_aa32_bkpt(imm8, true)); } +/* + * Thumb SWI. On A-profile CPUs this may be a semihosting call. + */ +static inline void gen_thumb_swi(DisasContext *s, int imm8) +{ + if (semihosting_enabled() && +#ifndef CONFIG_USER_ONLY + s->current_el != 0 && +#endif + (imm8 == 0xab)) { + gen_exception_internal_insn(s, 0, EXCP_SEMIHOST); + return; + } + gen_set_pc_im(s, s->pc); + s->svc_imm = imm8; + s->base.is_jmp = DISAS_SWI; +} + static void disas_thumb_insn(DisasContext *s, uint32_t insn) { uint32_t val, op, rm, rn, rd, shift, cond; @@ -11758,10 +11776,8 @@ static void disas_thumb_insn(DisasContext *s, uint32_t insn) goto undef; if (cond == 0xf) { - /* swi */ - gen_set_pc_im(s, s->pc); - s->svc_imm = extract32(insn, 0, 8); - s->base.is_jmp = DISAS_SWI; + /* swi/svc */ + gen_thumb_swi(s, extract32(insn, 0, 8)); break; } /* generate a conditional jump to next instruction */