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@xxxxxxx>
Date: Fri, 15 Apr 2011 10:05:46 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 15 Apr 2011 02:06:50 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:user-agent:date:subject:from:to:cc :message-id:thread-topic:thread-index:in-reply-to:mime-version :content-type:content-transfer-encoding; bh=R6R6au1inn0xOfeT6+kY5ITE6N7nG8yPYHGAgbtkNSc=; b=Z8pqM5bg7U7tFq6LOc/NUO9Te6gDW5ISB+Oz3HB274vrd7EM8ICkXnpUUg///KiXMx yyVlnvIxYOW7XdCS3x3n7J7XwGRxe2CkfHND1hoAMlbGRinDqkjdVFapfTe4ksWCzNyF 1qXjoAKsjA9oqchMLd4gi/0+VP8o0ihyb0N7o=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=UnK6v2p3hyx+EzLPbpb0ks5zQWaWjPJVxro7d2OeIVjIYYy0VsLf3rtdrlT18NtPUd idVEBCWYS8IzaZmvsK8BZaljht44+a7Dw+lnENoC3VB7sdAdOqdGje8PWpO7DghLAATF GJBQJ+GaLY4LFLunntxMO8m6zeJHNZDmMYv5s=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4DA7FFC6.3080702@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: Acv7TE5NEYks83RgnkWkM/EU4zptLQ==
Thread-topic: [Xen-devel] [PATCH] nestedhvm: ASID emulation
User-agent: Microsoft-Entourage/

On 15/04/2011 09:20, "Christoph Egger" <Christoph.Egger@xxxxxxx> wrote:

> On 04/14/11 16:43, Keir Fraser wrote:
>> On 14/04/2011 15:01, "Christoph Egger"<Christoph.Egger@xxxxxxx>  wrote:
>>>> What if some other vcpu's nv_n1asid or nv_n2asid got assigned the same HW
>>>> asid in this generation as this vcpu's (now stale, as it's from a previous
>>>> generation's) nv_n2asid? This PCPU can be interleaving execution of other
>>>> HVM VCPUs after all.
>>> I am not sure if I got you right. You mean what if two vcpus run on one
>>> physical cpu? In this case svm_do_resume() calls hvm_asid_flush_vcpu()
>>> before so that asid_generation and core_asid_generation do not match and
>>> a new asid is always assigned.
>> No, it only does that if a given VCPU gets scheduled onto a *different* PCPU
>> than last time it ran.
>> I've attached a mostly rewritten version of your patch that is about half
>> the size and I believe has a fighting chance of being correct (however it is
>> only build tested). Give it a look and a spin.
> Yes, it is correct. I like the idea to maintain a generation per asid.
> Please apply it. Thanks for this work.

You didn't notice my subtle error in switching n1 and n2 asid selection in
svm_asid_handle_vmrun()? ;-) Actually I bet it would take a lot of testing
to pick up on that error, since the transposition doesn't much matter except
that we are then switched round relative to which ASID gets flushed on
guest-initiated INVLPGA, and also we'd flush the 'wrong' ASID when guest
requests a new L2 guest ASID. Anyway, glad I spotted it before I checked the
patch in! Stale TLB bugs are no fun.

 -- Keir

> Christoph

Xen-devel mailing list