From patchwork Fri Jun 26 15:13:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 191852 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp596281ilg; Fri, 26 Jun 2020 08:36:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPn7IsgyKc/LeyjSUUe/xXo8jHiWv1dDnbL2HuxFwigCK1uwt+x2jhjUHf29pN02fTMcyr X-Received: by 2002:a25:ad57:: with SMTP id l23mr6555258ybe.277.1593185779346; Fri, 26 Jun 2020 08:36:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593185779; cv=none; d=google.com; s=arc-20160816; b=zfChfmMUcavROmQfx+PUDRz79ot409a1miAeMTNT7hRdcyvDKWaQTJHufKi0+wDK49 B4qpjHF9yt8MKT2+HlAokrH1LuqjFLQBtNxjO+kohavGtXgSpAbpwV05Uq9eeFE5rQsR r8Bwhh+bfirq/RlyMJDUOhTTC7YBYC0nNNhbJT20cadZBdHQJ3yBTvAdERkWclso4dBl mRPR2N92b2d3Iz1rJQgofs+1lRLtmTHOSADJHn9HMXRJOAzcqKvXyJGv36FFVgkGAYhX iC5fPbTPizcKVkR+w/jMaOj/NLBcjgOkA+aGI7IFn2JBGzNxzYHsS1pOyWAo4/VB65Qy l1Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Z3WhPCSbc/ErEx8VXjma/l1Goh9ApGA8m0ZTZ011C2o=; b=RFjdxsuTNAYraHH+xvr70k9LsUNJRyZu9IAZ4AzwLwSGpdWueX18KUIGdj5fesYo/5 Ego/oknxd6zMm7x6mCq+OZ9n3FnDsAotZQAzXnGLFVSGIkOB9o+efPzjnUR6HyvY3alu hYS+Yal3gRDi3xIPcvjIz87hjihVNwkrZW1E5TQItcXllGXM9hY1UG7vAhg72+hnDMLU ZGUrvXLgojEVXMaLdDa1Pe36yP0nHrx2reUaJOKyQRS8U6mb/86n5h3gGZ0ij3hiHF0k cFBC2ikzv4h3GmwxTm3IcbZ0sLysHzlLb1a36Fmg548PWaOMe2HB/uBMB1vPVDEVY57E oirw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W68PDnB8; 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=pass (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 d142si25750587ybh.180.2020.06.26.08.36.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Jun 2020 08:36:19 -0700 (PDT) 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=pass header.i=@linaro.org header.s=google header.b=W68PDnB8; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:47306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joqOo-0004uY-MZ for patch@linaro.org; Fri, 26 Jun 2020 11:36:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joq4C-0002dD-19 for qemu-devel@nongnu.org; Fri, 26 Jun 2020 11:15:00 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:41706) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1joq4A-0006Tr-8j for qemu-devel@nongnu.org; Fri, 26 Jun 2020 11:14:59 -0400 Received: by mail-wr1-x430.google.com with SMTP id h15so9845550wrq.8 for ; Fri, 26 Jun 2020 08:14:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Z3WhPCSbc/ErEx8VXjma/l1Goh9ApGA8m0ZTZ011C2o=; b=W68PDnB8XVh76ZTvt739lPw4floRS3q6OJisncP8jyctXY8j8DFijsJZuIiTlbedwZ IyPr/HH6x+ndy2jJanf+Vzc1opzPW9N6bDN3STJvHyzAXkQo6IlnQk3anHLY+Bet8g4s FvrR6UFUE3yVwBBlZILutSXrL8uUBkZ5o6Mhe5+/5V+d+Oa3h9R5MjS+nzVysBQoxWI4 zpS9LYnxgv2OdYBXirx3CVf3S+xArStEL+fdnDem01su/JQZzLpkfD5E4MMCIMQm8k90 k9LKbU1wBYcm53sIYcqD2YZAZ+IW5VtIeuvzQ41U3HEisUbjZH59ukY1m31ht2m1D+h7 +UPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Z3WhPCSbc/ErEx8VXjma/l1Goh9ApGA8m0ZTZ011C2o=; b=QlZsNAIfJ+9TJ+sEfyYG8O+ZlF2Zxgovj+/M8LJwKnvO8XgILEp3uVMXSIHBTqNnx5 3dESgnYEp3NX5LmCcJdBOTOHBlsOurXjs358TfFUbfhL7oMguVFI89Sem4Bx6rdlnDiI L99mfb9qziRhzgLebH8MHq3xJbslzH5jE65pUoOgFRGZA2jX1XTVdRSeroTL3m16xbau gFIGHXoOdSrSyv5eNde1qug/KpukUC1eh3a/wVeAxYnP6OD1Nu/9CR36oztE/5mczbVl cVSjq0374BrHCu6wouLy+IJoBPGf9HHu3Rx3jqYRhNuH+pMo8J98nWP510HJLGCzQGEZ VOEQ== X-Gm-Message-State: AOAM533WXmLZROOrT9i5/1QX+25UN1VosuEv3MUjgbr+hqLR7JUnm00x IWiA2RgMplvCgPqSwS8PUoWxpyE/lNL1yA== X-Received: by 2002:adf:8067:: with SMTP id 94mr4093422wrk.427.1593184496559; Fri, 26 Jun 2020 08:14:56 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id w13sm37838852wrr.67.2020.06.26.08.14.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 08:14:55 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 26/57] target/arm: Define arm_cpu_do_unaligned_access for user-only Date: Fri, 26 Jun 2020 16:13:53 +0100 Message-Id: <20200626151424.30117-27-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200626151424.30117-1-peter.maydell@linaro.org> References: <20200626151424.30117-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x430.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Use the same code as system mode, so that we generate the same exception + syndrome for the unaligned access. For the moment, if MTE is enabled so that this path is reachable, this would generate a SIGSEGV in the user-only cpu_loop. Decoding the syndrome to produce the proper SIGBUS will be done later. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20200626033144.790098-15-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/cpu.c | 2 +- target/arm/tlb_helper.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/target/arm/cpu.c b/target/arm/cpu.c index e44e18062cf..d9b8ec791ed 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2169,8 +2169,8 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) cc->tlb_fill = arm_cpu_tlb_fill; cc->debug_excp_handler = arm_debug_excp_handler; cc->debug_check_watchpoint = arm_debug_check_watchpoint; -#if !defined(CONFIG_USER_ONLY) cc->do_unaligned_access = arm_cpu_do_unaligned_access; +#if !defined(CONFIG_USER_ONLY) cc->do_transaction_failed = arm_cpu_do_transaction_failed; cc->adjust_watchpoint_address = arm_adjust_watchpoint_address; #endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ diff --git a/target/arm/tlb_helper.c b/target/arm/tlb_helper.c index 7388494a554..522a6442a48 100644 --- a/target/arm/tlb_helper.c +++ b/target/arm/tlb_helper.c @@ -10,8 +10,6 @@ #include "internals.h" #include "exec/exec-all.h" -#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, @@ -122,6 +120,8 @@ void arm_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, arm_deliver_fault(cpu, vaddr, access_type, mmu_idx, &fi); } +#if !defined(CONFIG_USER_ONLY) + /* * arm_cpu_do_transaction_failed: handle a memory system error response * (eg "no device/memory present at address") by raising an external abort