[PATCH 0/2] hw/scsi/ncr53c710: rewrite to support HP-UX, Linux and NetBSD

Keith Monahan posted 2 patches 3 weeks, 4 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260701031803.1817812-1-keith@techtravels.org
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Helge Deller <deller@gmx.de>, Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>
There is a newer version of this series
hw/misc/lasi.c        |   27 +-
hw/scsi/lasi_ncr710.c |  120 +-
hw/scsi/lasi_ncr710.h |   28 +-
hw/scsi/ncr53c710.c   | 3062 +++++++++++++++++------------------------
hw/scsi/ncr53c710.h   |  295 ++--
hw/scsi/trace-events  |   31 +-
6 files changed, 1500 insertions(+), 2063 deletions(-)
[PATCH 0/2] hw/scsi/ncr53c710: rewrite to support HP-UX, Linux and NetBSD
Posted by Keith Monahan 3 weeks, 4 days ago
This series replaces the NCR 53C710 model so HP-UX 10.20 (including the
Ignite/16700A install media) installs and boots on the HP 715 (-M 715),
while keeping the in tree Linux lasi700 and NetBSD osiop drivers working.

I first tried to fix the existing model.  It took about a dozen fixes
just to get the kernel's own 53c710 driver to negotiate its first
command, and even then HP-UX would not boot reliably.  Two of the faults
are in the core interpreter itself.  The model is connected only: no
target initiated disconnect/reselect, which HP-UX needs (and so does any
tagged, overlapped I/O).  And it runs SCRIPTS synchronously inside the
guest register write, so completion interrupts come back reentrantly
instead of the way the real chip delivers them.  Fixing either one meant
rewriting the interpreter, so I rewrote it.

The new model is derived from lsi53c895a.c, the maintained sibling in the
same NCR/LSI SCRIPTS family.  Its disconnect/reselect, asynchronous
completion and DMA paths already work across many guests.  I adapted it
to the 710: big endian SCRIPTS and table indirect fetch, 24 bit DMA byte
counts, the 710 register map, and the single byte interrupt model.  The
two LSI models share structure now, so a fix to one can carry to the
other.

Patch 1 is an independent LASI interrupt controller fix (a latched
request register that floods the installed HP-UX boot with "unexpected
core I/O interrupt").  Patch 2 is the rewrite, which depends on it.

Tested: HP-UX 10.20 install + reboot (Ignite 16700A and an overlapping
tagged software install); Debian install + boot (Linux 53c700);
NetBSD/hppa 9.4 and 10.1 boot + device enumeration (osiop).

Keith Monahan (2):
  hw/misc/lasi: derive IRR from pending and unmasked sources
  hw/scsi/ncr53c710: rewrite the 53C710 SCRIPTS engine

 hw/misc/lasi.c        |   27 +-
 hw/scsi/lasi_ncr710.c |  120 +-
 hw/scsi/lasi_ncr710.h |   28 +-
 hw/scsi/ncr53c710.c   | 3062 +++++++++++++++++------------------------
 hw/scsi/ncr53c710.h   |  295 ++--
 hw/scsi/trace-events  |   31 +-
 6 files changed, 1500 insertions(+), 2063 deletions(-)


base-commit: 30e8a06b64aa58a3990ba39cb5d09531e7d265e0
-- 
2.43.0
Re: [PATCH 0/2] hw/scsi/ncr53c710: rewrite to support HP-UX, Linux and NetBSD
Posted by Helge Deller 3 weeks, 3 days ago
On 7/1/26 05:18, Keith Monahan wrote:
> This series replaces the NCR 53C710 model so HP-UX 10.20 (including the
> Ignite/16700A install media) installs and boots on the HP 715 (-M 715),
> while keeping the in tree Linux lasi700 and NetBSD osiop drivers working.
> 
> I first tried to fix the existing model.  It took about a dozen fixes
> just to get the kernel's own 53c710 driver to negotiate its first
> command, and even then HP-UX would not boot reliably.  Two of the faults
> are in the core interpreter itself.  The model is connected only: no
> target initiated disconnect/reselect, which HP-UX needs (and so does any
> tagged, overlapped I/O).  And it runs SCRIPTS synchronously inside the
> guest register write, so completion interrupts come back reentrantly
> instead of the way the real chip delivers them.  Fixing either one meant
> rewriting the interpreter, so I rewrote it.
> 
> The new model is derived from lsi53c895a.c, the maintained sibling in the
> same NCR/LSI SCRIPTS family.  Its disconnect/reselect, asynchronous
> completion and DMA paths already work across many guests.  I adapted it
> to the 710: big endian SCRIPTS and table indirect fetch, 24 bit DMA byte
> counts, the 710 register map, and the single byte interrupt model.  The
> two LSI models share structure now, so a fix to one can carry to the
> other.
> 
> Patch 1 is an independent LASI interrupt controller fix (a latched
> request register that floods the installed HP-UX boot with "unexpected
> core I/O interrupt").  Patch 2 is the rewrite, which depends on it.
> 
> Tested: HP-UX 10.20 install + reboot (Ignite 16700A and an overlapping
> tagged software install); Debian install + boot (Linux 53c700);
> NetBSD/hppa 9.4 and 10.1 boot + device enumeration (osiop).
> 
> Keith Monahan (2):
>    hw/misc/lasi: derive IRR from pending and unmasked sources
>    hw/scsi/ncr53c710: rewrite the 53C710 SCRIPTS engine
> 
>   hw/misc/lasi.c        |   27 +-
>   hw/scsi/lasi_ncr710.c |  120 +-
>   hw/scsi/lasi_ncr710.h |   28 +-
>   hw/scsi/ncr53c710.c   | 3062 +++++++++++++++++------------------------
>   hw/scsi/ncr53c710.h   |  295 ++--
>   hw/scsi/trace-events  |   31 +-
>   6 files changed, 1500 insertions(+), 2063 deletions(-)
Thanks for this series!!!
I've tested this driver with HP-UX 10.20 (which didn't worked with the previous
ncr710 driver yet), and it's a big step forward.
Thanks for doing this.

Tested-by: Helge Deller <deller@gmx.de>
Re: [PATCH 0/2] hw/scsi/ncr53c710: rewrite to support HP-UX, Linux and NetBSD
Posted by Keith Monahan 3 weeks, 3 days ago
On 7/1/2026 8:40 AM, Helge Deller wrote:

> Thanks for this series!!!
> I've tested this driver with HP-UX 10.20 (which didn't worked with the 
> previous
> ncr710 driver yet), and it's a big step forward.
> Thanks for doing this.

You're welcome! Thanks for working with me on this! This LASI NCR710 
support for HP-UX is a feature I've wanted for years, so I'm glad to had 
the time to bring it life!

Keith