From patchwork Fri Feb 12 14:33:57 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: 8292421 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F07C8C1F0D for ; Fri, 12 Feb 2016 14:41:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 41218203E3 for ; Fri, 12 Feb 2016 14:41:43 +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 893B1203E1 for ; Fri, 12 Feb 2016 14:41:42 +0000 (UTC) Received: from localhost ([::1]:33199 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUEuk-0000DU-1Y for patchwork-qemu-devel@patchwork.kernel.org; Fri, 12 Feb 2016 09:41:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUEq8-0000Nx-0D for qemu-devel@nongnu.org; Fri, 12 Feb 2016 09:36:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aUEq3-0002eK-C1 for qemu-devel@nongnu.org; Fri, 12 Feb 2016 09:36:55 -0500 Received: from mail-pa0-x244.google.com ([2607:f8b0:400e:c03::244]:34005) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUEq3-0002e5-17; Fri, 12 Feb 2016 09:36:51 -0500 Received: by mail-pa0-x244.google.com with SMTP id yy13so3897590pab.1; Fri, 12 Feb 2016 06:36:50 -0800 (PST) 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=SmM2B3KV1b/pATlDE0gMmxecdlk99h3EFEl8iVnC0fY=; b=yXCZoY6J4Sq/myrN4imoIw5B6liUoUVJrN+RIDHnp93RAuKzQNhuCYvXCLYEGfvTFc j5/7pNAmZeaxsVYsgLxgW4SyyRRwgp13jTyA7FrkofBK2/0Sl/7jEyQ8Ew9e7XPfLOgS YGKV9aXiZdJMr8rKG6O8Hgovoc4azv0w4itnkXWulfreAR4tya3bCipSafpv+UTKG0sY 0AZ5LVBNOu/WH/PVPlb53rVMmmIXyXW1x+YD2Fud+Kzkb/7KF4O9g2cRE8fs0am5TFWM nqzmVbGiyO8yICTP0Din/O42kJ4dCGIUZIIvxfe3IH6ttBK5q1pgI5iLkgPfPoWVjBGl nWag== 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=SmM2B3KV1b/pATlDE0gMmxecdlk99h3EFEl8iVnC0fY=; b=O5SZY9zm2dPAjZQ7uMzZHVqBKyIdzWfvWLMqBoRNeMXoZENMP7Ho+mSWzmfNcnSC/p zGg9igEKUo5nhQSUsWeNRe/K3FtzUvDJR2BJaprmifsKYbOAxM+vgItjI7fGacs+vtml GG2HG4ih/aO8VJVQ03TyyM9ywlMsWDgPt5i4EfcDLt8Z2RZEQBacja87B39y5fx/5Xtm mh/+Rj4bfjXGQo+LJa2kXHGiJ4IVNAhrbJLk2v4pXMNrGKaj9wMZ7CX8iF9AS5Ql+g1C a+QRiysTk8gfC36QzoWoVUqDa9z8SPBkgIO9eQOgZvtryS5e2fY76ZG2tSPOy1d5nX6F mDLg== X-Gm-Message-State: AG10YOSqiKQbsHdsBCsUV8T/+ma6I+DRN2lpiuGBOcZQx3r64qPzhfo1BHt6xud2dLzHWA== X-Received: by 10.66.218.225 with SMTP id pj1mr2460140pac.83.1455287810339; Fri, 12 Feb 2016 06:36:50 -0800 (PST) Received: from localhost (ec2-52-8-89-49.us-west-1.compute.amazonaws.com. [52.8.89.49]) by smtp.gmail.com with ESMTPSA id o90sm20017195pfi.17.2016.02.12.06.36.48 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 12 Feb 2016 06:36:49 -0800 (PST) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Fri, 12 Feb 2016 15:33:57 +0100 Message-Id: <1455287642-28166-5-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1455287642-28166-1-git-send-email-edgar.iglesias@gmail.com> References: <1455287642-28166-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: 2607:f8b0:400e:c03::244 Cc: edgar.iglesias@xilinx.com, serge.fdrv@gmail.com, qemu-arm@nongnu.org, alex.bennee@linaro.org, rth@twiddle.net Subject: [Qemu-devel] [PATCH v1 4/9] target-arm: Add more fields to the data abort syndrome generator 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org 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=ham 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" Add the following flags to the data abort syndrome generator: * 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 | 16 ++++++++++++++-- target-arm/op_helper.c | 8 ++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/target-arm/internals.h b/target-arm/internals.h index b1c483b..0934709 100644 --- a/target-arm/internals.h +++ b/target-arm/internals.h @@ -359,13 +359,25 @@ 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, +static inline uint32_t syn_data_abort(int same_el, int isv, + int sas, int sse, int srt, + int sf, int ar, + int ea, int cm, int s1ptw, int wnr, int fsc, bool is_thumb) { - return (EC_DATAABORT << ARM_EL_EC_SHIFT) | (same_el << ARM_EL_EC_SHIFT) + uint32_t v; + + v = (EC_DATAABORT << ARM_EL_EC_SHIFT) | (same_el << ARM_EL_EC_SHIFT) | (is_thumb ? 0 : ARM_EL_IL) | (ea << 9) | (cm << 8) | (s1ptw << 7) | (wnr << 6) | fsc; + + /* Insn Syndrome fields are RES0 if ISV is unset. */ + if (isv) { + v |= (isv << 24) | (sas << 22) | (sse << 21) | (srt << 16) + | (sf << 15) | (ar << 14); + } + return v; } 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 4e629e1..9bf635f 100644 --- a/target-arm/op_helper.c +++ b/target-arm/op_helper.c @@ -115,7 +115,9 @@ 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, + syn = syn_data_abort(same_el, + 0, 0, 0, 0, 0, 0, + 0, 0, fi.s1ptw, is_write == 1, syn, env->thumb); if (is_write == 1 && arm_feature(env, ARM_FEATURE_V6)) { fsr |= (1 << 11); @@ -162,7 +164,9 @@ 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, + syn_data_abort(same_el, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, is_write == 1, 0x21, env->thumb), target_el); }