From: Keir Fraser Subject: Re: [PATCH] x86: optimize this_cpu() Date: Tue, 13 Jul 2010 16:03:48 +0100 Message-ID: References: <4C3C9AFA020000780000B030@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4C3C9AFA020000780000B030@vpn.id2.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 13/07/2010 15:57, "Jan Beulich" wrote: >> Where does that come from? > > From various assembly files, defining GET_CURRENT() or alike > on their own. grep-ing for STACK_SIZE had helped me noticing > the issue. Likewise GET_GUEST_REGS() implies that > "guest_cpu_user_regs" is the first field of struct cpu_info (but > this I would consider expected). Hmm, I think I will do a cleanup patch, thanks! On this theme, just look at how the code in arch/x86/acpi/wakeup_prot.S (lines 162--167) does multiple hardcoded indirections to get at the current domain_id. That is absolutely shocking! -- Keir