From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Egger Subject: Re: [PATCH] nestedhvm: ASID emulation Date: Thu, 14 Apr 2011 16:01:56 +0200 Message-ID: <4DA6FE54.2050403@amd.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 04/14/11 12:28, Keir Fraser wrote: > On 14/04/2011 10:26, "Christoph Egger" wrote: > >>> What if nv_n2asid wast last assigned on a previous generation, but nv_n1asid >>> was assigned from the current generation? Then you'd have next_asid> >>> nv_n2asid, but nv_n2asid is stale. >> >> When the generation changes, next_asid is set back to 1 and the hw TLB >> flushed. >> >> If next_asid is larger than nv_n2asid then it is reused and this is ok >> since the hw TLB got flushed. It is just important that nv_n1asid never >> gets the same hw ASID assigned and that is what the do { } while loop >> ensures. > > 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. Christoph -- ---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