[PATCH v2 0/7] esp.c: only allow ESP commands permitted in the current mode

Mark Cave-Ayland posted 7 patches 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250618061249.743897-1-mark.cave-ayland@ilande.co.uk
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>
There is a newer version of this series
hw/scsi/esp.c         | 94 +++++++++++++++++++++++++++++++++++++------
hw/scsi/trace-events  |  1 +
include/hw/scsi/esp.h | 15 ++++++-
3 files changed, 96 insertions(+), 14 deletions(-)
[PATCH v2 0/7] esp.c: only allow ESP commands permitted in the current mode
Posted by Mark Cave-Ayland 5 months ago
This series contains a few minor tidy-ups along with an implementation of the
logic to only allow ESP commands permitted in the current mode. The motivation
is to fix GitLab issue #2464 which causes Windows NT MIPS to bluescreen on
boot.

Patches 1 to 5 are simple tidy-ups from investigating the issue. Patch 6 adds
a new asc_mode variable to indicate the current ESP mode, whilst patch 7 implements
the feature which fixes GitLab issue #2464.

Note: this series is being reposted as both the SeaBIOS and SeaBIOS hppa binaries
currently distributed with QEMU have now been fixed so that they do not use an
illegal ESP command sequence.  

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

v2:
- Rebase onto master
- Add patches 4 and 5 to avoid calling the DMA functions for zero-length transfers


Mark Cave-Ayland (7):
  esp.c: only raise IRQ in esp_transfer_data() for CMD_SEL, CMD_SELATN
    and CMD_TI commands
  esp.c: improve comment in esp_transfer_data()
  esp.h: remove separate ESPState typedef
  esp.c: only call dma_memory_read function if transfer length is
    non-zero
  esp.c: only call dma_memory_write function if transfer length is
    non-zero
  esp.c: add asc_mode property to indicate the current ESP mode
  esp.c: only allow ESP commands permitted in the current asc_mode

 hw/scsi/esp.c         | 94 +++++++++++++++++++++++++++++++++++++------
 hw/scsi/trace-events  |  1 +
 include/hw/scsi/esp.h | 15 ++++++-
 3 files changed, 96 insertions(+), 14 deletions(-)

-- 
2.39.5
Re: [PATCH v2 0/7] esp.c: only allow ESP commands permitted in the current mode
Posted by Mark Cave-Ayland 4 months, 1 week ago
On 18/06/2025 07:12, Mark Cave-Ayland wrote:

> This series contains a few minor tidy-ups along with an implementation of the
> logic to only allow ESP commands permitted in the current mode. The motivation
> is to fix GitLab issue #2464 which causes Windows NT MIPS to bluescreen on
> boot.
> 
> Patches 1 to 5 are simple tidy-ups from investigating the issue. Patch 6 adds
> a new asc_mode variable to indicate the current ESP mode, whilst patch 7 implements
> the feature which fixes GitLab issue #2464.
> 
> Note: this series is being reposted as both the SeaBIOS and SeaBIOS hppa binaries
> currently distributed with QEMU have now been fixed so that they do not use an
> illegal ESP command sequence.
> 
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> 
> v2:
> - Rebase onto master
> - Add patches 4 and 5 to avoid calling the DMA functions for zero-length transfers
> 
> 
> Mark Cave-Ayland (7):
>    esp.c: only raise IRQ in esp_transfer_data() for CMD_SEL, CMD_SELATN
>      and CMD_TI commands
>    esp.c: improve comment in esp_transfer_data()
>    esp.h: remove separate ESPState typedef
>    esp.c: only call dma_memory_read function if transfer length is
>      non-zero
>    esp.c: only call dma_memory_write function if transfer length is
>      non-zero
>    esp.c: add asc_mode property to indicate the current ESP mode
>    esp.c: only allow ESP commands permitted in the current asc_mode
> 
>   hw/scsi/esp.c         | 94 +++++++++++++++++++++++++++++++++++++------
>   hw/scsi/trace-events  |  1 +
>   include/hw/scsi/esp.h | 15 ++++++-
>   3 files changed, 96 insertions(+), 14 deletions(-)

Ping?


ATB,

Mark.
Re: [PATCH v2 0/7] esp.c: only allow ESP commands permitted in the current mode
Posted by Philippe Mathieu-Daudé 4 months, 1 week ago
Hi Mark,

On 9/7/25 09:50, Mark Cave-Ayland wrote:
> On 18/06/2025 07:12, Mark Cave-Ayland wrote:
> 
>> This series contains a few minor tidy-ups along with an implementation 
>> of the
>> logic to only allow ESP commands permitted in the current mode. The 
>> motivation
>> is to fix GitLab issue #2464 which causes Windows NT MIPS to 
>> bluescreen on
>> boot.
>>
>> Patches 1 to 5 are simple tidy-ups from investigating the issue. Patch 
>> 6 adds
>> a new asc_mode variable to indicate the current ESP mode, whilst patch 
>> 7 implements
>> the feature which fixes GitLab issue #2464.
>>
>> Note: this series is being reposted as both the SeaBIOS and SeaBIOS 
>> hppa binaries
>> currently distributed with QEMU have now been fixed so that they do 
>> not use an
>> illegal ESP command sequence.


>> Mark Cave-Ayland (7):

>>    esp.c: add asc_mode property to indicate the current ESP mode
>>    esp.c: only allow ESP commands permitted in the current asc_mode
>>
>>   hw/scsi/esp.c         | 94 +++++++++++++++++++++++++++++++++++++------
>>   hw/scsi/trace-events  |  1 +
>>   include/hw/scsi/esp.h | 15 ++++++-
>>   3 files changed, 96 insertions(+), 14 deletions(-)
> 
> Ping?

I reviewed 1-5 but don't have sufficient knowledge for 6-7 so
will defer these to Paolo.

Regards,

Phil.

Re: [PATCH v2 0/7] esp.c: only allow ESP commands permitted in the current mode
Posted by Mark Cave-Ayland 4 months ago
On 09/07/2025 12:16, Philippe Mathieu-Daudé wrote:

> Hi Mark,
> 
> On 9/7/25 09:50, Mark Cave-Ayland wrote:
>> On 18/06/2025 07:12, Mark Cave-Ayland wrote:
>>
>>> This series contains a few minor tidy-ups along with an implementation of the
>>> logic to only allow ESP commands permitted in the current mode. The motivation
>>> is to fix GitLab issue #2464 which causes Windows NT MIPS to bluescreen on
>>> boot.
>>>
>>> Patches 1 to 5 are simple tidy-ups from investigating the issue. Patch 6 adds
>>> a new asc_mode variable to indicate the current ESP mode, whilst patch 7 implements
>>> the feature which fixes GitLab issue #2464.
>>>
>>> Note: this series is being reposted as both the SeaBIOS and SeaBIOS hppa binaries
>>> currently distributed with QEMU have now been fixed so that they do not use an
>>> illegal ESP command sequence.
> 
> 
>>> Mark Cave-Ayland (7):
> 
>>>    esp.c: add asc_mode property to indicate the current ESP mode
>>>    esp.c: only allow ESP commands permitted in the current asc_mode
>>>
>>>   hw/scsi/esp.c         | 94 +++++++++++++++++++++++++++++++++++++------
>>>   hw/scsi/trace-events  |  1 +
>>>   include/hw/scsi/esp.h | 15 ++++++-
>>>   3 files changed, 96 insertions(+), 14 deletions(-)
>>
>> Ping?
> 
> I reviewed 1-5 but don't have sufficient knowledge for 6-7 so
> will defer these to Paolo.

Thanks Phil, I really appreciate your effort to help out here.


ATB,

Mark.