From nobody Wed Feb 11 00:59:16 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1615497064; cv=none; d=zohomail.com; s=zohoarc; b=kKPWbe8MJxkyAv1UOewjhv3CCLUztLIZqrddwF3QkwcX8avQ6sZ10s6dK07jwOptDZ5I3LMzDTGV0PS5kY4CijqvzvgyR2Y/ozajK+MwEk3UX2mMYeD5y1kGN84+UlucnOu+5/bSJo6HZAIvBswkambr5CtxliwNSeEHy3bN6GY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615497064; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ACsF1i8AKwGxOE3tYLU5bYNqGeVpywHusbFN2CtvFk0=; b=ijY6IxTWI/IVrQ+0jUZDI0C2gUh623NiFNm56KFIfA8FNRxpZOg0PcsU3WgL7ObwPrVW7Txo2sVKODtDRZ7NHb4JKLwNTTvrYy/9nMvQH0L+VCjFA+gOPZMwHUagOeWKXrS4EXvIjRESLeMCEkkH3lLc1K8JJ8TF4b69R9NFZGw= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1615497064490345.4219940931242; Thu, 11 Mar 2021 13:11:04 -0800 (PST) Received: from localhost ([::1]:35554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKSaE-0007ti-IP for importer@patchew.org; Thu, 11 Mar 2021 16:11:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45518) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKSYw-0006bR-Mo for qemu-devel@nongnu.org; Thu, 11 Mar 2021 16:09:42 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:45437) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKSYu-0004xR-T0 for qemu-devel@nongnu.org; Thu, 11 Mar 2021 16:09:42 -0500 Received: from localhost.localdomain ([82.142.6.26]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MZkxd-1lGzwK0pNP-00Wmud; Thu, 11 Mar 2021 22:09:39 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 2/9] target/m68k: don't set SSW ATC bit for physical bus errors Date: Thu, 11 Mar 2021 22:09:27 +0100 Message-Id: <20210311210934.1935587-3-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210311210934.1935587-1-laurent@vivier.eu> References: <20210311210934.1935587-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:wxrnRbg+7k54Zn4OHJr2pWGbUtLEPu6hHngR9kx8JqC8s29tYaZ tqqBuim90p24/wl1PIMUwsjj+OEuQiA/ht1n8cx5w+7D3JzTtnti9fQ6MjWhomjqde4V2pU iIxTLla9JtpjnrJ+xxYkIFscyTsyKIuy87ft41rGjcrNN3/NoP4ZOGAMQwUog8/ZQ26KEBe EfNkus1sSnf65CX/oa2Uw== X-UI-Out-Filterresults: notjunk:1;V03:K0:HnR1wfMOBDE=:wUYMr93OImOHinbPAmphUI WkFkZQSoMPiwM/56WWgm0sFTwD6e8p65MrqlWu3cYFR3q90JJA9lAHlKqfjE0doqZ1FBb1cEk GzvOSmniZmTW5PT7JRrkbD9S/fph2XQv8iUFhoXZYTu3AWMeKn1IwMG5wQfYvyJcy6fDSWiK3 Imca5jQdN3vtx6gVuQBdrfWsUgJJxt/U7n9edwFrg8lzvkamu14zkd656lswJhuadj91JSkk3 ihbYoZ8t/wXqZ6hKYVNIW5peWABfQgkmmVuh8TEQxW0p3ZZu+o32i6xBqmVoYHLer2MitIQwI cp6iHFgWzL5XutiXZsV/WIyr0UkeyI8cYUjrJnmMV6iPUIfaRWuGmx3wBEDXWFsgAN4EupnjS IR2YG+hJsYLZaWrNzTH2x7oFqYFjPeQ15pAea9oonOTPPGHrnTp2OUag3ZLjPEko+OR6qC+qM Zl51YR68hA== Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=212.227.17.10; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=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: Mark Cave-Ayland , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland If a NuBus slot doesn't contain a card, the Quadra hardware generates a phy= sical bus error if the CPU attempts to access the slot address space. Both Linux = and MacOS use a separate bus error handler during NuBus accesses in order to de= tect and recover when addressing empty slots. According to the MC68040 users manual the ATC bit of the SSW is used to distinguish between ATC faults and physical bus errors. MacOS specifically = checks the stack frame generated by a NuBus error and panics if the SSW ATC bit is= set. Update m68k_cpu_transaction_failed() so that the SSW ATC bit is not set if = the memory API returns MEMTX_DECODE_ERROR which will be used to indicate that an access to an empty NuBus slot occurred. Signed-off-by: Mark Cave-Ayland Reviewed-by: Laurent Vivier Message-Id: <20210308121155.2476-2-mark.cave-ayland@ilande.co.uk> Signed-off-by: Laurent Vivier --- target/m68k/op_helper.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c index 730cdf774445..5f981e5bf628 100644 --- a/target/m68k/op_helper.c +++ b/target/m68k/op_helper.c @@ -468,7 +468,17 @@ void m68k_cpu_transaction_failed(CPUState *cs, hwaddr = physaddr, vaddr addr, =20 if (m68k_feature(env, M68K_FEATURE_M68040)) { env->mmu.mmusr =3D 0; - env->mmu.ssw |=3D M68K_ATC_040; + + /* + * According to the MC68040 users manual the ATC bit of the SSW is + * used to distinguish between ATC faults and physical bus errors. + * In the case of a bus error e.g. during nubus read from an empty + * slot this bit should not be set + */ + if (response !=3D MEMTX_DECODE_ERROR) { + env->mmu.ssw |=3D M68K_ATC_040; + } + /* FIXME: manage MMU table access error */ env->mmu.ssw &=3D ~M68K_TM_040; if (env->sr & SR_S) { /* SUPERVISOR */ --=20 2.29.2