public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: Nguyen Anh Quynh <aquynh@gmail.com>
Cc: kvm-devel@lists.sourceforge.net
Subject: Re: [PATCH] wrong pa calculation fix (extboot)
Date: Mon, 14 Apr 2008 09:15:22 -0500	[thread overview]
Message-ID: <480366FA.9050608@us.ibm.com> (raw)
In-Reply-To: <9cde8bff0804140338o915fe62y4032947cd87d46ac@mail.gmail.com>

Nguyen Anh Quynh wrote:
> This patch fixes a wrong calculation in the physical address of
> extboot (qemu/hw/extboot.c). Looks like a typo.
>
> Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>
>   
> diff --git a/qemu/hw/extboot.c b/qemu/hw/extboot.c
> index 056fb59..0dac34c 100644
> --- a/qemu/hw/extboot.c
> +++ b/qemu/hw/extboot.c
> @@ -81,7 +81,7 @@ static void extboot_write_cmd(void *opaque, uint32_t addr, uint32_t value)
>      get_translated_chs(bs, &cylinders, &heads, &sectors);
>  
>      if (cmd->type == 0x01 || cmd->type == 0x02) {
> -	target_ulong pa = cmd->xfer.segment * 16 + cmd->xfer.segment;
> +	target_ulong pa = cmd->xfer.segment * 16 + cmd->xfer.offset;
>  
>  	/* possible buffer overflow */
>  	if ((pa + cmd->xfer.nb_sectors * 512) > phys_ram_size)
>   

In practice, this check isn't actually necessary since a guest always 
has at least 1MB of memory.

Regards,

Anthony Liguori

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

  reply	other threads:[~2008-04-14 14:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-14 10:38 [PATCH] wrong pa calculation fix (extboot) Nguyen Anh Quynh
2008-04-14 14:15 ` Anthony Liguori [this message]
2008-04-14 14:47   ` Nguyen Anh Quynh
2008-04-14 15:08     ` Anthony Liguori
2008-04-14 15:13     ` 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=480366FA.9050608@us.ibm.com \
    --to=aliguori@us.ibm.com \
    --cc=aquynh@gmail.com \
    --cc=kvm-devel@lists.sourceforge.net \
    /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