All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: aisaila@bitdefender.com
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	tamas@tklengyel.com, Razvan Cojocaru <rcojocaru@bitdefender.com>,
	xen-devel@lists.xen.org
Subject: Re: [PATCH v2] x86/mm: Add mem access rights to NPT
Date: Thu, 28 Jun 2018 08:40:44 -0600	[thread overview]
Message-ID: <5B34F36C02000078001CEEA0@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <1530195070.8880.9.camel@bitdefender.com>

>>> On 28.06.18 at 16:10, <aisaila@bitdefender.com> wrote:
> On Vi, 2018-06-22 at 09:51 -0600, Jan Beulich wrote:
>> > > > On 18.06.18 at 17:17, <aisaila@bitdefender.com> wrote:
>> > From: Isaila Alexandru <aisaila@bitdefender.com>
>> >
>> > This patch adds access rights for the NPT pages. The access rights
>> > are
>> > saved in a radix tree with the root saved in p2m_domain.
>> Sounds resource intensive. How many nodes would such a radix tree
>> have
>> on average?
> 
> The average is around 1478890 for a machine with 4GB of ram.

Is this with ...

>> > +static void p2m_set_access(struct p2m_domain *p2m, unsigned long
>> > gfn,
>> > +                                      p2m_access_t a)
>> > +{
>> > +    int rc;
>> > +
>> > +    if ( p2m_access_rwx == a )
>> > +        radix_tree_delete(&p2m->mem_access_settings, gfn);
>> > +
>> > +    rc = radix_tree_insert(&p2m->mem_access_settings, gfn,
>> > +                           radix_tree_int_to_ptr(a));
>> Is there an "else" missing above here? Otherwise why would you
>> delete the node first?
> 
> Yes it needs a else or a return. We plan not to have the rwx in the
> tree so we ca save up some space.

... this corrected? Otherwise I'm tempted to say that the creation of
this radix tree needs to be avoided by all means, as long as it's not
really needed.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-06-28 14:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-18 15:17 [PATCH v2] x86/mm: Add mem access rights to NPT Alexandru Isaila
2018-06-18 15:39 ` Tamas K Lengyel
2018-06-19  8:14   ` Alexandru Stefan ISAILA
2018-06-19 14:22     ` Tamas K Lengyel
2018-06-22 15:51 ` Jan Beulich
2018-06-28 14:10   ` Alexandru Stefan ISAILA
2018-06-28 14:40     ` Jan Beulich [this message]
2018-06-28 14:53       ` Alexandru Stefan ISAILA
2018-06-28 14:58         ` Razvan Cojocaru
2018-06-29  6:17           ` Jan Beulich
2018-06-29  6:13         ` Jan Beulich
2018-06-29  8:42           ` Alexandru Stefan ISAILA
2018-06-29  9:38             ` Jan Beulich
2018-06-29 16:42               ` Tamas K Lengyel
2018-07-02  6:37                 ` Jan Beulich
2018-07-02  8:01                   ` Alexandru Stefan ISAILA
2018-07-02  8:20                     ` Jan Beulich
2018-06-28 16:29       ` Tamas K Lengyel

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=5B34F36C02000078001CEEA0@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=aisaila@bitdefender.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=rcojocaru@bitdefender.com \
    --cc=tamas@tklengyel.com \
    --cc=xen-devel@lists.xen.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.