[SeaBIOS] [PATCH 0/3] Run pvscsi driver entirely in 32bit mode.

Don Koch dkoch at verizon.com
Wed May 14 19:00:39 CEST 2014


On Fri, 27 Dec 2013 12:17:42 -0500
Kevin O'Connor <kevin at koconnor.net> wrote:

> 
> 
> As with the recent change to AHCI, if the pvscsi driver needs to jump
> into 32bit mode to access a register, then it's better to run the
> pvscsi driver entirely in 32bit mode.
> 
> Evgeny, can you take a look at this and give it a test?  Also, what
> command line do you use for testing?
> 
> I tried testing locally by adding:
> 
> -device pvscsi,id=pvscsi0 -device scsi-disk,bus=pvscsi0.0,drive=drive0 -drive id=drive0,if=none,file=dos-drivec-new
> 
> to my qemu command line (both qemu v1.6 and qemu v1.7), but it doesn't
> work for me even before my changes.  It hangs in
> pvscsi_wait_intr_cmpl().

Try the following patch to qemu. I was getting hangs in this routine due to
language definition/compiler/bogus input issues. The old one returned an
off-by-one value.

diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
index e35bff7..cfd7247 100644
--- a/hw/scsi/vmw_pvscsi.c
+++ b/hw/scsi/vmw_pvscsi.c
@@ -119,11 +119,8 @@ typedef struct PVSCSIRequest {
 static int
 pvscsi_log2(uint32_t input)
 {
-    int log = 0;
     assert(input > 0);
-    while (input >> ++log) {
-    }
-    return log;
+    return 31 - clz32(input);
 }
 
 static void

If this works, I'll pass it on to the qemu list.

-d

> -Kevin
> 
> 
> Kevin O'Connor (3):
>   pvscsi: Don't store reference to struct pci_device.
>   pvscsi: Always run entirely in 32bit mode.
>   pvscsi: Remove use of LOWFLAT and GLOBALFLAT macros.
> 
>  Makefile          |   4 +--
>  src/block.c       |   8 +++--
>  src/hw/blockcmd.c |   3 +-
>  src/hw/pvscsi.c   | 106 +++++++++++++++++++++++++-----------------------------
>  4 files changed, 58 insertions(+), 63 deletions(-)
> 
> -- 
> 1.8.3.1
> 
> 
> _______________________________________________
> SeaBIOS mailing list
> SeaBIOS at seabios.org
> http://www.seabios.org/mailman/listinfo/seabios



More information about the SeaBIOS mailing list