Changeset 108473 in vbox for trunk/src/VBox/VMM/VMMAll/GICAll.cpp
- Timestamp:
- Mar 7, 2025 12:10:21 PM (6 weeks ago)
- svn:sync-xref-src-repo-rev:
- 167860
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/GICAll.cpp
r108472 r108473 1421 1421 else 1422 1422 { 1423 /* SGIs are always edge-triggered ignore writes , verify value on strict builds (arm64 Win11 guests writes this). */1423 /* SGIs are always edge-triggered ignore writes. Windows 11 (24H2) arm64 guests writes these. */ 1424 1424 Assert(uValue == 0xaaaaaaaa); 1425 1425 Assert(pGicCpu->bmIntrConfig[0] == uValue); … … 2038 2038 ASMBitSet(&pGicCpu->bmIntrActive[0], idxIntr); 2039 2039 2040 /** @todo Duplicate block Id=E5ED12D2-088D-4525-9609-8325C02846C3 (start). */ 2041 /* Update the active priorities bitmap. */ 2042 AssertCompile(sizeof(pGicCpu->bmActivePriorityGroup0) * 8 >= 128); 2043 AssertCompile(sizeof(pGicCpu->bmActivePriorityGroup1) * 8 >= 128); 2044 uint8_t const idxPreemptionLevel = bIntrPriority >> 1; 2045 if (fGroup0) 2046 ASMBitSet(&pGicCpu->bmActivePriorityGroup0, idxPreemptionLevel); 2047 if (fGroup1) 2048 ASMBitSet(&pGicCpu->bmActivePriorityGroup1, idxPreemptionLevel); 2049 2050 /* Drop priority. */ 2051 if (RT_LIKELY(pGicCpu->idxRunningPriority < RT_ELEMENTS(pGicCpu->abRunningPriorities) - 1)) 2052 { 2053 LogFlowFunc(("Dropping interrupt priority from %u -> %u (idxRunningPriority: %u -> %u)\n", 2054 pGicCpu->abRunningPriorities[pGicCpu->idxRunningPriority], 2055 bIntrPriority, 2056 pGicCpu->idxRunningPriority, pGicCpu->idxRunningPriority + 1)); 2057 pGicCpu->abRunningPriorities[++pGicCpu->idxRunningPriority] = bIntrPriority; 2058 } 2059 else 2060 AssertReleaseMsgFailed(("Index of running interrupt priority out-of-bounds %u\n", pGicCpu->idxRunningPriority)); 2061 /** @todo Duplicate block Id=E5ED12D2-088D-4525-9609-8325C02846C3 (end). */ 2062 2063 /* If it is an edge-triggered interrupt, mark it as no longer pending. */ 2064 AssertRelease(2 * idxIntr + 1 < sizeof(pGicCpu->bmIntrConfig) * 8); 2065 bool const fEdgeTriggered = ASMBitTest(&pGicCpu->bmIntrConfig[0], 2 * idxIntr + 1); 2066 if (fEdgeTriggered) 2067 ASMBitClear(&pGicCpu->bmIntrPending[0], idxIntr); 2068 2069 /* Update the redistributor IRQ state to reflect change to the active interrupt. */ 2070 gicReDistUpdateIrqState(pGicDev, pVCpu); 2071 } 2072 else 2073 { 2074 /* Sanity check if the interrupt ID belongs to the distributor. */ 2075 Assert(GIC_IS_INTR_SPI(uIntId) || GIC_IS_INTR_EXT_SPI(uIntId)); 2076 2077 /* Mark the interrupt as active. */ 2078 Assert(idxIntr < sizeof(pGicDev->bmIntrActive) * 8); 2079 ASMBitSet(&pGicDev->bmIntrActive[0], idxIntr); 2080 2081 /** @todo Duplicate block Id=E5ED12D2-088D-4525-9609-8325C02846C3 (start). */ 2082 /* Update the active priorities bitmap. */ 2083 AssertCompile(sizeof(pGicCpu->bmActivePriorityGroup0) * 8 >= 128); 2084 AssertCompile(sizeof(pGicCpu->bmActivePriorityGroup1) * 8 >= 128); 2085 uint8_t const idxPreemptionLevel = bIntrPriority >> 1; 2086 if (fGroup0) 2087 ASMBitSet(&pGicCpu->bmActivePriorityGroup0, idxPreemptionLevel); 2088 if (fGroup1) 2089 ASMBitSet(&pGicCpu->bmActivePriorityGroup1, idxPreemptionLevel); 2090 2040 2091 /* Drop priority. */ 2041 2092 Assert(pGicCpu->idxRunningPriority < RT_ELEMENTS(pGicCpu->abRunningPriorities) - 1); … … 2046 2097 pGicCpu->idxRunningPriority, pGicCpu->idxRunningPriority + 1)); 2047 2098 pGicCpu->abRunningPriorities[++pGicCpu->idxRunningPriority] = bIntrPriority; 2048 2049 /* If it is an edge-triggered interrupt, mark it as no longer pending. */ 2050 AssertRelease(2 * idxIntr + 1 < sizeof(pGicCpu->bmIntrConfig) * 8); 2051 bool const fEdgeTriggered = ASMBitTest(&pGicCpu->bmIntrConfig[0], 2 * idxIntr + 1); 2052 if (fEdgeTriggered) 2053 ASMBitClear(&pGicCpu->bmIntrPending[0], idxIntr); 2054 2055 /* Update the redistributor IRQ state to reflect change to the active interrupt. */ 2056 gicReDistUpdateIrqState(pGicDev, pVCpu); 2057 } 2058 else 2059 { 2060 /* Sanity check if the interrupt ID belongs to the distirbutor. */ 2061 Assert(GIC_IS_INTR_SPI(uIntId) || GIC_IS_INTR_EXT_SPI(uIntId)); 2062 2063 /* Mark the interrupt as active. */ 2064 Assert(idxIntr < sizeof(pGicDev->bmIntrActive) * 8); 2065 ASMBitSet(&pGicDev->bmIntrActive[0], idxIntr); 2066 2067 /* Drop priority. */ 2068 Assert(pGicCpu->idxRunningPriority < RT_ELEMENTS(pGicCpu->abRunningPriorities) - 1); 2069 2070 LogFlowFunc(("Dropping interrupt priority from %u -> %u (idxRunningPriority: %u -> %u)\n", 2071 pGicCpu->abRunningPriorities[pGicCpu->idxRunningPriority], 2072 bIntrPriority, 2073 pGicCpu->idxRunningPriority, pGicCpu->idxRunningPriority + 1)); 2074 pGicCpu->abRunningPriorities[++pGicCpu->idxRunningPriority] = bIntrPriority; 2099 /** @todo Duplicate block Id=E5ED12D2-088D-4525-9609-8325C02846C3 (end). */ 2075 2100 2076 2101 /* If it is an edge-triggered interrupt, mark it as no longer pending. */ … … 2717 2742 break; 2718 2743 default: 2719 //AssertReleaseFailed(); 2720 break; 2744 { 2745 /* Windows 11 arm64 (24H2) writes zeroes into these reserved registers. We ignore them. */ 2746 if (offReg >= 0x7fe0 && offReg <= 0x7ffc) 2747 LogFlowFunc(("Bad guest writing to reserved GIC distributor register space [0x7fe0..0x7ffc] -- ignoring!")); 2748 else 2749 AssertReleaseMsgFailed(("offReg=%#x uValue=%#RX32\n", offReg, uValue)); 2750 break; 2751 } 2721 2752 } 2722 2753 … … 3600 3631 break; 3601 3632 case ARMV8_AARCH64_SYSREG_ICC_AP0R0_EL1: 3602 /** @todo */3633 AssertReleaseFailed(); 3603 3634 break; 3604 3635 case ARMV8_AARCH64_SYSREG_ICC_AP0R1_EL1: … … 3612 3643 break; 3613 3644 case ARMV8_AARCH64_SYSREG_ICC_AP1R0_EL1: 3614 /** @todo */3645 AssertReleaseFailed(); 3615 3646 break; 3616 3647 case ARMV8_AARCH64_SYSREG_ICC_AP1R1_EL1: … … 3763 3794 3764 3795 /* 3765 * Restore previous interrupt priority.3796 * Drop priority by restoring previous interrupt. 3766 3797 */ 3767 3798 Assert(pGicCpu->idxRunningPriority > 0); 3768 if (RT_LIKELY(pGicCpu->idxRunningPriority ))3799 if (RT_LIKELY(pGicCpu->idxRunningPriority > 0)) 3769 3800 { 3770 3801 LogFlowFunc(("Restoring interrupt priority from %u -> %u (idxRunningPriority: %u -> %u)\n", … … 3772 3803 pGicCpu->abRunningPriorities[pGicCpu->idxRunningPriority - 1], 3773 3804 pGicCpu->idxRunningPriority, pGicCpu->idxRunningPriority - 1)); 3805 3806 /* Update the active priorities bitmap. */ 3807 /** @todo Double check if this is doing the right thing :/ */ 3808 uint8_t const idxPreemptionLevel = pGicCpu->abRunningPriorities[pGicCpu->idxRunningPriority] >> 1; 3809 AssertCompile(sizeof(pGicCpu->bmActivePriorityGroup1) * 8 >= 128); 3810 ASMBitClear(&pGicCpu->bmActivePriorityGroup1, idxPreemptionLevel); 3811 3774 3812 pGicCpu->idxRunningPriority--; 3775 3813 }
Note:
See TracChangeset
for help on using the changeset viewer.