From: Jan Beulich <jbeulich@suse.com>
To: Paul Durrant <pdurrant@amazon.com>
Cc: "Kevin Tian" <kevin.tian@intel.com>, "Wei Liu" <wl@xen.org>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"George Dunlap" <george.dunlap@citrix.com>,
"Jun Nakajima" <jun.nakajima@intel.com>,
xen-devel@lists.xenproject.org,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH v4 4/7] x86 / vmx: move teardown from domain_destroy()...
Date: Tue, 28 Jan 2020 09:14:50 +0100 [thread overview]
Message-ID: <20130b6d-4428-6045-7e84-cd3b55d04ca8@suse.com> (raw)
In-Reply-To: <20200124153103.18321-5-pdurrant@amazon.com>
On 24.01.2020 16:31, Paul Durrant wrote:
> ... to domain_relinquish_resources().
>
> The teardown code frees the APICv page. This does not need to be done late
> so do it in domain_relinquish_resources() rather than domain_destroy().
For the normal domain destruction path this is fine. For the error path
of domain_create(), however, this will leak the page, as in this case
hvm_domain_relinquish_resources() won't be called. I'm afraid there
already is a similar issue with e.g. viridian_domain_deinit(). I guess
I'll make a patch.
Jan
> Signed-off-by: Paul Durrant <pdurrant@amazon.com>
> ---
> Cc: Jun Nakajima <jun.nakajima@intel.com>
> Cc: Kevin Tian <kevin.tian@intel.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> Cc: Wei Liu <wl@xen.org>
> Cc: "Roger Pau Monné" <roger.pau@citrix.com>
> Cc: George Dunlap <george.dunlap@citrix.com>
>
> v4:
> - New in v4 (disaggregated from v3 patch #3)
> ---
> xen/arch/x86/hvm/vmx/vmx.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
> index b262d38a7c..606f3dc2eb 100644
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -419,7 +419,7 @@ static int vmx_domain_initialise(struct domain *d)
> return 0;
> }
>
> -static void vmx_domain_destroy(struct domain *d)
> +static void vmx_domain_relinquish_resources(struct domain *d)
> {
> if ( !has_vlapic(d) )
> return;
> @@ -2240,7 +2240,7 @@ static struct hvm_function_table __initdata vmx_function_table = {
> .cpu_up_prepare = vmx_cpu_up_prepare,
> .cpu_dead = vmx_cpu_dead,
> .domain_initialise = vmx_domain_initialise,
> - .domain_destroy = vmx_domain_destroy,
> + .domain_relinquish_resources = vmx_domain_relinquish_resources,
> .vcpu_initialise = vmx_vcpu_initialise,
> .vcpu_destroy = vmx_vcpu_destroy,
> .save_cpu_ctxt = vmx_save_vmcs_ctxt,
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2020-01-28 8:15 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-24 15:30 [Xen-devel] [PATCH v4 0/7] purge free_shared_domheap_page() Paul Durrant
2020-01-24 15:30 ` [Xen-devel] [PATCH v4 1/7] x86 / vmx: make apic_access_mfn type-safe Paul Durrant
2020-01-24 15:30 ` [Xen-devel] [PATCH v4 2/7] x86 / hvm: add domain_relinquish_resources() method Paul Durrant
2020-01-24 15:30 ` [Xen-devel] [PATCH v4 3/7] x86 / hvm: make domain_destroy() method optional Paul Durrant
2020-01-24 15:44 ` Jan Beulich
2020-01-24 15:31 ` [Xen-devel] [PATCH v4 4/7] x86 / vmx: move teardown from domain_destroy() Paul Durrant
2020-01-28 8:14 ` Jan Beulich [this message]
2020-01-28 8:22 ` Durrant, Paul
2020-01-28 11:41 ` Jan Beulich
2020-01-24 15:31 ` [Xen-devel] [PATCH v4 5/7] mm: make MEMF_no_refcount pages safe to assign Paul Durrant
2020-01-28 15:23 ` Jan Beulich
2020-01-28 17:01 ` Durrant, Paul
2020-01-29 8:21 ` Jan Beulich
2020-01-29 8:29 ` Durrant, Paul
2020-01-28 17:13 ` Durrant, Paul
2020-01-24 15:31 ` [Xen-devel] [PATCH v4 6/7] x86 / vmx: use a MEMF_no_refcount domheap page for APIC_DEFAULT_PHYS_BASE Paul Durrant
2020-01-28 15:23 ` Jan Beulich
2020-01-24 15:31 ` [Xen-devel] [PATCH v4 7/7] mm: remove donate_page() Paul Durrant
2020-01-24 16:07 ` George Dunlap
2020-01-24 16:35 ` Julien Grall
2020-01-24 17:56 ` Andrew Cooper
2020-01-24 18:36 ` Durrant, Paul
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=20130b6d-4428-6045-7e84-cd3b55d04ca8@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=jun.nakajima@intel.com \
--cc=kevin.tian@intel.com \
--cc=pdurrant@amazon.com \
--cc=roger.pau@citrix.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).