xen/22744-ept-pod-locking.patch
Charles Arnold 0c76f22ef1 - Update to Xen 4.0.2 rc2-pre, changeset 21443
- bnc#633573 - System fail to boot after running several warm
  reboot tests
  22749-vtd-workarounds.patch
- Upstream patches from Jan
  22744-ept-pod-locking.patch
  22777-vtd-ats-fixes.patch
  22781-pod-hap-logdirty.patch
  22782-x86-emul-smsw.patch
  22789-i386-no-x2apic.patch
  22790-svm-resume-migrate-pirqs.patch
  22816-x86-pirq-drop-priv-check.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=94
2011-02-04 21:19:54 +00:00

48 lines
1.5 KiB
Diff

# HG changeset patch
# User Tim Deegan <Tim.Deegan@citrix.com>
# Date 1294933573 0
# Node ID b01ef59c8c805df751a8f6ae63cdd5c6a4565255
# Parent 54e91dcae649e23fd267d7afe623fbd52b1b4283
x86/mm: fix EPT PoD locking to match the normal p2m case.
This recursive-locking bug was fixed in the main p2m code in
20269:fd3d5d66c446 (in October 2009) but has lurked unseen in
the EPT side since then. Copy the fix across.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Index: xen-4.0.2-testing/xen/arch/x86/mm/hap/p2m-ept.c
===================================================================
--- xen-4.0.2-testing.orig/xen/arch/x86/mm/hap/p2m-ept.c
+++ xen-4.0.2-testing/xen/arch/x86/mm/hap/p2m-ept.c
@@ -37,19 +37,26 @@ static int ept_pod_check_and_populate(st
ept_entry_t *entry, int order,
p2m_query_t q)
{
+ /* Only take the lock if we don't already have it. Otherwise it
+ * wouldn't be safe to do p2m lookups with the p2m lock held */
+ int do_locking = !p2m_locked_by_me(d->arch.p2m);
int r;
- p2m_lock(d->arch.p2m);
+
+ if ( do_locking )
+ p2m_lock(d->arch.p2m);
/* Check to make sure this is still PoD */
if ( entry->avail1 != p2m_populate_on_demand )
{
- p2m_unlock(d->arch.p2m);
+ if ( do_locking )
+ p2m_unlock(d->arch.p2m);
return 0;
}
r = p2m_pod_demand_populate(d, gfn, order, q);
- p2m_unlock(d->arch.p2m);
+ if ( do_locking )
+ p2m_unlock(d->arch.p2m);
return r;
}