hppa lasi bugfixes pull request

Please pull a bunch of fixes which repair issues introduced due to the previous
 patch series which added LASI SCSI and LASI network card support as  well as
 the new 715 machines.
 This includes fixes for reported coverty issues, and repairs the B160L machine
 emulation.
 
 Thanks!
 Helge
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQS86RI+GtKfB8BJu973ErUQojoPXwUCaREQRQAKCRD3ErUQojoP
 Xy+DAQDJk9BbaZA4DOIMptbGewQMJLRYESa6XClF3s0IdbORQQD8DB49ipDtQkBz
 50VfT6IusGBBKMaLr/9XgKqrk2bBqgc=
 =mgEV
 -----END PGP SIGNATURE-----

Merge tag 'lasi-fixes-pull-request' of https://github.com/hdeller/qemu-hppa into staging

hppa lasi bugfixes pull request

Please pull a bunch of fixes which repair issues introduced due to the previous
patch series which added LASI SCSI and LASI network card support as  well as
the new 715 machines.
This includes fixes for reported coverty issues, and repairs the B160L machine
emulation.

Thanks!
Helge

# -----BEGIN PGP SIGNATURE-----
#
# iHUEABYKAB0WIQS86RI+GtKfB8BJu973ErUQojoPXwUCaREQRQAKCRD3ErUQojoP
# Xy+DAQDJk9BbaZA4DOIMptbGewQMJLRYESa6XClF3s0IdbORQQD8DB49ipDtQkBz
# 50VfT6IusGBBKMaLr/9XgKqrk2bBqgc=
# =mgEV
# -----END PGP SIGNATURE-----
# gpg: Signature made Sun 09 Nov 2025 11:05:57 PM CET
# gpg:                using EDDSA key BCE9123E1AD29F07C049BBDEF712B510A23A0F5F
# gpg: Good signature from "Helge Deller <deller@gmx.de>" [unknown]
# gpg:                 aka "Helge Deller <deller@kernel.org>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 4544 8228 2CD9 10DB EF3D  25F8 3E5F 3D04 A7A2 4603
#      Subkey fingerprint: BCE9 123E 1AD2 9F07 C049  BBDE F712 B510 A23A 0F5F

* tag 'lasi-fixes-pull-request' of https://github.com/hdeller/qemu-hppa:
  target/hppa: Update SeaBIOS-hppa to version 20
  ncr710: Use address space of device instead of global address space
  ncr710: Add missing vmstate entries
  i82596: Adding proper break-statement functionality in RX functions
  i82596: Remove crc_valid variable
  ncr710: Drop leftover debug code
  ncr710: Fix potential null pointer dereference

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2025-11-10 12:11:56 +01:00
commit 49877625c9
8 changed files with 16 additions and 22 deletions

View file

