xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH 1 of 8] tools: libxc: allow HVM firmware to be loaded at an arbitrary alignment
Date: Fri, 13 May 2011 10:03:05 -0400	[thread overview]
Message-ID: <20110513140305.GD6042@dumpdata.com> (raw)
In-Reply-To: <c5c7ae5f33b16ee03535.1305294150@cosworth.uk.xensource.com>

On Fri, May 13, 2011 at 02:42:30PM +0100, Ian Campbell wrote:
> # HG changeset patch
> # User Ian Campbell <ian.campbell@citrix.com>
> # Date 1305294079 -3600
> # Node ID c5c7ae5f33b16ee03535e9c688ad9bee2510b2b6
> # Parent  9476bc07db2c654b266ab1f1c9ff0c65f401d74d
> tools: libxc: allow HVM firmware to be loaded at an arbitrary alignment
> 
> Enables direct loading of e.g. seabios.elf.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> 
> diff -r 9476bc07db2c -r c5c7ae5f33b1 tools/libxc/xc_hvm_build.c
> --- a/tools/libxc/xc_hvm_build.c	Fri May 13 14:41:19 2011 +0100
> +++ b/tools/libxc/xc_hvm_build.c	Fri May 13 14:41:19 2011 +0100
> @@ -88,7 +88,9 @@ static int loadelfimage(
>      struct elf_binary *elf, uint32_t dom, unsigned long *parray)
>  {
>      privcmd_mmap_entry_t *entries = NULL;
> -    size_t pages = (elf->pend - elf->pstart + PAGE_SIZE - 1) >> PAGE_SHIFT;
> +    unsigned long pfn_start = elf->pstart >> PAGE_SHIFT;
> +    unsigned long pfn_end = (elf->pend + PAGE_SIZE - 1) >> PAGE_SHIFT;
> +    size_t pages = pfn_end - pfn_start;
>      int i, rc = -1;
>  
>      /* Map address space for initial elf image. */
> @@ -105,6 +107,8 @@ static int loadelfimage(
>      if ( elf->dest == NULL )
>          goto err;
>  
> +    elf->dest += elf->pstart & 4095;

Whoa. Decimal numbers! Threw me off when I saw this - so used to 0xfff. :-)

  reply	other threads:[~2011-05-13 14:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-13 13:42 [PATCH 0 of 8] tools: libx[cl]: support alternative HVM firmware Ian Campbell
2011-05-13 13:42 ` [PATCH 1 of 8] tools: libxc: allow HVM firmware to be loaded at an arbitrary alignment Ian Campbell
2011-05-13 14:03   ` Konrad Rzeszutek Wilk [this message]
2011-05-13 14:29     ` Ian Campbell
2011-05-13 13:42 ` [PATCH 2 of 8] tools: libxc: enable libelf logging for HVM domain builder Ian Campbell
2011-05-13 13:42 ` [PATCH 3 of 8] tools: libxl/xl: Use "firmware" rather than "hvmloader" in API Ian Campbell
2011-05-13 13:42 ` [PATCH 4 of 8] tools: libxl: constify parameter to libxl__abs_path Ian Campbell
2011-05-13 13:42 ` [PATCH 5 of 8] tools: libxl: pass device model info down into HVM domain build functions Ian Campbell
2011-05-13 13:42 ` [PATCH 6 of 8] tools: libxl: fixup error handling in libxl__build_hvm Ian Campbell
2011-05-13 13:42 ` [PATCH 7 of 8] tools: libxl: refactor libxl__domain_firmware to choose based on device_model_version Ian Campbell
2011-05-13 13:42 ` [PATCH 8 of 8] [RFC] tools: libxl: load SeaBIOS directly rather than via hvmloader Ian Campbell
2011-05-24 17:29 ` [PATCH 0 of 8] tools: libx[cl]: support alternative HVM firmware Ian Jackson
2011-05-25  9:02   ` Ian Campbell

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=20110513140305.GD6042@dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=ian.campbell@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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;
as well as URLs for NNTP newsgroup(s).