qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <mail@kevin-wolf.de>
To: qemu-devel@nongnu.org
Cc: Scott Moser <smoser@ubuntu.com>, Anthony Liguori <anthony@codemonkey.ws>
Subject: Re: [Qemu-devel] [PATCH] fix multiboot loading if load_end_addr == 0
Date: Sun, 27 May 2012 00:17:34 +0200	[thread overview]
Message-ID: <201205270017.34477@kevin-wolf.de> (raw)
In-Reply-To: <alpine.DEB.2.02.1203261523180.4638@brickies>

Am Montag, 26. März 2012 21:27:00 schrieb Scott Moser:
> The previous multiboot load code did not treat the case where
> load_end_addr was 0 specially.  The multiboot specification says the
> following:
>  * load_end_addr
>    Contains the physical address of the end of the data segment.
>    (load_end_addr - load_addr) specifies how much data to load. This
>    implies that the text and data segments must be consecutive in the
>    OS image; this is true for existing a.out executable formats. If
>    this field is zero, the boot loader assumes that the text and data
>    segments occupy the whole OS image file.
>
> Signed-off-by: Scott Moser <smoser@ubuntu.com>
>
> diff --git a/hw/multiboot.c b/hw/multiboot.c
> index b4484a3..b1e04c5 100644
> --- a/hw/multiboot.c
> +++ b/hw/multiboot.c
> @@ -202,10 +202,16 @@ int load_multiboot(void *fw_cfg,
>          uint32_t mh_bss_end_addr = ldl_p(header+i+24);
>          mh_load_addr = ldl_p(header+i+16);
>          uint32_t mb_kernel_text_offset = i - (mh_header_addr -
> mh_load_addr); -        uint32_t mb_load_size = mh_load_end_addr -
> mh_load_addr;
> -
> +        uint32_t mb_load_size = 0;
>          mh_entry_addr = ldl_p(header+i+28);
> -        mb_kernel_size = mh_bss_end_addr - mh_load_addr;
> +
> +        if (mh_load_end_addr) {
> +            mb_kernel_size = mh_bss_end_addr - mh_load_addr;
> +            mb_load_size = mh_load_end_addr - mh_load_addr;
> +        } else {
> +            mb_kernel_size = kernel_file_size - mb_kernel_text_offset;
> +            mb_load_size = mb_kernel_size;
> +        }
>
>          /* Valid if mh_flags sets MULTIBOOT_HEADER_HAS_VBE.
>          uint32_t mh_mode_type = ldl_p(header+i+32);


Anthony, what happened with this patch? Can we still get it into 1.1?

Kevin

  reply	other threads:[~2012-05-26 22:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-18 17:45 [Qemu-devel] [PATCH] fix multiboot loading if load_end_addr == 0 (fwd) Scott Moser
2012-03-20 15:04 ` Serge E. Hallyn
2012-03-26 19:17 ` Anthony Liguori
2012-03-26 19:27   ` [Qemu-devel] [PATCH] fix multiboot loading if load_end_addr == 0 Scott Moser
2012-05-26 22:17     ` Kevin Wolf [this message]
2012-05-27  0:52       ` Anthony Liguori

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=201205270017.34477@kevin-wolf.de \
    --to=mail@kevin-wolf.de \
    --cc=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    --cc=smoser@ubuntu.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).