ide: Prohibit RESET on IDE drives

This command is meant for ATAPI devices only, prohibit acknowledging it with
a command aborted response when an IDE device is busy.

Signed-off-by: John Snow <jsnow@redhat.com>
Reported-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1453225191-11871-2-git-send-email-jsnow@redhat.com
This commit is contained in:
John Snow 2016-02-10 13:29:38 -05:00
parent c9f19dff10
commit 266e77812c

View File

@ -1877,9 +1877,13 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val)
return; return;
} }
/* Only DEVICE RESET is allowed while BSY or/and DRQ are set */ /* Only RESET is allowed while BSY and/or DRQ are set,
if ((s->status & (BUSY_STAT|DRQ_STAT)) && val != WIN_DEVICE_RESET) * and only to ATAPI devices. */
return; if (s->status & (BUSY_STAT|DRQ_STAT)) {
if (val != WIN_DEVICE_RESET || s->drive_kind != IDE_CD) {
return;
}
}
if (!ide_cmd_permitted(s, val)) { if (!ide_cmd_permitted(s, val)) {
ide_abort_command(s); ide_abort_command(s);