From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 46680EB64D9 for ; Thu, 29 Jun 2023 09:43:04 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qEoAM-0007oA-JN; Thu, 29 Jun 2023 05:42:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEoAI-0007nP-MK; Thu, 29 Jun 2023 05:42:15 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEoAG-0002zY-UV; Thu, 29 Jun 2023 05:42:14 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-6689430d803so304299b3a.0; Thu, 29 Jun 2023 02:42:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688031725; x=1690623725; h=in-reply-to:references:from:subject:cc:to:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=G0s18dLUYxAa1cUjKB48Cq/5C70u01WO4q9a3tcWJoc=; b=OzJtgJIPcEPHnl8ABZ6ZpKy6x/z21m3RT0iIRSNhNfVMUxLDpOjw4GN99lv6Ai4SfY RSyUtM2ejbLJg6752XvP20EH8ZfNymsbgWqyWtf0Wjy7B5INrLf9howrk0orylyc7W2O LXDvCwzyZ2+WJ297cPuwkV1UFosufD/Oe6tmEP4F+yNVZRRX4/tisivaRLRcOr839OkQ GUaQ64Zpk9CDVJE22HMSMYhjYWEVD/J94aPU+rSbWa/TNLmhtcWXe9qJ56iFmRS+uO4Y L+vad230pKt8xf2Gw+6TbBHgwiqQraRev4g/X52aWQqU6cCRd0HB0gQR31xmgUMyIpvn IqVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688031725; x=1690623725; h=in-reply-to:references:from:subject:cc:to:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=G0s18dLUYxAa1cUjKB48Cq/5C70u01WO4q9a3tcWJoc=; b=fKMk7MmEkPrcXtc2YflkknzQev/ZC+PN4XFX8gowFrFuebt+LBj4fb1p8//MPpTS6a jAzZmEH34jzku2W/T/yzI/m3VlevhreuEWgiUf2abJepG4WP6T8+NfV7BSZGGt1YK7xC 9XsalsnvAi81a4GR5ZqDUUEU55UfPUDwnhqfYazkS+ONC98aCfSpPDHXv/rqvzUybBLc IzOg3S0rxRKgQM/N6USaEViCdOCJnthSiuRKqZiAbvCV9aE3UPikPk6i3rWN3THZCxFz FCgteQuejr8sjIOWPiSrLwYmNL9akst3ITLlP3kP0rl7acWwmOTdQ1qlBO03dR0mB19w ILhQ== X-Gm-Message-State: AC+VfDy50f9EJgHsRwUjtCMqEyjAoThtIYwTpB/kt0nIYP+eDs/myy6W /KOPuf4MwE0cNZYr01DeLFU= X-Google-Smtp-Source: ACHHUZ7Sn5NeCZQCYHvfsouTAiihpn5XA+veO//XQTxjbdW775Bleof9ifF2h4pbse+603ARYoy4mw== X-Received: by 2002:a05:6a00:10cf:b0:668:681f:ca98 with SMTP id d15-20020a056a0010cf00b00668681fca98mr28759585pfu.27.1688031724880; Thu, 29 Jun 2023 02:42:04 -0700 (PDT) Received: from localhost (203-219-179-91.tpgi.com.au. [203.219.179.91]) by smtp.gmail.com with ESMTPSA id k6-20020aa790c6000000b00681be8ebc00sm1726070pfk.95.2023.06.29.02.41.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Jun 2023 02:42:04 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 29 Jun 2023 19:41:56 +1000 Message-Id: To: =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Mark Cave-Ayland" , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Howard Spoelstra" Cc: "Peter Maydell" , , , "Christophe Leroy" , "BALATON Zoltan" , "Harsh Prateek Bora" , "Daniel Henrique Barboza" , "David Gibson" , "Greg Kurz" , "Frederic Barrat" , "Richard Henderson" Subject: Re: [PATCH 0/4] target/ppc: Catch invalid real address accesses From: "Nicholas Piggin" X-Mailer: aerc 0.15.2 References: <20230623081953.290875-1-npiggin@gmail.com> <47197a73-b106-47d5-9502-393a6bdc9945@redhat.com> <966b3fce-512d-f122-e76e-efded0db9731@kaod.org> <8e3010d8-9ca7-c834-3348-e11060c53f8a@ilande.co.uk> <840c34e7-0f5c-89fa-2dfa-f8de3da4d643@ilande.co.uk> <7e596b48-c631-34d5-2b63-0aac1922de93@kaod.org> <2bc2ca94-c1ba-a9de-0b81-6f9d3d4ad333@redhat.com> <1f6e63f1-d17d-c81c-cecb-3d9129c24360@redhat.com> In-Reply-To: <1f6e63f1-d17d-c81c-cecb-3d9129c24360@redhat.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=npiggin@gmail.com; helo=mail-pf1-x42b.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On Thu Jun 29, 2023 at 7:05 PM AEST, C=C3=A9dric Le Goater wrote: > On 6/29/23 10:29, Mark Cave-Ayland wrote: > > On 28/06/2023 08:17, C=C3=A9dric Le Goater wrote: > >=20 > >>>>>> qemu-system-ppc.exe -M mac99,via=3Dpmu -cdrom C:\mac-iso\9.2.2.iso= -boot d -L pc-bios > >>>>>> crashes Mac OS with an address error. (with unpatched and patched = builds). > >>>>> > >>>>> Same on Linux. I get an invalid opcode. QEMU 7.2 work fine though. > >>>>> > >>>>> C. > >>>> > >>>> That certainly shouldn't happen, and if it worked in 7.2 then there'= s definitely a regression which has crept in there somewhere. I'll try and = bisect this at some point soon, but feel free to try and beat me ;) > >>> > >>> bisect points to : > >>> > >>> commit e506ad6a05c806bbef460a7d014a184ff8d707a6 > >>> Author: Richard Henderson > >>> Date:=C2=A0=C2=A0 Mon Mar 6 04:30:11 2023 +0300 > >>> > >>> =C2=A0=C2=A0=C2=A0=C2=A0 accel/tcg: Pass last not end to tb_invalidat= e_phys_range > >>> =C2=A0=C2=A0=C2=A0=C2=A0 Pass the address of the last byte to be chan= ged, rather than > >>> =C2=A0=C2=A0=C2=A0=C2=A0 the first address past the last byte.=C2=A0 = This avoids overflow > >>> =C2=A0=C2=A0=C2=A0=C2=A0 when the last page of the address space is i= nvolved. > >>> =C2=A0=C2=A0=C2=A0=C2=A0 Reviewed-by: Philippe Mathieu-Daud=C3=A9 > >>> =C2=A0=C2=A0=C2=A0=C2=A0 Signed-off-by: Richard Henderson > >>> > >>> =C2=A0=C2=A0include/exec/exec-all.h=C2=A0=C2=A0 |=C2=A0 2 +- > >>> =C2=A0=C2=A0accel/tcg/tb-maint.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 31 += +++++++++++++++--------------- > >>> =C2=A0=C2=A0accel/tcg/translate-all.c |=C2=A0 2 +- > >>> =C2=A0=C2=A0accel/tcg/user-exec.c=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 2 += - > >>> =C2=A0=C2=A0softmmu/physmem.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 |=C2=A0 2 +- > >>> =C2=A0=C2=A05 files changed, 20 insertions(+), 19 deletions(-) > >>> > >>> > >>> I think the instruction is fnmadds. Needs more digging. > >> > >> the invalid opcode is just a symptom of something bad happening. > >> > >> C. > >=20 > > Indeed, it appears to be a copy/paste error within that commit. I've ju= st posted a proposed fix for this: https://lore.kernel.org/qemu-devel/20230= 629082522.606219-1-mark.cave-ayland@ilande.co.uk/T/. > > Looks good. I could boot macos 9.2.1 from an iso and 9.2.2 from disk. > > > Nick: you may wish to try your series again with this fix applied to se= e if there are still problems with the CPUs used in the Mac machines. > > Looks good too, with these : > > [PATCH v2 1/4] target/ppc: Machine check on invalid real address > [PATCH v2 2/4] target/ppc: Move common check in machine check > [PATCH v2 3/4] target/ppc: Make checkstop actually stop the system In the v2 series I removed the machine check for 970 btw so there might still be invalid memory access. Thanks, Nick