From patchwork Thu Jul 29 00:46:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 488631 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp1708156jas; Wed, 28 Jul 2021 18:02:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlXyLCfYMybYVc+lPWF/fwjd8Ie7NMxgy2XDZkRLYvorGGxQ2TwVOgubP4FymoZenq9P+w X-Received: by 2002:aa7:ca0d:: with SMTP id y13mr3040297eds.67.1627520550602; Wed, 28 Jul 2021 18:02:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627520550; cv=none; d=google.com; s=arc-20160816; b=Rwc3Cf8NywR9WNyuWjdYXTtpDK8fwAqGf0z8QHqOERgK/kzwvM2FvMphE4zlO+xm3g +hYy1veNlX6tM/EhSFPfxOIftc30/Hu3wsAW12y8+1fiBmI8e/axCJ0A908wIhhsnFJJ vxmbQfAXtNmUZwiP3sHx3/lhN3MODK5dPebbYGUnJ9pwKBF/6LdN+hc0FHxCL/CXq436 p2Y9jdAJ2GEAJEyiXvKoMmjHi20BeHdorO9MkFfQ6l+7YMZcPKCfB3YEOqOjVn3hMIoG gQFBSe9RfOmHvcY7+Pskyh/0ey2Twok7ozRUHK73srY20dyWDjgn/4u2iuu+E5M2weJc G62w== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=DmXl9DvoFiIMYZO3Xai8Zh+D5bFlHeruBJIEw/zNnu0=; b=bp1qE9dFAXwqzFIPdmyR5HqV6Brods23x02a4gcd36b2j06jdhcMXp2WXYM17zv51t l+Dzh3uKOJyuvfwnP4DAL9rNL6/zkJ31G+EIa4/D+50mAsOYk5MXZtqW11ASDF/mRADN MCi+5f8ugNh9705qtZH4lPr4z/VSn2LOb86bQD9aCzDeAXScxcvUVUDTHCuItWOhLWLa 9cRNEo+g+pqMqmMF35XSr7N+mKABrGWYTKYkRl11mcXOBw1+3YoKXBzczuavFA8HteAO 53FU9b5eUlvIuB4+jSRIVhRZcLUNVhJ6SemSK2sAAFYiD2VbY2UK6SBuahtZEICSAZ/d 5lWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R+5tWCz5; 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 o20si1354625ejm.682.2021.07.28.18.02.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Jul 2021 18:02:30 -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=R+5tWCz5; 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]:38654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m8uRR-0003MN-LE for patch@linaro.org; Wed, 28 Jul 2021 21:02:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8uCf-0004Mc-BY for qemu-devel@nongnu.org; Wed, 28 Jul 2021 20:47:14 -0400 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:43737) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m8uCc-0002Zf-LV for qemu-devel@nongnu.org; Wed, 28 Jul 2021 20:47:13 -0400 Received: by mail-pj1-x1029.google.com with SMTP id m2-20020a17090a71c2b0290175cf22899cso6744132pjs.2 for ; Wed, 28 Jul 2021 17:47:10 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=DmXl9DvoFiIMYZO3Xai8Zh+D5bFlHeruBJIEw/zNnu0=; b=R+5tWCz5jLWqj0lkcMnzXoE28H0K7C2+VvqSLR3EqtgBKwQfnazDd4eye+oivhoeTp S0h3DPbErG/b0dH8LonbAc3fojr0qGRgjV7utRSsLN7Y2NGfROdBTgVIyXSPRFfMuBKK I0USGl6VpoXSGHOSXx51ozhd/VlR7s3N1Qq4dbfh7Z9awx4R9K2ScSoGN8I+SamogGlJ 4gYr+oni4OrQgr55/nDLFkMVK/Cd0IYFN53KdIquWd+IpbegA6csv/Zrfb6wfls9bP19 uYpivBwna41oW1XxNN1rUqwBRpW4j0e1YYjqA622g61qWPhEoIAEhnBm8MiO93cITkHN XZTw== 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:mime-version:content-transfer-encoding; bh=DmXl9DvoFiIMYZO3Xai8Zh+D5bFlHeruBJIEw/zNnu0=; b=KEe+L34shjT6Ux3MVO1eNm6DNo+Grqh84PAK8Y+2ECgbcjQR4uKVX7BQ8OqG0kbaPh ee7A5J9icT67uZNhaJzFVZJ8xZ/qIMXg1LPKu8+BGgf4vV9wP6/2wfSN9Nquchg/31SG LgYHHM42zfn/HIwW4fmcA3yyljPHM6TTRnnz+IIDd2Kj7LHxeL4MkfyLsU9stih/7zjv o9b0lhSrGWetJIMTUhn22AvycdWmu5BTNkU09OGikkGqxIdSsbiij7aIkLzl7mwXkYLU Tc/FSxBNgBWBQxWeR5oGDaEXKF/4pNzkLHn3jJo64eIpQ8saaldvMhTygTvMmopHJBNm sKLA== X-Gm-Message-State: AOAM533KeHS5ZXIAqt5llbK10Y3LZmCeGPOhze0OVgNLBf+NlJ3tptbL O4i33GhgEShgQ7KWTZrxfxCmlBqgW/KWTw== X-Received: by 2002:a17:90a:7d02:: with SMTP id g2mr2427227pjl.168.1627519629502; Wed, 28 Jul 2021 17:47:09 -0700 (PDT) Received: from cloudburst.home (2603-800c-3202-ffa7-dcaa-9e71-a2b2-2604.res6.spectrum.com. [2603:800c:3202:ffa7:dcaa:9e71:a2b2:2604]) by smtp.gmail.com with ESMTPSA id t205sm1305005pfc.32.2021.07.28.17.47.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jul 2021 17:47:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH for-6.2 16/43] target/xtensa: Implement do_unaligned_access for user-only Date: Wed, 28 Jul 2021 14:46:20 -1000 Message-Id: <20210729004647.282017-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210729004647.282017-1-richard.henderson@linaro.org> References: <20210729004647.282017-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Cc: Max Filippov Signed-off-by: Richard Henderson --- target/xtensa/cpu.c | 2 +- target/xtensa/helper.c | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) -- 2.25.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 58ec3a0862..41816d91f6 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -195,11 +195,11 @@ static const struct TCGCPUOps xtensa_tcg_ops = { .cpu_exec_interrupt = xtensa_cpu_exec_interrupt, .tlb_fill = xtensa_cpu_tlb_fill, .debug_excp_handler = xtensa_breakpoint_handler, + .do_unaligned_access = xtensa_cpu_do_unaligned_access, #ifndef CONFIG_USER_ONLY .do_interrupt = xtensa_cpu_do_interrupt, .do_transaction_failed = xtensa_cpu_do_transaction_failed, - .do_unaligned_access = xtensa_cpu_do_unaligned_access, #endif /* !CONFIG_USER_ONLY */ }; diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c index f18ab383fd..a5296399c5 100644 --- a/target/xtensa/helper.c +++ b/target/xtensa/helper.c @@ -242,6 +242,21 @@ void xtensa_cpu_list(void) } } +void xtensa_cpu_do_unaligned_access(CPUState *cs, + vaddr addr, MMUAccessType access_type, + int mmu_idx, uintptr_t retaddr) +{ + XtensaCPU *cpu = XTENSA_CPU(cs); + CPUXtensaState *env = &cpu->env; + + assert(xtensa_option_enabled(env->config, + XTENSA_OPTION_UNALIGNED_EXCEPTION)); + cpu_restore_state(CPU(cpu), retaddr, true); + HELPER(exception_cause_vaddr)(env, + env->pc, LOAD_STORE_ALIGNMENT_CAUSE, + addr); +} + #ifdef CONFIG_USER_ONLY bool xtensa_cpu_tlb_fill(CPUState *cs, vaddr address, int size, @@ -263,21 +278,6 @@ bool xtensa_cpu_tlb_fill(CPUState *cs, vaddr address, int size, #else /* !CONFIG_USER_ONLY */ -void xtensa_cpu_do_unaligned_access(CPUState *cs, - vaddr addr, MMUAccessType access_type, - int mmu_idx, uintptr_t retaddr) -{ - XtensaCPU *cpu = XTENSA_CPU(cs); - CPUXtensaState *env = &cpu->env; - - assert(xtensa_option_enabled(env->config, - XTENSA_OPTION_UNALIGNED_EXCEPTION)); - cpu_restore_state(CPU(cpu), retaddr, true); - HELPER(exception_cause_vaddr)(env, - env->pc, LOAD_STORE_ALIGNMENT_CAUSE, - addr); -} - bool xtensa_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr)