From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
xen-devel <xen-devel@lists.xenproject.org>
Cc: Keir Fraser <keir@xen.org>
Subject: Re: [PATCH 1/2] x86: slightly simplify PHYSDEVOP_pirq_eoi_gmfn_v* handling
Date: Mon, 19 Jan 2015 15:40:24 +0000 [thread overview]
Message-ID: <54BD2568.90205@citrix.com> (raw)
In-Reply-To: <54BD327A02000078000568CB@mail.emea.novell.com>
On 19/01/15 15:36, Jan Beulich wrote:
> We don't really need the MFN in more than one place (after dropping
> mfn_to_page() translations where we know the result already), so no
> need to have a local variable for it.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> --- a/xen/arch/x86/physdev.c
> +++ b/xen/arch/x86/physdev.c
> @@ -336,7 +336,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
> case PHYSDEVOP_pirq_eoi_gmfn_v2:
> case PHYSDEVOP_pirq_eoi_gmfn_v1: {
> struct physdev_pirq_eoi_gmfn info;
> - unsigned long mfn;
> struct page_info *page;
>
> ret = -EFAULT;
> @@ -352,21 +351,20 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
> put_page(page);
> break;
> }
> - mfn = page_to_mfn(page);
>
> if ( cmpxchg(&v->domain->arch.pirq_eoi_map_mfn,
> - 0, mfn) != 0 )
> + 0, page_to_mfn(page)) != 0 )
> {
> - put_page_and_type(mfn_to_page(mfn));
> + put_page_and_type(page);
> ret = -EBUSY;
> break;
> }
>
> - v->domain->arch.pirq_eoi_map = map_domain_page_global(mfn);
> + v->domain->arch.pirq_eoi_map = __map_domain_page_global(page);
> if ( v->domain->arch.pirq_eoi_map == NULL )
> {
> v->domain->arch.pirq_eoi_map_mfn = 0;
> - put_page_and_type(mfn_to_page(mfn));
> + put_page_and_type(page);
> ret = -ENOSPC;
> break;
> }
>
>
>
next prev parent reply other threads:[~2015-01-19 15:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-19 15:30 [PATCH 0/2] x86: physdev-op handling adjustments Jan Beulich
2015-01-19 15:36 ` [PATCH 1/2] x86: slightly simplify PHYSDEVOP_pirq_eoi_gmfn_v* handling Jan Beulich
2015-01-19 15:40 ` Andrew Cooper [this message]
2015-01-19 15:36 ` [PATCH 2/2] x86: latch current‑>domain in do_physdev_op() Jan Beulich
2015-01-19 15:58 ` Andrew Cooper
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=54BD2568.90205@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=keir@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.