From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:51426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gs9vX-0003f8-2F for qemu-devel@nongnu.org; Fri, 08 Feb 2019 12:26:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gs9vV-0003gB-9D for qemu-devel@nongnu.org; Fri, 08 Feb 2019 12:26:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56480) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gs9vT-0003bc-If for qemu-devel@nongnu.org; Fri, 08 Feb 2019 12:26:57 -0500 References: <20181214025849.84274-1-aik@ozlabs.ru> <8727c6e5-006c-20e5-cb6b-be525154e184@redhat.com> <69a29694-b777-721a-eafd-4ff38c457f6d@redhat.com> <20190103173753.GJ2316@work-vm> <20190207114953.GB2773@work-vm> From: Paolo Bonzini Message-ID: <16486ff4-eb62-b4f2-78f8-a1ec7e3fbb0b@redhat.com> Date: Fri, 8 Feb 2019 18:26:34 +0100 MIME-Version: 1.0 In-Reply-To: <20190207114953.GB2773@work-vm> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH qemu v2] hmp: Print if memory section is registered with an accelerator List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" , Alexey Kardashevskiy Cc: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , qemu-devel@nongnu.org, Daniel Henrique Barboza On 07/02/19 12:49, Dr. David Alan Gilbert wrote: > //#define DEBUG_UNASSIGNED > @@ -2924,6 +2926,8 @@ struct FlatViewInfo { > int counter; > bool dispatch_tree; > bool owner; > + AccelClass *ac; > + const char *ac_name; > }; > > static void mtree_print_flatview(gpointer key, gpointer value, > @@ -2939,6 +2943,7 @@ static void mtree_print_flatview(gpointer key, gpointer value, > int n = view->nr; > int i; > AddressSpace *as; > + bool system_as = false; > > p(f, "FlatView #%d\n", fvi->counter); > ++fvi->counter; > @@ -2950,6 +2955,9 @@ static void mtree_print_flatview(gpointer key, gpointer value, > p(f, ", alias %s", memory_region_name(as->root->alias)); > } > p(f, "\n"); > + if (as == &address_space_memory) { > + system_as = true; > + } > } > > p(f, " Root memory region: %s\n", > @@ -2985,6 +2993,13 @@ static void mtree_print_flatview(gpointer key, gpointer value, > if (fvi->owner) { > mtree_print_mr_owner(p, f, mr); > } > + > + if (system_as && fvi->ac && > + fvi->ac->has_memory(current_machine, > + int128_get64(range->addr.start), > + MR_SIZE(range->addr.size) + 1)) { > + p(f, " %s", fvi->ac_name); I don't understand this. This doesn't check that the memory range actually matches the memory registered with the accelerator, only that there is something in that range. Why isn't it enough to use "info mtree" and look at the KVM address space? Perhaps you could add instead an argument to "info mtree" that prints only the AddressSpace with a given name? Paolo