All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v2 14/23] x86/mm: put nested p2m code under CONFIG_HVM
Date: Tue, 28 Aug 2018 03:10:45 -0600	[thread overview]
Message-ID: <5B85119502000078001E27C0@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <20180828084035.p3esovpsa4hi7gyf@citrix.com>

>>> On 28.08.18 at 10:40, <wei.liu2@citrix.com> wrote:
> On Mon, Aug 27, 2018 at 09:56:24AM -0600, Jan Beulich wrote:
>> >>> On 26.08.18 at 14:19, <wei.liu2@citrix.com> wrote:
>> > --- a/xen/arch/x86/domain.c
>> > +++ b/xen/arch/x86/domain.c
>> > @@ -1689,7 +1689,8 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
>> >      {
>> >          _update_runstate_area(prev);
>> >          vpmu_switch_from(prev);
>> > -        np2m_schedule(NP2M_SCHEDLE_OUT);
>> > +        if ( nestedhvm_enabled(prevd) )
>> > +            np2m_schedule(NP2M_SCHEDLE_OUT);
>> >      }
>> >  
>> >      if ( is_hvm_domain(prevd) && !list_empty(&prev->arch.hvm_vcpu.tm_list) )
>> > @@ -1756,7 +1757,8 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
>> >  
>> >          /* Must be done with interrupts enabled */
>> >          vpmu_switch_to(next);
>> > -        np2m_schedule(NP2M_SCHEDLE_IN);
>> > +        if ( nestedhvm_enabled(nextd) )
>> > +            np2m_schedule(NP2M_SCHEDLE_IN);
>> >      }
>> 
>> How do these additions help? nestedhvm_enabled() is not an inline
>> function, and the entire series doesn't seem to touch hvm/nestedhvm.h
>> (i.e. there's no inline stub being added).
> 
> The patch that changed nestedhvm_enabled was committed before I sent out
> this series -- please pull the latest changes.

Oh, I see - I'm sorry.

>> > --- a/xen/arch/x86/mm/p2m.c
>> > +++ b/xen/arch/x86/mm/p2m.c
>> > @@ -144,6 +144,7 @@ static void p2m_teardown_hostp2m(struct domain *d)
>> >  
>> >  static void p2m_teardown_nestedp2m(struct domain *d)
>> >  {
>> > +#ifdef CONFIG_HVM
>> >      unsigned int i;
>> >      struct p2m_domain *p2m;
>> >  
>> > @@ -156,10 +157,12 @@ static void p2m_teardown_nestedp2m(struct domain *d)
>> >          p2m_free_one(p2m);
>> >          d->arch.nested_p2m[i] = NULL;
>> >      }
>> > +#endif
>> >  }
>> >  
>> >  static int p2m_init_nestedp2m(struct domain *d)
>> >  {
>> > +#ifdef CONFIG_HVM
>> >      unsigned int i;
>> >      struct p2m_domain *p2m;
>> >  
>> > @@ -176,6 +179,7 @@ static int p2m_init_nestedp2m(struct domain *d)
>> >          p2m->write_p2m_entry = nestedp2m_write_p2m_entry;
>> >          list_add(&p2m->np2m_list, &p2m_get_hostp2m(d)->np2m_list);
>> >      }
>> > +#endif
>> >  
>> >      return 0;
>> >  }
>> 
>> Hmm, I think this is too ad hoc for my taste: For one I'm puzzled
>> by the lack of any (existing) is_hvm_domain() here. And then the
>> fields initialization of which you skip should also disappear, to
>> eliminate the risk of some code somewhere using the fields
>> uninitialized. This might simply mean to move the fields from
>> struct arch_domain to struct hvm_domain. I understand this may
>> end up being a more involved task, but it looks pretty much
>> unavoidable to me.
> 
> p2m_init is called unconditionally for both PV and HVM. At the time I
> read the code it appeared that it required nestedp2m to be initialised
> and tear down unconditionally.
> 
> Do you want me to rewrite p2m_init and p2m_teardown_final to put things
> under is_hvm_domain?

I think that's what is needed, yes.

Jan



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

  reply	other threads:[~2018-08-28  9:10 UTC|newest]

