Skip to content

Megasas HBA emulation

Hannes Reinecke kvm qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest5 patches 10 repliesIn review
  2. v53 patches 14 repliesSuperseded
  3. v43 patches 11 repliesSuperseded

Changes in v6 from the cover letter

- scsi-disk: Fixup debugging statement
A debugging statement wasn't converted. Do so now.
- scsi-disk: Mask out serial number EVPD
The 'serial' parameter to scsi-disk is optional. So if it's not set we should mask it out in the list of supported EVPD pages and not return '0' here.
- megasas: Use tracing infrastructure instead of DPRINTF
- megasas: Use new PCI infrastructure
- megasas: Check for iovec mapping failure cpu_map_physical_memory() might fail, so we need to check for it when mapping iovecs.
- megasas: Trace scsi buffer overflow
The transfer length as specified in the SCSI command might disagree with the length of the iovec. We should be tracing these issues.
- megasas: Reset frames after init firmware
When receiving an INIT FIRMWARE command we need reset all frames, otherwise some frames might point to invalid memory.

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5iov: Update parameter usage in iov_(to|from)_buf()hw/virtio-net.c hw/virtio-serial-bus.c iov.c +1 more+34 -290 replies
2/5scsi: Add 'hba_private' to SCSIRequesthw/esp.c hw/lsi53c895a.c hw/scsi-bus.c +5 more+37 -530 replies
3/5scsi-disk: Fixup debugging statementhw/scsi-disk.c+1 -11 reply
4/5scsi-disk: Mask out serial number EVPDhw/scsi-disk.c+12 -31 reply
5/5megasas: LSI Megaraid SAS emulationMakefile.objs default-configs/pci.mak hw/megasas.c +3 more+3222 -17 replies

Reviews trailers per patch

4 of 5 patches have a Reviewed-by or Acked-by.

PatchAlexander GrafPaolo Bonzini
1/5A-b
2/5A-b
3/5A-b
4/5A-b
5/5T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH 0/5][v6] Megasas HBA emulation

Hi all,

as Alex Graf reminded me the driver needed some more bugfixing to be done. I've found some issues and also moved the megasas emulation over to the new trace infrastructure. Driver works for me now and a full installation of openSUSE-12.1 works perfectly.
I've also included the fixes suggested by Stefan Hajnoczi. And during debugging I've found two minor issues in scsi_disk.c

Changes since v5:
- scsi-disk: Fixup debugging statement
A debugging statement wasn't converted. Do so now.
- scsi-disk: Mask out serial number EVPD
The 'serial' parameter to scsi-disk is optional. So if it's not set we should mask it out in the list of supported EVPD pages and not return '0' here.
- megasas: Use tracing infrastructure instead of DPRINTF
- megasas: Use new PCI infrastructure
- megasas: Check for iovec mapping failure cpu_map_physical_memory() might fail, so we need to check for it when mapping iovecs.
- megasas: Trace scsi buffer overflow
The transfer length as specified in the SCSI command might disagree with the length of the iovec. We should be tracing these issues.
- megasas: Reset frames after init firmware
When receiving an INIT FIRMWARE command we need reset all frames, otherwise some frames might point to invalid memory.

Chances since v4:
- iov: Update parameter usage in iov_(to|from)_buf() Updated description for the first patch and clarified the usage Renamed arguments for io_XXX for clarification
- scsi: Add 'hba_private' to SCSIRequest
Kept 'tag' for tracing and just add 'hba_private' as an additional field as per request from Paolo
- megasas: checkpatch.pl fixes and update to work with the changed interface in scsi_req_new(). Also included the suggested fixes from Alex.

Hannes Reinecke (5):
iov: Update parameter usage in iov_(to|from)_buf()
scsi: Add 'hba_private' to SCSIRequest
scsi-disk: Fixup debugging statement
scsi-disk: Mask out serial number EVPD
megasas: LSI Megaraid SAS emulation

 Makefile.objs           |    1 +
 default-configs/pci.mak |    1 +
 hw/esp.c                |    2 +-
 hw/lsi53c895a.c         |   22 +-
 hw/megasas.c            | 1950 +++++++++++++++++++++++++++++++++++++++++++++++
 hw/mfi.h                | 1197 +++++++++++++++++++++++++++++
 hw/pci_ids.h            |    3 +-
 hw/scsi-bus.c           |    9 +-
 hw/scsi-disk.c          |   21 +-
 hw/scsi-generic.c       |    5 +-
 hw/scsi.h               |   10 +-
 hw/spapr_vscsi.c        |   29 +-
 hw/usb-msd.c            |    9 +-
 hw/virtio-net.c         |    2 +-
 hw/virtio-serial-bus.c  |    2 +-
 iov.c                   |   49 +-
 iov.h                   |   10 +-
 trace-events            |   71 ++
 18 files changed, 3306 insertions(+), 87 deletions(-)
 create mode 100644 hw/megasas.c
 create mode 100644 hw/mfi.h
Signature · 1 line
1.7.3.4