public inbox for kexec@lists.infradead.org
 help / color / mirror / Atom feed
From: Daniel Kiper <daniel.kiper@oracle.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: Simon Horman <horms@verge.net.au>,
	kexec@lists.infradead.org, xen-devel@lists.xen.org
Subject: Re: [PATCH 5/5] kexec/xen: directly load images images into Xen
Date: Wed, 17 Apr 2013 14:56:02 +0200	[thread overview]
Message-ID: <20130417125602.GC906@debian70-amd64.local.net-space.pl> (raw)
In-Reply-To: <20130409212036.GE31533@debian70-amd64.local.net-space.pl>

On Tue, Apr 09, 2013 at 11:20:36PM +0200, Daniel Kiper wrote:
> On Mon, Apr 08, 2013 at 08:06:54PM +0100, David Vrabel wrote:
> > From: David Vrabel <david.vrabel@citrix.com>
> >
> > Xen 4.3 has an improvided kexec hypercall ABI that allows images to be
> > loaded and executed without any kernel involvement.  Use the API
> > provided by libxc to load images when running in a Xen guest.
> >
> > Support for loading images via the kexec_load syscall in non-upstream
> > ("classic") Xen kernels is no longer supported.
> >
> > Signed-off-by: David Vrabel <david.vrabel@citrix.com>
>
> [...]
>
> > diff --git a/kexec/kexec-xen.c b/kexec/kexec-xen.c
>
> [...]
>
> > +int xen_kexec_load(uint64_t entry,
> > +		   uint32_t nr_segments, struct kexec_segment *segments,
> > +		   uint64_t kexec_flags)
> > +{
> > +	xc_interface *xch;
> > +	xc_hypercall_buffer_array_t *array = NULL;
> > +	uint8_t type;
> > +	uint8_t arch;
> > +	xen_kexec_segment_t *xen_segs;
> > +	int s;
> > +	int ret = -1;
> > +
> > +	xch = xc_interface_open(NULL, NULL, 0);
> > +	if (!xch)
> > +		return -1;
> > +
> > +	xen_segs = calloc(nr_segments, sizeof(*xen_segs));
> > +	if (!xen_segs)
> > +		goto out;
> > +
> > +	array = xc_hypercall_buffer_array_create(xch, nr_segments);
> > +	if (array == NULL)
> > +		goto out;
> > +
> > +	for (s = 0; s < nr_segments; s++) {
> > +		DECLARE_HYPERCALL_BUFFER(void, seg_buf);
> > +
> > +		seg_buf = xc_hypercall_buffer_array_alloc(xch, array, s,
> > +							  seg_buf, segments[s].bufsz);
> > +		if (seg_buf == NULL)
> > +			goto out;
> > +		memcpy(seg_buf, segments[s].buf, segments[s].bufsz);
> > +
> > +		set_xen_guest_handle(xen_segs[s].buf, seg_buf);
> > +		xen_segs[s].buf_size = segments[s].bufsz;
> > +		xen_segs[s].dest_maddr = (uint64_t)segments[s].mem;
> > +		xen_segs[s].dest_size = segments[s].memsz;
> > +	}
> > +
> > +	type = kexec_flags & KEXEC_TYPE_CRASH;
> > +	arch = (kexec_flags >> 16) & 0xffff;
>
> arch = (kexec_flags & KEXEC_ARCH_MASK) >> 16;

What is wrong with this line?
Why did not you applied it?

Daniel

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2013-04-17 12:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-08 19:06 [PATCHv2 0/4] kexec-tools: add support for Xen 4.3 David Vrabel
2013-04-08 19:06 ` [PATCH 1/5] purgatory: put variables altered by kexec in .data not .bss David Vrabel
2013-04-08 19:06 ` [PATCH 2/5] kexec/xen: require libxc from Xen 4.3 David Vrabel
2013-04-08 19:06 ` [PATCH 3/5] kexec/xen: use libxc to get location of crash notes David Vrabel
2013-04-08 19:06 ` [PATCH 4/5] kexec/xen: switch to use xc_kexec_get_range for get_xen_vmcoreinfo David Vrabel
2013-04-08 19:06 ` [PATCH 5/5] kexec/xen: directly load images images into Xen David Vrabel
2013-04-09 21:20   ` Daniel Kiper
2013-04-17 12:56     ` Daniel Kiper [this message]
2013-04-17 13:53       ` David Vrabel
2013-04-17 14:12         ` Daniel Kiper
2013-04-09  2:49 ` [PATCHv2 0/4] kexec-tools: add support for Xen 4.3 Simon Horman
2013-04-09 21:16 ` Daniel Kiper
  -- strict thread matches above, loose matches on Subject: below --
2013-09-12 20:00 [PATCHv4 0/5] " David Vrabel
2013-09-12 20:00 ` [PATCH 5/5] kexec/xen: directly load images images into Xen David Vrabel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130417125602.GC906@debian70-amd64.local.net-space.pl \
    --to=daniel.kiper@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=horms@verge.net.au \
    --cc=kexec@lists.infradead.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox