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 414BCC7EE23 for ; Thu, 8 Jun 2023 12:07:33 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q7EPj-0003Ki-JN; Thu, 08 Jun 2023 08:06:51 -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 1q7EPg-0003KX-TM for qemu-devel@nongnu.org; Thu, 08 Jun 2023 08:06:49 -0400 Received: from [2a00:1098:5b::1] (helo=mx.treblig.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7EPe-0000mb-CH for qemu-devel@nongnu.org; Thu, 08 Jun 2023 08:06:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID :Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe :List-Post:List-Owner:List-Archive; bh=tfFsxFBLcOg5JqxH5EhUXKagNmEQIp7rsN61b5AWIy0=; b=X8QGos9jZ4vI1UCSZp+IAIaPwm QqTnongvY09mywZDG3zrDFHcMfTrG99e1QuAGBUDpj1ihR2rD4eoyEjGupW2xj56HEOXAxV5z054e d7X3gysit+77cJygqxheJc1Z0Hk2uS3guKxdtwyxtT05bOHMTzAE72vkBFTc2lGUYA+2//VGU5f9o FzC0LtKHUD5yBSGvMW/7y/3qq0aViTP+MyLO3MTu1yoEOs6NCgQrHoiAcoTyVMBiKIycOS70lrjQy +D5uBTfwvgmePnLwkmvz+P3WOCd/ThhzZBCjfR4un0G4DSRbgoPxFE0dpDggncNaziFTIDrf5M1BJ tFCJNqog==; Received: from dg by mx.treblig.org with local (Exim 4.94.2) (envelope-from ) id 1q7EPW-00D1NA-SO; Thu, 08 Jun 2023 12:06:38 +0000 Date: Thu, 8 Jun 2023 12:06:38 +0000 From: "Dr. David Alan Gilbert" To: Peter Maydell Cc: "Wu, Fei" , Richard Henderson , alex.bennee@linaro.org, qemu-devel@nongnu.org, "Vanderson M. do Rosario" , "Dr . David Alan Gilbert" , Paolo Bonzini Subject: Re: [PATCH v14 08/10] Adding info [tb-list|tb] commands to HMP (WIP) Message-ID: References: <20230530083526.2174430-1-fei2.wu@intel.com> <20230530083526.2174430-9-fei2.wu@intel.com> <387127a0-4030-32b9-ccbb-db2f95bd618b@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: X-Chocolate: 70 percent or better cocoa solids preferably X-Operating-System: Linux/5.10.0-21-amd64 (x86_64) X-Uptime: 12:03:04 up 80 days, 22:37, 1 user, load average: 0.04, 0.01, 0.00 User-Agent: Mutt/2.0.5 (2021-01-21) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1098:5b::1 (failed) Received-SPF: pass client-ip=2a00:1098:5b::1; envelope-from=dg@treblig.org; helo=mx.treblig.org X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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 * Peter Maydell (peter.maydell@linaro.org) wrote: > On Thu, 8 Jun 2023 at 08:44, Wu, Fei wrote: > > > > On 6/7/2023 8:49 PM, Wu, Fei wrote: > > > On 6/1/2023 10:40 AM, Richard Henderson wrote: > > >> Did you really need something different than monitor_disas? You almost > > >> certainly want to read physical memory and not virtual anyway. > > >> > > > Yes, it's usually okay for kernel address, but cannot re-gen the code > > > for userspace virtual address (guest kernel panic on riscv guest). I > > > tried monitor_disas() but it failed to disas too: > > > monitor_disas(mon, mon_get_cpu(mon), tbs->phys_pc, num_inst, true); > > > > > > How to use this function correctly? > > > > > 'phys_pc' in tbs is returned by get_page_addr_code_hostp(), which is not > > guest phys address actually, but ram_addr_t instead, so it's always > > wrong for monitor_disas. After some dirty changes, tbs can record the > > guest pa. Now we can disas both kernel and user space code. But still, > > no code is regenerated, disas in 'info tb' is just a convenient way to 'xp'. > > > > Is there any existing function to convert ram_addr_t to guest pa? > > Such a function would not be well-defined, because a block of RAM > as specified by a ram_addr_t could be present at (aliased to) multiple > guest physical addresses, or even currently not mapped to any guest > physical address at all. And it could be present at different physical > addresses for different vCPUs. True, but isn't there a similar mechanism for when an MCE happens in the host memory? Dave > thanks > -- PMM -- -----Open up your eyes, open up your mind, open up your code ------- / Dr. David Alan Gilbert | Running GNU/Linux | Happy \ \ dave @ treblig.org | | In Hex / \ _________________________|_____ http://www.treblig.org |_______/