All of lore.kernel.org
 help / color / mirror / Atom feed
* Proposal for init/kexec/hotplug format for Xen
@ 2005-02-26 20:57 Rusty Russell
  2005-02-27 10:53 ` Keir Fraser
  0 siblings, 1 reply; 29+ messages in thread
From: Rusty Russell @ 2005-02-26 20:57 UTC (permalink / raw)
  To: Xen Mailing List; +Cc: Jeremy Katz

Hi all,

	This has a degree of overlap with Jeremy's excellent work: I've been
looking at the bundling of device information passed to guest OSes when
they boot, and future uses for kexec and possibly the implementation of
hotplug.

	For kexec and bare-metal bringup, the PPC64 port uses a fairly simple
header + flattened tree of keyword/value pairs (on PPC64, used to hold
the Open Firmware tree plus Linux extras).  This offers flexibility for
new virtual devices, etc; I propose that we adopt this format or
something very similar for Xen, first by putting a pointer into it in
start_info_t, and then migrate entries across as appropriate.  Here's
the code from PPC64:

/* Definitions used by the flattened device tree */
#define OF_DT_HEADER		0xd00dfeed	/* 4: version, 4: total size */
#define OF_DT_BEGIN_NODE	0x1		/* Start node: full name */
#define OF_DT_END_NODE		0x2		/* End node */
#define OF_DT_PROP		0x3		/* Property: name off, size, content */
#define OF_DT_END		0x9

#define OF_DT_VERSION		1

/*
 * This is what gets passed to the kernel by prom_init or kexec
 *
 * The dt struct contains the device tree structure, full pathes and
 * property contents. The dt strings contain a separate block with just
 * the strings for the property names, and is fully page aligned and
 * self contained in a page, so that it can be kept around by the kernel,
 * each property name appears only once in this page (cheap compression)
 *
 * the mem_rsvmap contains a map of reserved ranges of physical memory,
 * passing it here instead of in the device-tree itself greatly simplifies
 * the job of everybody. It's just a list of u64 pairs (base/size) that
 * ends when size is 0
 */
struct boot_param_header
{
	u32	magic;			/* magic word OF_DT_HEADER */
	u32	totalsize;		/* total size of DT block */
	u32	off_dt_struct;		/* offset to structure */
	u32	off_dt_strings;		/* offset to strings */
	u32	off_mem_rsvmap;		/* offset to memory reserve map */
	u32	version;		/* format version */
	u32	last_comp_version;	/* last compatible version */
	/* version 2 fields below */
	u32	boot_cpuid_phys;	/* Which physical CPU id we're booting on */
};

Thoughts?
Rusty.
-- 
A bad analogy is like a leaky screwdriver -- Richard Braakman



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 29+ messages in thread
* Re: Re: Re: Proposal for init/kexec/hotplug format for Xen
@ 2005-02-28 13:08 harry
  2005-02-28 13:32 ` Rusty Russell
  0 siblings, 1 reply; 29+ messages in thread
From: harry @ 2005-02-28 13:08 UTC (permalink / raw)
  To: Rusty Russell, harry
  Cc: Anthony Liguori, Keir Fraser, Jeremy Katz, Xen Mailing List

You are thinking about the code differences from the point of view of the code running inside the domain.  What about the code outside the domain, for example, is the code required to remove a device from one domain and give it to another going to have to be different depending on whether the target domain has been booted yet?


> Message date : Feb 28 2005, 01:01 PM
> From : "Rusty Russell" <rusty@rustcorp.com.au>
> To : harry@hebutterworth.freeserve.co.uk
> Copy to : "Anthony Liguori" <aliguori@us.ibm.com>, "Keir Fraser" <Keir.Fraser@cl.cam.ac.uk>, "Jeremy Katz" <katzj@redhat.com>, "Xen Mailing List" <xen-devel@lists.sourceforge.net>
> Subject : Re: Re: [Xen-devel] Proposal for init/kexec/hotplug format for Xen
> 
> On Mon, 2005-02-28 at 13:22 +0100, harry@hebutterworth.freeserve.co.uk
> wrote:
> > Why have two separate mechanisms when the mechanism required for
> > hotplug can be used to build the tree from scratch?
> 
> The only difference would be the transport for hotplug events, which is
> infrastructure which needs to exist anyway to transport other
> information between domains.
> 
> We'll see when the code's finished, but I see the code being:
> 
> 	__init boot_devtree_setup()
> 	{
> 		devtree_add(boot_devtree_ptr);
> 	}
> 
> 	hotplug_receive_event()
> 	{
> 		receive data
> 		if (op == ADD)
> 			devtree_add(data);
> 		else if (op == REMOVE)
> 			devtree_remove(data);
> 	}
> 
> ie. the mere difference in transport should be a few lines of code.
> Rusty.
> -- 
> A bad analogy is like a leaky screwdriver -- Richard Braakman
> 
> 
> 

-- 

Whatever you Wanadoo:
http://www.wanadoo.co.uk/time/

This email has been checked for most known viruses - find out more at: http://www.wanadoo.co.uk/help/id/7098.htm



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

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

end of thread, other threads:[~2005-03-01 15:08 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-26 20:57 Proposal for init/kexec/hotplug format for Xen Rusty Russell
2005-02-27 10:53 ` Keir Fraser
2005-02-27 11:46   ` Rusty Russell
2005-02-27 15:25   ` Anthony Liguori
2005-02-27 15:48     ` Keir Fraser
2005-02-27 15:54       ` Anthony Liguori
2005-02-27 16:09         ` Keir Fraser
2005-02-27 16:16           ` Anthony Liguori
2005-02-27 16:31             ` Harry Butterworth
2005-02-27 16:42               ` Anthony Liguori
2005-02-27 17:32                 ` Keir Fraser
2005-02-27 17:59                   ` Anthony Liguori
2005-02-27 18:12                 ` Harry Butterworth
2005-02-27 18:24                   ` Anthony Liguori
2005-02-27 18:55                     ` Harry Butterworth
2005-02-27 18:57                       ` Keir Fraser
2005-02-27 19:10                         ` Anthony Liguori
2005-02-27 21:49                           ` Keir Fraser
2005-02-27 22:39                             ` Anthony Liguori
2005-02-27 23:29                               ` Harry Butterworth
2005-02-28  8:59                               ` Keir Fraser
2005-02-27 19:38                         ` Harry Butterworth
2005-02-27 16:05     ` Harry Butterworth
2005-02-28 12:06     ` Rusty Russell
2005-02-28 15:46       ` Anthony Liguori
2005-02-28 20:28       ` Jeremy Katz
2005-02-28 22:24         ` Harry Butterworth
  -- strict thread matches above, loose matches on Subject: below --
2005-02-28 13:08 Re: " harry
2005-02-28 13:32 ` Rusty Russell
2005-02-28 13:40   ` Harry Butterworth
2005-02-28 14:33     ` Keir Fraser
2005-02-28 16:46     ` Re: " Rusty Russell
2005-03-01 13:15       ` Harry Butterworth
2005-03-01 15:08         ` Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.