[SeaBIOS] [PATCH v2 0/2] esp-scsi: fix reliance on QEMU ESP SCSI implementation bugs

Mark Cave-Ayland posted 2 patches 1 year, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/seabios tags/patchew/20230802094810.58670-1-mark.cave-ayland@ilande.co.uk
There is a newer version of this series
src/hw/esp-scsi.c | 38 +++++++++++++++++++++++++-------------
1 file changed, 25 insertions(+), 13 deletions(-)
[SeaBIOS] [PATCH v2 0/2] esp-scsi: fix reliance on QEMU ESP SCSI implementation bugs
Posted by Mark Cave-Ayland 1 year, 2 months ago
Whilst trying to improve QEMU's ESP SCSI implementation with regard to the
NCR datasheet, I noticed that SeaBIOS would fail to boot one of my Debian
test images with my patches applied.

Further investigation revealed that the SeaBIOS esp-scsi driver inadvertently
relies on existing bugs in QEMU's ESP SCSI emulation to work correctly, so this
series changes the driver to work as described in the NCR datasheet.

With this series applied it is possible for the updated SeaBIOS to boot both
QEMU current git HEAD as well as my local WIP branch containing various fixes
and improvements to QEMU's ESP SCSI emulation.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

v2:
- Fix typo in patch 2 commit message
- Add reference to datasheet in patch 2 commit message as requested by Paul


Mark Cave-Ayland (2):
  esp-scsi: flush FIFO before sending SCSI command
  esp-scsi: check for INTR_BS/INTR_FC instead of STAT_TC for command
    completion

 src/hw/esp-scsi.c | 38 +++++++++++++++++++++++++-------------
 1 file changed, 25 insertions(+), 13 deletions(-)

-- 
2.39.2

_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org
[SeaBIOS] Re: [PATCH v2 0/2] esp-scsi: fix reliance on QEMU ESP SCSI implementation bugs
Posted by Mark Cave-Ayland 1 year, 2 months ago
On 02/08/2023 10:48, Mark Cave-Ayland wrote:

> Whilst trying to improve QEMU's ESP SCSI implementation with regard to the
> NCR datasheet, I noticed that SeaBIOS would fail to boot one of my Debian
> test images with my patches applied.
> 
> Further investigation revealed that the SeaBIOS esp-scsi driver inadvertently
> relies on existing bugs in QEMU's ESP SCSI emulation to work correctly, so this
> series changes the driver to work as described in the NCR datasheet.
> 
> With this series applied it is possible for the updated SeaBIOS to boot both
> QEMU current git HEAD as well as my local WIP branch containing various fixes
> and improvements to QEMU's ESP SCSI emulation.
> 
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> 
> v2:
> - Fix typo in patch 2 commit message
> - Add reference to datasheet in patch 2 commit message as requested by Paul
> 
> 
> Mark Cave-Ayland (2):
>    esp-scsi: flush FIFO before sending SCSI command
>    esp-scsi: check for INTR_BS/INTR_FC instead of STAT_TC for command
>      completion
> 
>   src/hw/esp-scsi.c | 38 +++++++++++++++++++++++++-------------
>   1 file changed, 25 insertions(+), 13 deletions(-)

With a bit more time poking at QEMU's ESP emulation at the weekend, I found one more 
problem in that QEMU currently always sets STAT_TC after issuing every SCSI request.

Hence we need an extra fix to the esp-scsi state machine to handle the case where 
there is no DATA phase e.g. Test Unit Ready with a non-DMA SELATN command for when 
this is eventually fixed in QEMU.


ATB,

Mark.

_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org
[SeaBIOS] Re: [PATCH v2 0/2] esp-scsi: fix reliance on QEMU ESP SCSI implementation bugs
Posted by Paolo Bonzini 1 year, 2 months ago
On 8/2/23 11:48, Mark Cave-Ayland wrote:
> Whilst trying to improve QEMU's ESP SCSI implementation with regard to the
> NCR datasheet, I noticed that SeaBIOS would fail to boot one of my Debian
> test images with my patches applied.
> 
> Further investigation revealed that the SeaBIOS esp-scsi driver inadvertently
> relies on existing bugs in QEMU's ESP SCSI emulation to work correctly, so this
> series changes the driver to work as described in the NCR datasheet.
> 
> With this series applied it is possible for the updated SeaBIOS to boot both
> QEMU current git HEAD as well as my local WIP branch containing various fixes
> and improvements to QEMU's ESP SCSI emulation.
> 
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> 
> v2:
> - Fix typo in patch 2 commit message
> - Add reference to datasheet in patch 2 commit message as requested by Paul
> 
> 
> Mark Cave-Ayland (2):
>    esp-scsi: flush FIFO before sending SCSI command
>    esp-scsi: check for INTR_BS/INTR_FC instead of STAT_TC for command
>      completion
> 
>   src/hw/esp-scsi.c | 38 +++++++++++++++++++++++++-------------
>   1 file changed, 25 insertions(+), 13 deletions(-)
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org