History log of /freebsd-11.0-release/usr.sbin/bhyve/pci_ahci.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 303975 11-Aug-2016 gjb

Copy stable/11@r303970 to releng/11.0 as part of the 11.0-RELEASE
cycle.

Prune svn:mergeinfo from the new branch, and rename it to RC1.

Update __FreeBSD_version.

Use the quarterly branch for the default FreeBSD.conf pkg(8) repo and
the dvd1.iso packages population.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 303138 21-Jul-2016 mav

MFC r302957: Fix NCQ TRIM emulation.

When this code was written, there was no guests using it to test.

Approved by: re (kib)


# 302408 08-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 302363 06-Jul-2016 ngie

Fix gcc warnings

Put cfl/prdt under AHCI_DEBUG #defines as they are only used in
those cases.

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division


# 298454 22-Apr-2016 araujo

Use MIN()/MAX() macros from sys/param.h.

Reviewed by: grehan
Differential Revision: https://reviews.freebsd.org/D6054


# 297589 05-Apr-2016 pfg

bhyve: Remove unneeded variable ncq.

ncq was not being inititialized properly but it was not actually
necessary either, so make the code smaller by removing it.

CID: 1248842
Reviewed by: grehan


# 294774 26-Jan-2016 araujo

Cleanup unused-but-set-variable spotted by gcc-4.9.

Reviewed by: neel
Approved by: rodrigc (mentor)
Differential Revision: https://reviews.freebsd.org/D5042


# 288826 05-Oct-2015 grehan

Clean up some harmless unimplemented-command warning messages.

- Don't advertize trusted-computing capability in the Identify page.
This prevents Windows from issuing a TRUSTED_RECEIVE_DMA command.
- Windows will send down SMART and SECURITY_FREEZE_LOCK
even though smart and security capabilities were not advertized.
Send back a silent abort.

Reviewed by: mav


# 286838 17-Aug-2015 grehan

Add simple (no-op) emulations for the CHECK_POWER_MODE,
READ_VERIFY and READ_VERIFY_EXT commands.

Reviewed by: mav


# 282595 07-May-2015 neel

Allow byte reads of AHCI registers.

This is needed to support Windows guests that use byte reads to access certain
AHCI registers (e.g. PxTFD.Status and PxTFD.Error).

Reviewed by: grehan, mav
Reported by: Leon Dang (ldang@nahannisys.com)
Differential Revision: https://reviews.freebsd.org/D2469
MFC after: 2 weeks


# 282524 06-May-2015 mav

Reimplement queue freeze on error, added in r282429:

It is not required to use CLO to recover from task file error, it should
be enough to do only stop/start, that does not clear the PxTFD.STS.ERR.

MFC after: 13 days


# 282429 04-May-2015 mav

Implement in-order execution of non-NCQ commands.

Using status updates in r282364, block queue on BSY, DRQ or ERR bits set.
This can be a performance penalization for non-NCQ commands, but it is
required for proper error recovery and standard compliance.

MFC after: 2 weeks


# 282364 03-May-2015 mav

Implement basic PxTFD.STS.BSY reporting.

MFC after: 2 weeks


# 282345 02-May-2015 mav

Initialize PxCMD on reset and make its read-only bits such.

MFC after: 2 weeks


# 282344 02-May-2015 mav

Handle ATA_SEND_FPDMA_QUEUED as NCQ in ahci_port_stop().

MFC after: 1 week


# 281782 20-Apr-2015 mav

Don't set bits that should be zero for SATA devices.

Old value made Linux think that it is PATA device with SATA bridge.

MFC after: 2 weeks


# 281700 18-Apr-2015 mav

Workaround bhyve virtual disks operation on top of GEOM providers.

GEOM does not support scatter/gather lists in its I/Os. Such requests
are cut in pieces by physio(), that may be problematic, if those pieces
are not multiple of provider's sector size. If such case is detected,
move the data through temporary sequential buffer.

