0e9e131edf
25242-x86_64-hotplug-compat-m2p.patch 25247-SVM-no-rdtsc-intercept.patch 25267-x86-text-unlikely.patch 25269-x86-vMCE-addr-misc-write.patch 25271-x86_64-IST-index.patch 25327-pvdrv-no-asm-system-h.patch - Upstream patches from Jan 25168-x86-memset-size.patch 25191-x86-tdt-delta-calculation.patch 25195-x86-cpuidle-C2-no-flush-or-bm-check.patch 25196-x86-HAP-PAT-sr.patch 25200-x86_64-trap-bounce-flags.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=189
60 lines
2.3 KiB
Diff
60 lines
2.3 KiB
Diff
# HG changeset patch
|
|
# Parent 00989d5f44b59ba7f3a467342a14b9c7621fa926
|
|
xenpaging: restore p2mt if gfn is needed before evict
|
|
|
|
In the rare case that a gfn is needed by a guest or a foreign domain
|
|
between nominate and evict, restore the p2mt and skip sending a request.
|
|
A request is not needed because the pager will notice the evict failure.
|
|
|
|
Signed-off-by: Olaf Hering <olaf@aepfle.de>
|
|
|
|
---
|
|
xen/arch/x86/mm/p2m.c | 18 +++++++++++-------
|
|
1 file changed, 11 insertions(+), 7 deletions(-)
|
|
|
|
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
|
|
===================================================================
|
|
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
|
|
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
|
|
@@ -3036,6 +3036,7 @@ void p2m_mem_paging_populate(struct p2m_
|
|
p2m_type_t p2mt;
|
|
p2m_access_t a;
|
|
mfn_t mfn;
|
|
+ int restored = 0;
|
|
struct domain *d = p2m->domain;
|
|
|
|
/* Check that there's space on the ring for this request */
|
|
@@ -3051,23 +3052,25 @@ void p2m_mem_paging_populate(struct p2m_
|
|
/* Allow only nominated or evicted pages to enter page-in path */
|
|
if ( p2m_do_populate(p2mt) )
|
|
{
|
|
- /* Evict will fail now, tag this request for pager */
|
|
- if ( p2mt == p2m_ram_paging_out )
|
|
- req.flags |= MEM_EVENT_FLAG_EVICT_FAIL;
|
|
-
|
|
- set_p2m_entry(p2m, gfn, mfn, 0, p2m_ram_paging_in_start, a);
|
|
+ /* Restore page state if gfn was requested before evict */
|
|
+ if ( p2mt == p2m_ram_paging_out && mfn_valid(mfn) ) {
|
|
+ set_p2m_entry(p2m, gfn, mfn, 0, p2m_ram_rw, a);
|
|
+ restored = 1;
|
|
+ } else {
|
|
+ set_p2m_entry(p2m, gfn, mfn, 0, p2m_ram_paging_in_start, a);
|
|
+ }
|
|
audit_p2m(p2m, 1);
|
|
}
|
|
p2m_unlock(p2m);
|
|
|
|
/* Pause domain if request came from guest and gfn has paging type */
|
|
- if ( p2m_is_paging(p2mt) && v->domain == d )
|
|
+ if ( !restored && p2m_is_paging(p2mt) && v->domain == d )
|
|
{
|
|
vcpu_pause_nosync(v);
|
|
req.flags |= MEM_EVENT_FLAG_VCPU_PAUSED;
|
|
}
|
|
/* No need to inform pager if the gfn is not in the page-out path */
|
|
- else if ( !p2m_do_populate(p2mt) )
|
|
+ else if ( restored || !p2m_do_populate(p2mt) )
|
|
{
|
|
/* gfn is already on its way back and vcpu is not paused */
|
|
mem_event_put_req_producers(&d->mem_event->paging);
|