* [PATCH] wrong pa calculation fix (extboot)
@ 2008-04-14 10:38 Nguyen Anh Quynh
2008-04-14 14:15 ` Anthony Liguori
0 siblings, 1 reply; 5+ messages in thread
From: Nguyen Anh Quynh @ 2008-04-14 10:38 UTC (permalink / raw
To: kvm-devel, Anthony Liguori
[-- Attachment #1: Type: text/plain, Size: 164 bytes --]
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>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: extboot.diff --]
[-- Type: text/x-diff; name=extboot.diff, Size: 553 bytes --]
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, §ors);
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)
[-- Attachment #3: Type: text/plain, Size: 320 bytes --]
-------------------------------------------------------------------------
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
[-- Attachment #4: Type: text/plain, Size: 158 bytes --]
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] wrong pa calculation fix (extboot)
2008-04-14 10:38 [PATCH] wrong pa calculation fix (extboot) Nguyen Anh Quynh
@ 2008-04-14 14:15 ` Anthony Liguori
2008-04-14 14:47 ` Nguyen Anh Quynh
0 siblings, 1 reply; 5+ messages in thread
From: Anthony Liguori @ 2008-04-14 14:15 UTC (permalink / raw
To: Nguyen Anh Quynh; +Cc: kvm-devel
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, §ors);
>
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] wrong pa calculation fix (extboot)
2008-04-14 14:15 ` Anthony Liguori
@ 2008-04-14 14:47 ` Nguyen Anh Quynh
2008-04-14 15:08 ` Anthony Liguori
2008-04-14 15:13 ` Anthony Liguori
0 siblings, 2 replies; 5+ messages in thread
From: Nguyen Anh Quynh @ 2008-04-14 14:47 UTC (permalink / raw
To: Anthony Liguori; +Cc: kvm-devel
On 4/14/08, Anthony Liguori <aliguori@us.ibm.com> wrote:
> 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, §ors);
> > 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.
Agreed. But it needs to be fixed, anyway. Or we can remove it.
Thanks,
Q
-------------------------------------------------------------------------
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] wrong pa calculation fix (extboot)
2008-04-14 14:47 ` Nguyen Anh Quynh
@ 2008-04-14 15:08 ` Anthony Liguori
2008-04-14 15:13 ` Anthony Liguori
1 sibling, 0 replies; 5+ messages in thread
From: Anthony Liguori @ 2008-04-14 15:08 UTC (permalink / raw
To: Nguyen Anh Quynh; +Cc: kvm-devel
Nguyen Anh Quynh wrote:
> On 4/14/08, Anthony Liguori <aliguori@us.ibm.com> wrote:
>
>> Nguyen Anh Quynh wrote:
>>
>>
>> In practice, this check isn't actually necessary since a guest always has
>> at least 1MB of memory.
>>
>
> Agreed. But it needs to be fixed, anyway. Or we can remove it.
>
Please just remove the whole check.
Regards,
Anthony Liguori
> Thanks,
> Q
>
-------------------------------------------------------------------------
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] wrong pa calculation fix (extboot)
2008-04-14 14:47 ` Nguyen Anh Quynh
2008-04-14 15:08 ` Anthony Liguori
@ 2008-04-14 15:13 ` Anthony Liguori
1 sibling, 0 replies; 5+ messages in thread
From: Anthony Liguori @ 2008-04-14 15:13 UTC (permalink / raw
To: Nguyen Anh Quynh; +Cc: kvm-devel
Nguyen Anh Quynh wrote:
> On 4/14/08, Anthony Liguori <aliguori@us.ibm.com> wrote:
>
>> In practice, this check isn't actually necessary since a guest always has
>> at least 1MB of memory.
>>
>
> Agreed. But it needs to be fixed, anyway. Or we can remove it.
>
I should mention, the reason for removing the check, is that what we
really want to do is remove all references to phys_ram_base() and
replace them with cpu_physical_memory_{read,write}(). That will enforce
memory checking.
Regards,
Anthony Liguori
> Thanks,
> Q
>
-------------------------------------------------------------------------
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-04-14 15:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-14 10:38 [PATCH] wrong pa calculation fix (extboot) Nguyen Anh Quynh
2008-04-14 14:15 ` Anthony Liguori
2008-04-14 14:47 ` Nguyen Anh Quynh
2008-04-14 15:08 ` Anthony Liguori
2008-04-14 15:13 ` Anthony Liguori
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.