All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Tim Deegan <tim@xen.org>
Subject: Re: [PATCH 2/5] x86/p2m: collapse the two ->write_p2m_entry() hooks
Date: Tue, 10 Nov 2020 14:51:11 +0100	[thread overview]
Message-ID: <b4932c75-c9c4-1da0-2218-fe3cb959e2e2@suse.com> (raw)
In-Reply-To: <20201110110611.p3twf6rmy7qdlxa7@Air-de-Roger>

On 10.11.2020 12:06, Roger Pau Monné wrote:
> On Wed, Oct 28, 2020 at 10:22:58AM +0100, Jan Beulich wrote:
>> @@ -1132,7 +1132,13 @@ void p2m_pt_init(struct p2m_domain *p2m)
>>      p2m->recalc = do_recalc;
>>      p2m->change_entry_type_global = p2m_pt_change_entry_type_global;
>>      p2m->change_entry_type_range = p2m_pt_change_entry_type_range;
>> -    p2m->write_p2m_entry = write_p2m_entry;
>> +
>> +    /* Still too early to use paging_mode_hap(). */
>> +    if ( hap_enabled(p2m->domain) )
>> +        hap_p2m_init(p2m);
>> +    else if ( IS_ENABLED(CONFIG_SHADOW_PAGING) )
>> +        shadow_p2m_init(p2m);
> 
> There's already some logic in p2m_initialise that checks for
> hap_enabled for EPT specific initialization. Do you think you could
> move this there so that it's more contained?
> 
> I think having the initialization condition sprinkled all over the
> different functions makes the logic more complicated to follow.
> 
> Also, should hap_p2m_init be limited to HAP and PT, as opposed to HAP
> and EPT which doesn't use the helper AFAICT?

It is limited to HAP and PT - we're in p2m_pt_init() here. This is
also why I don't want to move it to e.g. p2m_initialise(), as that
would be the wrong layer.

> Maybe it would be clearer to unify shadow_write_p2m_entry with
> hap_write_p2m_entry and call it p2m_pt_write_p2m_entry to match the
> rest of the p2m PT helpers?

This looks to go along the lines of what I'd put up as a post-
commit-message remark in "x86/p2m: collapse the two
->write_p2m_entry() hooks". The nested handler is perhaps the
bigger problem with such merging, plus it would feel a little like
a layering violation (which is why I did put up the question
instead of doing it right away).

Jan


  reply	other threads:[~2020-11-10 13:51 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-28  9:20 [PATCH 0/5] x86/p2m: hook adjustments Jan Beulich
2020-10-28  9:22 ` [PATCH 1/5] x86/p2m: paging_write_p2m_entry() is a private function Jan Beulich
2020-11-10 10:27   ` Roger Pau Monné
2020-11-10 10:32     ` Jan Beulich
2020-10-28  9:22 ` [PATCH 2/5] x86/p2m: collapse the two ->write_p2m_entry() hooks Jan Beulich
2020-10-29 20:36   ` Tim Deegan
2020-11-10 11:06   ` Roger Pau Monné
2020-11-10 13:51     ` Jan Beulich [this message]
2020-11-18  9:44       ` Roger Pau Monné
2020-10-28  9:23 ` [PATCH 3/5] x86/p2m: suppress audit_p2m hook when possible Jan Beulich
2020-11-10 11:30   ` Roger Pau Monné
2020-11-10 13:21     ` Jan Beulich
2020-11-10 14:01       ` Roger Pau Monné
2020-10-28  9:24 ` [PATCH 4/5] x86/HAP: move nested-P2M flush calculations out of locked region Jan Beulich
2020-11-10 11:38   ` Roger Pau Monné
2020-10-28  9:24 ` [PATCH 5/5] x86/p2m: split write_p2m_entry() hook Jan Beulich
2020-10-29 20:46   ` Tim Deegan
2020-11-10 13:59   ` Roger Pau Monné
2020-11-10 14:50     ` Jan Beulich
2020-11-11 12:17       ` Roger Pau Monné
2020-11-12 12:29         ` Jan Beulich
2020-11-12 13:07           ` Roger Pau Monné
2020-11-12 14:04             ` Jan Beulich
2020-11-12 17:52               ` Tim Deegan
2020-11-13  9:52                 ` Jan Beulich
2020-11-18  9:22                   ` Roger Pau Monné
2020-11-18  9:31   ` Roger Pau Monné

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=b4932c75-c9c4-1da0-2218-fe3cb959e2e2@suse.com \
    --to=jbeulich@suse.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=tim@xen.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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.