WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] [PATCH] add support for XCHG instruction accessingAPIC

To: "Boris Ostrovsky" <bostrovsky@xxxxxxxxxxxxxxx>, "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH] add support for XCHG instruction accessingAPIC
From: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>
Date: Thu, 6 Apr 2006 00:50:54 +0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 05 Apr 2006 10:52:23 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcZYvQsfAY9511SOQ1GVK5EXNXYOLgAEgw0A
Thread-topic: [Xen-devel] [PATCH] add support for XCHG instruction accessingAPIC
I think the reason we don't take any lock here is; we are sure this is just 
used for local APIC range. However, if in future someone adds another MMIO 
range or if IOAPIC is accessed with XCHG (will this happen?), this may have 
potential issue.

So I'd suggest adding comments that we didn't take any lock here, or add a 
check to make sure the range is on local APIC range.

Thanks
Yunhong Jiang

>-----Original Message-----
>From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>[mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Boris Ostrovsky
>Sent: 2006年4月5日 7:26
>To: Keir Fraser
>Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
>Subject: Re: [Xen-devel] [PATCH] add support for XCHG instruction accessingAPIC
>
>Keir Fraser wrote:
>
>>>
>>> My only argument in favor of using the lock would be for completeness
>>> of the emulation. You are
>>> absolutely right in that for Linux there seems to be no need to hold
>>> the lock. My concern is that
>>> other OSs  may treat this differently. And if we don't have sources,
>>> it may be somewhat difficult
>>> to  figure out that the atomicity (or lack of it) was the cause of a
>>> problem.
>>>
>>> If, however, there is a strong feeling that we don't need the lock, I
>>> am happy to drop it.
>>> I guess you are mostly unhappy about adding a new field to
>>> hvm_domain, not about performance
>>> impact?
>>
>>
>> Yes, also my second argument was that there is *no way* for two VCPUs
>> to conflict on a local APIC access, since LAPIC accesses are always to
>> the VCPU's own LAPIC. So there is no potential concurrency that needs
>> to be serialised, regardless of the guest OS.
>
>
>OK, that's fair. Here is updated patch with lock removed.
>
>I don't think I then understand why Linux is using atomic accesses to
>local APICs. It's interesting though that 64-bit code doesn't do it ---
>they use vanilla apic_write().
>
>-boris

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>