Message ID | 20210818191920.390759-44-richard.henderson@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp992569jab; Wed, 18 Aug 2021 13:02:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNgS4jli0tle6kv4o4CXcF3aoVLQ8Sq93z2f0AvZy8IjdW5tag73i1fOdnL3O/D47GkmCJ X-Received: by 2002:a17:907:7291:: with SMTP id dt17mr11764478ejc.162.1629316955490; Wed, 18 Aug 2021 13:02:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629316955; cv=none; d=google.com; s=arc-20160816; b=OYWkLh0EpR65H2cUIlcYBvCS5xiI6ApGm0YdkAC8mu9KO6Spc68O+wQpgZTO1gHcMT +zBxbU8qKlBbF4eGoPARF2v/UCX6CF9mpegKGh2YUjj9vIRC6D9TJSb6ZXExKDHwxvp/ P2DOau90KzAVQyrSGc38hnyMPl0URrIWnvomJpbpe8pJcBmiRB0Ax5/qJBj0uHHByQC3 rEE/FC5jUnlJ1m3F7lOL3bZRDZpH3dCB3sFnfjL1jV7wpDPg+hJeayCOPnUv6IvHM8le xITxG2gqCxpogVqdwEOYnxD14dEn+OIVbEY2E+7O/w3YYT2pawfn0ibrL9Fso+bpIWDu 6KVQ== 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=jWZckpkxE9uIH7Kemi/cAWTlru/8DfEcWtH0nqhtr9E=; b=rN/jneCgClf7IkiiRaSufkwqt8i2wONds0YKHtf6nED00xQA9kjowt3dW3EzSqb68e CjWUMBd8hsjZeDHYUPLCPMnp2FqsmfzEa92kW7CkMOOye/KVmNPVAMBWcBtDXlmgVqOO TtbW+o2AJTZSbkdL4Dcj4pDPxlk1+iAGYQa+JlU6dY17ArDJtwqlseAj524F8UnG/Jun kR9nWx3+QqyR669kNhZm2RlGUfEF0KPcQD3rCu+tuCRqrbOPNkpNIRedH5FPWg1tVrhj M5TD965XWiYq1r2IgAMcIoHZrtcR/INKHqtxIslG6yet1t8SjOO9rYOJ1djiT3UxJARv ed/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=QXAF9Us2; 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: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f20si859221ejd.329.2021.08.18.13.02.35 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Aug 2021 13:02:35 -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=fail header.i=@linaro.org header.s=google header.b=QXAF9Us2; 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 ([::1]:50564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+patch=linaro.org@nongnu.org>) id 1mGRli-0003GE-66 for patch@linaro.org; Wed, 18 Aug 2021 16:02:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1mGR9k-0006ny-6N for qemu-devel@nongnu.org; Wed, 18 Aug 2021 15:23:20 -0400 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]:51061) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1mGR9i-0002fh-KW for qemu-devel@nongnu.org; Wed, 18 Aug 2021 15:23:19 -0400 Received: by mail-pj1-x102d.google.com with SMTP id bo18so3382363pjb.0 for <qemu-devel@nongnu.org>; Wed, 18 Aug 2021 12:23:18 -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=jWZckpkxE9uIH7Kemi/cAWTlru/8DfEcWtH0nqhtr9E=; b=QXAF9Us20mae24KwME5FPRzgh9yIgjcXe8I8rGdZDrV4A37RkTpTAbCz7keOQHHmJN m/EWyhV/3RTOBiuEehuCPkrwLf8BnK28nQi59R3mmfTfkFT6gS1XQtw25mv45Cy0ImeQ D8xE0DLmPVVoywYqwdZQiB8CzAmxgPxBLP50TjwmY/ba6SUztopNoQRm0bZxZmUVrhvQ 7gzI2MPAZErVBmSa2GhJu4d7gkHvxFlJfn113AdRg48Wu6fRL7g9M4owWbKF3h3jT1dX WChW/WtOfxzmtoKxXBtOlAnS6i3wUuN2lCF1+4lg9hctcIgYpdD3LBNA2RCp6KLS8R8H jjHQ== 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=jWZckpkxE9uIH7Kemi/cAWTlru/8DfEcWtH0nqhtr9E=; b=K9TtBAWr/nifUwbIxnstEOWxJtmlUC+yCys2AwRKkGAdcG/Bdnqk+fe3QH/lbnjOgq YzSAPCXAPW2SP055CIEfTmELBqKuzygu3EhzzkhCgBbLliGy9Evi2Sf5ZsO+QkQzI4R7 AntjGyS8jVxav3UENeQsRthOMdX6P/S4/1//RpOoSoOkxwG+DC4zZzkwlkfB2AaX0noG Uiq3RTRHOkVV+SvphwR0DUOb3/qZHYXx49X0i4fMOv934r9T7DQAeajz8vwofyDKpfbK jt9S1im4hvq7xeBhR3cVduUx7kTEsRY14PaqDGR+wPOkbNgoV6eJD7aM8aOBUVnEySFf W6wg== X-Gm-Message-State: AOAM5329ZFAUzKSrXTSnvvWMwkm4UrECyEYBJBq0K3c+2sny7flLylpU q1efpdnViFfLETgaex+7knWeUcy0hjM+9w== X-Received: by 2002:a17:90a:8b12:: with SMTP id y18mr10867405pjn.72.1629314597385; Wed, 18 Aug 2021 12:23:17 -0700 (PDT) Received: from localhost.localdomain ([173.197.107.15]) by smtp.gmail.com with ESMTPSA id w82sm569302pff.112.2021.08.18.12.23.16 for <qemu-devel@nongnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 12:23:17 -0700 (PDT) From: Richard Henderson <richard.henderson@linaro.org> To: qemu-devel@nongnu.org Subject: [PATCH v3 43/66] tcg: Add helper_unaligned_{ld, st} for user-only sigbus Date: Wed, 18 Aug 2021 09:18:57 -1000 Message-Id: <20210818191920.390759-44-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210818191920.390759-1-richard.henderson@linaro.org> References: <20210818191920.390759-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.google.com 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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patch=linaro.org@nongnu.org> |
Series |
Unaligned access for user-only
|
expand
|
On Wed, 18 Aug 2021 at 21:03, Richard Henderson <richard.henderson@linaro.org> wrote: > > To be called from tcg generated code on hosts that support > unaligned accesses natively, in response to an access that > is supposed to be aligned. > > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> thanks -- PMM
diff --git a/include/tcg/tcg-ldst.h b/include/tcg/tcg-ldst.h index 8c86365611..bf40942de4 100644 --- a/include/tcg/tcg-ldst.h +++ b/include/tcg/tcg-ldst.h @@ -70,5 +70,10 @@ void helper_be_stl_mmu(CPUArchState *env, target_ulong addr, uint32_t val, void helper_be_stq_mmu(CPUArchState *env, target_ulong addr, uint64_t val, MemOpIdx oi, uintptr_t retaddr); +#else + +void QEMU_NORETURN helper_unaligned_ld(CPUArchState *env, target_ulong addr); +void QEMU_NORETURN helper_unaligned_st(CPUArchState *env, target_ulong addr); + #endif /* CONFIG_SOFTMMU */ #endif /* TCG_LDST_H */ diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 46b74b5f70..6a3fec3002 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -27,6 +27,7 @@ #include "exec/helper-proto.h" #include "qemu/atomic128.h" #include "trace/trace-root.h" +#include "tcg/tcg-ldst.h" #include "internal.h" #undef EAX @@ -867,6 +868,18 @@ static void validate_memop(MemOpIdx oi, MemOp expected) #endif } +void helper_unaligned_ld(CPUArchState *env, target_ulong addr) +{ + cpu_unaligned_access(env_cpu(env), addr, MMU_DATA_LOAD, + MMU_USER_IDX, GETPC()); +} + +void helper_unaligned_st(CPUArchState *env, target_ulong addr) +{ + cpu_unaligned_access(env_cpu(env), addr, MMU_DATA_STORE, + MMU_USER_IDX, GETPC()); +} + static void *cpu_mmu_lookup(CPUArchState *env, target_ulong addr, MemOpIdx oi, uintptr_t ra, MMUAccessType type) {
To be called from tcg generated code on hosts that support unaligned accesses natively, in response to an access that is supposed to be aligned. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- include/tcg/tcg-ldst.h | 5 +++++ accel/tcg/user-exec.c | 13 +++++++++++++ 2 files changed, 18 insertions(+) -- 2.25.1