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

[Xen-devel] Re: [PATCH FIXED] x86: use flush_tlb_others to implement flu

To: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH FIXED] x86: use flush_tlb_others to implement flush_tlb_all
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Wed, 13 May 2009 10:36:22 -0700
Cc: Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxx>, the arch/x86 maintainers <x86@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>
Delivery-date: Wed, 13 May 2009 10:36:50 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1242204775.24976.7.camel@xxxxxxxxxxxxxxxxxxxxxx>
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: <4A09E5FE.2080507@xxxxxxxx> <4A0A0D7C.8050206@xxxxxxxxx> <4A0A154C.9080000@xxxxxxxx> <1242204775.24976.7.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.21 (X11/20090320)
Ian Campbell wrote:
get_cpu() returns smp_processor_id() so wouldn't this be more normally
written as:
        /* flush_tlb_others expects preempt to be disabled */
        unsigned long cpu = get_cpu();
        [....]
        if ([....] == TLBSTATE_LAZY)
                leave_mm(cpu)
        put_cpu();

Quite so. In theory gcc should be able to CSE smp_processor_id(), but the intent of get_cpu() is that you use its return value...

   J

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