Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp39972rdg; Tue, 10 Oct 2023 03:46:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFv+km9fU1EjO3IKkAiZ4f4gY8q57gb7fpYgB7EBF9C1+iKhUk0AMlIKKnzH6ynVCG+jf6T X-Received: by 2002:a05:6358:4429:b0:143:4b0a:5f20 with SMTP id z41-20020a056358442900b001434b0a5f20mr14208931rwc.29.1696934790029; Tue, 10 Oct 2023 03:46:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696934789; cv=none; d=google.com; s=arc-20160816; b=KDzkn09mCj1O3WfqxYDnY6rOaRYdEiQ5RG4IJLZMtudEk7cRjG60KpG0y/tLyIQxXG D5sEPav62Yf8QhBBjNbo1wSK8K3scTDrDa250PgLKcuk1TGLw2FXNGH0FT9N1aL7US6c ydKWK+61YfXImnKu0qvhUdLKoy8GDbtW6+Ls4F3rj7uPEHDSFUTufz9t0P77G8TFsgXe 8PQi5396hIPNwXdP3GbSSAuHwhPPxrvlMD6WCoNUnAYBVFoGDjivA5zK/l2FhU0FR/t/ dr6AWZ9JlarcQ5rpp0QPx9hnkdAvv4TVkPdt8pfbNQdPZFHQeIDojKd6k98wSm43v48Q nTyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=Keye6tp09f7AaDHq21s2ZPcLTfXNXkaJSM26tkcvZns=; fh=oCsIBZgyYWa2BMuquJucZgATb2BelBwkAs1YkkYyMZQ=; b=B9BOsegrh3IUZOsRL0oDqZwZd4GNkotJznY1B9gb7LinQFzm4Zl5pUYRNjIbubsb5Q SfJyO0+b7RbidPkVLWQChmf/LNb4Vf0DOK5T0UxFa+7yol9qf48lFFG1C7zHwmQyuqpJ XOMQ9Y1e86+91uN9YLKh/AGcTbhhTshgq4oGzFQIehJFbXYn4fVMg+atWpmlQs+eAkow 1e2x1BE18pWgF70eKySklGw+xWDENrCSarCIzdcnkYf22XcVLAAQId3REmzStZ5DB+Ps QP2NyeVMyIfH2N1TL0lOFWNwG2qyTqJTv00AzUj+3UN23eWpE/3x7dJIVaHoJ8CSXVc6 ct/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=GsNX9efb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id fh25-20020a056a00391900b0068fe810e8a0si9454454pfb.197.2023.10.10.03.46.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 03:46:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=GsNX9efb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 6193E80E4FEC; Tue, 10 Oct 2023 03:45:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231216AbjJJKpU (ORCPT + 99 others); Tue, 10 Oct 2023 06:45:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbjJJKpT (ORCPT ); Tue, 10 Oct 2023 06:45:19 -0400 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5A139E for ; Tue, 10 Oct 2023 03:45:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1696934716; bh=Keye6tp09f7AaDHq21s2ZPcLTfXNXkaJSM26tkcvZns=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=GsNX9efb9iY0prGMW73Nnj2xFLseuu4l7MCN1wgrNZDmeA+S6RNDOlNnD2F74dUgf vz8QECYtcFm/dK2WZTyBng84y3YC+pjMqUNLPAdeU1+T4mhhZTW0ew/nQuSV7NpPLz kNQSsL/MmeeJiWmRl6S1hPkejirK4ww6v8DbmbcPbgM3BvbPv/2MNkgKgPe5ezANIN JGtpQJC74sCjuuAKv3l3H19pOubSP+3xvvpGysgB1iuBQq18SuQpc3UvygEwvKCcTg jrtHxcqN58MAtgbyod/FQiXGd7QJ1pi1mnTyk4KqRZCmd7Nin3BVFdcox+7OaXGr1H V1oWgFlnJ7fuQ== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4S4Xbw1xFYz4xWL; Tue, 10 Oct 2023 21:45:14 +1100 (AEDT) From: Michael Ellerman To: Christophe Leroy , Nicholas Piggin Cc: Christophe Leroy , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH] powerpc/85xx: Fix math emulation exception In-Reply-To: <066caa6d9480365da9b8ed83692d7101e10ac5f8.1695657339.git.christophe.leroy@csgroup.eu> References: <066caa6d9480365da9b8ed83692d7101e10ac5f8.1695657339.git.christophe.leroy@csgroup.eu> Date: Tue, 10 Oct 2023 21:45:10 +1100 Message-ID: <8734yisqmh.fsf@mail.lhotse> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 10 Oct 2023 03:45:29 -0700 (PDT) X-Spam-Level: ** Christophe Leroy writes: > Booting mpc85xx_defconfig kernel on QEMU leads to: What machine/CPU model are you using for that? I tried ppce500/e500 and that is working OK for me, ie. boots to userspace and I see math instructions being emulated via the emulated stats. cheers > Bad trap at PC: fe9bab0, SR: 2d000, vector=800 > awk[82]: unhandled trap (5) at 0 nip fe9bab0 lr fe9e01c code 5 in libc-2.27.so[fe5a000+17a000] > awk[82]: code: 3aa00000 3a800010 4bffe03c 9421fff0 7ca62b78 38a00000 93c10008 83c10008 > awk[82]: code: 38210010 4bffdec8 9421ffc0 7c0802a6 d8010008 4815190d 93810030 > Trace/breakpoint trap > WARNING: no useful console > > This is because allthough CONFIG_MATH_EMULATION is selected, > Exception 800 calls unknown_exception(). > > Call emulation_assist_interrupt() instead. > > Signed-off-by: Christophe Leroy > --- > arch/powerpc/kernel/head_85xx.S | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/powerpc/kernel/head_85xx.S b/arch/powerpc/kernel/head_85xx.S > index 97e9ea0c7297..0f1641a31250 100644 > --- a/arch/powerpc/kernel/head_85xx.S > +++ b/arch/powerpc/kernel/head_85xx.S > @@ -395,7 +395,7 @@ interrupt_base: > #ifdef CONFIG_PPC_FPU > FP_UNAVAILABLE_EXCEPTION > #else > - EXCEPTION(0x0800, FP_UNAVAIL, FloatingPointUnavailable, unknown_exception) > + EXCEPTION(0x0800, FP_UNAVAIL, FloatingPointUnavailable, emulation_assist_interrupt) > #endif > > /* System Call Interrupt */ > -- > 2.41.0