Changeset 105600 in vbox for trunk/src/VBox/Main/src-client/ConsoleImplConfigArmV8.cpp
- Timestamp:
- Aug 6, 2024 9:39:44 AM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImplConfigArmV8.cpp
r104386 r105600 108 108 #define VRC() AssertLogRelMsgReturnStmt(RT_SUCCESS(vrc), ("vrc=%Rrc\n", vrc), RTFdtDestroy(hFdt), vrc) 109 109 110 /** @todo Find a way to figure it out before CPUM is set up, can't use CPUMGetGuestAddrWidths() and on macOS we need111 * access to Hypervisor.framework to query the ID registers (Linux can in theory parse /proc/cpuinfo, no idea for Windows). */112 RTGCPHYS GCPhysTopOfAddrSpace = RT_BIT_64(36);113 114 110 /* 115 111 * Get necessary objects and frequently used parameters. … … 187 183 BusAssignmentManager *pBusMgr = mBusMgr = BusAssignmentManager::createInstance(pVMM, chipsetType, IommuType_None); 188 184 ResourceAssignmentManager *pResMgr = ResourceAssignmentManager::createInstance(pVMM, chipsetType, IommuType_None, 189 GCPhysTopOfAddrSpace - sizeof(VBOXPLATFORMARMV8),190 _1G, /*GCPhysRam*/191 128 * _1M,/*GCPhysMmio32Start*/192 _1G - 128 * _1M, /*cbMmio32*/193 32 /*cInterrupts*/);185 RT_MAX(_1G + cbRam, _4G), /*GCPhysMmio*/ 186 _1G, /*GCPhysRam*/ 187 VBOXPLATFORMARMV8_PHYS_ADDR + _1M, /*GCPhysMmio32Start*/ 188 _1G - (VBOXPLATFORMARMV8_PHYS_ADDR + _1M), /*cbMmio32*/ 189 32 /*cInterrupts*/); 194 190 195 191 /* … … 332 328 333 329 vrc = RTFdtNodeFinalize(hFdt); VRC(); 330 331 332 /* 333 * CPUM values. 334 */ 335 PCFGMNODE pCpum; 336 InsertConfigNode(pRoot, "CPUM", &pCpum); 334 337 335 338 … … 398 401 InsertConfigNode(pResources, "ArmV8Desc", &pRes); 399 402 InsertConfigInteger(pRes, "RegisterAsRom", 1); 400 InsertConfigInteger(pRes, "GCPhysLoadAddress", UINT64_MAX); /* End of physical address space. */403 InsertConfigInteger(pRes, "GCPhysLoadAddress", VBOXPLATFORMARMV8_PHYS_ADDR); 401 404 InsertConfigString(pRes, "ResourceId", "VBoxArmV8Desc"); 402 405 … … 613 616 RTGCPHYS GCPhysPciMmioEcam, GCPhysPciMmio, GCPhysPciMmio32; 614 617 RTGCPHYS cbPciMmioEcam, cbPciMmio, cbPciMmio32; 615 hrc = pResMgr->assignMmioRegionAligned("pci-pio", _64K, _64K, &GCPhysMmioStart, &cbMmio); H();616 hrc = pResMgr->assignMmioRegion( "pci-ecam", 16 * _1M, &GCPhysPciMmioEcam, &cbPciMmioEcam); H();617 hrc = pResMgr->assignMmioRegion( "pci-mmio", _2G, &GCPhysPciMmio, &cbPciMmio); H();618 hrc = pResMgr->assignMmio32Region( "pci-mmio32", (1024 - 128) *_1M, &GCPhysPciMmio32, &cbPciMmio32); H();618 hrc = pResMgr->assignMmioRegionAligned("pci-pio", _64K, _64K, &GCPhysMmioStart, &cbMmio); H(); 619 hrc = pResMgr->assignMmioRegion( "pci-ecam", 16 * _1M, &GCPhysPciMmioEcam, &cbPciMmioEcam); H(); 620 hrc = pResMgr->assignMmioRegion( "pci-mmio", _2G, &GCPhysPciMmio, &cbPciMmio); H(); 621 hrc = pResMgr->assignMmio32Region( "pci-mmio32", _1G - VBOXPLATFORMARMV8_PHYS_ADDR - _1M, &GCPhysPciMmio32, &cbPciMmio32); H(); 619 622 620 623 InsertConfigNode(pDevices, "pci-generic-ecam", &pDev); … … 773 776 VBOXPLATFORMARMV8 ArmV8Platform; RT_ZERO(ArmV8Platform); 774 777 778 /* Make room for the descriptor at the beginning. */ 779 vrc = RTVfsIoStrmZeroFill(hVfsIosDesc, sizeof(ArmV8Platform)); 780 AssertRCReturnStmt(vrc, RTFdtDestroy(hFdt), vrc); 781 775 782 vrc = RTFdtDumpToVfsIoStrm(hFdt, RTFDTTYPE_DTB, 0 /*fFlags*/, hVfsIosDesc, NULL /*pErrInfo*/); 783 uint64_t cbFdt = 0; 776 784 if (RT_SUCCESS(vrc)) 777 vrc = RTVfsFileQuerySize(hVfsFileDesc, &ArmV8Platform.cbFdt); 785 { 786 vrc = RTVfsFileQuerySize(hVfsFileDesc, &cbFdt); 787 cbFdt -= sizeof(ArmV8Platform); 788 } 778 789 AssertRCReturnStmt(vrc, RTFdtDestroy(hFdt), vrc); 779 790 780 vrc = RTVfsIoStrmZeroFill(hVfsIosDesc, (RTFOFF)(RT_ALIGN_64( ArmV8Platform.cbFdt, _64K) - ArmV8Platform.cbFdt));791 vrc = RTVfsIoStrmZeroFill(hVfsIosDesc, (RTFOFF)(RT_ALIGN_64(cbFdt, _64K) - cbFdt)); 781 792 AssertRCReturn(vrc, vrc); 782 793 … … 797 808 ArmV8Platform.u64PhysAddrRamBase = GCPhysRam; 798 809 ArmV8Platform.cbRamBase = cbRam; 799 ArmV8Platform. u64OffBackFdt = RT_ALIGN_64(ArmV8Platform.cbFdt, _64K);800 ArmV8Platform.cbFdt = RT_ALIGN_64( ArmV8Platform.cbFdt, _64K);801 ArmV8Platform. u64OffBackAcpiXsdp= 0;810 ArmV8Platform.i64OffFdt = sizeof(ArmV8Platform); 811 ArmV8Platform.cbFdt = RT_ALIGN_64(cbFdt, _64K); 812 ArmV8Platform.i64OffAcpiXsdp = 0; 802 813 ArmV8Platform.cbAcpiXsdp = 0; 803 ArmV8Platform. u64OffBackUefiRom = GCPhysTopOfAddrSpace - sizeof(ArmV8Platform);804 ArmV8Platform.cbUefiRom = _64M; /** @todo Fixed reservation but the ROM region is usually much smaller. */805 ArmV8Platform. u64OffBackMmio = GCPhysTopOfAddrSpace - sizeof(ArmV8Platform) - GCPhysMmioStart;814 ArmV8Platform.i64OffUefiRom = -128 * _1M; 815 ArmV8Platform.cbUefiRom = _64M; 816 ArmV8Platform.i64OffMmio = GCPhysMmioStart - _128M; 806 817 ArmV8Platform.cbMmio = cbMmio; 807 ArmV8Platform. u64OffBackMmio32 = GCPhysTopOfAddrSpace - sizeof(ArmV8Platform) - GCPhysMmio32Start;818 ArmV8Platform.i64OffMmio32 = GCPhysMmio32Start - _128M; 808 819 ArmV8Platform.cbMmio32 = cbMmio32; 809 820 810 821 /* Add the VBox platform descriptor to the resource store. */ 811 vrc = RTVfsIoStrmWrite (hVfsIosDesc, &ArmV8Platform, sizeof(ArmV8Platform), true /*fBlocking*/, NULL /*pcbWritten*/);822 vrc = RTVfsIoStrmWriteAt(hVfsIosDesc, 0, &ArmV8Platform, sizeof(ArmV8Platform), true /*fBlocking*/, NULL /*pcbWritten*/); 812 823 RTVfsIoStrmRelease(hVfsIosDesc); 813 824 vrc = mptrResourceStore->i_addItem("resources", "VBoxArmV8Desc", hVfsFileDesc);
Note:
See TracChangeset
for help on using the changeset viewer.