From patchwork Fri Apr 29 12:08:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 8982231 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 254029F46D for ; Fri, 29 Apr 2016 13:29:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6D83D201FA for ; Fri, 29 Apr 2016 13:29:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 44A4B201CE for ; Fri, 29 Apr 2016 13:29:56 +0000 (UTC) Received: from localhost ([::1]:53895 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aw7Ip-0002Bb-5A for patchwork-qemu-devel@patchwork.kernel.org; Fri, 29 Apr 2016 08:13:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aw7E5-0002hM-Nd for qemu-devel@nongnu.org; Fri, 29 Apr 2016 08:09:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aw7Du-0001v1-1G for qemu-devel@nongnu.org; Fri, 29 Apr 2016 08:08:48 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:34557) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aw7Ds-0001nR-K0; Fri, 29 Apr 2016 08:08:41 -0400 Received: by mail-wm0-x241.google.com with SMTP id n129so4550478wmn.1; Fri, 29 Apr 2016 05:08:12 -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=B8+M59l7BLs+E+0716H5mAerkTN5ZcjYG7wBkzZZRkg=; b=FcFNyX1XNEcg/TS0h0baZKjliDEJY+LIodFjy9CtXTmsAVnPm6bPAV1Pq/sa7JGRjI UN9VqkR9FKlZdKzjCfZbN1VsdQkUbMtXChgypLZ3FwUWYtLbfxBKlXLxwnvxSjDm33gB 0yHlbGUWcelrzjSCy/+zhe9NCG/5H3bz11Xpk5TNIVx7ChkRuAUHKFHCekorrusNhyGi rxJgaDY/MH/bwApoIHOuQtOKh1bqTsYsoNmidTR7n+l2yJZ5WBRbEkczGzm816kqndF0 XdAbcNxd3YCced/2OD0CLlccWbG20E02I4ctH4wf30sfqq8D5CHK7RD6SD+nWuAOtEGU LGqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=B8+M59l7BLs+E+0716H5mAerkTN5ZcjYG7wBkzZZRkg=; b=V28HYRoA8EvVfJooa6L7coTCFpR/053C+P+dluN1PKLc9j90ISoYVdluQ39DJ183QM XhaiqG/iD67D0QU32gPM/EkI8dfqL45Ez+hzP146lGYTNzm0Qoyg5ly2FsglW0mCaR// v5GWudArEUTmeK03m297LvNSy1AE4ZOYBGznwyyeg0yBKg6Wve/yri2AKmpbyhmU9RK2 UfDl5HkcGwKt9StFlEOCXrIKWTEJjdN8cyisK2CrXbDF84POTOy4oXYtmudJdhpdi8sd pFEBWLysEoCR71kRy2OMlRu3fZWFCEwLxa88Wz6CkwvcqFFd7QK0ocjnNT6ehQWb9IX1 zc5g== X-Gm-Message-State: AOPr4FWFjMCQtDR9tp9au5T6eGlBQPiW/1m1VL3xoL9ehxI3EGMxLCP4+jhhx4fT9xeTkw== X-Received: by 10.28.194.69 with SMTP id s66mr3787196wmf.88.1461931691037; Fri, 29 Apr 2016 05:08:11 -0700 (PDT) Received: from localhost (81-231-233-234-no56.tbcn.telia.com. [81.231.233.234]) by smtp.gmail.com with ESMTPSA id jo6sm14460498wjb.48.2016.04.29.05.08.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Apr 2016 05:08:10 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Fri, 29 Apr 2016 14:08:01 +0200 Message-Id: <1461931684-1867-5-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1461931684-1867-1-git-send-email-edgar.iglesias@gmail.com> References: <1461931684-1867-1-git-send-email-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PATCH v3 4/7] target-arm: Split data abort syndrome generator X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@xilinx.com, serge.fdrv@gmail.com, qemu-arm@nongnu.org, alex.bennee@linaro.org, rth@twiddle.net Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Edgar E. Iglesias" Split the data abort syndrome generator into two versions. One with a valid Instruction Specific Syndrome (ISS) and another without. The following new flags are supported by the syndrome generator with ISS: * isv - Instruction syndrome valid * sas - Syndrome access size * sse - Syndrome sign extend * srt - Syndrome register transfer * sf - Sixty-Four bit register width * ar - Acquire/Release These flags are not yet used, so this patch has no functional change. Signed-off-by: Edgar E. Iglesias --- target-arm/internals.h | 26 +++++++++++++++++++++----- target-arm/op_helper.c | 8 ++++---- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/target-arm/internals.h b/target-arm/internals.h index 34e2688..54a0fb1 100644 --- a/target-arm/internals.h +++ b/target-arm/internals.h @@ -263,7 +263,9 @@ enum arm_exception_class { #define ARM_EL_EC_SHIFT 26 #define ARM_EL_IL_SHIFT 25 +#define ARM_EL_ISV_SHIFT 24 #define ARM_EL_IL (1 << ARM_EL_IL_SHIFT) +#define ARM_EL_ISV (1 << ARM_EL_ISV_SHIFT) /* Utility functions for constructing various kinds of syndrome value. * Note that in general we follow the AArch64 syndrome values; in a @@ -383,13 +385,27 @@ static inline uint32_t syn_insn_abort(int same_el, int ea, int s1ptw, int fsc) | (ea << 9) | (s1ptw << 7) | fsc; } -static inline uint32_t syn_data_abort(int same_el, int ea, int cm, int s1ptw, - int wnr, int fsc, - bool is_16bit) +static inline uint32_t syn_data_abort_no_iss(int same_el, + int ea, int cm, int s1ptw, + int wnr, int fsc) { return (EC_DATAABORT << ARM_EL_EC_SHIFT) | (same_el << ARM_EL_EC_SHIFT) - | (is_16bit ? 0 : ARM_EL_IL) - | (ea << 9) | (cm << 8) | (s1ptw << 7) | (wnr << 6) | fsc; + | ARM_EL_IL + | (ea << 9) | (cm << 8) | (s1ptw << 7) | (wnr << 6) | fsc; +} + +static inline uint32_t syn_data_abort_with_iss(int same_el, + int sas, int sse, int srt, + int sf, int ar, + int ea, int cm, int s1ptw, + int wnr, int fsc, + bool is_16bit) +{ + return (EC_DATAABORT << ARM_EL_EC_SHIFT) | (same_el << ARM_EL_EC_SHIFT) + | (is_16bit ? 0 : ARM_EL_IL) + | ARM_EL_ISV | (sas << 22) | (sse << 21) | (srt << 16) + | (sf << 15) | (ar << 14) + | (ea << 9) | (cm << 8) | (s1ptw << 7) | (wnr << 6) | fsc; } static inline uint32_t syn_swstep(int same_el, int isv, int ex) diff --git a/target-arm/op_helper.c b/target-arm/op_helper.c index e69c1de..c7fba85 100644 --- a/target-arm/op_helper.c +++ b/target-arm/op_helper.c @@ -115,8 +115,8 @@ void tlb_fill(CPUState *cs, target_ulong addr, int is_write, int mmu_idx, syn = syn_insn_abort(same_el, 0, fi.s1ptw, syn); exc = EXCP_PREFETCH_ABORT; } else { - syn = syn_data_abort(same_el, 0, 0, fi.s1ptw, is_write == 1, syn, - 1); + syn = syn_data_abort_no_iss(same_el, + 0, 0, fi.s1ptw, is_write == 1, syn); if (is_write == 1 && arm_feature(env, ARM_FEATURE_V6)) { fsr |= (1 << 11); } @@ -162,8 +162,8 @@ void arm_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, int is_write, } raise_exception(env, EXCP_DATA_ABORT, - syn_data_abort(same_el, 0, 0, 0, is_write == 1, 0x21, - 1), + syn_data_abort_no_iss(same_el, + 0, 0, 0, is_write == 1, 0x21), target_el); }