]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
bhyve: Drop volatile qualifiers from xhci hw struct fields
authorMark Johnston <markj@FreeBSD.org>
Fri, 11 Nov 2022 15:01:52 +0000 (10:01 -0500)
committerMark Johnston <markj@FreeBSD.org>
Fri, 11 Nov 2022 15:01:52 +0000 (10:01 -0500)
commit691e23e6c5d9f46828cafbce156909d14bce635c
tree88773d4550865d90cd9742af6b8cc0678258f129
parent0ced97acb05197cb2ef30932786eab0512f77e07
bhyve: Drop volatile qualifiers from xhci hw struct fields

This fixes a warning raised by the removal of the volatile qualifier
from &trb->qwTrb0 in the following snippet:

xfer_block = usb_data_xfer_append(xfer,
     (void *)(trbflags & XHCI_TRB_3_IDT_BIT ?
 &trb->qwTrb0 : XHCI_GADDR(sc, trb->qwTrb0)),
     trb->dwTrb2 & 0x1FFFF, (void *)addr, ccs);

The use of volatile appears to be inherited from the kernel driver's
definitions of the same structures.  It makes some sense, since USB TRBs
and related structures live in guest memory, but bhyve device models
generally don't volatile-qualify accesses to guest memory and I can't
see how they are required for correctness here.  Moreover, XHCI_GADDR
does not return volatile pointers so we're already being inconsistent.
Just drop the qualifiers to address the warning.

MFC after: 2 weeks
Reviewed by: corvink, jhb
Differential Revision: https://reviews.freebsd.org/D37290
usr.sbin/bhyve/pci_xhci.h