Changeset 84086 in vbox for trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
- Timestamp:
- Apr 29, 2020 3:20:29 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
r84075 r84086 1851 1851 } IOMMU_STATUS_T; 1852 1852 AssertCompileSize(IOMMU_STATUS_T, 8); 1853 #define IOMMU_STATUS_VALID_MASK UINT64_C(0x0000000000079fff) 1854 #define IOMMU_STATUS_RW1C_MASK UINT64_C(0x0000000000068e67) 1853 1855 1854 1856 /** … … 2729 2731 2730 2732 2733 /** 2734 * Writes the Status Register (64-bit). 2735 */ 2736 static VBOXSTRICTRC iommuAmdStatus_w(PPDMDEVINS pDevIns, PIOMMU pThis, uint32_t iReg, uint64_t u64Value) 2737 { 2738 RT_NOREF(pDevIns, iReg); 2739 2740 /* Mask out all unrecognized bits. */ 2741 u64Value &= IOMMU_STATUS_VALID_MASK; 2742 2743 /* 2744 * Compute RW1C (read-only, write-1-to-clear) bits and preserve the rest (which are read-only). 2745 * Writing 0 to an RW1C bit has no effect. Writing 1 to an RW1C bit, clears the bit if it's already 1. 2746 */ 2747 IOMMU_STATUS_T const OldStatus = iommuAmdGetStatus(pThis); 2748 uint64_t const fOldRw1cBits = (OldStatus.u64 & IOMMU_STATUS_RW1C_MASK); 2749 uint64_t const fOldRoBits = (OldStatus.u64 & ~IOMMU_STATUS_RW1C_MASK); 2750 uint64_t const fNewRw1cBits = (u64Value & IOMMU_STATUS_RW1C_MASK); 2751 2752 uint64_t const uNewStatus = (fOldRw1cBits & ~fNewRw1cBits) | fOldRoBits; 2753 2754 /* Update the register. */ 2755 ASMAtomicWriteU64(&pThis->Status.u64, uNewStatus); 2756 return VINF_SUCCESS; 2757 } 2758 2759 2731 2760 #if 0 2732 2761 /** … … 2843 2872 case IOMMU_MMIO_EVT_LOG_TAIL_PTR: return iommuAmdEvtLogTailPtr_w(pDevIns, pThis, off, uValue); 2844 2873 2845 case IOMMU_MMIO_OFF_STATUS: 2874 case IOMMU_MMIO_OFF_STATUS: return iommuAmdStatus_w(pDevIns, pThis, off, uValue); 2846 2875 2847 2876 case IOMMU_MMIO_OFF_PPR_LOG_HEAD_PTR:
Note:
See TracChangeset
for help on using the changeset viewer.