qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/2] Ide patches
@ 2015-07-08 18:09 John Snow
  2015-07-08 18:09 ` [Qemu-devel] [PULL 1/2] libqos/ahci: fix ahci_write_fis for ncq on ppc64 John Snow
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: John Snow @ 2015-07-08 18:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, jsnow

The following changes since commit c8232b39bb18a91cde39b8e0b60e731a4ce782b1:

  Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2015-07-08 13:36:19 +0100)

are available in the git repository at:

  https://github.com/jnsnow/qemu.git tags/ide-pull-request

for you to fetch changes up to 702c8c8be2f3317c81fff83f82d8a5f1d50d41b8:

  ahci: Fix CD-ROM signature (2015-07-08 14:07:47 -0400)

----------------------------------------------------------------

----------------------------------------------------------------

Hannes Reinecke (1):
  ahci: Fix CD-ROM signature

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

 hw/ide/ahci.h       |  2 +-
 tests/libqos/ahci.c | 20 +++++++++++---------
 tests/libqos/ahci.h |  2 +-
 3 files changed, 13 insertions(+), 11 deletions(-)

-- 
2.1.0

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

* [Qemu-devel] [PULL 1/2] libqos/ahci: fix ahci_write_fis for ncq on ppc64
  2015-07-08 18:09 [Qemu-devel] [PULL 0/2] Ide patches John Snow
@ 2015-07-08 18:09 ` John Snow
  2015-07-08 18:09 ` [Qemu-devel] [PULL 2/2] ahci: Fix CD-ROM signature John Snow
  2015-07-08 19:45 ` [Qemu-devel] [PULL 0/2] Ide patches Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: John Snow @ 2015-07-08 18:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, jsnow

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>
Tested-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1436210229-4118-2-git-send-email-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] 4+ messages in thread

* [Qemu-devel] [PULL 2/2] ahci: Fix CD-ROM signature
  2015-07-08 18:09 [Qemu-devel] [PULL 0/2] Ide patches John Snow
  2015-07-08 18:09 ` [Qemu-devel] [PULL 1/2] libqos/ahci: fix ahci_write_fis for ncq on ppc64 John Snow
@ 2015-07-08 18:09 ` John Snow
  2015-07-08 19:45 ` [Qemu-devel] [PULL 0/2] Ide patches Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: John Snow @ 2015-07-08 18:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, jsnow, Hannes Reinecke

From: Hannes Reinecke <hare@suse.de>

The CD-ROM signature is 0xeb140101, not 0xeb140000.
Without this change OVMF/Duet runs into a timeout trying
to detect a SATA cdrom.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 1436219392-31915-2-git-send-email-jsnow@redhat.com
---
 hw/ide/ahci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/ide/ahci.h b/hw/ide/ahci.h
index 9f5b4d2..68d5074 100644
--- a/hw/ide/ahci.h
+++ b/hw/ide/ahci.h
@@ -166,7 +166,7 @@
 #define AHCI_CMD_HDR_CMD_FIS_LEN           0x1f
 #define AHCI_CMD_HDR_PRDT_LEN              16
 
-#define SATA_SIGNATURE_CDROM               0xeb140000
+#define SATA_SIGNATURE_CDROM               0xeb140101
 #define SATA_SIGNATURE_DISK                0x00000101
 
 #define AHCI_GENERIC_HOST_CONTROL_REGS_MAX_ADDR 0x20
-- 
2.1.0

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

* Re: [Qemu-devel] [PULL 0/2] Ide patches
  2015-07-08 18:09 [Qemu-devel] [PULL 0/2] Ide patches John Snow
  2015-07-08 18:09 ` [Qemu-devel] [PULL 1/2] libqos/ahci: fix ahci_write_fis for ncq on ppc64 John Snow
  2015-07-08 18:09 ` [Qemu-devel] [PULL 2/2] ahci: Fix CD-ROM signature John Snow
@ 2015-07-08 19:45 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2015-07-08 19:45 UTC (permalink / raw)
  To: John Snow; +Cc: QEMU Developers

On 8 July 2015 at 19:09, John Snow <jsnow@redhat.com> wrote:
> The following changes since commit c8232b39bb18a91cde39b8e0b60e731a4ce782b1:
>
>   Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2015-07-08 13:36:19 +0100)
>
> are available in the git repository at:
>
>   https://github.com/jnsnow/qemu.git tags/ide-pull-request
>
> for you to fetch changes up to 702c8c8be2f3317c81fff83f82d8a5f1d50d41b8:
>
>   ahci: Fix CD-ROM signature (2015-07-08 14:07:47 -0400)
>

Applied, thanks.

-- PMM

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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-08 18:09 [Qemu-devel] [PULL 0/2] Ide patches John Snow
2015-07-08 18:09 ` [Qemu-devel] [PULL 1/2] libqos/ahci: fix ahci_write_fis for ncq on ppc64 John Snow
2015-07-08 18:09 ` [Qemu-devel] [PULL 2/2] ahci: Fix CD-ROM signature John Snow
2015-07-08 19:45 ` [Qemu-devel] [PULL 0/2] Ide patches 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).