[kvm-devel] [PATCH] wrong pa calculation fix (extboot)

2008-04-14 Thread Nguyen Anh Quynh
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 [EMAIL PROTECTED]
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)
-
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___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [PATCH] wrong pa calculation fix (extboot)

2008-04-14 Thread Nguyen Anh Quynh
On 4/14/08, Anthony Liguori [EMAIL PROTECTED] 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 [EMAIL PROTECTED]
   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.

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
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [PATCH] wrong pa calculation fix (extboot)

2008-04-14 Thread Anthony Liguori
Nguyen Anh Quynh wrote:
 On 4/14/08, Anthony Liguori [EMAIL PROTECTED] 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
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [PATCH] wrong pa calculation fix (extboot)

2008-04-14 Thread Anthony Liguori
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 [EMAIL PROTECTED]
   
 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
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [PATCH] wrong pa calculation fix (extboot)

2008-04-14 Thread Anthony Liguori
Nguyen Anh Quynh wrote:
 On 4/14/08, Anthony Liguori [EMAIL PROTECTED] 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
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel