Changeset 84131 in vbox for trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
- Timestamp:
- May 2, 2020 3:43:31 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
r84129 r84131 2554 2554 2555 2555 /** 2556 * Writes the PPR Log Base Address Register.2557 */2558 static VBOXSTRICTRC iommuAmdPprLogBar_w(PPDMDEVINS pDevIns, PIOMMU pThis, uint32_t iReg, uint64_t u64Value)2559 {2560 RT_NOREF(pDevIns, iReg);2561 2562 /*2563 * IOMMU behavior is undefined when software writes this register when PPR logging is running.2564 * In our emulation, we ignore the write entirely.2565 * See AMD IOMMU spec. 3.3.2 "PPR Log Registers".2566 */2567 IOMMU_STATUS_T const Status = iommuAmdGetStatus(pThis);2568 if (Status.n.u1PprLogRunning)2569 {2570 Log((IOMMU_LOG_PFX ": Setting PprLogBar (%#RX64) when PPR logging is running -> Ignored\n", u64Value));2571 return VINF_SUCCESS;2572 }2573 2574 /* Mask out all unrecognized bits. */2575 u64Value &= IOMMU_PPR_LOG_BAR_VALID_MASK;2576 PPR_LOG_BAR_T PprLogBaseAddr;2577 PprLogBaseAddr.u64 = u64Value;2578 2579 /* Validate the length. */2580 if (PprLogBaseAddr.n.u4Len >= 8)2581 {2582 /* Update the register. */2583 pThis->PprLogBaseAddr.u64 = PprLogBaseAddr.u64;2584 2585 /*2586 * Writing the event log base address, clears the PPR log head and tail pointers.2587 * See AMD spec. 2.6 "Peripheral Page Request (PPR) Logging"2588 */2589 pThis->PprLogHeadPtr.u64 = 0;2590 pThis->PprLogTailPtr.u64 = 0;2591 }2592 else2593 Log((IOMMU_LOG_PFX ": PPR log length (%#x) invalid -> Ignored\n", PprLogBaseAddr.n.u4Len));2594 2595 return VINF_SUCCESS;2596 }2597 2598 2599 /**2600 2556 * Writes the Hardware Event Register (Hi). 2601 2557 */ … … 2965 2921 case IOMMU_MMIO_OFF_EXT_FEAT: return iommuAmdIgnore_w(pDevIns, pThis, off, uValue); 2966 2922 2967 case IOMMU_MMIO_OFF_PPR_LOG_BAR: return iommuAmd PprLogBar_w(pDevIns, pThis, off, uValue);2923 case IOMMU_MMIO_OFF_PPR_LOG_BAR: return iommuAmdIgnore_w(pDevIns, pThis, off, uValue); 2968 2924 case IOMMU_MMIO_OFF_HW_EVT_HI: return iommuAmdHwEvtHi_w(pDevIns, pThis, off, uValue); 2969 2925 case IOMMU_MMIO_OFF_HW_EVT_LO: return iommuAmdHwEvtLo_w(pDevIns, pThis, off, uValue);
Note:
See TracChangeset
for help on using the changeset viewer.