VirtualBox

Changeset 84826 in vbox for trunk/include


Ignore:
Timestamp:
Jun 15, 2020 8:20:40 AM (5 years ago)
Author:
vboxsync
Message:

AMD IOMMU: bugref:9654 PDM interface changes for supplying bus:device:function for devices' initiating PCI interrupts and MSIs.

Location:
trunk/include/VBox
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/msi.h

    r84677 r84826  
    145145 * fields but specifies reserved bits.
    146146 */
    147 typedef union
     147typedef union MSIADDR
    148148{
    149149    struct
     
    177177
    178178/**
    179  * MSI Data Register (PCI + MMIO).
     179 * MSI Data Register.
    180180 * In accordance to the Intel spec.
    181181 * See Intel spec. 10.11.2 "Message Data Register Format".
     
    184184 * fields but specifies reserved bits.
    185185 */
    186 typedef union
     186typedef union MSIDATA
    187187{
    188188    struct
     
    210210 * MSI Message (Address and Data Register Pair).
    211211 */
    212 typedef struct
     212typedef struct MSIMSG
    213213{
    214214    /** The MSI Address Register. */
     
    217217    MSIDATA     Data;
    218218} MSIMSG;
    219 /** Pointer to an MSI message struct. */
    220 typedef MSIMSG *PMSIMSG;
    221 /** Pointer to a const MSI message struct. */
    222 typedef MSIMSG const *PCMSIMSG;
    223219
    224220#endif /* !VBOX_INCLUDED_msi_h */
  • trunk/include/VBox/pci.h

    r84799 r84826  
    469469/** Make a device+function number.   */
    470470#define VBOX_PCI_DEVFN_MAKE(a_uPciDevNo, a_uPciFunNo) (((a_uPciDevNo) << VBOX_PCI_DEVFN_DEV_SHIFT) | (a_uPciFunNo))
    471 /** Make a bus+device+function number. */
    472 #define VBOX_PCI_BUSDEVFN_MAKE(a_uPciBusNo, a_uPciDevFunNo) (((a_uPciBusNo) << VBOX_PCI_BUS_SHIFT) | (a_uPciDevFunNo))
     471
     472/** Checks whether the PCIBDF is valid. */
     473#define PCIBDF_IS_VALID(a_uBusDevFn)    (!((a_uBusDevFn) & PCI_BDF_F_INVALID))
     474/** Make a PCIBDF given the bus and device:function. */
     475#define PCIBDF_MAKE(a_uBus, a_uDevFn)   (((a_uBus) << VBOX_PCI_BUS_SHIFT) | (a_uDevFn))
    473476
    474477
  • trunk/include/VBox/types.h

    r84458 r84826  
    12011201
    12021202
     1203/**
     1204 * A PCI bus:device:function (BDF) identifier.
     1205 *
     1206 * All 16 bits of a BDF are valid according to the PCI spec. We need one extra bit
     1207 * to determine whether the BDF is valid in interfaces where the BDF may be
     1208 * optional.
     1209 */
     1210typedef uint32_t PCIBDF;
     1211/** PCIBDF flag: Invalid. */
     1212#define PCI_BDF_F_INVALID           RT_BIT(31)
     1213/** Nil PCIBDF value. */
     1214#define NIL_PCIBDF                  PCI_BDF_F_INVALID
     1215
     1216/** Pointer to an MSI message struct. */
     1217typedef struct MSIMSG *PMSIMSG;
     1218/** Pointer to a const MSI message struct. */
     1219typedef const struct MSIMSG *PCMSIMSG;
     1220
     1221
    12031222/** @} */
    12041223
  • trunk/include/VBox/vmm/pdmapi.h

    r84459 r84826  
    5353VMM_INT_DECL(bool)      PDMHasIoApic(PVM pVM);
    5454VMM_INT_DECL(bool)      PDMHasApic(PVM pVM);
    55 VMM_INT_DECL(int)       PDMIoApicSetIrq(PVM pVM, uint8_t u8Irq, uint8_t u8Level, uint32_t uTagSrc);
     55VMM_INT_DECL(int)       PDMIoApicSetIrq(PVM pVM, PCIBDF uBusDevFn, uint8_t u8Irq, uint8_t u8Level, uint32_t uTagSrc);
    5656VMM_INT_DECL(VBOXSTRICTRC) PDMIoApicBroadcastEoi(PVM pVM, uint8_t uVector);
    57 VMM_INT_DECL(int)       PDMIoApicSendMsi(PVM pVM, RTGCPHYS GCAddr, uint32_t uValue, uint32_t uTagSrc);
     57VMM_INT_DECL(int)       PDMIoApicSendMsi(PVM pVM, PCIBDF uBusDevFn, PCMSIMSG pMsi, uint32_t uTagSrc);
    5858VMM_INT_DECL(int)       PDMVmmDevHeapR3ToGCPhys(PVM pVM, RTR3PTR pv, RTGCPHYS *pGCPhys);
    5959VMM_INT_DECL(bool)      PDMVmmDevHeapIsEnabled(PVM pVM);
  • trunk/include/VBox/vmm/pdmdev.h

    r84714 r84826  
    10341034     *
    10351035     * @param   pDevIns         PCI device instance.
     1036     * @param   uBusDevFn       The bus:device:function of the device initiating the
     1037     *                          IRQ. Pass NIL_PCIBDF when it's not a PCI device or
     1038     *                          interrupt.
    10361039     * @param   iIrq            IRQ number to set.
    10371040     * @param   iLevel          IRQ level. See the PDM_IRQ_LEVEL_* \#defines.
     
    10391042     * @thread  EMT only.
    10401043     */
    1041     DECLRCCALLBACKMEMBER(void,  pfnIoApicSetIrq,(PPDMDEVINS pDevIns, int iIrq, int iLevel, uint32_t uTagSrc));
     1044    DECLRCCALLBACKMEMBER(void,  pfnIoApicSetIrq,(PPDMDEVINS pDevIns, PCIBDF uBusDevFn, int iIrq, int iLevel, uint32_t uTagSrc));
    10421045
    10431046    /**
     
    10451048     *
    10461049     * @param   pDevIns         PCI device instance.
    1047      * @param   GCPhys          Physical address MSI request was written.
    1048      * @param   uValue          Value written.
     1050     * @param   uBusDevFn       The bus:device:function of the device initiating the
     1051     *                          MSI. Cannot be NIL_PCIBDF.
     1052     * @param   pMsi            The MSI to send.
    10491053     * @param   uTagSrc         The IRQ tag and source (for tracing).
    10501054     * @thread  EMT only.
    10511055     */
    1052     DECLRCCALLBACKMEMBER(void,  pfnIoApicSendMsi,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, uint32_t uValue, uint32_t uTagSrc));
     1056    DECLRCCALLBACKMEMBER(void,  pfnIoApicSendMsi,(PPDMDEVINS pDevIns, PCIBDF uBusDevFn, PCMSIMSG pMsi, uint32_t uTagSrc));
    10531057
    10541058
     
    10881092
    10891093/** Current PDMPCIHLPRC version number. */
    1090 #define PDM_PCIHLPRC_VERSION                    PDM_VERSION_MAKE(0xfffd, 3, 0)
     1094#define PDM_PCIHLPRC_VERSION                    PDM_VERSION_MAKE(0xfffd, 4, 0)
    10911095
    10921096
     
    11141118     *
    11151119     * @param   pDevIns         PCI device instance.
     1120     * @param   uBusDevFn       The bus:device:function of the device initiating the
     1121     *                          IRQ. Pass NIL_PCIBDF when it's not a PCI device or
     1122     *                          interrupt.
    11161123     * @param   iIrq            IRQ number to set.
    11171124     * @param   iLevel          IRQ level. See the PDM_IRQ_LEVEL_* \#defines.
     
    11191126     * @thread  EMT only.
    11201127     */
    1121     DECLR0CALLBACKMEMBER(void,  pfnIoApicSetIrq,(PPDMDEVINS pDevIns, int iIrq, int iLevel, uint32_t uTagSrc));
     1128    DECLR0CALLBACKMEMBER(void,  pfnIoApicSetIrq,(PPDMDEVINS pDevIns, PCIBDF uBusDevFn, int iIrq, int iLevel, uint32_t uTagSrc));
    11221129
    11231130    /**
     
    11251132     *
    11261133     * @param   pDevIns         PCI device instance.
    1127      * @param   GCPhys          Physical address MSI request was written.
    1128      * @param   uValue          Value written.
     1134     * @param   uBusDevFn       The bus:device:function of the device initiating the
     1135     *                          MSI. Cannot be NIL_PCIBDF.
     1136     * @param   pMsi            The MSI to send.
    11291137     * @param   uTagSrc         The IRQ tag and source (for tracing).
    11301138     * @thread  EMT only.
    11311139     */
    1132     DECLR0CALLBACKMEMBER(void,  pfnIoApicSendMsi,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, uint32_t uValue, uint32_t uTagSrc));
     1140    DECLR0CALLBACKMEMBER(void,  pfnIoApicSendMsi,(PPDMDEVINS pDevIns, PCIBDF uBusDevFn, PCMSIMSG pMsi, uint32_t uTagSrc));
    11331141
    11341142    /**
     
    11671175
    11681176/** Current PDMPCIHLPR0 version number. */
    1169 #define PDM_PCIHLPR0_VERSION                    PDM_VERSION_MAKE(0xfffc, 5, 0)
     1177#define PDM_PCIHLPR0_VERSION                    PDM_VERSION_MAKE(0xfffc, 6, 0)
    11701178
    11711179/**
     
    11911199     *
    11921200     * @param   pDevIns         The PCI device instance.
     1201     * @param   uBusDevFn       The bus:device:function of the device initiating the
     1202     *                          IRQ. Pass NIL_PCIBDF when it's not a PCI device or
     1203     *                          interrupt.
    11931204     * @param   iIrq            IRQ number to set.
    11941205     * @param   iLevel          IRQ level. See the PDM_IRQ_LEVEL_* \#defines.
    11951206     * @param   uTagSrc         The IRQ tag and source (for tracing).
    11961207     */
    1197     DECLR3CALLBACKMEMBER(void,  pfnIoApicSetIrq,(PPDMDEVINS pDevIns, int iIrq, int iLevel, uint32_t uTagSrc));
     1208    DECLR3CALLBACKMEMBER(void,  pfnIoApicSetIrq,(PPDMDEVINS pDevIns, PCIBDF uBusDevFn, int iIrq, int iLevel, uint32_t uTagSrc));
    11981209
    11991210    /**
     
    12011212     *
    12021213     * @param   pDevIns         PCI device instance.
    1203      * @param   GCPhys          Physical address MSI request was written.
    1204      * @param   uValue          Value written.
     1214     * @param   uBusDevFn       The bus:device:function of the device initiating the
     1215     *                          MSI. Cannot be NIL_PCIBDF.
     1216     * @param   pMsi            The MSI to send.
    12051217     * @param   uTagSrc         The IRQ tag and source (for tracing).
    12061218     */
    1207     DECLR3CALLBACKMEMBER(void,  pfnIoApicSendMsi,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, uint32_t uValue, uint32_t uTagSrc));
     1219    DECLR3CALLBACKMEMBER(void,  pfnIoApicSendMsi,(PPDMDEVINS pDevIns, PCIBDF uBusDevFn, PCMSIMSG pMsi, uint32_t uTagSrc));
    12081220
    12091221    /**
     
    12421254
    12431255/** Current PDMPCIHLPR3 version number. */
    1244 #define PDM_PCIHLPR3_VERSION                    PDM_VERSION_MAKE(0xfffb, 4, 0)
     1256#define PDM_PCIHLPR3_VERSION                    PDM_VERSION_MAKE(0xfffb, 5, 0)
    12451257
    12461258
     
    16951707     *
    16961708     * @param   pDevIns         Device instance of the I/O APIC.
     1709     * @param   uBusDevFn       The bus:device:function of the device initiating the
     1710     *                          IRQ. Can be NIL_PCIBDF.
    16971711     * @param   iIrq            IRQ number to set.
    16981712     * @param   iLevel          IRQ level. See the PDM_IRQ_LEVEL_* \#defines.
     
    17021716     *          Actually, as per 2018-07-21 this isn't true (bird).
    17031717     */
    1704     DECLCALLBACKMEMBER(void, pfnSetIrq)(PPDMDEVINS pDevIns, int iIrq, int iLevel, uint32_t uTagSrc);
     1718    DECLCALLBACKMEMBER(void, pfnSetIrq)(PPDMDEVINS pDevIns, PCIBDF uBusDevFn, int iIrq, int iLevel, uint32_t uTagSrc);
    17051719
    17061720    /**
     
    17081722     *
    17091723     * @param   pDevIns         Device instance of the I/O APIC.
    1710      * @param   GCPhys          Request address.
    1711      * @param   uValue          Request value.
     1724     * @param   uBusDevFn       The bus:device:function of the device initiating the
     1725     *                          MSI. Cannot be NIL_PCIBDF.
     1726     * @param   pMsi            The MSI to send.
    17121727     * @param   uTagSrc         The IRQ tag and source (for tracing).
    17131728     *
     
    17151730     *          Actually, as per 2018-07-21 this isn't true (bird).
    17161731     */
    1717     DECLCALLBACKMEMBER(void, pfnSendMsi)(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, uint32_t uValue, uint32_t uTagSrc);
     1732    DECLCALLBACKMEMBER(void, pfnSendMsi)(PPDMDEVINS pDevIns, PCIBDF uBusDevFn, PCMSIMSG pMsi, uint32_t uTagSrc);
    17181733
    17191734    /**
     
    17391754
    17401755/** Current PDMAPICREG version number. */
    1741 #define PDM_IOAPICREG_VERSION                   PDM_VERSION_MAKE(0xfff2, 6, 0)
     1756#define PDM_IOAPICREG_VERSION                   PDM_VERSION_MAKE(0xfff2, 7, 0)
    17421757
    17431758
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette