This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-devel] [PATCH 0 of 5] v2: Nested-p2m cleanups and locking chang

To: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 0 of 5] v2: Nested-p2m cleanups and locking changes
From: Christoph Egger <Christoph.Egger@xxxxxxx>
Date: Tue, 28 Jun 2011 15:47:34 +0200
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 28 Jun 2011 06:49:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110627154831.GS17634@xxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1309171570@xxxxxxxxxxxxxxxxxxxxxxx> <20110627105654.GK17634@xxxxxxxxxxxxxxxxxxxxxxx> <4E08762A.2050801@xxxxxxx> <20110627131528.GN17634@xxxxxxxxxxxxxxxxxxxxxxx> <20110627154831.GS17634@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; NetBSD amd64; en-US; rv: Gecko/20110523 Lightning/1.0b3pre Thunderbird/3.1.10
On 06/27/11 17:48, Tim Deegan wrote:
At 14:15 +0100 on 27 Jun (1309184128), Tim Deegan wrote:
At 14:23 +0200 on 27 Jun (1309184586), Christoph Egger wrote:
  - Why is there a 10x increase in IPIs after this series?  I don't see
    what sequence of events sets the relevant cpumask bits to make this

In patch 1 the code that sends the IPIs was outside of the loop and
moved into the loop.

Well, yes, but I don't see what that causes 10x IPIs, unless the vcpus
are burning through np2m tables very quickly indeed.  Maybe removing the
extra flushes for TLB control will do the trick.  I'll make a patch...

I think I get it - it's a race between p2m_flush_nestedp2m() on one CPU
flushing all the nested P2M tables and a VCPU on another CPU repeatedly
getting fresh ones.  Try the attached patch, which should cut back the
major source of p2m_flush_nestedp2m() calls.

Writing it, I realised that after my locking fix, p2m_flush_nestedp2m()
isn't safe because it can run in parallel with p2m_get_nestedp2m, which
reorders the array it walks.  I'll have to make the LRU-fu independent
of the array order; should be easy enough but I'll hold off committing
the current series until I've done it.

With Windows 7 XP mode I see a xen crash where p2m_get_nestedp2m() calls
nestedhvm_vmcx_flushtlb(nv->nv_p2m) with nv->nv_p2m being NULL.

nestedhvm_vmcx_flushtlb() assumes the parameter is not NULL.

(XEN) Xen call trace:
(XEN)    [<ffff82c4801b1d19>] nestedhvm_vmcx_flushtlb+0xf/0x52
(XEN)    [<ffff82c4801d270c>] p2m_get_nestedp2m+0x406/0x497
(XEN)    [<ffff82c4801bad7a>] nestedsvm_vmcb_set_nestedp2m+0x54/0x6a
(XEN)    [<ffff82c4801bc602>] nsvm_vcpu_vmrun+0x984/0xf14
(XEN)    [<ffff82c4801bcd53>] nsvm_vcpu_switch+0x1c1/0x226


---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632

Xen-devel mailing list