nc53c710 rewrite
v3 cover nc53c710 rewrite
From: Helge Deller <[email protected]>
This is the third attempt to replace the existing 53c710 driver by a new driver based on the code of the lsi53c895a.c. Patch #1 is not meant to be reviewed, as it basically just replaces the existing driver by a new one.
But patch #2 implements the proposed changes to use a common header for both drivers, as suggested by BALATON Zoltan.
Note that the ncr53c710 driver is currently only used by the HPPA 715 machine, and this patch should not have any effect on any other platform or machine. On the 715, this driver has been sucessfully tested with Linux, HP-UX and NetBSD.
Please review.
It would be great if this series can be included for qemu v11.2, as the current driver does not work stable for any guest OS.
Keith Monahan (6):
hw/scsi/ncr53c710: rewrite the 53C710 SCRIPTS engine hw/scsi: share NCR/LSI definitions in lsi_scsi.h hw/scsi/lasi_ncr710: map the full LASI SCSI module page hw/scsi/ncr53c710: move to COMMAND on CLEAR ACK after MESSAGE REJECT hw/scsi/scsi-disk: add quirk_mode_page_no_flexible_disk, use it on the
715
hw/scsi/ncr53c710: Comment cleanup, reduce verbosity, repetition
MAINTAINERS | 1 + hw/hppa/machine.c | 10 + hw/scsi/lasi_ncr710.c | 129 +- hw/scsi/lasi_ncr710.h | 28 +- hw/scsi/lsi53c895a.c | 79 +- hw/scsi/lsi_scsi.h | 98 ++ hw/scsi/ncr53c710.c | 2957 +++++++++++++++------------------------- hw/scsi/ncr53c710.h | 282 ++-- hw/scsi/scsi-disk.c | 13 + hw/scsi/trace-events | 43 +- include/hw/scsi/scsi.h | 1 + 11 files changed, 1426 insertions(+), 2215 deletions(-) create mode 100644 hw/scsi/lsi_scsi.h
Signature · 1 line
2.54.0
PATCH v3 1/6 hw/scsi/ncr53c710: rewrite the 53C710 SCRIPTS engine
From: Keith Monahan <[email protected]>
Rewrite the NCR 53C710 model with a SCRIPTS engine derived from QEMU's LSI53C895A model (hw/scsi/lsi53c895a.c), an actively maintained sibling in the same NCR/LSI SCRIPTS family, adapted to the 53C710: its register map, single byte (DSTAT/SSTAT0) interrupt model, big endian SCRIPTS and table indirect fetch (the part sits on the big endian PA-RISC LASI bus), and 24 bit DMA counts. Behaviour follows the NCR 53C710 Data Manual (Jun 1992) and Programmer's Guide (Oct 1990).
The LASI glue (hw/scsi/lasi_ncr710.c) is the only instantiated device and embeds one NCR710State by value. It gains the free_request SCSIBusInfo callback and request queue init the new core needs, renames the reselection timer to scripts_timer, and drops the old model's dead scaffolding (the unused SCNR define, the DPRINTF macros, and unused or shadowing register macros).
Tested through real SCSI I/O on the HP 715 (-M 715, LASI):
- HP-UX 10.20 installs and reboots into the installed system, on both the Ignite (16700A) media and a software install that overlaps tagged commands.
- Linux lasi700/53c700 installs and boots Debian off the 710.
- NetBSD/hppa 9.4 and 10.1 (osiop) boot and enumerate disk and CD-ROM.
Disconnect and reselect, adapted from lsi53c895a, let a driver overlap tagged commands: a disconnecting command's request moves onto a per device queue and is reselected once its data is ready and the engine is parked at Wait Reselect. Reselection follows the 53C700 family rather than the 8xx parts: gated on the (re)selection interrupt enable (SIEN.SEL) alone, one hot SDID, an SFBR id bitmask in 700 compatibility mode, and IDENTIFY (plus SIMPLE QUEUE TAG when tagged) replayed on reconnect. A disconnect is fabricated only for a tagged command under a driver that parks on Wait Reselect with SIEN.SEL clear, which today means HP-UX; untagged transfers and reselection interrupt drivers (e.g. Linux 53c700) keep the existing connected completion path.
Completions are delivered asynchronously, as the real chip delivers them, rather than reentrantly inside the interpreter: a reselect reconnect and a tagged completion off host cached media (the install CD-ROM) are deferred to a bottom half. A reentrant completion would collapse the disconnect and the completion interrupt into the one guest MMIO write driving the engine and race the HP-UX 10.20 c720 driver's completion bookkeeping. The interpreter also guards the reentrancy class behind CVE-2023-0330. Untagged and polled transfers keep inline completion.
The c720 driver further needs the completion interrupt ordering hardware provides, starting a command with interrupts masked and then spinning. So after a register write starts an asynchronous transfer the model drives it to completion before returning to the guest (a bounded synchronous drain under the BQL, as IDE and MegaSAS do, falling back to asynchronous completion if it cannot advance), and a SIGP kick that lands on a stopped engine is held and replayed once it parks.
The companion change in hw/misc/lasi.c fixes the LASI interrupt controller's request register. IRR was latched - set when a source asserted, then never cleared or re-evaluated against the mask - so a masked or dropped request stuck forever, and since the parisc core I/O dispatcher reads IRR to find its source, the stuck bit returned on every later interrupt as an "unexpected core I/O interrupt". On the installed HP-UX system an unacknowledged i82596 LAN interrupt latched this way and the flood wedged the boot. IRR is now derived as (pending and unmasked) with IPR tracking each source's level, matching the hardware and the in tree parisc gsc/lasi driver.
SDTR/WDTR/PPR negotiation is declined with MESSAGE REJECT. The HP-UX 10.20 install kernel is nonconformant: its self modifying SCRIPTS reads a second message byte after the reject and hangs unless it is SAVE DATA POINTERS, while NetBSD's osiop resets the bus if it sees that byte. The two are told apart by ATN state as the reject is consumed (HP-UX has deasserted ATN, a conformant initiator has not), so the extra byte is appended only for HP-UX.
A guest ISTAT.RST soft reset cancels the connected and any queued tagged requests, so a stale s->current cannot dangle into the next command and queued requests are not leaked, mirroring the SCNTL1.RST bus reset teardown.
The migration format is incompatible with the model this replaces, so the ncr710 and lasi_ncr710 vmstate descriptions raise minimum_version_id in lockstep: an old stream is rejected rather than silently misparsed.
Derived from hw/scsi/lsi53c895a.c (Copyright (c) 2006 CodeSourcery, written by Paul Brook), which is LGPL; this derived work is distributed under GPL-2.0-or-later, as the LGPL permits. Replaces the 53C710 model written for Google Summer of Code 2025 by Soumyajyotii Ssarkar, itself based on earlier NCR 53C710 work by Helge Deller and by Toni Wilen (for UAE).
--- hw/scsi/lasi_ncr710.c | 118 +- hw/scsi/lasi_ncr710.h | 28 +- hw/scsi/ncr53c710.c | 3042 +++++++++++++++++------------------------ hw/scsi/ncr53c710.h | 295 ++-- hw/scsi/trace-events | 43 +- 5 files changed, 1462 insertions(+), 2064 deletions(-)
hw/scsi/lasi_ncr710.c +47 -71
@@ -1,12 +1,12 @@/* -* LASI Wrapper for NCR710 SCSI Controller +* LASI wrapper for the NCR 53C710 SCSI controller * * Copyright (c) 2025 Soumyajyotii Ssarkar <[email protected]> -* This driver was developed during the Google Summer of Code 2025 program. -* Mentored by Helge Deller <[email protected]> +* Developed during Google Summer of Code 2025, mentored by +* Helge Deller <[email protected]>. * -* NCR710 SCSI Controller implementation -* Based on the NCR53C710 Technical Manual Version 3.2, December 2000 +* LASI module glue around the 53C710 core in ncr53c710.c: it embeds one +* NCR710State by value and maps it onto the HP 715 (-M 715) LASI bus. * * SPDX-License-Identifier: GPL-2.0-or-later */
@@ -24,7 +24,6 @@#include "system/dma.h" #define LASI_710_SVERSION 0x00082 -#define SCNR 0xBEEFBABE#define LASI_710_HVERSION 0x3D#define HPHW_FIO 5/* Fixed I/O module */
@@ -34,8 +33,6 @@ static uint64_t lasi_ncr710_reg_read(void *opaque, hwaddr addr,LasiNCR710State *s =LASI_NCR710 (opaque);uint64_t val =0 ; -trace_lasi_ncr710_reg_read (addr,0 , size); -if (addr ==0x00 ) {/* Device ID */ val = (HPHW_FIO <<24 ) |LASI_710_SVERSION ;trace_lasi_ncr710_reg_read_id (HPHW_FIO ,LASI_710_SVERSION , val);
@@ -51,22 +48,22 @@ static uint64_t lasi_ncr710_reg_read(void *opaque, hwaddr addr,if (addr >=0x100 ) {hwaddr ncr_addr = addr -0x100 ;if (size ==1 ) { +/* +* Single byte access: flip the byte lane (PA-RISC big endian +* access -> the chip's little endian register order). +*/ ncr_addr ^=3 ; -NCR710_DPRINTF ("Reading value to LASI WRAPPER == 0x%lx%s, " -"val=0x%lx, size=%u\n" , - addr -0x100 , size ==1 ?" (XORed)" :"" , - val, size); val =ncr710_reg_read (&s->ncr710, ncr_addr, size); }else { +/* +* Multibyte access: gather little endian, no lane flip, so +* the 24/32 bit registers assemble correctly. +*/ val =0 ;for (unsigned i =0 ; i < size; i++) {uint8_t byte_val =ncr710_reg_read (&s->ncr710, ncr_addr + i,1 ); val |= ((uint64_t )byte_val) << (i *8 ); -NCR710_DPRINTF (" Read byte %u from NCR addr 0x%lx: " -"0x%02x\n" , i, ncr_addr + i, byte_val); } -NCR710_DPRINTF (" Reconstructed %u-byte value: 0x%lx\n" , - size, val); }trace_lasi_ncr710_reg_forward_read (addr, val);
@@ -84,7 +81,13 @@ static void lasi_ncr710_reg_write(void *opaque, hwaddr addr,trace_lasi_ncr710_reg_write (addr, val, size); -if (addr <=0x0F ) { +/* +* 0x00..0x0f is the read only LASI module header (ID/SVERSION/HVERSION) and +* 0x10..0xff is unmapped module space; writes to both are ignored. The +* SCSI bus reset is driven through the chip's SCNTL1.RST at forwarded +* offset 0x101 (see ncr53c710.c), not through this window. +*/ +if (addr <=0x0f ) {return ; }
@@ -93,16 +96,10 @@ static void lasi_ncr710_reg_write(void *opaque, hwaddr addr,if (size ==1 ) { ncr_addr ^=3 ; -NCR710_DPRINTF ("Writing value to LASI WRAPPER == 0x%lx%s, " -"val=0x%lx, size=%u\n" , - addr -0x100 , size ==1 ?" (XORed)" :"" , - val, size);ncr710_reg_write (&s->ncr710, ncr_addr, val, size); }else {for (unsigned i =0 ; i < size; i++) {uint8_t byte_val = (val >> (i *8 )) &0xff ; -NCR710_DPRINTF (" Writing byte %u to NCR addr 0x%lx: 0x%02x\n" , - i, ncr_addr + i, byte_val);ncr710_reg_write (&s->ncr710, ncr_addr + i, byte_val,1 ); } }
@@ -113,10 +110,7 @@ static void lasi_ncr710_reg_write(void *opaque, hwaddr addr, } } -/* -* req_cancelled, command_complete, transfer_data forwards -* commands to its core counterparts. -*/ +/* SCSIBusInfo callbacks: trace, then forward to the ncr53c710 core. */ static void lasi_ncr710_request_cancelled (SCSIRequest *req) {trace_lasi_ncr710_request_cancelled (req);
@@ -129,20 +123,27 @@ static void lasi_ncr710_command_complete(SCSIRequest *req, size_t resid)ncr710_command_complete (req, resid); } -static void lasi_ncr710_transfer_data (SCSIRequest *req,uint32_t len) +static void lasi_ncr710_transfer_data (SCSIRequest *req,uint32_t len) {trace_lasi_ncr710_transfer_data (len);ncr710_transfer_data (req, len); } +static void lasi_ncr710_free_request (SCSIBus *bus,void *priv) +{ +g_free (priv); +} +static const struct SCSIBusInfo lasi_ncr710_scsi_info = { .tcq = true, - .max_target =8 , - .max_lun =8 ,/* full LUN support */ +/* 8-bit bus: targets and LUNs 0-7 (scsi-bus.c maxima are inclusive). */ + .max_target =7 , + .max_lun =7 , .transfer_data = lasi_ncr710_transfer_data, .complete = lasi_ncr710_command_complete, .cancel = lasi_ncr710_request_cancelled, + .free_request = lasi_ncr710_free_request, };static const MemoryRegionOps lasi_ncr710_mmio_ops = {
@@ -157,12 +158,9 @@ static const MemoryRegionOps lasi_ncr710_mmio_ops = {static const VMStateDescription vmstate_lasi_ncr710 = { .name ="lasi-ncr710" , - .version_id =1 , - .minimum_version_id =1 , + .version_id =2 , + .minimum_version_id =2 , .fields = (const VMStateField []) { -VMSTATE_UINT32 (hw_type, LasiNCR710State), -VMSTATE_UINT32 (sversion, LasiNCR710State), -VMSTATE_UINT32 (hversion, LasiNCR710State),VMSTATE_STRUCT (ncr710, LasiNCR710State,1 , vmstate_ncr710, NCR710State),VMSTATE_END_OF_LIST () }
@@ -179,49 +177,36 @@ static void lasi_ncr710_realize(DeviceState *dev, Error **errp) &lasi_ncr710_scsi_info); s->ncr710.as = &address_space_memory; s->ncr710.irq = s->lasi_irq; +QTAILQ_INIT (&s->ncr710.queue); - s->ncr710.reselection_retry_timer = + s->ncr710.scripts_timer =timer_new_ns (QEMU_CLOCK_VIRTUAL , - ncr710_reselection_retry_callback, + ncr710_scripts_timer_callback, &s->ncr710);ncr710_soft_reset (&s->ncr710);trace_lasi_ncr710_timers_initialized ( - (uint64_t )s->ncr710.reselection_retry_timer); + (uint64_t )s->ncr710.scripts_timer); -/* Initialize memory region */ memory_region_init_io (&s->mmio,OBJECT (dev), &lasi_ncr710_mmio_ops, s,"lasi-ncr710" ,0x200 );sysbus_init_mmio (sbd, &s->mmio); } -void lasi_ncr710_handle_legacy_cmdline (DeviceState *lasi_dev) +static void lasi_ncr710_unrealize (DeviceState *dev) { -LasiNCR710State *s =LASI_NCR710 (lasi_dev); -SCSIBus *bus = &s->ncr710.bus; -int found_drives =0 ; - -if (!bus) { -return ; - } +LasiNCR710State *s =LASI_NCR710 (dev); -for (int unit =0 ; unit <=7 ; unit++) { -DriveInfo *dinfo =drive_get (IF_SCSI , bus->busnr, unit); -if (dinfo) { -trace_lasi_ncr710_legacy_drive_found (bus->busnr, unit); - found_drives++; - } - } +timer_free (s->ncr710.scripts_timer); + s->ncr710.scripts_timer =NULL ; +} -trace_lasi_ncr710_handle_legacy_cmdline (bus->busnr, found_drives); +void lasi_ncr710_handle_legacy_cmdline (DeviceState *lasi_dev) +{ +LasiNCR710State *s =LASI_NCR710 (lasi_dev); -scsi_bus_legacy_handle_cmdline (bus); -BusChild *kid; - QTAILQ_FOREACH(kid, &bus->qbus.children, sibling) { -trace_lasi_ncr710_scsi_device_created ( -object_get_typename (OBJECT (kid->child))); - } +scsi_bus_legacy_handle_cmdline (&s->ncr710.bus); } DeviceState *lasi_ncr710_init(MemoryRegion *addr_space, hwaddr hpa,
@@ -248,20 +233,12 @@ static void lasi_ncr710_reset(DeviceState *dev)ncr710_soft_reset (&s->ncr710); } -static void lasi_ncr710_instance_init (Object *obj) -{ -LasiNCR710State *s =LASI_NCR710 (obj); - - s->hw_type =HPHW_FIO ; - s->sversion =LASI_710_SVERSION ; - s->hversion =LASI_710_HVERSION ; -} -static void lasi_ncr710_class_init (ObjectClass *klass,const void *data) {DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = lasi_ncr710_realize; + dc->unrealize = lasi_ncr710_unrealize;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); dc->fw_name ="scsi" ; dc->desc ="HP-PARISC LASI NCR710 SCSI adapter" ;
@@ -274,7 +251,6 @@ static const TypeInfo lasi_ncr710_info = { .name = TYPE_LASI_NCR710, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(LasiNCR710State), - .instance_init = lasi_ncr710_instance_init, .class_init = lasi_ncr710_class_init, };
hw/scsi/lasi_ncr710.h +3 -25
@@ -1,12 +1,9 @@/* -* LASI Wrapper for NCR710 SCSI Controller +* LASI wrapper for the NCR 53C710 SCSI controller * * Copyright (c) 2025 Soumyajyotii Ssarkar <[email protected]> -* This driver was developed during the Google Summer of Code 2025 program. -* Mentored by Helge Deller <[email protected]> -* -* NCR710 SCSI Controller implementation -* Based on the NCR53C710 Technical Manual Version 3.2, December 2000 +* Developed during Google Summer of Code 2025, mentored by +* Helge Deller <[email protected]>. * * SPDX-License-Identifier: GPL-2.0-or-later */
@@ -22,29 +19,10 @@#define TYPE_LASI_NCR710 "lasi-ncr710" OBJECT_DECLARE_SIMPLE_TYPE(LasiNCR710State, LASI_NCR710) -#define LASI_SCSI_RESET 0x000/* SCSI Reset Register */ -#define LASI_SCSI_NCR710_BASE 0x100/* NCR710 Base Register Offset */ - -#define PARISC_DEVICE_ID_OFF 0x00/* HW type, HVERSION, SVERSION */ -#define PARISC_DEVICE_CONFIG_OFF 0x04/* Configuration data */ - -#define PHASE_MASK 7 -#define PHASE_DO 0 - -#define NCR710_SCNTL1_RST 0x08/* SCSI Reset */ -#define NCR710_ISTAT_RST 0x40/* Device Reset */ -#define NCR710_ISTAT_ABRT 0x80/* Script Abort */ -#define NCR710_ISTAT_CON 0x08/* ISTAT_Connected */ -#define NCR710_DSTAT_DFE 0x80/* DMA FIFO Empty */ -#define NCR710_CTEST2_DACK 0x01/* DMA Acknowledge */ -typedef struct LasiNCR710State {SysBusDevice parent_obj;MemoryRegion mmio;qemu_irq lasi_irq;/* IRQ line to LASI controller */ -uint32_t hw_type;/* Hardware type (HPHW_*) */ -uint32_t sversion;/* Software version */ -uint32_t hversion;/* Hardware version */ NCR710State ncr710; }LasiNCR710State ;
hw/scsi/ncr53c710.c +1264 -1778
2,719 lines not on this page · raw message
hw/scsi/ncr53c710.h +116 -179
295 lines not on this page · raw message
hw/scsi/trace-events +32 -11
43 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.54.0
Part of the diff is not shown here. View the raw message.
PATCH v3 2/6 hw/scsi: share NCR/LSI definitions in lsi_scsi.h
In reply to Helge DellerFrom: Keith Monahan <[email protected]>
Move common defines and structures of the 53c710 and the lsi53c895a drivers to lsi_scsi.h, as suggested by BALATON Zoltan.
--- MAINTAINERS | 1 + hw/scsi/lsi53c895a.c | 79 +---- hw/scsi/lsi_scsi.h | 98 ++++++ hw/scsi/ncr53c710.c | 727 +++++++++++++++++++------------------------ hw/scsi/ncr53c710.h | 13 +- 5 files changed, 426 insertions(+), 492 deletions(-) create mode 100644 hw/scsi/lsi_scsi.h
MAINTAINERS +1 -0
@@ -1368,6 +1368,7 @@ F: hw/misc/lasi.c F: hw/pci-host/astro.c F: hw/pci-host/dino.c F: hw/scsi/lasi_ncr710.* +F: hw/scsi/lsi_scsi.h F: hw/scsi/ncr53c710.* F: include/hw/input/lasips2.h F: include/hw/misc/lasi.h
hw/scsi/lsi53c895a.c +1 -78
143 lines not on this page · raw message
hw/scsi/lsi_scsi.h new file +98 -0
98 lines not on this page · raw message
hw/scsi/ncr53c710.c +321 -406
1,589 lines not on this page · raw message
hw/scsi/ncr53c710.h +5 -8
@@ -21,6 +21,7 @@#include "system/memory.h" #include "qemu/timer.h" #include "migration/vmstate.h" +#include "lsi_scsi.h" /* Register offsets (little endian addressing; the chip is internally LE). */ #define NCR710_SCNTL0 0x00
@@ -65,13 +66,9 @@#define NCR710_DCNTL 0x3b#define NCR710_ADDER 0x3c -#define NCR710_MAX_MSGIN_LEN 8 -/* The chip revision reported in CTEST8[7:4]. */ #define NCR710_CHIP_REVISION 0x2 -typedef struct NCR710Request NCR710Request ; - typedef struct NCR710State { /* Wiring filled in by the LASI wrapper before ncr710_soft_reset(). */ SCSIBus bus;
@@ -89,7 +86,7 @@ typedef struct NCR710State {int status;int msg_action;int msg_len; -uint8_t msg[NCR710_MAX_MSGIN_LEN ]; +uint8_t msg[LSI_MAX_MSGIN_LEN ];int waiting;int current_lun;uint32_t select_tag;
@@ -105,7 +102,7 @@ typedef struct NCR710State {*/ bool sigp_pending_resume;/* -* A cached-backend SCSI continue was deferred to ncr710_issue_bh so its +* A cached-backend SCSI continue was deferred to lsi_issue_bh so its * completion arrives asynchronously, not reentrantly inside the engine. */ bool issue_pending;
@@ -114,13 +111,13 @@ typedef struct NCR710State {* outside execute_script), so it is not migrated in vmstate. */ int reentrancy_level; -NCR710Request *current; +lsi_request *current;/* * Disconnected tagged commands awaiting target-initiated reselection * (lsi53c895a-style). Untagged 53C700-family transfers never disconnect, * so for them this stays empty and the engine runs connected as before. */ - QTAILQ_HEAD(, NCR710Request) queue; + QTAILQ_HEAD(, lsi_request) queue;/* * Registers (53C710 layout). Several (e.g. sodl/sidl/sbdl/lcrc/ctest*) are
Signature · 1 line
2.54.0
Re: [PATCH v3 2/6] hw/scsi: share NCR/LSI definitions in lsi_scsi.h
Quoted 4 lines · Helge Deller
From: Keith Monahan <[email protected]>
Move common defines and structures of the 53c710 and the lsi53c895a drivers to
lsi_scsi.h, as suggested by BALATON Zoltan.
We have Suggested-by tag for that instead of putting it in comment message. This patch should come before the previous so it avoids the churn of renaming what patch 1 added and add that already using these defines and names after this patch.
Regards,
BALATON Zoltan
Re: [PATCH v3 2/6] hw/scsi: share NCR/LSI definitions in lsi_scsi.h
Quoted 8 lines · BALATON Zoltan
Quoted 4 lines · Helge Deller
From: Keith Monahan <[email protected]>
Move common defines and structures of the 53c710 and the lsi53c895a drivers to
lsi_scsi.h, as suggested by BALATON Zoltan.We have Suggested-by tag for that instead of putting it in comment message.
Sure, will fix that.
Quoted 3 lines
This patch should come before the previous so it avoids the churn of renaming what patch 1 added and add that already using these defines and names after this patch.
Independend of in which order patches should come, please take a closer look at patch #2.
Your suggestion was to "share common defines and functions" in a common header file, with the intention that both drivers share functionality/code.
This is what this patch currently does, e.g this part:
-#define LSI_ISTAT0_DIP 0x01 -#define LSI_ISTAT0_SIP 0x02 #define LSI_ISTAT0_INTF 0x04 -#define LSI_ISTAT0_CON 0x08 #define LSI_ISTAT0_SEM 0x10 -#define LSI_ISTAT0_SIGP 0x20 -#define LSI_ISTAT0_SRST 0x40 -#define LSI_ISTAT0_ABRT 0x80
Now, looking at the result, I'm not sure this is what we really want. We rip out single bitmasks out of context and put it in in various header files. I think this is generating more confusion that having the defines per chip/driver as it was before.
I suggest to keep those defines per-driver as they are, but instead share the lsi_request struct, LSI_* enums, PHASE* enums, and lsi_* functions only.
Thoughts?
Helge
Re: [PATCH v3 2/6] hw/scsi: share NCR/LSI definitions in lsi_scsi.h
Quoted 10 lines · Helge Deller
Quoted 8 lines · BALATON Zoltan
Quoted 4 lines · Helge Deller
From: Keith Monahan <[email protected]>
Move common defines and structures of the 53c710 and the lsi53c895a drivers to
lsi_scsi.h, as suggested by BALATON Zoltan.We have Suggested-by tag for that instead of putting it in comment message.
Quoted 7 lines
Sure, will fix that.
Quoted 3 lines
This patch should come before the previous so it avoids the churn of renaming what patch 1 added and add that already using these defines and names after this patch.
Independend of in which order patches should come, please take a closer look at patch #2.
Maybe it wasn't clear so just in case, first patch should split out shared parts into a header from the 895 model leaving the old 710 model to be replaced untouched. Then should come the patch replacing 710 with a rewrite using the header and having the rename changes to make it more easily comparable to the 895 model. That should avoid churn in this version.
Quoted 19 lines
Your suggestion was to "share common defines and functions" in a common header file, with the intention that both drivers share functionality/code.
This is what this patch currently does, e.g this part:
hw/scsi/lsi53c895a.c +0
-2-#define LSI_ISTAT0_DIP 0x01 -#define LSI_ISTAT0_SIP 0x02#define
LSI_ISTAT0_INTF0x04
-#defineLSI_ISTAT0_CON0x08
#defineLSI_ISTAT0_SEM0x10hw/scsi/lsi53c895a.c +0
-3-#define LSI_ISTAT0_SIGP 0x20 -#define LSI_ISTAT0_SRST 0x40 -#define LSI_ISTAT0_ABRT 0x80Now, looking at the result, I'm not sure this is what we really want. We rip out single bitmasks out of context and put it in in various header files. I think this is generating more confusion that having the defines per chip/driver as it was before.
Quoted 5 lines
I suggest to keep those defines per-driver as they are, but instead share the
lsi_requeststruct, LSI_* enums, PHASE* enums, and lsi_* functions only.Thoughts?
I think there are more defines that have the same values just different names so there might be more to share but you can leave that to a separate patch after the two models are easier to compare to see the simlilarities and differences better.
Regards,
BALATON Zoltan
PATCH v3 3/6 hw/scsi/lasi_ncr710: map the full LASI SCSI module page
In reply to Helge DellerFrom: Keith Monahan <[email protected]>
0x100..0x1ff goes to the chip core as before. The rest of the module page reads as 0: HP-UX reads a board strap at 0xd85 (bit 0x20:
differential bus, 25 MHz clock); 0 is single ended, 50 MHz.
0x10..0xff and 0x200..0xfff are unmapped module space. Writes to all of them are ignored.
--- hw/scsi/lasi_ncr710.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
hw/scsi/lasi_ncr710.c +14 -7
@@ -45,7 +45,13 @@ static uint64_t lasi_ncr710_reg_read(void *opaque, hwaddr addr,return val; } -if (addr >=0x100 ) { +/* +* 0x100..0x1ff goes to the chip core as before. The rest of the +* module page reads as 0: HP-UX reads a board strap at 0xd85 +* (bit 0x20: differential bus, 25 MHz clock); 0 is single ended, +* 50 MHz. +*/ +if (addr >=0x100 && addr + size <=0x200 ) {hwaddr ncr_addr = addr -0x100 ;if (size ==1 ) {/*
@@ -82,16 +88,17 @@ static void lasi_ncr710_reg_write(void *opaque, hwaddr addr,trace_lasi_ncr710_reg_write (addr, val, size);/* -* 0x00..0x0f is the read only LASI module header (ID/SVERSION/HVERSION) and -* 0x10..0xff is unmapped module space; writes to both are ignored. The -* SCSI bus reset is driven through the chip's SCNTL1.RST at forwarded -* offset 0x101 (see ncr53c710.c), not through this window. +* 0x00..0x0f is the read only LASI module header (ID/SVERSION/HVERSION); +* 0x10..0xff and 0x200..0xfff are unmapped module space. Writes to all +* of them are ignored. The SCSI bus reset is driven through the chip's +* SCNTL1.RST at forwarded offset 0x101 (see ncr53c710.c), not through +* this window. */ if (addr <=0x0f ) {return ; } -if (addr >=0x100 ) { +if (addr >=0x100 && addr + size <=0x200 ) {hwaddr ncr_addr = addr -0x100 ;if (size ==1 ) {
@@ -190,7 +197,7 @@ static void lasi_ncr710_realize(DeviceState *dev, Error **errp) (uint64_t)s->ncr710.scripts_timer);memory_region_init_io (&s->mmio,OBJECT (dev), &lasi_ncr710_mmio_ops, s, -"lasi-ncr710" ,0x200 ); +"lasi-ncr710" ,0x1000 );sysbus_init_mmio (sbd, &s->mmio); }
Signature · 1 line
2.54.0
PATCH v3 4/6 hw/scsi/ncr53c710: move to COMMAND on CLEAR ACK after MESSAGE REJECT
In reply to Helge DellerFrom: Keith Monahan <[email protected]>
Releasing ACK on the last byte of a declined negotiation MESSAGE REJECT lets the target move on to COMMAND. HP-UX 9 tests the phase with JUMP WHEN COMMAND after CLEAR ACK instead of issuing the CDB block move directly.
--- hw/scsi/ncr53c710.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
hw/scsi/ncr53c710.c +10 -0
@@ -1181,6 +1181,16 @@ again: }if (insn & (1 <<6 )) { s->sbcl &= ~LSI_SBCL_ACK ; +/* +* Releasing ACK on the last byte of a declined negotiation +* MESSAGE REJECT lets the target move on to COMMAND. HP-UX +* 9 tests the phase with JUMP WHEN COMMAND after CLEAR ACK +* instead of issuing the CDB block move directly. +*/ +if ((s->sstat2 &PHASE_MASK ) ==PHASE_MI && s->msg_len ==0 && + s->msg_action ==LSI_MSG_ACTION_COMMAND ) { +lsi_set_phase (s,PHASE_CMD ); + } }if (insn & (1 <<10 )) { s->carry =0 ;
Signature · 1 line
2.54.0
PATCH v3 5/6 hw/scsi/scsi-disk: add quirk_mode_page_no_flexible_disk, use it on the 715
In reply to Helge DellerFrom: Keith Monahan <[email protected]>
scsi-hd returns MODE SENSE page 5 (flexible disk geometry) for every disk. Real SCSI hard disks do not implement it; only floppy drives do. HP-UX 9 ioscan sends MODE SENSE page 5 to the open root disk and leaves the disk out of its listing when the page comes back, so SAM's disk manager shows no hard disk. Add quirk_mode_page_no_flexible_disk, which makes page 5 an invalid field in the CDB, and turn it on for scsi-hd on the HP 715 machine.
--- hw/hppa/machine.c | 10 ++++++++++ hw/scsi/scsi-disk.c | 13 +++++++++++++ include/hw/scsi/scsi.h | 1 + 3 files changed, 24 insertions(+)
hw/hppa/machine.c +10 -0
@@ -1024,6 +1024,14 @@ static void HP_A400_machine_init_class_init(ObjectClass *oc, const void *data) mc->default_ram_size =1024 * MiB; } +/* +* HP-UX 9 ioscan sends MODE SENSE page 5 to the open root disk and leaves +* the disk out of its listing if the page is returned. +*/ +static GlobalProperty hw_compat_715[] = { + {"scsi-hd" ,"quirk_mode_page_no_flexible_disk" ,"on" }, +}; +static void HP_715_machine_init_class_init (ObjectClass *oc,const void *data) {static const char *const valid_cpu_types[] = {
@@ -1045,6 +1053,8 @@ static void HP_715_machine_init_class_init(ObjectClass *oc, const void *data) mc->max_cpus =MIN_CONST (HPPA_MAX_CPUS ,8 ); mc->default_ram_size =256 * MiB; mc->default_nic =TYPE_LASI_82596 ; +compat_props_add (mc->compat_props, hw_compat_715, +G_N_ELEMENTS (hw_compat_715)); }
hw/scsi/scsi-disk.c +13 -0
@@ -1156,6 +1156,15 @@ static int mode_sense_page(SCSIDiskState *s, int page, uint8_t **p_outbuf,return -1 ; } +/* +* The flexible disk page is only implemented by floppy drives. Some +* guests (HP-UX 9 ioscan) take a disk that returns it for a floppy. +*/ +if (page ==MODE_PAGE_FLEXIBLE_DISK_GEOMETRY && + (s->quirks & (1 <<SCSI_DISK_QUIRK_MODE_PAGE_NO_FLEXIBLE_DISK ))) { +return -1 ; + } +/* * If Changeable Values are requested, a mask denoting those mode parameters * that are changeable shall be returned. As we currently don't support
@@ -3293,6 +3302,8 @@ static const Property scsi_hd_properties[] = { 0),DEFINE_PROP_BIT ("quirk_mode_page_set_block_size" , SCSIDiskState, quirks,SCSI_DISK_QUIRK_MODE_PAGE_SET_BLOCK_SIZE ,0 ), +DEFINE_PROP_BIT ("quirk_mode_page_no_flexible_disk" , SCSIDiskState, + quirks,SCSI_DISK_QUIRK_MODE_PAGE_NO_FLEXIBLE_DISK ,0 ), DEFINE_BLOCK_CHS_PROPERTIES(SCSIDiskState, qdev.conf), };
@@ -3401,6 +3412,8 @@ static const Property scsi_cd_properties[] = { SCSI_DISK_QUIRK_MODE_PAGE_TRUNCATED, 0),DEFINE_PROP_BIT ("quirk_mode_page_set_block_size" , SCSIDiskState, quirks,SCSI_DISK_QUIRK_MODE_PAGE_SET_BLOCK_SIZE ,0 ), +DEFINE_PROP_BIT ("quirk_mode_page_no_flexible_disk" , SCSIDiskState, + quirks, SCSI_DISK_QUIRK_MODE_PAGE_NO_FLEXIBLE_DISK, 0), };static void scsi_cd_class_initfn (ObjectClass *klass,const void *data)
include/hw/scsi/scsi.h +1 -0
@@ -264,5 +264,6 @@ bool scsi_generic_pr_state_cleanup(SCSIDevice *s, Error **errp);#define SCSI_DISK_QUIRK_MODE_PAGE_VENDOR_SPECIFIC_APPLE 2#define SCSI_DISK_QUIRK_MODE_PAGE_TRUNCATED 3#define SCSI_DISK_QUIRK_MODE_PAGE_SET_BLOCK_SIZE 4 +#define SCSI_DISK_QUIRK_MODE_PAGE_NO_FLEXIBLE_DISK 5#endif
Signature · 1 line
2.54.0
PATCH v3 6/6 hw/scsi/ncr53c710: Comment cleanup, reduce verbosity, repetition
In reply to Helge DellerFrom: Keith Monahan <[email protected]>
Various comment cleanups.
--- hw/scsi/lasi_ncr710.c | 20 ++- hw/scsi/ncr53c710.c | 306 +++++++++++------------------------------- hw/scsi/ncr53c710.h | 38 ++---- 3 files changed, 101 insertions(+), 263 deletions(-)
hw/scsi/lasi_ncr710.c +9 -11
@@ -5,8 +5,8 @@* Developed during Google Summer of Code 2025, mentored by * Helge Deller <[email protected]>. * -* LASI module glue around the 53C710 core in ncr53c710.c: it embeds one -* NCR710State by value and maps it onto the HP 715 (-M 715) LASI bus. +* LASI module glue mapping the 53C710 core in ncr53c710.c onto the HP 715 +* (-M 715) LASI bus. * * SPDX-License-Identifier: GPL-2.0-or-later */
@@ -45,12 +45,7 @@ static uint64_t lasi_ncr710_reg_read(void *opaque, hwaddr addr,return val; } -/* -* 0x100..0x1ff goes to the chip core as before. The rest of the -* module page reads as 0: HP-UX reads a board strap at 0xd85 -* (bit 0x20: differential bus, 25 MHz clock); 0 is single ended, -* 50 MHz. -*/ +/* 0x100..0x1ff goes to the chip core. */ if (addr >=0x100 && addr + size <=0x200 ) {hwaddr ncr_addr = addr -0x100 ;if (size ==1 ) {
@@ -74,6 +69,11 @@ static uint64_t lasi_ncr710_reg_read(void *opaque, hwaddr addr,trace_lasi_ncr710_reg_forward_read (addr, val); }else { +/* +* The rest of the module page reads as 0. HP-UX reads a board strap +* at 0xd85 (bit 0x20: differential bus, 25 MHz clock); 0 is single +* ended, 50 MHz. +*/ val =0 ;trace_lasi_ncr710_reg_read (addr, val, size); }
@@ -90,9 +90,7 @@ static void lasi_ncr710_reg_write(void *opaque, hwaddr addr,/* * 0x00..0x0f is the read only LASI module header (ID/SVERSION/HVERSION); * 0x10..0xff and 0x200..0xfff are unmapped module space. Writes to all -* of them are ignored. The SCSI bus reset is driven through the chip's -* SCNTL1.RST at forwarded offset 0x101 (see ncr53c710.c), not through -* this window. +* of them are ignored. */ if (addr <=0x0f ) {return ;
hw/scsi/ncr53c710.c +80 -226
518 lines not on this page · raw message
hw/scsi/ncr53c710.h +12 -26
@@ -3,12 +3,9 @@* * Copyright (c) 2026 Keith Monahan <[email protected]> * -* Interface to the 53C710 model (ncr53c710.c), a rewrite whose SCRIPTS engine -* is derived from QEMU's LSI53C895A model and adapted to the 53C710 per its -* Data Manual (Jun 1992). The only instantiated device is the LASI wrapper in -* lasi_ncr710.c, which embeds one NCR710State by value and drives it through -* the functions declared here. This file is a function library, not a QOM -* type. +* Interface to the 53C710 model (ncr53c710.c). The only instantiated device is +* the LASI wrapper in lasi_ncr710.c, which embeds one NCR710State by value and +* drives it through the functions declared here. * * SPDX-License-Identifier: GPL-2.0-or-later */
@@ -75,9 +72,8 @@ typedef struct NCR710State {AddressSpace *as;qemu_irq irq;/* -* SCRIPTS yield/resume timer: instruction budget backoff and post load -* restart, mirroring lsi53c895a's scripts_timer. The wrapper creates it -* and points it at ncr710_scripts_timer_callback(). +* SCRIPTS yield/resume timer, mirroring lsi53c895a's scripts_timer. The +* wrapper creates it. */ QEMUTimer *scripts_timer;
@@ -93,30 +89,20 @@ typedef struct NCR710State {int command_complete;bool script_running;/* -* The driver's "start next command" SIGP kick landed while the engine was -* halted at a completion INT (waiting==NOWAIT) instead of parked at Wait -* Reselect, so the normal SIGP wake is skipped. The ISTAT write clears the -* SIGP latch (presenting the kick as "consumed" to the driver's poll) and -* sets this flag instead; the Wait Reselect handler (execute_script case 2) -* consumes it when the engine next parks, selecting the next command. +* A SIGP arrived while the engine was halted instead of parked at Wait +* Reselect; the Wait Reselect handler consumes it when the engine next +* parks. */ bool sigp_pending_resume; -/* -* A cached-backend SCSI continue was deferred to lsi_issue_bh so its -* completion arrives asynchronously, not reentrantly inside the engine. -*/ +/* A SCSI continue was deferred to lsi_issue_bh. */ bool issue_pending;/* -* SCRIPTS interpreter on-stack recursion depth; transient (always 0 -* outside execute_script), so it is not migrated in vmstate. +* SCRIPTS interpreter recursion depth; always 0 outside +* lsi_execute_script, so it is not migrated. */ int reentrancy_level;lsi_request *current; -/* -* Disconnected tagged commands awaiting target-initiated reselection -* (lsi53c895a-style). Untagged 53C700-family transfers never disconnect, -* so for them this stays empty and the engine runs connected as before. -*/ +/* Disconnected tagged commands awaiting reselection. */ QTAILQ_HEAD(, lsi_request) queue;/*
Signature · 1 line
2.54.0
Quoted 6 lines · Helge Deller
From: Helge Deller <[email protected]>
This is the third attempt to replace the existing 53c710 driver by a new driver based on the code of the
lsi53c895a.c. Patch #1 is not meant to be reviewed, as it basically just replaces the existing driver by a new one.
"Please do not review, simply accept".
hw/scsi/ncr53c710.c | 3042 +++++++++++++++++------------------------
Quoted 1 line
Please review.
.
Quoted 2 lines
It would be great if this series can be included for qemu v11.2, as the current driver does not work stable for any guest OS.
11 files changed, 1426 insertions(+), 2215 deletions(-)
IIUC even v11.1 driver "does not work stable for any guest OS", right?
Quoted 9 lines · Philippe Mathieu-Daudé
Quoted 6 lines · Helge Deller
From: Helge Deller <[email protected]>
This is the third attempt to replace the existing 53c710 driver by a new driver based on the code of the
lsi53c895a.c. Patch #1 is not meant to be reviewed, as it basically just replaces the existing driver by a new one."Please do not review, simply accept".
Well, I agree, it sounds quite rude, which was not my intention. I basically wanted to say that it's a hard lift-and-shift patch which makes no real sense to try to review, as it is huge and replaces most of the code.
Quoted 4 lines
hw/scsi/ncr53c710.c | 3042 +++++++++++++++++------------------------Quoted 1 line
Please review.
Quoted 8 lines
.
Quoted 2 lines
It would be great if this series can be included for qemu v11.2, as the current driver does not work stable for any guest OS.
11 files changed, 1426 insertions(+), 2215 deletions(-)IIUC even v11.1 driver "does not work stable for any guest OS", right?
Yes.
Helge
Quoted 24 lines · Helge Deller
Quoted 9 lines · Philippe Mathieu-Daudé
Quoted 6 lines · Helge Deller
From: Helge Deller <[email protected]>
This is the third attempt to replace the existing 53c710 driver by a new driver based on the code of the
lsi53c895a.c. Patch #1 is not meant to be reviewed, as it basically just replaces the existing driver by a new one."Please do not review, simply accept".
Well, I agree, it sounds quite rude, which was not my intention. I basically wanted to say that it's a hard lift-and-shift patch which makes no real sense to try to review, as it is huge and replaces most of the code.
Quoted 9 lines
hw/scsi/ncr53c710.c | 3042 +++++++++++++++++------------------------
Quoted 1 line
Please review.
.
Quoted 2 lines
It would be great if this series can be included for qemu v11.2, as the current driver does not work stable for any guest OS.
Quoted 7 lines
Quoted 3 lines
11 files changed, 1426 insertions(+), 2215 deletions(-)IIUC even v11.1 driver "does not work stable for any guest OS", right?
Yes.
Helge
As I mentioned in some of the earlier reviews, I have a lot of sympathy for the submitter here based upon my experience of doing the large rework of the ESP SCSI driver a while back. In particular when working on QEMU as a hobby, it can take much longer to find the time to complete any changes requested during upstream review.
My take on this is that we want to encourage more people to contribute to QEMU and unless you happen to be an LSI SCSI expert it's almost impossible to review a large rework like this - and this shouldn't be a barrier for contribution. It's clear from Keith and Helge's comments that this series solves real problems that users are currently experiencing with QEMU's HPPA emulation so I think we should aim for a more pragmatic approach:
- Aim for a basic code review based upon our existing coding standards to check that the device implements a reasonable object model
- Ask for proof that testing the supported guest OSs (Linux, HP-UX and NetBSD) doesn't trigger a sanitizer abort when built using '--cc=clang' '--cxx=clang++' '--enable-ubsan' '--enable-asan'
- Mark the device as not being included in the QEMU security boundary
- Update Kconfig so that the NCR710 device is only built when the HPPA target is selected
If these criteria are met, and given it only affects the HPPA target, then is there any reason why this series shouldn't be merged?
ATB,
Mark.
Quoted 44 lines · Mark Cave-Ayland
Quoted 24 lines · Helge Deller
Quoted 9 lines · Philippe Mathieu-Daudé
Quoted 6 lines · Helge Deller
From: Helge Deller <[email protected]>
This is the third attempt to replace the existing 53c710 driver by a new driver based on the code of the
lsi53c895a.c. Patch #1 is not meant to be reviewed, as it basically just replaces the existing driver by a new one."Please do not review, simply accept".
Well, I agree, it sounds quite rude, which was not my intention. I basically wanted to say that it's a hard lift-and-shift patch which makes no real sense to try to review, as it is huge and replaces most of the code.
Quoted 9 lines
hw/scsi/ncr53c710.c | 3042 +++++++++++++++++------------------------
Quoted 1 line
Please review.
.
Quoted 2 lines
It would be great if this series can be included for qemu v11.2, as the current driver does not work stable for any guest OS.
Quoted 7 lines
Quoted 3 lines
11 files changed, 1426 insertions(+), 2215 deletions(-)IIUC even v11.1 driver "does not work stable for any guest OS", right?
Yes.
Helge
As I mentioned in some of the earlier reviews, I have a lot of sympathy for the submitter here based upon my experience of doing the large rework of the ESP SCSI driver a while back. In particular when working on QEMU as a hobby, it can take much longer to find the time to complete any changes requested during upstream review.
My take on this is that we want to encourage more people to contribute to QEMU and unless you happen to be an LSI SCSI expert it's almost impossible to review a large rework like this - and this shouldn't be a barrier for contribution. It's clear from Keith and Helge's comments that this series solves real problems that users are currently experiencing with QEMU's HPPA emulation so I think we should aim for a more pragmatic approach:
- Aim for a basic code review based upon our existing coding standards to check that the device implements a reasonable object model
- Ask for proof that testing the supported guest OSs (Linux, HP-UX and
NetBSD) doesn't trigger a sanitizer abort when built using '--cc=clang' '--cxx=clang++' '--enable-ubsan' '--enable-asan'
Quoted 6 lines
- Mark the device as not being included in the QEMU security boundary
- Update
Kconfigso that the NCR710 device is only built when the HPPA target is selectedIf these criteria are met, and given it only affects the HPPA target, then is there any reason why this series shouldn't be merged?
Sorry if I missed your comment on an earlier series, I was not Cc'ed and try to not read all qemu-devel@ :)
I understand the hobbyist PoV and respect it, but that would settle a precedent which I'd rather discuss with other maintainers or during a community call.
I'll try to split this series using a LLM, since this appears to be an acceptable use.
Quoted 55 lines · Philippe Mathieu-Daudé
Quoted 45 lines · Mark Cave-Ayland
Quoted 25 lines · Helge Deller
Quoted 9 lines · Philippe Mathieu-Daudé
Quoted 6 lines · Helge Deller
From: Helge Deller <[email protected]>
This is the third attempt to replace the existing 53c710 driver by a new driver based on the code of the
lsi53c895a.c. Patch #1 is not meant to be reviewed, as it basically just replaces the existing driver by a new one."Please do not review, simply accept".
Well, I agree, it sounds quite rude, which was not my intention. I basically wanted to say that it's a hard lift-and-shift patch which makes no real sense to try to review, as it is huge and replaces most of the code.
Quoted 10 lines
hw/scsi/ncr53c710.c | 3042 ++++++++++++++++
+------------------------Quoted 1 line
Please review.
.
Quoted 2 lines
It would be great if this series can be included for qemu v11.2, as the current driver does not work stable for any guest OS.
Quoted 7 lines
Quoted 3 lines
11 files changed, 1426 insertions(+), 2215 deletions(-)IIUC even v11.1 driver "does not work stable for any guest OS", right?
Yes.
Helge
As I mentioned in some of the earlier reviews, I have a lot of sympathy for the submitter here based upon my experience of doing the large rework of the ESP SCSI driver a while back. In particular when working on QEMU as a hobby, it can take much longer to find the time to complete any changes requested during upstream review.
My take on this is that we want to encourage more people to contribute to QEMU and unless you happen to be an LSI SCSI expert it's almost impossible to review a large rework like this - and this shouldn't be a barrier for contribution. It's clear from Keith and Helge's comments that this series solves real problems that users are currently experiencing with QEMU's HPPA emulation so I think we should aim for a more pragmatic approach:
- Aim for a basic code review based upon our existing coding standards to check that the device implements a reasonable object model
- Ask for proof that testing the supported guest OSs (Linux, HP-UX and
NetBSD) doesn't trigger a sanitizer abort when built using '-- cc=clang' '--cxx=clang++' '--enable-ubsan' '--enable-asan'Quoted 6 lines
- Mark the device as not being included in the QEMU security boundary
- Update
Kconfigso that the NCR710 device is only built when the HPPA target is selectedIf these criteria are met, and given it only affects the HPPA target, then is there any reason why this series shouldn't be merged?
Sorry if I missed your comment on an earlier series, I was not Cc'ed and try to not read all qemu-devel@ :)
Quoted 6 lines
I understand the hobbyist PoV and respect it, but that would settle a precedent which I'd rather discuss with other maintainers or during a community call.
I'll try to split this series using a LLM, since this appears to be an acceptable use.
Hi Phil,
I think this work is different from the ESP device in that when I did that rework (about 88 patches from memory) there were several guest OSs that I had to test on each commit to ensure the series was bisectible, and even then it wasn't possible to keep all guests OSs working for every commit.
The NCR53C710 is different here in that it only has one user which is the HPPA machine, and the submitter has clearly tested the set of guests they wish to support and has considerably improved on what is already there.
Based upon my previous experience above, no matter how you split the series there will always be at least one guest OS that won't work: by splitting the series it feels like the end result won't necessarily be any better for developer maintainability, and will delay the merge of some much-needed improvements.
ATB,
Mark.
Quoted 64 lines · Mark Cave-Ayland
Quoted 55 lines · Philippe Mathieu-Daudé
Quoted 45 lines · Mark Cave-Ayland
Quoted 25 lines · Helge Deller
Quoted 9 lines · Philippe Mathieu-Daudé
Quoted 6 lines · Helge Deller
From: Helge Deller <[email protected]>
This is the third attempt to replace the existing 53c710 driver by a new driver based on the code of the
lsi53c895a.c. Patch #1 is not meant to be reviewed, as it basically just replaces the existing driver by a new one."Please do not review, simply accept".
Well, I agree, it sounds quite rude, which was not my intention. I basically wanted to say that it's a hard lift-and-shift patch which makes no real sense to try to review, as it is huge and replaces most of the code.
Quoted 10 lines
hw/scsi/ncr53c710.c | 3042 ++++++++++++++++
+------------------------Quoted 1 line
Please review.
.
Quoted 2 lines
It would be great if this series can be included for qemu v11.2, as the current driver does not work stable for any guest OS.
Quoted 7 lines
Quoted 3 lines
11 files changed, 1426 insertions(+), 2215 deletions(-)IIUC even v11.1 driver "does not work stable for any guest OS", right?
Yes.
Helge
As I mentioned in some of the earlier reviews, I have a lot of sympathy for the submitter here based upon my experience of doing the large rework of the ESP SCSI driver a while back. In particular when working on QEMU as a hobby, it can take much longer to find the time to complete any changes requested during upstream review.
My take on this is that we want to encourage more people to contribute to QEMU and unless you happen to be an LSI SCSI expert it's almost impossible to review a large rework like this - and this shouldn't be a barrier for contribution. It's clear from Keith and Helge's comments that this series solves real problems that users are currently experiencing with QEMU's HPPA emulation so I think we should aim for a more pragmatic approach:
- Aim for a basic code review based upon our existing coding standards to check that the device implements a reasonable object model
- Ask for proof that testing the supported guest OSs (Linux, HP-UX
and NetBSD) doesn't trigger a sanitizer abort when built using '-- cc=clang' '--cxx=clang++' '--enable-ubsan' '--enable-asan'Quoted 6 lines
- Mark the device as not being included in the QEMU security boundary
- Update
Kconfigso that the NCR710 device is only built when the HPPA target is selectedIf these criteria are met, and given it only affects the HPPA target, then is there any reason why this series shouldn't be merged?
Sorry if I missed your comment on an earlier series, I was not Cc'ed and try to not read all qemu-devel@ :)
Quoted 6 lines
I understand the hobbyist PoV and respect it, but that would settle a precedent which I'd rather discuss with other maintainers or during a community call.
I'll try to split this series using a LLM, since this appears to be an acceptable use.
Quoted 7 lines
Hi Phil,
I think this work is different from the ESP device in that when I did that rework (about 88 patches from memory) there were several guest OSs that I had to test on each commit to ensure the series was bisectible, and even then it wasn't possible to keep all guests OSs working for every commit.
The NCR53C710 is different here in that it only has one user which is the HPPA machine, and the submitter has clearly tested the set of guests they wish to support and has considerably improved on what is already there.
Based upon my previous experience above, no matter how you split the series there will always be at least one guest OS that won't work: by splitting the series it feels like the end result won't necessarily be any better for developer maintainability, and will delay the merge of some much-needed improvements.
It was quick enough, already posted, no clue what it is worth:
https://lore.kernel.org/qemu-devel/[email protected]/
Quoted 9 lines · Helge Deller
From: Helge Deller <[email protected]>
This is the third attempt to replace the existing 53c710 driver by a new driver based on the code of the
lsi53c895a.c. Patch #1 is not meant to be reviewed, as it basically just replaces the existing driver by a new one.
But patch #2 implements the proposed changes to use a common header for both drivers, as suggested by BALATON Zoltan.
Quoted 7 lines
Note that the ncr53c710 driver is currently only used by the HPPA 715 machine, and this patch should not have any effect on any other platform or machine. On the 715, this driver has been sucessfully tested with Linux, HP-UX and NetBSD.
Please review.
It would be great if this series can be included for qemu v11.2, as the current driver does not work stable for any guest OS.
The freeze is strictly for bug fixes but replacing a whole device model with a new one is hard to justify as just a bug fix. I had the same before that something I wanted to include was ready too late and I had to wait until the next release to upstream it. It may be frustrating but please accept that this has likely missed the release so you now have more time to clean this up. I've never seen execptions made during hard freeze but I'm not the maintainer of this area so I'm not the one deciding just telling that in my previous experience this happened to me too a few times. If you don't want to wait until the next release maybe this could be submitted early in the next cycle with backporting to stable as a fix then could be available in 11.2.1. This series as it is is not the best way to do this and I think your intent was maybe to have one patch at the beginning that could be included without the rest but if that won't happen anyway you could redo it the right way that was suggested and merge it in next devel cycle.
Regards,
BALATON Zoltan
Quoted 24 lines
Keith Monahan (6):
hw/scsi/ncr53c710: rewrite the 53C710 SCRIPTS engine hw/scsi: share NCR/LSI definitions inlsi_scsi.hhw/scsi/lasi_ncr710: map the full LASI SCSI module page hw/scsi/ncr53c710: move to COMMAND on CLEAR ACK after MESSAGE REJECT hw/scsi/scsi-disk: addquirk_mode_page_no_flexible_disk, use it on the
715
hw/scsi/ncr53c710: Comment cleanup, reduce verbosity, repetitionMAINTAINERS | 1 + hw/hppa/machine.c | 10 + hw/scsi/lasi_ncr710.c | 129 +- hw/scsi/lasi_ncr710.h | 28 +- hw/scsi/lsi53c895a.c | 79 +- hw/scsi/lsi_scsi.h | 98 ++ hw/scsi/ncr53c710.c | 2957 +++++++++++++++------------------------- hw/scsi/ncr53c710.h | 282 ++-- hw/scsi/scsi-disk.c | 13 + hw/scsi/trace-events | 43 +- include/hw/scsi/scsi.h | 1 + 11 files changed, 1426 insertions(+), 2215 deletions(-)create mode 100644
hw/scsi/lsi_scsi.h