]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
ahci: Correct PIO/D2H FIS responses
authorJohn Snow <jsnow@redhat.com>
Wed, 1 Oct 2014 22:55:46 +0000 (18:55 -0400)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 3 Nov 2014 09:48:41 +0000 (09:48 +0000)
commit7b8bad1b6abde7612940900dd1092dad873f1a11
treed4c113352012e508fff96214c5000a9f149de8e2
parentdc9e716369282ed687821d52cb3170369626f99f
ahci: Correct PIO/D2H FIS responses

Currently, the D2H FIS packets AHCI generates simply parrot back
the LBA that the guest sent to us in the cmd_fis. However, some
commands (like READ NATIVE MAX) modify the LBA registers as a
return value, through which the AHCI D2H FIS is the only response
mechanism. Thus, the D2H response should use the current register
values, not the initial ones.

This patch adjusts the LBA and drive select register responses for
PIO Setup and D2H FIS response packets.

Additionally, the PIO and D2H FIS responses copy too many bytes
from the command FIS that it is being generated from. Specifically,
byte 11 which is the Features(15:8) field for Register Host to
Device FIS packets, is instead reserved for the PIO Setup FIS and
should always be 0.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 1412204151-18117-2-git-send-email-jsnow@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/ide/ahci.c