From: "Egger, Christoph" <chegger@amazon.de>
To: Jan Beulich <JBeulich@suse.com>,
xen-devel <xen-devel@lists.xenproject.org>
Cc: Tim Deegan <tim@xen.org>
Subject: Re: [PATCH] x86/p2m: also clear defer_nested_flush on error
Date: Tue, 15 Apr 2014 16:50:22 +0200 [thread overview]
Message-ID: <534D472E.3060407@amazon.de> (raw)
In-Reply-To: <534D59DF02000078000090A1@nat28.tlf.novell.com>
On 15.04.14 16:10, Jan Beulich wrote:
> While presumably benign (domain creation ought to fail when P2M setup
> fails) let's be on the safe side and clear the flag as intended. And
> actually, the code can be streamlined quite a bit by recognizing that
> the only difference between the success and error cases is the message
> printed in each case. With that, a stray spin_unlock() also goes away.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Nice cleanup!
Reviewed-by: Christoph Egger <chegger@amazon.de>
>
> --- a/xen/arch/x86/mm/p2m.c
> +++ b/xen/arch/x86/mm/p2m.c
> @@ -435,18 +435,12 @@ int p2m_alloc_table(struct p2m_domain *p
> p2m->defer_nested_flush = 1;
> rc = p2m_set_entry(p2m, 0, _mfn(INVALID_MFN), PAGE_ORDER_4K,
> p2m_invalid, p2m->default_access);
> - if ( rc )
> - goto error;
> p2m->defer_nested_flush = 0;
> -
> - P2M_PRINTK("p2m table initialised for slot zero\n");
> - p2m_unlock(p2m);
> - return 0;
> -
> - spin_unlock(&p2m->domain->page_alloc_lock);
> - error:
> - P2M_PRINTK("failed to initialise p2m table for slot zero. rc:%d\n", rc);
> p2m_unlock(p2m);
> + if ( !rc )
> + P2M_PRINTK("p2m table initialised for slot zero\n");
> + else
> + P2M_PRINTK("failed to initialise p2m table for slot zero (%d)\n", rc);
> return rc;
> }
next prev parent reply other threads:[~2014-04-15 14:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-15 14:10 [PATCH] x86/p2m: also clear defer_nested_flush on error Jan Beulich
2014-04-15 14:17 ` Andrew Cooper
2014-04-15 14:50 ` Egger, Christoph [this message]
2014-04-24 11:35 ` Tim Deegan
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=534D472E.3060407@amazon.de \
--to=chegger@amazon.de \
--cc=JBeulich@suse.com \
--cc=tim@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.