From patchwork Thu Mar 7 17:04:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 159911 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp7698142jad; Thu, 7 Mar 2019 09:30:58 -0800 (PST) X-Google-Smtp-Source: APXvYqzqmHR6xV/Aq0waJOXBL2pb6WRWMdgCCXMHb+8S5+zFn4niqOxB99GFQIcVhWonDSXLflrN X-Received: by 2002:a81:3dc8:: with SMTP id k191mr10981557ywa.139.1551979858737; Thu, 07 Mar 2019 09:30:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551979858; cv=none; d=google.com; s=arc-20160816; b=QgcU67fwToHNvJLsNkGNbOaGZWGqQNbhlSJSXXIEBtkxplliUbvQ4QlNZ8RPQ1Px55 SV9CyPe5C3nA125MHe7ic6B2k8ezxn6xnTRFITA7ojbIAwQAo4sGHVXIEU4VvzB6IQrU sPVZrMMrxiqisRD/i7T84V+vovmQp+Lk13OndzhNHh6DTwOjGw7rL32azpyNf8XfxJum /AlM3rwrk2/8Rn5UOHePUnnCcygIIHkqtNt45pn5W0WLulL3eStbpf5VdRX1Jb2ufUeD XcFs8MSLqL+8k679/FpS+loDJ/Dygdf7Ns8jjrJ1WXIWZA8Afe+mzYjQE2WYLiSyxh2f 3AEg== 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=bWRjfgz859wzAV/5eV6H6fpmIyaKUhYWZUGG1MpfC3kvZ3ZSl+wSb+uvkhP4+qZzv2 icYPpGFNspGyzXr01DknLBJ4JoOsDC6MUcAGwO6Og+/gnECBjmQrl017e2JlHLb/5AUj mbhWh6tcu0vUpWtrPZkkaUKA1oeD+ebAk2M/DtFks/oELMdtHP5/Gha/IeJNtRQ1nNU+ XMCxCmM2WW8ihV5Z8dT5eHMOncz9KHjPhm4qtz3mRYtD+gJ7wY6HUYWnvXLQLPDWwoRa 5FuH4N7GEEBAZ9NFC8Yrm43CPo1QSHE4w700oyBdzo1nyu6QeCFUsom9OVL6NdSMR6cA pXwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=xMe3HR02; 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 z207si3279896ywz.31.2019.03.07.09.30.58 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 07 Mar 2019 09:30:58 -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=xMe3HR02; 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]:56019 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1wrC-0003Fh-3X for patch@linaro.org; Thu, 07 Mar 2019 12:30:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1wTY-0007WP-7L for qemu-devel@nongnu.org; Thu, 07 Mar 2019 12:06:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1wTW-0006aM-Ty for qemu-devel@nongnu.org; Thu, 07 Mar 2019 12:06:32 -0500 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:44353) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1wTV-0004Ri-U2 for qemu-devel@nongnu.org; Thu, 07 Mar 2019 12:06:30 -0500 Received: by mail-pg1-x543.google.com with SMTP id j3so11726954pgm.11 for ; Thu, 07 Mar 2019 09:04:56 -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=xMe3HR02vyZPx+KjvoL9dFfJro0088bfV3XqMVzBIPVgqBcDoLgn7zTqDk5CjPM58d CGwM6PKQ5Ej6iOsCyumJXKtzTaJKFYYKpynoXsOk5DBwCpTy53ETx7uu6/7FX830A33e l/mxWhPs0PbBHVf2zsCVFrR0vZ8OaD7zL4SAZDuw0FQvmdl3/P9Luw/4FUfFYBwcXGh7 YYJR248Be4pHKeYIke9Zn64fh/X3Asu5m04DN+mzfGzJ/hbNV85TWARpGE45Wg+k+Jzs Glt6eFAfLFhJLwl5ftVuBpYTKX+UlEi+/DKC40ycfAVB6vi9eWW4h9AsWTTJJhg5/RwU Yvow== 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=UEqw+aBw2SXatU9Y61U/zyrCDAmtGWeQeIs1cUNg4qplu6uFqQoCHAbg+IUnvuYphL tvm8BLypoQiqF61Y1lUmCSlYS7Og37n4QF1+UHJNpfkCTLkMLlbg+OWaI8Hf/fJcfDqa IOWU16sqY3lCtFvf6vFqetfLzlsoGGHb0Eyos4fl9Tmph4YBD595knwYdI+dJDAPMPvb 8DkDAa8KwncrBOAYdkdHsFakM6PK1x/via6B40oAEDwHk0f1ed9Ly1xSHrpxkrnPyBtG a71Cfe8wwJONtA7ZlvVQK4ItWBUkIJ+ZoNh+QQJbEi/nkKdvj2YhHKaHJuXrCcUX8C7U uQoQ== X-Gm-Message-State: APjAAAU0+mVoOfnte6vDo3k4KHqGbR5y71XhUPKNMCLHe7iAMauUdp8Y 3XUT5WPaFDtz6oSBYXPHCtemI9T7RA8= X-Received: by 2002:a63:584e:: with SMTP id i14mr12408212pgm.68.1551978294975; Thu, 07 Mar 2019 09:04:54 -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 r82sm10040562pfa.161.2019.03.07.09.04.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Mar 2019 09:04:54 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 7 Mar 2019 09:04:28 -0800 Message-Id: <20190307170440.3113-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190307170440.3113-1-richard.henderson@linaro.org> References: <20190307170440.3113-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::543 Subject: [Qemu-devel] [PATCH v4 10/22] 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 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