@ -992,7 +992,6 @@ static ssize_t i82596_receive_packet(I82596State *s, const uint8_t *buf,
size_t payload_size = 0;
size_t bytes_copied = 0;
const uint8_t *packet_data = buf;
bool crc_valid = true;
bool out_of_resources = false;
size_t crc_size = i82596_get_crc_size(s);
@ -1093,6 +1092,7 @@ static ssize_t i82596_receive_packet(I82596State *s, const uint8_t *buf,
rx_status |= RFD_STATUS_TRUNC | RFD_STATUS_NOBUFS;
i82596_record_error(s, RFD_STATUS_NOBUFS, false);
packet_completed = true;
break;
} else {
hwaddr remaining_rbd = I596_NULL;
size_t rbd_bytes = i82596_rx_copy_to_rbds(
@ -1119,17 +1119,18 @@ static ssize_t i82596_receive_packet(I82596State *s, const uint8_t *buf,
i82596_record_error(s, RFD_STATUS_NOBUFS, false);
rx_status |= RFD_STATUS_TRUNC | RFD_STATUS_NOBUFS;
packet_completed = true;
break;
}
if (bytes_copied < payload_size) {
trace_i82596_rx_incomplete(bytes_copied, payload_size);
rx_status |= RFD_STATUS_TRUNC;
packet_completed = true;
break;
}
}
}
}
break;
} while (bytes_copied < payload_size);
@ -1155,16 +1156,11 @@ rx_complete:
}
}
if (packet_completed && crc_valid) {
if (packet_completed) {
rx_status |= STAT_C | STAT_OK;
if (is_broadcast) {
rx_status |= 0x0001;
}
} else if (packet_completed) {
rx_status |= STAT_C;
if (!crc_valid) {
rx_status |= RX_CRC_ERRORS;
}
} else {
rx_status |= STAT_B;
}
@ -1187,7 +1183,7 @@ rx_complete:
return size;
}
if (packet_completed && crc_valid && s->rx_status == RX_READY) {
if (packet_completed && s->rx_status == RX_READY) {
uint32_t next_rfd_addr = i82596_translate_address(s, rfd.link, false);
if (next_rfd_addr != 0 && next_rfd_addr != I596_NULL) {
set_uint32(s->scb + 8, next_rfd_addr);

View file

@ -160,6 +160,10 @@ static const VMStateDescription vmstate_lasi_ncr710 = {
.version_id = 1,
.minimum_version_id = 1,
.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()
}
};

View file

@ -46,7 +46,6 @@ typedef struct LasiNCR710State {
uint32_t hw_type; /* Hardware type (HPHW_*) */
uint32_t sversion; /* Software version */
uint32_t hversion; /* Hardware version */
SCSIBus bus;
NCR710State ncr710;
} LasiNCR710State;

View file

@ -550,7 +550,7 @@ static inline uint8_t ncr710_scsi_fifo_dequeue(NCR710_SCSI_FIFO *fifo,
static inline uint32_t ncr710_read_dword(NCR710State *s, uint32_t addr)
{
uint32_t buf;
address_space_read(&address_space_memory, addr, MEMTXATTRS_UNSPECIFIED,
address_space_read(s->as, addr, MEMTXATTRS_UNSPECIFIED,
(uint8_t *)&buf, 4);
/*
* The NCR710 datasheet saying "operates internally in LE mode"
@ -565,7 +565,7 @@ static inline uint32_t ncr710_read_dword(NCR710State *s, uint32_t addr)
static inline void ncr710_dma_read(NCR710State *s, uint32_t addr,
void *buf, uint32_t len)
{
address_space_read(&address_space_memory, addr, MEMTXATTRS_UNSPECIFIED,
address_space_read(s->as, addr, MEMTXATTRS_UNSPECIFIED,
buf, len);
NCR710_DPRINTF("Read %d bytes from %08x: ", len, addr);
for (int i = 0; i < len && i < 16; i++) {
@ -577,7 +577,7 @@ static inline void ncr710_dma_read(NCR710State *s, uint32_t addr,
static inline void ncr710_dma_write(NCR710State *s, uint32_t addr,
const void *buf, uint32_t len)
{
address_space_write(&address_space_memory, addr, MEMTXATTRS_UNSPECIFIED,
address_space_write(s->as, addr, MEMTXATTRS_UNSPECIFIED,
buf, len);
NCR710_DPRINTF("Wrote %d bytes to %08x\n", len, addr);
}
@ -832,12 +832,11 @@ void ncr710_transfer_data(SCSIRequest *req, uint32_t len)
}
/* Host adapter (re)connected */
s->current->dma_len = len;
s->command_complete = NCR710_CMD_DATA_READY;
if (!s->current) {
return;
}
s->current->dma_len = len;
if (s->waiting) {
s->scntl1 |= NCR710_SCNTL1_CON;
@ -1362,11 +1361,6 @@ again:
case PHASE_DI:
s->waiting = NCR710_WAIT_DMA;
ncr710_do_dma(s, 0);
if (s->waiting != NCR710_WAIT_NONE) {
/* Async - stop and wait */
break;
}
/* Sync - continue execution */
break;
case PHASE_CO:
ncr710_do_command(s);
@ -2256,7 +2250,7 @@ static const VMStateDescription vmstate_ncr710_scsi_fifo = {
}
};
static const VMStateDescription vmstate_ncr710 = {
const VMStateDescription vmstate_ncr710 = {
.name = "ncr710",
.version_id = 1,
.minimum_version_id = 1,

View file

@ -242,5 +242,6 @@ void ncr710_transfer_data(SCSIRequest *req, uint32_t len);
void ncr710_execute_script(NCR710State *s);
void ncr710_set_phase(NCR710State *s, int phase);
void ncr710_reselection_retry_callback(void *opaque);
extern const VMStateDescription vmstate_ncr710;
#endif /* HW_NCR53C710_H */

Binary file not shown.

Binary file not shown.

@ -1 +1 @@
Subproject commit d0d359929a009549f7cecac9d2a29c8bdbc07a98
Subproject commit a04b6f35c0b7437ce968f64106ee6ff5aadee419