From patchwork Thu Jul 29 00:46:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 488627 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp1705546jas; Wed, 28 Jul 2021 17:58:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxY6KygIYaqeJ8QUkqN03DKhqnfILGF6g/INoF/j0DvmL3heYMS2xRNGbhIiuKpHExBebEz X-Received: by 2002:a5d:83c4:: with SMTP id u4mr1843158ior.21.1627520329331; Wed, 28 Jul 2021 17:58:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627520329; cv=none; d=google.com; s=arc-20160816; b=KtlmIRz8WRQzikKdsDkNVKgrsWhm9RVurSotZmeX6eSFPNisRyml9ZF1Y0UdXJYlb+ 9dUcggQBTfy5Vr57mnlxbyKkgcixlV6idoSizVibT0DLtgNii9tUkCSk7mFV+8LnJAZo qX0asnA4EujjVIhGtgKn1q7XFR47QbnCb+reORHsAqVILmRuTn0CqdOVzpkDFSY4UY3Y L1GkNps0SMnDP3SzaN+SiujAokhxMBzlHxXFh/+ohhkjk5B+Dp1vGzFUPJBIQw9BvZBp VevRT5hiGJ94+U7wSzZkkkx5TKuihIizxiKkZOMbLJ/U9sCsNIxsCkFXHzh5qihiDKGY PpTw== 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=GsG/mGwD/IYF/92cwqqDJk3mRh5qwD8ZIzWLNfv5xQzIXLNFINU/JBjmRtHaFuuKW3 30mNvLjCQc0pOYLmkY8Dk5Jl2QP8hEH/e1UhVhbeCzUTgCZGsdlZzd8i/arshw9kl0Z/ +rBcD7NhzABuu/lqjBiYhqxsT+oEjZ2drUMiwawq8M7YFlnNzTMPlWypMLvznuR+kZk6 zER3DcvVdIi4nRWa+oCBKhJH47XwWVx5uL7LaMaidDp+zSyvNPcssn+1zureFYgJsGNF tz3G1xXreATSbvqJSEo5cyEcc2Lpn1BJx/yZnx+TNSqrc4K3RVyvilSwWyMvisaE3i6i b78A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r2GbXBeT; 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 f6si1794556jav.23.2021.07.28.17.58.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Jul 2021 17:58:49 -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=r2GbXBeT; 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]:58260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m8uNs-0005ti-MV for patch@linaro.org; Wed, 28 Jul 2021 20:58:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36926) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8uCZ-0004KW-NS for qemu-devel@nongnu.org; Wed, 28 Jul 2021 20:47:07 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:53204) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m8uCY-0002WT-0N for qemu-devel@nongnu.org; Wed, 28 Jul 2021 20:47:07 -0400 Received: by mail-pj1-x1033.google.com with SMTP id m1so7800290pjv.2 for ; Wed, 28 Jul 2021 17:47:05 -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=r2GbXBeTrZkFBlEoQpX1xhuSADWB2HHtmhBgZVms75o81+AAWnu/Rp3iSwC/T5UZoD hHwx0DsJA2vEjeN3sn3AzWdhQWHkngR70I0Lji8ai2P+wKyoPbXK0Q4vVO9w3fkp1kUp wv78eJGnrEWl5MGEKeOaz+15Vdj2YG316WT5qcrENKvymrw2zYbiXmDCdaMkU00oG3JD HK2Xp0+6j7Q/Dw0/75ZGTmuOQdBMtlhvT8pyKFeb8kSjATrxw+GqLJbFEnjVJZMotKcs WxVG1zktKWw22o4KDt/CcTSI4gEUSrZXrLJQRoqiASv14HUlRA9NIBJ9JMmfd3QHlj13 HEvg== 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=K9IBRAVT7rnoON9EhT/dMEYU1wNLzc5KsfH3dtWWx2h8AnsDKr+k+P8r7+sGixvWJr 7WL83S4n7ZwcJ2QFQlPDfad30IAPw3Paxswqlf10IRYcIuPxa0c+Te5wxtVqQg3hHl7K chQgvyACWfR2vOsr8bH3D2hLSeLoLREaGmvPUvtWxuoBo1nG2JNdBfzxdjoGbu86cJI4 lNIUZiOF8ABpNDn06qqSiBaNytcQuIsL73ZPxyfVX5L9E+tVTQ761wCmJUoKKwV0Rl/K mBIG3EGqAfRTzqIYJNnfMOniDxw41YFeOGLtWamt1RoKgk199k4A9gtCx6cgJonu5L8T 2M8g== X-Gm-Message-State: AOAM531Fd+rJbPjRvbq+hA5031zd9OHV+tDeeaH993imoEXEYrsHNMxB q3xu7Hikj81vU7qjMSu761xVtopRkUBliA== X-Received: by 2002:a17:902:6509:b029:12b:5175:43b8 with SMTP id b9-20020a1709026509b029012b517543b8mr2254006plk.60.1627519624686; Wed, 28 Jul 2021 17:47:04 -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.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jul 2021 17:47:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH for-6.2 12/43] target/sh4: Implement do_unaligned_access for user-only Date: Wed, 28 Jul 2021 14:46:16 -1000 Message-Id: <20210729004647.282017-13-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::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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