MFC after: 2 weeks


# 281666 17-Apr-2015 mav

Make virtual AHCI more careful with I/O lengths.

MFC after: 2 weeks


# 280293 20-Mar-2015 mav

Add missing variable initialization.

Reported by: Coverity
CID: 1288938
MFC after: 3 days


# 280040 15-Mar-2015 mav

Give AHCI disk serial based on backing file path same as for virtio block.

It is still not good that they may intersect on different hosts, but that
is better then intersecting on the same host.

MFC after: 2 weeks


# 280017 15-Mar-2015 mav

Block delete capability for read-only devices.

Submitted by: neel
MFC after: 2 weeks


# 279987 14-Mar-2015 mav

Add checksums to identify data and NCQ command error log.

MFC after: 2 weeks


# 279979 14-Mar-2015 mav

Slightly polish virtual AHCI CD reporting.

MFC after: 2 weeks


# 279977 14-Mar-2015 mav

Fix NOP and IDLE commands for virtual AHCI disks.

MFC after: 2 weeks


# 279976 14-Mar-2015 mav

Add support for NCQ variant of DSM TRIM for virtual AHCI disks.

The code is not really tested yet due to lack of initiator support.

Requested by: imp
MFC after: 2 weeks


# 279975 14-Mar-2015 mav

Improve NCQ errors reporting for virtual AHCI disks.

While this implementation is still not perfect, previous was just broken.

MFC after: 2 weeks


# 279968 13-Mar-2015 mav

Remove incorrect SERR register setting.

At this point we have nothing to report through that register.

MFC after: 2 weeks


# 279967 13-Mar-2015 mav

Change prdbc value reporting.

MFC after: 2 weeks


# 279965 13-Mar-2015 mav

Polish AHCI disk identify data and fix speed negotiation.

MFC after: 2 weeks


# 279960 13-Mar-2015 mav

Add support for PIO variants of READ/WRITE commands for AHCI disks.

AHCI API hides all PIO specifics, so this functionality is almost free.

MFC after: 2 weeks


# 279959 13-Mar-2015 mav

Use ahci_write_fis_d2h() for commands completion.

MFC after: 2 weeks


# 279957 13-Mar-2015 mav

Add DSM TRIM command support for virtual AHCI disks.

It works only for virtual disks backed by ZVOLs and raw devices supporting
BIO_DELETE. Virtual disks backed by files won't report this capability.

MFC after: 2 weeks
Relnotes: yes


# 279654 05-Mar-2015 mav

Report logical/physical sector sizes for virtual SATA disk.

MFC after: 2 weeks


# 279220 23-Feb-2015 grehan

Don't close a block context if it couldn't be opened,
for example if the backing file doesn't exist,
avoiding a null deref.

Reviewed by: neel
MFC after: 1 week.


# 274045 03-Nov-2014 tychon

If the start bit, PxCMD.ST, is cleared and nothing is in-flight then
PxCI, PxSACT, PxCMD.CCS and PxCMD.CR should be 0.

Reviewed by: grehan


# 273212 17-Oct-2014 tychon

Support stopping and restarting the AHCI command list via toggling
PxCMD.ST from '1' to '0' and back. This allows the driver a chance to
recover if for instance a timeout occurred due to activity on the
host.

Reviewed by: grehan


# 269317 30-Jul-2014 tychon

Commands which encounter a fatal error shouldn't be marked as completed.
Furthermore, provide an indication of the current command so it can be
determined which one actually failed.

Reviewed by: grehan


# 268639 15-Jul-2014 grehan

Use the blockif CHS routine to create fake CHS values,
and then populate them in the identity page.

This fixes a divide-by-zero error at probe time with NetBSD.

MFC after: 1 week.


# 265058 28-Apr-2014 grehan

Implement legacy interrupts for the AHCI device emulation
according to the method outlined in the AHCI spec.

