All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandru Stefan ISAILA <aisaila@bitdefender.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Kevin Tian" <kevin.tian@intel.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Julien Grall" <julien@xen.org>, "Wei Liu" <wl@xen.org>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
	"George Dunlap" <George.Dunlap@eu.citrix.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Ian Jackson" <ian.jackson@eu.citrix.com>,
	"Jun Nakajima" <jun.nakajima@intel.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH V2] x86/altp2m: Hypercall to set altp2m view visibility
Date: Tue, 18 Feb 2020 14:42:30 +0000	[thread overview]
Message-ID: <1fd4b6fc-f380-ac8e-4b3d-394d48885fb7@bitdefender.com> (raw)
In-Reply-To: <695f304c-2968-66fe-5a33-14c81d980d18@bitdefender.com>


>>> --- a/xen/arch/x86/mm/hap/hap.c
>>> +++ b/xen/arch/x86/mm/hap/hap.c
>>> @@ -488,8 +488,17 @@ int hap_enable(struct domain *d, u32 mode)
>>>                goto out;
>>>            }
>>>    
>>> +        if ( (d->arch.altp2m_working_eptp = alloc_xenheap_page()) == NULL )
>>> +        {
>>> +            rv = -ENOMEM;
>>> +            goto out;
>>> +        }
>>
>> Isn't there a pre-existing error handling issue here which you
>> widen, in that later encountered errors don't cause clean up
>> of what had already succeeded before?
> 
> It seems non of the errors perform a cleanup. It might be better to have
> a general cleanup done at "out:" if ( !rv ) and then check what should
> be "p2m_teardown()" or "free_xenheap_page()".
> 

I've looked around for this and it is handled in arch_domain_create().
If hvm_domain_initialise() fails then paging_final_teardown() is called 
and in the end hap_final_teardown() takes care of cleaning up.

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

  reply	other threads:[~2020-02-18 14:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-30 13:07 [Xen-devel] [PATCH V2] x86/altp2m: Hypercall to set altp2m view visibility Alexandru Stefan ISAILA
2020-02-07  8:54 ` Alexandru Stefan ISAILA
2020-02-17 11:52 ` [Xen-devel] Ping: " Alexandru Stefan ISAILA
2020-02-17 14:14 ` [Xen-devel] " Jan Beulich
2020-02-18  8:13   ` Alexandru Stefan ISAILA
2020-02-18 14:42     ` Alexandru Stefan ISAILA [this message]
2020-02-18 14:47       ` 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=1fd4b6fc-f380-ac8e-4b3d-394d48885fb7@bitdefender.com \
    --to=aisaila@bitdefender.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=konrad.wilk@oracle.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.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.