From patchwork Mon Feb 11 23:52:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 158054 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3214228jaa; Mon, 11 Feb 2019 16:12:36 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibu32JV3l0dxmiuahSJWfgDvCq/nb3vfpZpUnrLyVQxS79Sj4vsvSj+Fcqd0lFfMKsmssOg X-Received: by 2002:a25:2102:: with SMTP id h2mr688408ybh.363.1549930356515; Mon, 11 Feb 2019 16:12:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549930356; cv=none; d=google.com; s=arc-20160816; b=y9AvX1468GEDu9WybmDw3CDRD4JOoVuUmU8Mb8rXtPRMmwJWanlgINWahGhQutEsm6 Cx78kP0t1uDg3OdpkkRegkSpQ2/gofjvT2dRXeDXsCKDHwqjuSafjPP7Pz6hkjnrHTty 92QMW/4p5vemalADPcPZcbzukFEhtdRXEnOe+tNey/u3Cb2Am3gjTEVQCUe03j9GqNXF WDkS47fB7LfiuWKeoiqPeVUZox5RR745f+alhGRNuxqnongAvUpJcqmMOQFOLjCROkDk EOG0iqS20oXyfdj5tiYSgaJQVmgp4a3BeEtvAUA2MUC9svjiMRghzCyMSLe7XSNogRws rYiw== 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:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=AmqIDdbNf59JA1t3/NmXQ2mwEInbv+gIdpyKJXCMyoQ=; b=CGVIxmZXQFpPugIUwBozHSN+bCLxOyxdJW3GCmCGikg1rWnimdTXuzn7ZRF+8GPoNy TojLMNL2Ktk5jeyZ+h0I3p5TIXChNj2zX8zv/eD9SthSC6nFVAFN4gKYspHW3ioYRDxT nF2ChW472EDPzfxLRuNwIwEjrAW+9Q3FpJ8oRUMkkL/W2ba6E2rDaOnDTAlZ071rqbpD 8PWyJt/k8N2U/lTJSERyOKSg32zkz/sfS9u3ASBrh8xOILHSGy+94lg/BHlVF2X1AU3d PPutYSTzipEEi+A4UCRDps/6bQSijI0rVshVc4EvjBdBarTHHSw4+OXsHjWt4BOeE3FK C4JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=kpTRBcPR; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k7si6794521ywa.335.2019.02.11.16.12.36 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 11 Feb 2019 16:12:36 -0800 (PST) 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=kpTRBcPR; 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 ([127.0.0.1]:58431 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtLgh-0002b1-Q6 for patch@linaro.org; Mon, 11 Feb 2019 19:12:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtLOi-0005tB-K2 for qemu-devel@nongnu.org; Mon, 11 Feb 2019 18:54:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtLOg-000533-4I for qemu-devel@nongnu.org; Mon, 11 Feb 2019 18:54:00 -0500 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:35021) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gtLOf-0004T5-Ct for qemu-devel@nongnu.org; Mon, 11 Feb 2019 18:53:57 -0500 Received: by mail-pf1-x441.google.com with SMTP id z9so344620pfi.2 for ; Mon, 11 Feb 2019 15:53:20 -0800 (PST) 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; bh=AmqIDdbNf59JA1t3/NmXQ2mwEInbv+gIdpyKJXCMyoQ=; b=kpTRBcPR1pjIbmKTUySdMX6vGJ3l+DDfNo6AvjTf2B8+LdoW9GwQHU4Ib4GiaFa966 KDuBHGbhVRJqYaGcZcUUVveZzeLBYuHA1JtlYCOlJDsMJ4HhVlXjVxQa/9kp9jM02fz1 G4uzk8PUcHCNW/Vy/jZEaWj8c7uxy4I7YzHZ4u0Mo+ye6HyZVZuykvi+sSpjDxiEonl+ b+Y04tfOq0+fwa+Yqa/nrlFa6Uon6TFspiH0j6GFTlQc675xUbfj0TVrz5KKOrpedJ+Z UuZAD30J/j1dNKTE5pMsB/UVmJ0DM5+RWr8cEOB3MlFocFYHM3rFd1K1qlqFR20+cmMZ BPLw== 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; bh=AmqIDdbNf59JA1t3/NmXQ2mwEInbv+gIdpyKJXCMyoQ=; b=Ml28+Vq8tL/Og4PvJevNTHZQhFa6LOPT4trcTn0vmPQhrWDtAxzguwt+db+WSnpMs1 qWEBX+zLqPvY1bemh7PBx1zFa1Gl0S8MYUXrtNKgvTNXHSkXqxFVBKFS395g37EDBHxL MKYutozIvMmVcbwQF2f7q8qQDtW0SXlgiRm+VZh5U5oS4LjCIMzjbMqEXa9BCh5eK9lY AByChMPodhW7pWixs15QQfxwzekkW9U9blchote/08gsUEa2frTKRpc3XK4NZ0ZS7Smi GZ+lfmXt7aMVzMgzdVvoEK5awOnJciTLwpGPxyNeOcMHsNDekaMZgm4nKQ5sFy5wmqNb Y2RA== X-Gm-Message-State: AHQUAuaEcsKQ2WEem7u3iiWR9d5z6bPaT3a+5hA/OQyMTM1SFqhI6j/P +B6HNv3FrxbWCCiC2hDWHF+AxHHiwIU= X-Received: by 2002:a62:4e83:: with SMTP id c125mr907167pfb.101.1549929199620; Mon, 11 Feb 2019 15:53:19 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id c4sm11861031pgq.85.2019.02.11.15.53.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Feb 2019 15:53:18 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 11 Feb 2019 15:52:44 -0800 Message-Id: <20190211235258.542-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190211235258.542-1-richard.henderson@linaro.org> References: <20190211235258.542-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::441 Subject: [Qemu-devel] [PATCH v3 14/28] target/arm: Define arm_cpu_do_unaligned_access for CONFIG_USER_ONLY 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: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We will need this to raise unaligned exceptions from user mode. Signed-off-by: Richard Henderson --- target/arm/op_helper.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) -- 2.17.2 diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c index 8698b4dc83..d3cf362e4b 100644 --- a/target/arm/op_helper.c +++ b/target/arm/op_helper.c @@ -87,8 +87,6 @@ uint32_t HELPER(neon_tbl)(uint32_t ireg, uint32_t def, void *vn, return val; } -#if !defined(CONFIG_USER_ONLY) - static inline uint32_t merge_syn_data_abort(uint32_t template_syn, unsigned int target_el, bool same_el, bool ea, @@ -179,6 +177,22 @@ static void deliver_fault(ARMCPU *cpu, vaddr addr, MMUAccessType access_type, raise_exception(env, exc, syn, target_el); } +/* Raise a data fault alignment exception for the specified virtual address */ +void arm_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, + MMUAccessType access_type, + int mmu_idx, uintptr_t retaddr) +{ + ARMCPU *cpu = ARM_CPU(cs); + ARMMMUFaultInfo fi = {}; + + /* now we have a real cpu fault */ + cpu_restore_state(cs, retaddr, true); + + fi.type = ARMFault_Alignment; + deliver_fault(cpu, vaddr, access_type, mmu_idx, &fi); +} + +#ifndef CONFIG_USER_ONLY /* try to fill the TLB and return an exception if error. If retaddr is * NULL, it means that the function was called in C code (i.e. not * from generated code or from helper.c) @@ -200,21 +214,6 @@ void tlb_fill(CPUState *cs, target_ulong addr, int size, } } -/* Raise a data fault alignment exception for the specified virtual address */ -void arm_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, - MMUAccessType access_type, - int mmu_idx, uintptr_t retaddr) -{ - ARMCPU *cpu = ARM_CPU(cs); - ARMMMUFaultInfo fi = {}; - - /* now we have a real cpu fault */ - cpu_restore_state(cs, retaddr, true); - - fi.type = ARMFault_Alignment; - deliver_fault(cpu, vaddr, access_type, mmu_idx, &fi); -} - /* arm_cpu_do_transaction_failed: handle a memory system error response * (eg "no device/memory present at address") by raising an external abort * exception