Tested with FreeBSD 9/10/11 with MSI disabled,
and also NetBSD/amd64 (lightly).

Reviewed by: neel, tychon
MFC after: 3 weeks


# 264770 22-Apr-2014 delphij

Use calloc() in favor of malloc + memset.

Reviewed by: neel


# 264302 09-Apr-2014 tychon

Constrain the amount of data returned to what is actually available
not the size of the buffer.

Approved by: grehan (co-mentor)


# 263322 18-Mar-2014 tychon

Don't reissue in-flight commands.

Approved by: neel (co-mentor)


# 263238 16-Mar-2014 tychon

Though there currently isn't a way to insert new media into an ATAPI
drive, at least pretend to support Asynchronous Notification (AN) to
avoid a guest needlessly polling for it.

Approved by: grehan (co-mentor)


# 261785 12-Feb-2014 tychon

Provide an indication a "PIO Setup Device to Host FIS" occurred while executing
the IDENTIFY DEVICE and IDENTIFY PACKET DEVICE commands.

Also, provide an indication a "D2H Register FIS" occurred during a SET FEATURES
command.

Approved by: grehan (co-mentor)


# 261000 22-Jan-2014 tychon

Fix issue with stale fields from a recycled request pulled off the freelist.

Approved by: grehan (co-mentor)


# 258614 26-Nov-2013 grehan

The Data Byte Count (DBC) field of a Physical Region Descriptor
Table is 22 bits, with the bit 31 being the interrupt-on-completion
bit.

OpenBSD and UEFI set this bit, resulting in large block i/o lengths
being sent to bhyve and coredumping the process. Fix by masking off
the relevant 22 bits when using the DBC field as a length.

Reviewed by: Zhixiang Yu
Discussed with: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)
MFC after: 10.0


# 257729 06-Nov-2013 grehan

Add the VM name to the process name with setproctitle().
Remove the VM name from some of the thread-naming calls
since it is now in the proc title.
Slightly modify the thread-naming for the net and block
threads.

This improves readability when using top/ps with the -a
and -H options on a system with a large number of bhyve VMs.

Requested by: Michael Dexter
Reviewed by: neel
MFC after: 4 weeks


# 256926 22-Oct-2013 grehan

Fix AHCI ATAPI emulation when backed with /dev/cd0

- remove assumption that the backing file/device had
512-byte sectors
- fix incorrect iovec size variable that would result
in a buffer overrun when an o/s issued an i/o request
with more s/g elements than the blockif api

Reviewed by: Zhixiang Yu (zxyu.core@gmail.com)
MFC after: 3 days


# 256709 17-Oct-2013 grehan

Eliminate unconditional debug printfs.

Linux writes to these nominally read-only registers,
so avoid having bhyve write warning messages to stdout
when the reg writes can be safely ignored. Change the
WPRINTF to DPRINTF which is conditional.

Reviewed by: mav
Discussed with: mav, Zhixiang Yu
MFC after: 3 days


# 256164 08-Oct-2013 dim

In usr.sbin/bhyve/pci_ahci.c, fix several gcc warnings of the form
"assignment makes pointer from integer without a cast", by changing the
cmd_lst and rbis members of struct ahci_port from integers to pointers.

Also surround a pow-of-2 test expression with parentheses to clarify it,
and avoid another gcc warning.

Approved by: re (glebius)
Reviewed by: grehan, mav


# 256056 04-Oct-2013 grehan

Import Zhixiang Yu's GSoC'13 AHCI emulation:
https://wiki.freebsd.org/SummerOfCode2013/bhyveAHCI

This provides ICH8 SATA disk and ATAPI ports, selectable
via the bhyve slot command-line parameter:

SATA
-s <slot>,ahci-hd,<image-file>

ATAPI
-s <slot>,ahci-cd,<image-file>

Slight modifications by: grehan@
Approved by: re@ (blanket)
Obtained from: FreeBSD GSoC'13