From patchwork Fri Feb 19 20:04:48 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: 8363641 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 DE0DA9F372 for ; Fri, 19 Feb 2016 20:09:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 298F620454 for ; Fri, 19 Feb 2016 20:09:09 +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 74B6820450 for ; Fri, 19 Feb 2016 20:09:08 +0000 (UTC) Received: from localhost ([::1]:55037 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWrMR-0002VP-OX for patchwork-qemu-devel@patchwork.kernel.org; Fri, 19 Feb 2016 15:09:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWrIm-0004Al-LN for qemu-devel@nongnu.org; Fri, 19 Feb 2016 15:05:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWrIj-0007Ms-DH for qemu-devel@nongnu.org; Fri, 19 Feb 2016 15:05:20 -0500 Received: from mail-pa0-x22a.google.com ([2607:f8b0:400e:c03::22a]:36445) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWrIj-0007Lw-28; Fri, 19 Feb 2016 15:05:17 -0500 Received: by mail-pa0-x22a.google.com with SMTP id yy13so55472927pab.3; Fri, 19 Feb 2016 12:05:16 -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=Gx8QBvmgdGYIFu2QMQkyc2UA8Us+rbB9R5hggMahBLg=; b=bfWcChR24MJoJGBZ9aVFhppX23dUifIwbJ1oeMiGydZuILkgnhJts3ZFtqGWR3cUaH Uf9ASeXZLSANAx7CHo3X3ehZ1lH4z86dIdmPMpJFfLzHNb98Rd2OOcvamF9m2Bffe6ih YQOhWEqxTy1PoqSdXxPZcPfHIIhftgUpWVURb7pOC3yzLIXXXk9tsAd0wV9HufLCJ5+x Vdkf1ZOj8b5K5B/PGAiTBwVDCc+tphZXkyHruV+nPv73onqyOw+7nr/TsjAaq5tx5aZ5 Z4d8xyjJrLbFPX0p9JPDiE8HPXtycEPouHznzgRVdEyIk3S+G5O2Ux3gnyFPIrXu0+K2 +uCg== 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=Gx8QBvmgdGYIFu2QMQkyc2UA8Us+rbB9R5hggMahBLg=; b=UTjmcLap6qB6TCwQ1C+akGjtTyOrdiasEJqy/lVWjbAypUbtSQsQ/RrwAMD5+rAtOl j46dmrhIH3ZI31IlSArmOq55y3z9OfPtVOlxtsjyTtGCTZg7IYSE++PMdOQpYx4ikalw Kb1x7KpWKEoCziYI/7CVeDLR/btdC065THfUT4zMQ1kccQdiNQL/MIyzYvs+r6MCbL2c 950UyOFk5kGj83046dfiUcg7wN92ZVNYfd9SRh94hzVfGuWAzLTFs+PWBUK+RFu2FNoH DLka2L4nag40RYacxAG1ImOG5+4pt/bwHIR5YktGgl3zhIuOTP8MKyvOqMgY9Z6kivDb +kOQ== X-Gm-Message-State: AG10YOR7nWqH9vVc8FzFeetdVPZ61hzqUnUVvPadUBg/o0PX6QbzB4bCnBOiZFzt15UkWw== X-Received: by 10.66.191.202 with SMTP id ha10mr20737562pac.8.1455912316407; Fri, 19 Feb 2016 12:05:16 -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 r5sm19840740pap.7.2016.02.19.12.05.15 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 19 Feb 2016 12:05:15 -0800 (PST) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Fri, 19 Feb 2016 21:04:48 +0100 Message-Id: <1455912292-23807-5-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1455912292-23807-1-git-send-email-edgar.iglesias@gmail.com> References: <1455912292-23807-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::22a Cc: edgar.iglesias@xilinx.com, serge.fdrv@gmail.com, qemu-arm@nongnu.org, alex.bennee@linaro.org, rth@twiddle.net Subject: [Qemu-devel] [PATCH v2 4/8] 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 | 20 ++++++++++++++++++-- target-arm/op_helper.c | 8 ++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/target-arm/internals.h b/target-arm/internals.h index 34e2688..4e9d9f5 100644 --- a/target-arm/internals.h +++ b/target-arm/internals.h @@ -383,13 +383,29 @@ 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_16bit) { - 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_16bit ? 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); + } else { + /* If ISV is zero, the IL field should be set to one. + * See ARM ARMv8 D7.2.27 for more details. + */ + v |= ARM_EL_IL; + } + 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 7e845d5..2522d3c 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, 1); 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, 1), target_el); }