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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B899C433EF for ; Mon, 25 Oct 2021 22:41:33 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E92D26105A for ; Mon, 25 Oct 2021 22:41:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E92D26105A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eik.bme.hu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:50428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mf8ep-00044j-OV for qemu-devel@archiver.kernel.org; Mon, 25 Oct 2021 18:41:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mf8e9-00039y-KN for qemu-devel@nongnu.org; Mon, 25 Oct 2021 18:40:49 -0400 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]:31301) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mf8e6-0005h4-M4 for qemu-devel@nongnu.org; Mon, 25 Oct 2021 18:40:48 -0400 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 99BFF7463B7; Tue, 26 Oct 2021 00:40:42 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 77B8D746353; Tue, 26 Oct 2021 00:40:42 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zero.eik.bme.hu (Postfix) with ESMTP id 753447462D3; Tue, 26 Oct 2021 00:40:42 +0200 (CEST) Date: Tue, 26 Oct 2021 00:40:42 +0200 (CEST) From: BALATON Zoltan To: John Paul Adrian Glaubitz Subject: Re: Looking for advise on debugging a non-boot kernel on qemu-system-sh4 In-Reply-To: Message-ID: <82c6635-68c7-9b51-3f6c-7555dfb7958c@eik.bme.hu> References: <4882e4cc-6754-1c8a-a8ae-a2ceeca115fb@physik.fu-berlin.de> <013d782d-0d7c-8204-cab2-08102a7d80f4@physik.fu-berlin.de> <3c524162-e83-a9b3-1e28-2aa28dbefa76@eik.bme.hu> <9189dbe7-cf92-19c7-dee5-b707262964d1@physik.fu-berlin.de> <3f483f63-9e68-b1da-01ab-a1e05dcf45aa@physik.fu-berlin.de> <378d863-abbb-57b7-d624-ce1ca81d09c@eik.bme.hu> <105383e6-9dab-e2bd-ffe2-fead5555f37c@physik.fu-berlin.de> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Received-SPF: pass client-ip=2001:738:2001:2001::2001; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu 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, 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: Richard Henderson , QEMU Developers Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Tue, 26 Oct 2021, John Paul Adrian Glaubitz wrote: > Hi Zoltan! > > On 10/23/21 15:22, BALATON Zoltan wrote: >>> You either need to strip the kernel with "strip vmlinux" or use the image from arch/sh/ >>> boot/zImage. >> >> I've actually used that kernel but looked at the wrong uncompressed size, it's indeed just >> 9.2MB when stripped so that should work. I was trying to debug further and found two problems: >> >> Commit abb0cd93494 (accel/tcg: Split out log_cpu_exec) seems to have broken -singlestep -d in_asm,cpu >> output with sh after a delay slot. Since that commit I get: >> (...) >> This seems to take a wrong turn at the delayed branch and somehow ends up at 0x8c800964 instead of >> 0x8c801528 but I'm not sure where to look firther why. I'm cc-ing Richard for both the -d cpu and >> this hoping he has some more insight. > > Shall we open a bug report? Well, we don't know yet what to put in the bug report apart from there is some bug somewhere. That's not too useful. I now understand that the -d output is not showing already translated TBs (I knew this but most of the time with -singlestep it gives good results anyway) but here it runs the loops without further output then we only see the first loop iteration and the end result. So the problem is not that it goes to 0x8c800964 as I think that's part of the loop for decompressing the kernel but it seems something is overwriting 0x8c800964 while it still expects to run code from there but I don't know what and why. One way to find could be to disassemble the kernel code and compare that with the -d output and check every instruction manually but that takes a lot of time or if you have a cross debugger you could try attaching that to QEMU and try to debug it that way but I don't have that either. Any other idea how to find out what is happening? Regards, BALATON Zoltan