From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>, Tim Deegan <tim@xen.org>
Subject: Re: [PATCH v2 1/2] x86/P2M: pass on errors from p2m_set_entry()
Date: Tue, 6 May 2014 15:09:30 +0100 [thread overview]
Message-ID: <5368ED1A.1020702@citrix.com> (raw)
In-Reply-To: <536900B7020000780000F666@mail.emea.novell.com>
[-- Attachment #1.1: Type: text/plain, Size: 3256 bytes --]
On 06/05/14 14:33, Jan Beulich wrote:
> ... at least in a couple of straightforward cases.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> v2: Split out change to p2m_change_type().
>
> --- a/xen/arch/x86/mm/p2m.c
> +++ b/xen/arch/x86/mm/p2m.c
> @@ -501,7 +501,7 @@ void p2m_final_teardown(struct domain *d
> }
>
>
> -static void
> +static int
> p2m_remove_page(struct p2m_domain *p2m, unsigned long gfn, unsigned long mfn,
> unsigned int page_order)
> {
> @@ -515,7 +515,7 @@ p2m_remove_page(struct p2m_domain *p2m,
> if ( need_iommu(p2m->domain) )
> for ( i = 0; i < (1 << page_order); i++ )
> iommu_unmap_page(p2m->domain, mfn + i);
> - return;
> + return 0;
> }
>
> ASSERT(gfn_locked_by_me(p2m, gfn));
> @@ -531,8 +531,8 @@ p2m_remove_page(struct p2m_domain *p2m,
> ASSERT( !p2m_is_valid(t) || mfn + i == mfn_x(mfn_return) );
> }
> }
> - p2m_set_entry(p2m, gfn, _mfn(INVALID_MFN), page_order, p2m_invalid,
> - p2m->default_access);
> + return p2m_set_entry(p2m, gfn, _mfn(INVALID_MFN), page_order, p2m_invalid,
> + p2m->default_access);
> }
>
> void
> @@ -957,8 +957,7 @@ int p2m_mem_paging_nominate(struct domai
> goto out;
>
> /* Fix p2m entry */
> - p2m_set_entry(p2m, gfn, mfn, PAGE_ORDER_4K, p2m_ram_paging_out, a);
> - ret = 0;
> + ret = p2m_set_entry(p2m, gfn, mfn, PAGE_ORDER_4K, p2m_ram_paging_out, a);
>
> out:
> gfn_unlock(p2m, gfn, 0);
> @@ -1022,7 +1021,8 @@ int p2m_mem_paging_evict(struct domain *
> put_page(page);
>
> /* Remove mapping from p2m table */
> - p2m_set_entry(p2m, gfn, _mfn(INVALID_MFN), PAGE_ORDER_4K, p2m_ram_paged, a);
> + ret = p2m_set_entry(p2m, gfn, _mfn(INVALID_MFN), PAGE_ORDER_4K,
> + p2m_ram_paged, a);
>
> /* Clear content before returning the page to Xen */
> scrub_one_page(page);
> @@ -1030,8 +1030,6 @@ int p2m_mem_paging_evict(struct domain *
> /* Track number of paged gfns */
> atomic_inc(&d->paged_pages);
>
> - ret = 0;
> -
> out_put:
> /* Put the page back so it gets freed */
> put_page(page);
> @@ -1231,16 +1229,14 @@ int p2m_mem_paging_prep(struct domain *d
> /* Make the page already guest-accessible. If the pager still has a
> * pending resume operation, it will be idempotent p2m entry-wise,
> * but will unpause the vcpu */
> - p2m_set_entry(p2m, gfn, mfn, PAGE_ORDER_4K,
> - paging_mode_log_dirty(d) ? p2m_ram_logdirty :
> - p2m_ram_rw, a);
> + ret = p2m_set_entry(p2m, gfn, mfn, PAGE_ORDER_4K,
> + paging_mode_log_dirty(d) ? p2m_ram_logdirty
> + : p2m_ram_rw, a);
> set_gpfn_from_mfn(mfn_x(mfn), gfn);
>
> if ( !page_extant )
> atomic_dec(&d->paged_pages);
>
> - ret = 0;
> -
> out:
> gfn_unlock(p2m, gfn, 0);
> return ret;
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
[-- Attachment #1.2: Type: text/html, Size: 4043 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2014-05-06 14:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-06 13:18 [PATCH v2 0/2] x86/P2M: pass on errors from p2m_set_entry() Jan Beulich
2014-05-06 13:33 ` [PATCH v2 1/2] " Jan Beulich
2014-05-06 14:09 ` Andrew Cooper [this message]
2014-05-06 13:34 ` [PATCH v2 2/2] x86/P2M: p2m_change_type() should pass on error " Jan Beulich
2014-05-08 11:16 ` [PATCH v2 0/2] x86/P2M: pass on errors " 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=5368ED1A.1020702@citrix.com \
--to=andrew.cooper3@citrix.com \
--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.