From patchwork Tue Aug 3 04:14:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 490847 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp308168jap; Mon, 2 Aug 2021 21:21:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxn6p4mQf0QZ8xWDuaxfGxVuucC4yXOmideY8T8EMC5tmIhiXHhBFSkP75A5BS3M8zOzNu X-Received: by 2002:a25:541:: with SMTP id 62mr24345288ybf.367.1627964463279; Mon, 02 Aug 2021 21:21:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627964463; cv=none; d=google.com; s=arc-20160816; b=A50cCwm+T5xoAKDT7rAAxto04cZ+N9sqtVa0Prv+XzIhDEA9AN9FQwEiU6sg7Wr1+Z 5eSmxwFeVvALcTZV1myIfAuIhjB1qaTXwjwdp2KI1UcGdcO53g2XoyDMk280ja8Scs/8 EpzTa56ljH+WWl7Zo/hmlOeNihv+Z17/XASVjtTePdIy7wXau6uLfo2EoV1+gm1Uelvy ijHvekLupMdaQTow8P4lsQ3OdfDkS0XgSNG5efrUdpNFfFMty0PvAwjTyBfhnSL/PcyW cFffkczSq/wszoIzzngzpe9bZoNURosH3F9XmMFBmiYDznOkBn4e6ZOpOp1r2AOjvYgl IfJQ== 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=GXOlbQT0wGZicRa4Afgu+4pPip7Q2NUMioJcGG1uVyI=; b=H84NKWxxGERsWoLpz+lDzgRKtnKxYL+AhPS6bUVpzWyMcBNT/5CMAYUTCQxb9A+Ckp l3hB1ezWEetWKR6q34+dy8XmfRjdDSp4zVlnGu7obNYIkqElAgF6CaDq/s3pYPLvJBt/ bqBLNCeAfrOEqKwNb0QBpZzAf7O7zyTw5+NtiM4EaWmMZKeJ0JbthfSlDcFtjg8H7YoL /VAdIeEy31f6+JibDnQNNPoOa0e+v7ISV1yCVP++0rfJPaBWxN+YUQ+tpmZ2x9cbE9Oh HtRqWwdHgla9nVdzoVgeZxcy7crGs4G5yh4Xysvq9axp4lUwqBy8JqdVhPzlTGDK+Co5 x8SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L8hyDq7g; 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 p2si13359784ybl.413.2021.08.02.21.21.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Aug 2021 21:21:03 -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=L8hyDq7g; 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]:41284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mAlvK-000308-O7 for patch@linaro.org; Tue, 03 Aug 2021 00:21:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mAlpZ-00034J-90 for qemu-devel@nongnu.org; Tue, 03 Aug 2021 00:15:05 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:46823) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mAlpX-0002Bj-Hu for qemu-devel@nongnu.org; Tue, 03 Aug 2021 00:15:04 -0400 Received: by mail-pl1-x636.google.com with SMTP id k2so4598898plk.13 for ; Mon, 02 Aug 2021 21:15:03 -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=GXOlbQT0wGZicRa4Afgu+4pPip7Q2NUMioJcGG1uVyI=; b=L8hyDq7gkzmLPvYBe6B19El0Bsna1Td5Gmt2ZPtgFCLmNR3ZBLm12OfCyf8xdcWlkw hhY07QIpA047ZSpcchkg8OJVoaNKExeMetp0gebjquU+DTn3N8mt6ITYR58wWlAM/eF4 EuQK+tw7UhAvpVyNmu5hsI3wX+WigaBDGzwUm1fjCcYt3X+f3ZwPSK24bzpmD3N662HG y3qhsDLT52lffuY/P2L2h03C/jCbjl9W/gSnORbVhiPRonuVyyXnpkg2iHLs3hIEzYuA 9602c4v36D5RK4NvcfcgsQFzIoEDRuXi3m7I9Szei8t6E1k0M3FCw24wC0QGh2AAtWvE wPsw== 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=GXOlbQT0wGZicRa4Afgu+4pPip7Q2NUMioJcGG1uVyI=; b=YQXzAOKSh0ybiEbF5yHla2fBavfq/SRKXGaLLXKy/Ew2lKCjnQs3cYtAoS2ZUqquob +ESS5Kou/NEqmwu5ojIaCA1fXFNLCvw0PHYLXL8P7K+e2oagygj7/T8fhdZOkzhDVGoo wSAHSGb0fgpm0rCv8OijkfrkHLGzQeZRffZuTEXNVbzR83R9i1wdz+bCaiUnhQyAvldc 0IQpTLtgSJNgFJQQ87HYxaxS66X5mn9O3/n/luODWzmYqt94dpodWLs39l5i61lGFv6g 8KkvSX9D7OAKFqiCiPa+opJxv47q3ZRZtQvuSsyfi9Zdg80oZfI6hsG8VEp0mZ3z5moM GhIg== X-Gm-Message-State: AOAM532sy3eymtB2KAVMP8wyt6QDyZqtaMYI2V3/5fORzhHrpBgV+dux 5yJt0wp2neqP+KfB/MFmrRhcuCnjPx8lhg== X-Received: by 2002:aa7:848e:0:b029:333:4742:edb3 with SMTP id u14-20020aa7848e0000b02903334742edb3mr19675119pfn.12.1627964102229; Mon, 02 Aug 2021 21:15:02 -0700 (PDT) Received: from localhost.localdomain (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id c23sm13718532pfn.140.2021.08.02.21.15.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 21:15:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 14/55] target/sh4: Implement do_unaligned_access for user-only Date: Mon, 2 Aug 2021 18:14:02 -1000 Message-Id: <20210803041443.55452-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210803041443.55452-1-richard.henderson@linaro.org> References: <20210803041443.55452-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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: Yoshinori Sato Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Cc: Yoshinori Sato Signed-off-by: Richard Henderson --- linux-user/sh4/cpu_loop.c | 8 ++++++++ target/sh4/cpu.c | 2 +- target/sh4/op_helper.c | 3 --- 3 files changed, 9 insertions(+), 4 deletions(-) -- 2.25.1 diff --git a/linux-user/sh4/cpu_loop.c b/linux-user/sh4/cpu_loop.c index 222ed1c670..21d97250a8 100644 --- a/linux-user/sh4/cpu_loop.c +++ b/linux-user/sh4/cpu_loop.c @@ -71,6 +71,14 @@ void cpu_loop(CPUSH4State *env) info._sifields._sigfault._addr = env->tea; queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); break; + case 0xe0: + case 0x100: + info.si_signo = TARGET_SIGBUS; + info.si_errno = 0; + info.si_code = TARGET_BUS_ADRALN; + info._sifields._sigfault._addr = env->tea; + queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + break; case EXCP_ATOMIC: cpu_exec_step_atomic(cs); arch_interrupt = false; diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 8326922942..b60234cd31 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -238,10 +238,10 @@ static const struct TCGCPUOps superh_tcg_ops = { .synchronize_from_tb = superh_cpu_synchronize_from_tb, .cpu_exec_interrupt = superh_cpu_exec_interrupt, .tlb_fill = superh_cpu_tlb_fill, + .do_unaligned_access = superh_cpu_do_unaligned_access, #ifndef CONFIG_USER_ONLY .do_interrupt = superh_cpu_do_interrupt, - .do_unaligned_access = superh_cpu_do_unaligned_access, .io_recompile_replay_branch = superh_io_recompile_replay_branch, #endif /* !CONFIG_USER_ONLY */ }; diff --git a/target/sh4/op_helper.c b/target/sh4/op_helper.c index d6d70c339f..b46fc1bf11 100644 --- a/target/sh4/op_helper.c +++ b/target/sh4/op_helper.c @@ -23,7 +23,6 @@ #include "exec/cpu_ldst.h" #include "fpu/softfloat.h" -#ifndef CONFIG_USER_ONLY void superh_cpu_do_unaligned_access(CPUState *cs, vaddr addr, MMUAccessType access_type, @@ -46,8 +45,6 @@ void superh_cpu_do_unaligned_access(CPUState *cs, vaddr addr, cpu_loop_exit_restore(cs, retaddr); } -#endif - void helper_ldtlb(CPUSH4State *env) { #ifdef CONFIG_USER_ONLY