From: "Jan Beulich" Subject: Re: set_current in Xen booting sequence Date: Mon, 03 Dec 2012 08:50:52 +0000 Message-ID: <50BC75FC02000078000AD310@nat28.tlf.novell.com> References: <1354520163.12932.YahooMailNeo@web120002.mail.ne1.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1354520163.12932.YahooMailNeo@web120002.mail.ne1.yahoo.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: maheen butt Cc: xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 03.12.12 at 08:36, maheen butt wrote: > Hi all, > > I'm investigating Xen bootup sequence and I'm stuck with the function > set_current((struct vcpu *)0xfffff000); > the high level idea is that it is assigning VCPU to physical CPU but I can't > understand the following > > > 1) what is the need of this hard coded address? it is seemed that vcpu > exist on this address (but no idea who put vcpu on that particular > address)? > (the same address is passed both in case of ARM and X86) This is merely a debugging safeguard, making sure accesses through "current" crash rather than going unnoticed. > 2) no idea about what exactly get_cpu_info() (called by set_current) is > doing.. (logically doing & and or with sp register)? It does what its name says - getting the cpu_info structure's address for the current CPU. As that lives at the end of the stack, arithmetic on the stack pointer it the appropriate thing to do here. Jan