All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
	qemu-devel@nongnu.org,
	"Daniel Henrique Barboza" <danielhb413@gmail.com>
Subject: Re: [Qemu-devel] [PATCH qemu v2] hmp: Print if memory section is registered with an accelerator
Date: Fri, 8 Feb 2019 18:26:34 +0100	[thread overview]
Message-ID: <16486ff4-eb62-b4f2-78f8-a1ec7e3fbb0b@redhat.com> (raw)
In-Reply-To: <20190207114953.GB2773@work-vm>

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

  reply	other threads:[~2019-02-08 17:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14  2:58 [Qemu-devel] [PATCH qemu v2] hmp: Print if memory section is registered with an accelerator Alexey Kardashevskiy
2018-12-14 11:07 ` Philippe Mathieu-Daudé
2018-12-17  1:27   ` Alexey Kardashevskiy
2018-12-17 12:47     ` Philippe Mathieu-Daudé
2018-12-18  0:58       ` Alexey Kardashevskiy
2019-01-03 17:37         ` Dr. David Alan Gilbert
2019-01-14  1:43           ` Alexey Kardashevskiy
2019-01-29  2:30             ` Alexey Kardashevskiy
2019-02-07  5:20               ` Alexey Kardashevskiy
2019-02-07 11:49             ` Dr. David Alan Gilbert
2019-02-08 17:26               ` Paolo Bonzini [this message]
2019-02-11  4:56                 ` Alexey Kardashevskiy
     [not found]                   ` <f346fdcb-1849-3397-7f4c-2d6ee07fcd7c@ozlabs.ru>
2019-04-24  5:32                     ` Alexey Kardashevskiy
2019-04-24  5:32                       ` Alexey Kardashevskiy
2019-05-21  6:37                       ` Alexey Kardashevskiy
2019-06-13  5:07                         ` Alexey Kardashevskiy
2019-06-13 11:49                           ` Dr. David Alan Gilbert
2019-06-13 13:59                           ` Paolo Bonzini
2019-06-13 14:04                           ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16486ff4-eb62-b4f2-78f8-a1ec7e3fbb0b@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=aik@ozlabs.ru \
    --cc=danielhb413@gmail.com \
    --cc=dgilbert@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.