Prevent truncation of big page start in GetVaRegions

This commit is contained in:
Billy Laws 2022-10-30 16:33:16 +00:00
parent f650f32bf0
commit cd0b2636e5

View File

@ -243,6 +243,7 @@ namespace skyline::service::nvdrv::device::nvhost {
if (!vm.initialised) if (!vm.initialised)
return PosixResult::InvalidArgument; return PosixResult::InvalidArgument;
bufSize = 2 * sizeof(VaRegion);
vaRegions = std::array<VaRegion, 2> { vaRegions = std::array<VaRegion, 2> {
VaRegion{ VaRegion{
.pageSize = VM::PageSize, .pageSize = VM::PageSize,
@ -252,7 +253,7 @@ namespace skyline::service::nvdrv::device::nvhost {
VaRegion{ VaRegion{
.pageSize = vm.bigPageSize, .pageSize = vm.bigPageSize,
.pages = vm.bigPageAllocator->vaLimit - vm.bigPageAllocator->vaStart, .pages = vm.bigPageAllocator->vaLimit - vm.bigPageAllocator->vaStart,
.offset = vm.bigPageAllocator->vaStart << vm.bigPageSizeBits, .offset = static_cast<u64>(vm.bigPageAllocator->vaStart) << vm.bigPageSizeBits,
} }
}; };