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] nestedhvm: ASID emulation

To: Christoph Egger <Christoph.Egger@xxxxxxx>
Subject: Re: [Xen-devel] [PATCH] nestedhvm: ASID emulation
From: Keir Fraser <keir.xen@xxxxxxxxx>
Date: Wed, 13 Apr 2011 16:05:20 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 13 Apr 2011 08:12:23 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:user-agent:date:subject:from:to:cc:message-id :thread-topic:thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; bh=jUVzuBvUAiR2ohxUZDVTVpgkBB5Xj7NnGKpng9H44ws=; b=chx2V4DTxtL5UeEo1SZ/MCy7fD5sb4vXbChvtdfm/1v/gYCfueUBGHQw5hPLv9WRIU JcNdwwZ8FYCbmTsKoDiS1z/DzcV5Igx3Rn5UU+IZJIck7Jwg5kjlIxDScMD05oSuCmcT +2M0FRpuFnQ1nrzH11XTOVpLA2gTNh0wHyQNA=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=user-agent:date:subject:from:to:cc:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=i9Es5Yoto4aZklbAZAtLo4K38FTZBZdS56fLO6UZGJWlYeivu6HR7buIN2vrfhrDHj mxMu8BtxcDRw610sucRE2Hl7BdIj2IpgQbk9CdLwoxdN+n6jvSb5KeIVea4s+xQqhkBs jzy+T3OlLCmwygKlfb58Qgu9BsPqIWtW73SPc=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4DA5B299.3060904@xxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acv57DSVQtGARVE69UuKxRtmcfJIAQ==
Thread-topic: [Xen-devel] [PATCH] nestedhvm: ASID emulation
User-agent: Microsoft-Entourage/
On 13/04/2011 15:26, "Christoph Egger" <Christoph.Egger@xxxxxxx> wrote:

> On 04/13/11 15:27, Keir Fraser wrote:
>> On 13/04/2011 11:37, "Christoph Egger"<Christoph.Egger@xxxxxxx>  wrote:
> We talk about a win of about 1000 cycles per VMRUN and another 1000
> cycles per VMEXIT emulation.
> That's a speedup of about 10% for each VMRUN and about 20% for each
> VMEXIT emulation.

Is this measurable on a macro benchmark?

I mean this looks like a micro-optimisation on a feature that noone is going
to use for serious performance work anyway.

> 4. nestedhvm is enabled and we are going to run l2 guest
> We run the l1 guest in the last call. The asid generation may have
> changed by then. In this case the current nv_n2asid number is stale
> and the value of data->next_asid is <= of nv->nv_n2asid.

How do you know for sure that next_asid will be <= nv_n2asid in this case?
What if other VCPUs have run meanwhile, and next_asid has been incremented
multiple times until it is greather than nv_n2asid?

 -- Keir

> The the value of nv->nv_n2asid is valid if l1 guest doesn't change
> the virtual asid (= asid number in the virtual vmcb) and
> data->next_asid is larger than nv->nv_n2asid. In this case
> just reuse the same hw ASID that has been used from the last
> VMRUN emulation.
> 5. nestedhvm is enabled and we are going to run l2 guest again
> The same hw ASID should be reused unless the generation changed because
> the nestedp2m got flushed or the vcpu moved to a different physical cpu,
> for example.
> But the hw ASID number may never match the hw ASID used to run the l1 guest.
> In all cases we have to verify that the
>> I wouldn't bother fixing #2 unless there's a convincing answer for #1.
>>   -- Keir

Xen-devel mailing list