From cd0b2636e5df151c7b949939a438760b2a0f0f1a Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sun, 30 Oct 2022 16:33:16 +0000 Subject: [PATCH] Prevent truncation of big page start in GetVaRegions --- .../main/cpp/skyline/services/nvdrv/devices/nvhost/as_gpu.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/as_gpu.cpp b/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/as_gpu.cpp index 17fa98a9..9f013762 100644 --- a/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/as_gpu.cpp +++ b/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/as_gpu.cpp @@ -243,6 +243,7 @@ namespace skyline::service::nvdrv::device::nvhost { if (!vm.initialised) return PosixResult::InvalidArgument; + bufSize = 2 * sizeof(VaRegion); vaRegions = std::array { VaRegion{ .pageSize = VM::PageSize, @@ -252,7 +253,7 @@ namespace skyline::service::nvdrv::device::nvhost { VaRegion{ .pageSize = vm.bigPageSize, .pages = vm.bigPageAllocator->vaLimit - vm.bigPageAllocator->vaStart, - .offset = vm.bigPageAllocator->vaStart << vm.bigPageSizeBits, + .offset = static_cast(vm.bigPageAllocator->vaStart) << vm.bigPageSizeBits, } };