Thread overview: 97+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-26 12:19 [PATCH v2 00/23] Make CONFIG_HVM work Wei Liu
2018-08-26 12:19 ` [PATCH v2 01/23] x86: change name of parameter for various invlpg functions Wei Liu
2018-08-27 13:49   ` Boris Ostrovsky
2018-08-27 13:54     ` Jan Beulich
2018-08-27 14:20   ` Jan Beulich
2018-08-30  1:26   ` Tian, Kevin
2018-09-03 13:46   ` Wei Liu
2018-09-04 13:42     ` Boris Ostrovsky
2018-08-26 12:19 ` [PATCH v2 02/23] xen: is_hvm_{domain, vcpu} should evaluate to false when !CONFIG_HVM Wei Liu
2018-08-27 14:24   ` Jan Beulich
2018-08-28  8:41     ` Wei Liu
2018-08-28 11:09       ` Julien Grall
2018-08-26 12:19 ` [PATCH v2 03/23] x86: enclose hvm_op and dm_op in CONFIG_HVM in relevant tables Wei Liu
2018-08-27 14:24   ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 04/23] x86/hvm: provide hvm_hap_supported Wei Liu
2018-08-27 14:25   ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 05/23] x86: provide stub for memory_type_changed Wei Liu
2018-08-27 14:28   ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 06/23] x86: don't call vpci function in physdev_op when !CONFIG_HAS_VPCI Wei Liu
2018-08-27 14:29   ` Jan Beulich
2018-08-28  8:45     ` Wei Liu
2018-08-28  9:08       ` Jan Beulich
2018-08-29 16:23         ` Wei Liu
2018-08-26 12:19 ` [PATCH v2 07/23] x86/vpmu: put HVM only code under CONFIG_HVM Wei Liu
2018-08-27 15:03   ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 08/23] xen/pt: io.c contains HVM only code Wei Liu
2018-08-27 15:04   ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 09/23] x86/pt: make it build with !CONFIG_HVM Wei Liu
2018-08-27 15:07   ` Jan Beulich
2018-08-30  1:29   ` Tian, Kevin
2018-08-26 12:19 ` [PATCH v2 10/23] x86/pt: split out HVM functions from vtd.c Wei Liu
2018-08-30  1:29   ` Tian, Kevin
2018-08-26 12:19 ` [PATCH v2 11/23] x86: XENMEM_resource_ioreq_server is HVM only Wei Liu
2018-08-27 15:13   ` Jan Beulich
2018-08-29 16:28     ` Wei Liu
2018-08-26 12:19 ` [PATCH v2 12/23] x86: monitor.o is currently " Wei Liu
2018-08-26 16:33   ` Razvan Cojocaru
2018-08-27 15:18   ` Jan Beulich
2018-08-27 15:23     ` Razvan Cojocaru
2018-08-29 16:42     ` Wei Liu
2018-08-29 17:43       ` Tamas K Lengyel
2018-08-29 18:09         ` Razvan Cojocaru
2018-08-30  7:14           ` Wei Liu
2018-08-26 12:19 ` [PATCH v2 13/23] x86: provide stubs, declarations and macros in hvm.h Wei Liu
2018-08-27 15:43   ` Jan Beulich
2018-09-03  9:45   ` Paul Durrant
2018-09-03  9:50     ` Wei Liu
2018-08-26 12:19 ` [PATCH v2 14/23] x86/mm: put nested p2m code under CONFIG_HVM Wei Liu
2018-08-27 15:56   ` Jan Beulich
2018-08-28  8:40     ` Wei Liu
2018-08-28  9:10       ` Jan Beulich [this message]
2018-08-26 12:19 ` [PATCH v2 15/23] x86/mm: put HVM only " Wei Liu
2018-08-26 16:39   ` Razvan Cojocaru
2018-08-27  9:03   ` Wei Liu
2018-08-28 10:41     ` Wei Liu
2018-08-28 10:53       ` Jan Beulich
2018-08-27 16:01   ` Jan Beulich
2018-08-28 10:41     ` Wei Liu
2018-08-26 12:19 ` [PATCH v2 16/23] x86/p2m/pod: make it build with !CONFIG_HVM Wei Liu
2018-08-28 10:47   ` Jan Beulich
2018-08-28 10:54     ` Wei Liu
2018-08-28 11:32       ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 17/23] x86/mm: put paging_update_nestedmode under CONFIG_HVM Wei Liu
2018-08-28 10:50   ` Jan Beulich
2018-08-30  7:42     ` Wei Liu
2018-08-30  8:35       ` Jan Beulich
2018-09-03 14:27         ` Wei Liu
2018-09-03 14:48           ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 18/23] x86/domctl: XEN_DOMCTL_debug_op is HVM only Wei Liu
2018-08-28 10:50   ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 19/23] x86: PIT emulation is common to both PV and HVM Wei Liu
2018-08-28 11:44   ` Jan Beulich
2018-08-28 13:19     ` Wei Liu
2018-08-28 14:36       ` Jan Beulich
2018-08-28 14:48         ` Wei Liu
2018-08-28 14:51           ` Andrew Cooper
2018-08-28 14:58             ` Wei Liu
2018-08-28 15:04               ` Jan Beulich
2018-08-28 15:17                 ` Wei Liu
2018-08-28 14:56           ` Wei Liu
2018-08-26 12:19 ` [PATCH v2 20/23] xen: connect guest creation with CONFIG_{HVM, PV} Wei Liu
2018-08-28 11:07   ` Julien Grall
2018-08-28 13:13     ` Wei Liu
2018-08-28 11:47   ` Jan Beulich
2018-08-28 13:15     ` Wei Liu
2018-08-26 12:19 ` [PATCH v2 21/23] x86: expose CONFIG_HVM Wei Liu
2018-08-28 11:50   ` Jan Beulich
2018-08-28 12:14     ` Andrew Cooper
2018-08-28 13:33       ` Jan Beulich
2018-08-29 16:56         ` Andrew Cooper
2018-08-30  6:21           ` Jan Beulich
2018-08-30  6:57             ` Juergen Gross
2018-08-31 20:09             ` Andrew Cooper
2018-09-03 11:35               ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 22/23] x86/pvshim: disable HVM for PV shim Wei Liu
2018-08-26 12:19 ` [PATCH v2 23/23] xen: decouple HVM and IOMMU capabilities Wei Liu
2018-08-28 11:56   ` Jan Beulich

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=5B85119502000078001E27C0@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=wei.liu2@citrix.com \
    --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.