All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Cc: Kevin Tian <kevin.tian@intel.com>, Jun Nakajima <jun.nakajima@intel.com>
Subject: Re: [PATCH 2/3] VMX: allocate VMCS pages from domain heap
Date: Tue, 20 Oct 2015 11:12:46 +0100	[thread overview]
Message-ID: <5626139E.60906@citrix.com> (raw)
In-Reply-To: <562526D002000078000AC766@prv-mh.provo.novell.com>

On 19/10/15 16:22, Jan Beulich wrote:
> -static struct vmcs_struct *vmx_alloc_vmcs(void)
> +static paddr_t vmx_alloc_vmcs(void)
>  {
> +    struct page_info *pg;
>      struct vmcs_struct *vmcs;
>  
> -    if ( (vmcs = alloc_xenheap_page()) == NULL )
> +    if ( (pg = alloc_domheap_page(NULL, 0)) == NULL )

As an observation, it would be good to pass v from the caller, and NUMA
allocate against v->domain here.

> @@ -580,7 +583,7 @@ int vmx_cpu_up_prepare(unsigned int cpu)
>  void vmx_cpu_dead(unsigned int cpu)
>  {
>      vmx_free_vmcs(per_cpu(vmxon_region, cpu));
> -    per_cpu(vmxon_region, cpu) = NULL;
> +    per_cpu(vmxon_region, cpu) = 0;

While this is currently safe (as pa 0 is not part of the available heap
allocation range), might it be worth introducing a named sentential?  I
can forsee a DMLite nested Xen scenario where we definitely don't need
to treat the low 1MB magically.

> --- a/xen/arch/x86/hvm/vmx/vvmx.c
> +++ b/xen/arch/x86/hvm/vmx/vvmx.c
> @@ -56,13 +56,14 @@ int nvmx_vcpu_initialise(struct vcpu *v)
>  {
>      struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
>      struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
> +    struct page_info *pg = alloc_domheap_page(NULL, 0);

Again - this can be NUMA allocated with v->domain.

~Andrew

  reply	other threads:[~2015-10-20 10:12 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-19 15:10 [PATCH 0/3] VMX: misc adjustments Jan Beulich
2015-10-19 15:21 ` [PATCH 1/3] VMX: re-order definitions Jan Beulich
2015-10-21  3:04   ` Tian, Kevin
2015-10-19 15:22 ` [PATCH 2/3] VMX: allocate VMCS pages from domain heap Jan Beulich
2015-10-20 10:12   ` Andrew Cooper [this message]
2015-10-20 10:35     ` Jan Beulich
2015-10-21  3:16       ` Tian, Kevin
2015-10-21  5:54         ` Jan Beulich
2015-11-23 14:28         ` Jan Beulich
2015-11-24  5:04           ` Tian, Kevin
2015-11-24  7:50             ` Jan Beulich
2015-11-24 10:55               ` Andrew Cooper
2015-11-24 10:59                 ` Andrew Cooper
2015-11-24 11:04                   ` Jan Beulich
2015-11-24 11:09                     ` Andrew Cooper
2015-10-19 15:23 ` [PATCH 3/3] vVMX: use latched VMCS machine address Jan Beulich
2015-10-21  5:44   ` Tian, Kevin
2016-02-23  8:34   ` Li, Liang Z
2016-02-23 10:31     ` Jan Beulich
2016-02-23 10:48       ` Li, Liang Z
2016-02-24  7:04       ` Li, Liang Z
2016-02-24 10:32         ` Jan Beulich
2016-02-24 15:08           ` Li, Liang Z
2016-02-25  6:50           ` Li, Liang Z
2016-02-25  9:01             ` Jan Beulich
2016-02-25  9:42               ` Li, Liang Z

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=5626139E.60906@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.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.