xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* set_current in Xen booting sequence
@ 2012-12-03  7:36 maheen butt
  2012-12-03  8:50 ` Jan Beulich
  2012-12-03 17:54 ` Keir Fraser
  0 siblings, 2 replies; 3+ messages in thread
From: maheen butt @ 2012-12-03  7:36 UTC (permalink / raw)
  To: xen-devel@lists.xensource.com


[-- Attachment #1.1: Type: text/plain, Size: 578 bytes --]

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)
2) no idea about what exactly get_cpu_info() (called by set_current) is doing..  (logically doing & and or with sp register)?
 
Thanks

[-- Attachment #1.2: Type: text/html, Size: 1741 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: set_current in Xen booting sequence
  2012-12-03  7:36 set_current in Xen booting sequence maheen butt
@ 2012-12-03  8:50 ` Jan Beulich
  2012-12-03 17:54 ` Keir Fraser
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2012-12-03  8:50 UTC (permalink / raw)
  To: maheen butt; +Cc: xen-devel

>>> On 03.12.12 at 08:36, maheen butt <maheen_butt26@yahoo.com> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: set_current in Xen booting sequence
  2012-12-03  7:36 set_current in Xen booting sequence maheen butt
  2012-12-03  8:50 ` Jan Beulich
@ 2012-12-03 17:54 ` Keir Fraser
  1 sibling, 0 replies; 3+ messages in thread
From: Keir Fraser @ 2012-12-03 17:54 UTC (permalink / raw)
  To: maheen butt, xen-devel@lists.xensource.com


[-- Attachment #1.1: Type: text/plain, Size: 947 bytes --]

It¹s a dummy or poison value to catch invalid use of current before it is
properly set up.

 -- Keir

On 03/12/2012 07:36, "maheen butt" <maheen_butt26@yahoo.com> 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)
> 2) no idea about what exactly get_cpu_info() (called by set_current) is
> doing..  (logically doing & and or with sp register)?
>  
> Thanks
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


[-- Attachment #1.2: Type: text/html, Size: 1719 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-12-03 17:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-03  7:36 set_current in Xen booting sequence maheen butt
2012-12-03  8:50 ` Jan Beulich
2012-12-03 17:54 ` Keir Fraser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).