On Fri, 2007-03-23 at 09:38 +0100, Christian Ehrhardt wrote:
> Hi everyone,
> I have several issues where I need your help to understand xenppc so 
> that I don't get lost in the code. I try to number the questions so no 
> one can be overseen in the text.
> 1. arch_vcpu
> I order to be able to save/restore performance sprs I need a per vcpu 
> storage, because it only affects our architecture it seemed logic to put 
> that into arch_vcpu (defined in include/asm-powerpc/domain.h). I 
> searched for a while with grep, cscope, ... but unfortunately I can't 
> find the initialization of the variables in the arch_vcpu struct. I 
> found some initializations of the similar arch_domain in 
> arch/powerpc/domain.c and the general vcpu initialization in 
> common/domain.c.
> The only related arch dependent init is in arch/powerpc/domain.c in the 
> function alloc_vcpu_struct, but it looked to small for me because it 
> only does alloc/memset zero.
> I need to initialize my variables, so I welcome every hint where I could 
> find (or create if really not existant) the initialization of the 
> arch_vcpu part.

vcpu_initialise() is where we should be initializing arch_vcpu state. We
currently don't do any of it because it's mostly used as save/restore
storage by 'full_resume'.

Also, the initial register state is special: it will be initialized by
construct_dom0() (for dom0) or by the userland tools doing domU

> 2. background hcall, hypercall, papr call
> Sorry for the confusion jimi, but up to your last mails I don't even 
> know that they are different things. I know the "xen hypercalls" from 
> the xen docs, but can someone please describe (or point to a doc) what 
> the other(s) is/are?
> Whats the difference between them?
> When do we use which kind of call in xenppc?

"hcall" is just an abbreviation for "hypercall". "PAPR hcalls" vs "Xen
hcalls" is the important distinction here.

PAPR is a specification that describes the hypercall ABI for IBM's Power
Hypervisor. Xen was developed independently and so has defined its own
hypercall ABI. In many cases, such as PTE insertion, we have chosen to
implement the PAPR hypercall (this is architecture-specific anyways, so
Xen didn't specify anything here). In other cases, such as IRQ delivery,
we have chosen to implement Xen's hypercalls.

(Note: it would be interesting to implement a PAPR compatibility layer
so that we could support PAPR guests. This is feasible but currently is
low on the priority list.)

Jimi is suggesting that you implement the PAPR version of the
performance monitor hypercall, a.k.a. H_PERFMON. The specification he
pasted in email was from the PAPR.

> Hopefully I understand the suggestion of "ppc_md.enable_pmcs = 
> xen_enable_pmcs;" from Jimi after that ;)
> 3. background hcall, hypercall, papr call - second one
> I hope to get a "I see" with the answer to number two, but it would be 
> really helpful to have some brief cookbook like instructions that 
> describe for the different calls what is and where it need to be 
> implemented - look there for an example.
> Here a wrong example what I hope to get ;)
> Xen Hypercall foo_op:
> 0. Xen & Domain set up an event channel foo_chan - look in 
> xen/bar/file.c & arch/powerpc/platforms/xen/hcall.c
> 1. The Domain needs to setup a irq vector for the irq of the event 
> channel - look arch/powerpc/foo.c
> 2. Xen uses the event channel to notify the domain - look 
> xen/arch/powerpc/foo.c
> papr hcall XY:
> 1. ...

As usual, this is probably too detailed for an open source project still
in heavy development: the description would soon be obsoleted by code
changes. Once you grasp the core data structures, cscope can tell you
all you need to know. :)

However, having a high-level description of e.g. event channels is
valuable. Some of that information is actually available in docs/src
('make docs' should build it), and also on the wiki
(http://wiki.xensource.com/xenwiki/). Of course, it could always be
improved, and we haven't done much documentation of the PowerPC-specific

Hollis Blanchard
IBM Linux Technology Center

Xen-ppc-devel mailing list

Reply via email to