Message ID | 20190731160719.11396-4-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 q18csp4213035ile; Wed, 31 Jul 2019 09:08:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+JhXcHdr+hjN6igq4k6L8sBVIev2oJErk0jIWoK8e8hcbU+SqCthecmjtOwL2YyNM4suo X-Received: by 2002:a17:906:fae0:: with SMTP id lu32mr8856454ejb.283.1564589304669; 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=vhFj6xB2qTrEXSHETRO7ojN+8LaUapOLka9Qvd/Rk/iwYtSJpaSFIDM5wFLc8SmY4U 5oAiRVRzVxsKe/tGBQYghk9B0O/7ZNU5HSiNFD8PhNklOliIeiWZZp25AE/KXmiDaFml WPd9bF/MB/4sMJi4n1S6EjnsMzfQdjdqDSOckETnyt/RkmGNDXLUhpzyXKgGuwqGZA5i guoxKfGYZ8fuV2lole/B1zto6Nvh32z94QmKH1LM/4SUMfiq+6cqpa2pbNpxe++PN/x+ KE1YaSXV6C9Sf1z8CEFZkr7Z6OGuBeGPzmOVdb0GdtpA/QwxTaMO1SlS5CtsfzfdwJPq D/+A== 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=JEIhsoUVe/t2uBROzqs6p6wGD1/psRv2lgg50pkn0Cw=; b=ZYGa1SnHWdeKbSM8Yj/ctervKUl7i3rEF2zfBFA4L7Q4Kv1EhJPL2CumbnRusdpiyt HTvbOq0+NH5wr0hUijZ3mSpgq+g5tjh7rxNJLK6d/rmybSlr7bdupyxp2hOW+d4YnhTC is7B97NNfRbR87ezwhBmejEcgmWqzCGFU5glSS2rLsx/4O/HCrEf9oXXx5KcwciL8Zan 1RekoPRuYLeUpFWdoRgg/D3f0Yq+KUPqEW8RrR//rnN0NstzCpxDGuZZYLkRGeMKkER+ OmtPauhBh639Vb6MEAl8swqWIZ/BqPj29BTXtKb3wUJs65txa+yoY8cc+TH+D06ckza3 4+4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=cduasaV5; 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 i22si22403666ede.37.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=cduasaV5; 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]:42326 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-00025W-Li for patch@linaro.org; Wed, 31 Jul 2019 12:08:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40239) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from <alex.bennee@linaro.org>) id 1hsr8U-00022J-2V for qemu-devel@nongnu.org; Wed, 31 Jul 2019 12:07:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <alex.bennee@linaro.org>) id 1hsr8O-0000dM-P9 for qemu-devel@nongnu.org; Wed, 31 Jul 2019 12:07:29 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:35770) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <alex.bennee@linaro.org>) id 1hsr8O-0000bI-7S for qemu-devel@nongnu.org; Wed, 31 Jul 2019 12:07:24 -0400 Received: by mail-wm1-x344.google.com with SMTP id l2so60318606wmg.0 for <qemu-devel@nongnu.org>; Wed, 31 Jul 2019 09:07:23 -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=JEIhsoUVe/t2uBROzqs6p6wGD1/psRv2lgg50pkn0Cw=; b=cduasaV5SuAXu9fYxB4y5rpUSMxkR6CW9rKalNPPx1C5RQfwqkQGImFKAgSfPNNKmV lVrCEJmDXp8/Dg49ixeYLENJTKVgSSB5wz5z1fHnaLUR2FxKuhLsO21jmOZRbHfI16Vk kVQONHFlMVsfT8qFawZo28BrUphomvyR1MQnhOSJZO9g020DnxIRdO+QXOmbxlNwIETc AcD2tAsB1irO6er6Nc6zIQAJbXiHwijRwBLSa/3EldfS+keboB8ftABk8vV9NTwcTaIA W6pF7I6j186Dt5vbNBLIGnDYyiUA8cwo17xESMFSN9ZvyQbbAEoY0BVMhElBM7bRib0m Z6uw== 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=JEIhsoUVe/t2uBROzqs6p6wGD1/psRv2lgg50pkn0Cw=; b=tqo9jSr17RR6NTDJ2w+106y2fq5AvKER/Nld2rMOUkaMatNONKnl0IrnRtFySFAaYm wlJSrYuoNKUo7wtvwjRvFXGChgFOvQ34jOpjpXJOObD6EIBKDD7a6uijym0y99zhmxDT Fbqcn2nbHJCvUZQGs3M1GNqkvCD9r7iYr/a9YGwEuJuK6VSvcZxLUT2zkdGl5IIvKTUe FJDUCLNqBGxAiroTh9bmVnP+C48j/SxSLTqQVwMnxen/ZFgEjhNjclgvHbLGHsx+JFvS 6/pBRD74MY8w7/sjbAfqTJ6YxVzZpi5wnNiGypkSDaPpc3uolYa0C8Y3ihCK/2ONDRkM SMJQ== X-Gm-Message-State: APjAAAVLQ38m9Cj2E0qcqUCZtlZsLQUqVHOKxNnUQ9Q2xbY15lGnlPJK 1ct2dyHCYnS7MEMFzis3UDe3ROPjHfI= X-Received: by 2002:a7b:cb94:: with SMTP id m20mr107284760wmi.144.1564589242451; Wed, 31 Jul 2019 09:07:22 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id i12sm81289977wrx.61.2019.07.31.09.07.20 (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 B50E01FF90; 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:28 +0100 Message-Id: <20190731160719.11396-4-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::344 Subject: [Qemu-devel] [PATCH v4 03/54] target/arm: handle A-profile A32 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 662d6f49115..4cb0e6fd835 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -7698,6 +7698,22 @@ static void arm_skip_unless(DisasContext *s, uint32_t cond) arm_gen_test_cc(cond ^ 1, s->condlabel); } +static inline void gen_arm_swi(DisasContext *s, int imm24) +{ + if (semihosting_enabled() && +#ifndef CONFIG_USER_ONLY + s->current_el != 0 && +#endif + (imm24 == 0x123456)) { + gen_exception_internal_insn(s, 0, EXCP_SEMIHOST); + return; + } + + gen_set_pc_im(s, s->pc); + s->svc_imm = imm24; + s->base.is_jmp = DISAS_SWI; +} + static void disas_arm_insn(DisasContext *s, unsigned int insn) { unsigned int cond, val, op1, i, shift, rm, rs, rn, rd, sh; @@ -9248,9 +9264,7 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) break; case 0xf: /* swi */ - gen_set_pc_im(s, s->pc); - s->svc_imm = extract32(insn, 0, 24); - s->base.is_jmp = DISAS_SWI; + gen_arm_swi(s, extract32(insn, 0, 24)); break; default: illegal_op: