qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/1] libqos/ahci: fix 'make check' on ppc64
@ 2015-07-06 19:17 John Snow
  2015-07-06 19:17 ` [Qemu-devel] [PATCH 1/1] libqos/ahci: fix ahci_write_fis for ncq " John Snow
  2015-07-08 16:04 ` [Qemu-devel] [PATCH 0/1] libqos/ahci: fix 'make check' " Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: John Snow @ 2015-07-06 19:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, John Snow, afaerber, pbonzini

A little bit of accidental byteswapping that was
unwarranted for NCQ on PPC64.

Does not fix the issue reported by Paolo, but does
fix the issue reported by Peter Maydell.

________________________________________________________________________________

For convenience, this branch is available at:
https://github.com/jnsnow/qemu.git branch ahci-2.4-fix
https://github.com/jnsnow/qemu/tree/ahci-2.4-fix

This version is tagged ahci-2.4-fix-v1:
https://github.com/jnsnow/qemu/releases/tag/ahci-2.4-fix-v1

John Snow (1):
  libqos/ahci: fix ahci_write_fis for ncq on ppc64

 tests/libqos/ahci.c | 20 +++++++++++---------
 tests/libqos/ahci.h |  2 +-
 2 files changed, 12 insertions(+), 10 deletions(-)

-- 
2.1.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PATCH 1/1] libqos/ahci: fix ahci_write_fis for ncq on ppc64
  2015-07-06 19:17 [Qemu-devel] [PATCH 0/1] libqos/ahci: fix 'make check' on ppc64 John Snow
@ 2015-07-06 19:17 ` John Snow
  2015-07-08 16:04 ` [Qemu-devel] [PATCH 0/1] libqos/ahci: fix 'make check' " Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: John Snow @ 2015-07-06 19:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, John Snow, afaerber, pbonzini

Don't try to correct the endianness of NCQ commands, which do not
use any fields wider than a single byte.

This corrects the /x86_64/ahci/io/ncq/simple test (and others)
for ppc64 BE hosts.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: John Snow <jsnow@redhat.com>
---
 tests/libqos/ahci.c | 20 +++++++++++---------
 tests/libqos/ahci.h |  2 +-
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c
index 33ecd2a..cf66b3e 100644
--- a/tests/libqos/ahci.c
+++ b/tests/libqos/ahci.c
@@ -545,16 +545,18 @@ void ahci_destroy_command(AHCIQState *ahci, uint8_t port, uint8_t slot)
     ahci->port[port].prdtl[slot] = 0;
 }
 
-void ahci_write_fis(AHCIQState *ahci, RegH2DFIS *fis, uint64_t addr)
+void ahci_write_fis(AHCIQState *ahci, AHCICommand *cmd)
 {
-    RegH2DFIS tmp = *fis;
+    RegH2DFIS tmp = cmd->fis;
+    uint64_t addr = cmd->header.ctba;
 
-    /* The auxiliary FIS fields are defined per-command and are not
-     * currently implemented in libqos/ahci.o, but may or may not need
-     * to be flipped. */
-
-    /* All other FIS fields are 8 bit and do not need to be flipped. */
-    tmp.count = cpu_to_le16(tmp.count);
+    /* NCQ commands use exclusively 8 bit fields and needs no adjustment.
+     * Only the count field needs to be adjusted for non-NCQ commands.
+     * The auxiliary FIS fields are defined per-command and are not currently
+     * implemented in libqos/ahci.o, but may or may not need to be flipped. */
+    if (!cmd->props->ncq) {
+        tmp.count = cpu_to_le16(tmp.count);
+    }
 
     memwrite(addr, &tmp, sizeof(tmp));
 }
@@ -877,7 +879,7 @@ void ahci_command_commit(AHCIQState *ahci, AHCICommand *cmd, uint8_t port)
 
     /* Commit the command header and command FIS */
     ahci_set_command_header(ahci, port, cmd->slot, &(cmd->header));
-    ahci_write_fis(ahci, &(cmd->fis), table_ptr);
+    ahci_write_fis(ahci, cmd);
 
     /* Construct and write the PRDs to the command table */
     g_assert_cmphex(prdtl, ==, cmd->header.prdtl);
diff --git a/tests/libqos/ahci.h b/tests/libqos/ahci.h
index a08a9dd..cffc2c3 100644
--- a/tests/libqos/ahci.h
+++ b/tests/libqos/ahci.h
@@ -548,7 +548,7 @@ void ahci_get_command_header(AHCIQState *ahci, uint8_t port,
 void ahci_set_command_header(AHCIQState *ahci, uint8_t port,
                              uint8_t slot, AHCICommandHeader *cmd);
 void ahci_destroy_command(AHCIQState *ahci, uint8_t port, uint8_t slot);
-void ahci_write_fis(AHCIQState *ahci, RegH2DFIS *fis, uint64_t addr);
+void ahci_write_fis(AHCIQState *ahci, AHCICommand *cmd);
 unsigned ahci_pick_cmd(AHCIQState *ahci, uint8_t port);
 unsigned size_to_prdtl(unsigned bytes, unsigned bytes_per_prd);
 void ahci_guest_io(AHCIQState *ahci, uint8_t port, uint8_t ide_cmd,
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH 0/1] libqos/ahci: fix 'make check' on ppc64
  2015-07-06 19:17 [Qemu-devel] [PATCH 0/1] libqos/ahci: fix 'make check' on ppc64 John Snow
  2015-07-06 19:17 ` [Qemu-devel] [PATCH 1/1] libqos/ahci: fix ahci_write_fis for ncq " John Snow
@ 2015-07-08 16:04 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2015-07-08 16:04 UTC (permalink / raw)
  To: John Snow; +Cc: Paolo Bonzini, QEMU Developers, Andreas Färber

On 6 July 2015 at 20:17, John Snow <jsnow@redhat.com> wrote:
> A little bit of accidental byteswapping that was
> unwarranted for NCQ on PPC64.
>
> Does not fix the issue reported by Paolo, but does
> fix the issue reported by Peter Maydell.

Checked on the ppc64 box I have access to and this does
fix the hang I was seeing.

Tested-by: Peter Maydell <peter.maydell@linaro.org>

PS: you don't really need a cover letter for a
single patch.

I do still see some test failures in other tests,
for instance

  /x86_64/virtio/blk/pci/basic:                                        OK
  /x86_64/virtio/blk/pci/indirect:                                     **
ERROR:/home/pm215/qemu/tests/virtio-blk-test.c:354:pci_indirect:
assertion failed (features & QVIRTIO_F_RING_INDIRECT_DESC != 0):
(0x00000000 !=
 0x00000000)
FAIL
GTester: last random seed: R02S8c870ae988a53fb86ee3e101fac57706
(pid=31320)
  /x86_64/virtio/blk/pci/config:                                       OK
  /x86_64/virtio/blk/pci/msix:                                         OK
  /x86_64/virtio/blk/pci/idx:                                          **
ERROR:/home/pm215/qemu/tests/libqos/virtio.c:277:qvirtqueue_set_used_event:
assertion failed: (vq->event)
FAIL
GTester: last random seed: R02S69d9a4b783eb5fa265c334eb5619f007
(pid=31341)
  /x86_64/virtio/blk/pci/hotplug:                                      OK


-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-08 16:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-06 19:17 [Qemu-devel] [PATCH 0/1] libqos/ahci: fix 'make check' on ppc64 John Snow
2015-07-06 19:17 ` [Qemu-devel] [PATCH 1/1] libqos/ahci: fix ahci_write_fis for ncq " John Snow
2015-07-08 16:04 ` [Qemu-devel] [PATCH 0/1] libqos/ahci: fix 'make check' " Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).