From: Andi Kleen Subject: Re: [RFC PATCH 18/35] Support gdt/idt/ldt handling on Xen. Date: Wed, 10 May 2006 22:23:48 +0200 Message-ID: <200605102223.48955.ak@suse.de> References: <20060509084945.373541000@sous-sol.org> <20060509085155.177937000@sous-sol.org> <20060509072139.GB4150@ucw.cz> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20060509072139.GB4150@ucw.cz> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: virtualization@lists.osdl.org Cc: Chris Wright , Ian Pratt , xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org, Pavel Machek List-Id: xen-devel@lists.xenproject.org On Tuesday 09 May 2006 09:21, Pavel Machek wrote: > Hi! > > > +static inline void load_TLS(struct thread_struct *t, unsigned int cpu) > > +{ > > +#define C(i) get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN + i] = t->tls_array[i] > > + C(0); C(1); C(2); > > +#undef C > > +} > > Why not use for loop here? gcc should be able to optimize it... I don't think you can really blame the Xen people for that code - it's just the old code moved. -Andi