On 19/10/2016 16:43, Laurent Vivier wrote:
> 
> 
> On 19/10/2016 14:25, David Gibson wrote:
>> ide-test uses many explicit inb() / outb() operations for its IO, which
>> means it's not portable to non-x86 platforms.  This cleans it up to use
>> the libqos PCI accessors instead.
>>
>> Signed-off-by: David Gibson <da...@gibson.dropbear.id.au>
>> ---
>>  tests/ide-test.c | 179 
>> ++++++++++++++++++++++++++++++++++++-------------------
>>  1 file changed, 118 insertions(+), 61 deletions(-)
> 
> Could explain why you have swapped the le16_to_cpu() and cpu_to_le16()?
> 
> For me, they were correct.

And I have just finished testing your series on a BE host, and ide-test
is broken:

TEST: tests/ide-test... (pid=12472)
  /i386/ide/identify:                                                  **
ERROR:/home/laurent/Projects/qemu/tests/ide-test.c:518:test_identify:
assertion failed: (ret == 0)
FAIL

You should not add the cpu_to_le16():

     for (i = 0; i < 256; i++) {
-        data = inb(IDE_BASE + reg_status);
+        data = qpci_io_readb(dev, ide_base + reg_status);
         assert_bit_set(data, DRDY | DRQ);
         assert_bit_clear(data, BSY | DF | ERR);

-        ((uint16_t*) buf)[i] = inw(IDE_BASE + reg_data);
+        buf[i] = cpu_to_le16(qpci_io_readw(dev, ide_base + reg_data));
     }

Laurent

Reply via email to