-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Description
Building the binaries and starting simpleator.exe N:\path\to\testapp.exe yielded an E_INVALID_ARG in the debug console so I tried to look into it:
- It seems like the source address isn't aligned to a page boundary, as it should be, so WHvMapGpaRange yields that HRESULT.
- After fixing that and calling it manually small mappings work (roughly < 1<<36) when adding similar code as below directly after
SemVmCreatePartition.
For bigger sizes, we get E_INVALID_ARG again.
Any idea whats going on there?
Are some kind of limits put onto the guest address space?
Running Win10 Pro 1903 x64, HyperV Platform and HyperV enabled.
MEM_ADDRESS_REQUIREMENTS addrReqs = { 0 };
addrReqs.Alignment = 65536; // align to page boundary, should be dwAllocationGranularity
MEM_EXTENDED_PARAMETER additional = { 0 };
additional.Type = MemExtendedParameterAddressRequirements;
additional.Pointer = &addrReqs;
auto addr = VirtualAlloc2(GetCurrentProcess(),
NULL,
4096,
MEM_COMMIT | MEM_TOP_DOWN,
PAGE_READWRITE,
&additional,
1);
// This works: WHV_GUEST_PHYSICAL_ADDRESS size = 0x0000000b40000000;
WHV_GUEST_PHYSICAL_ADDRESS size = 0x0000000b80000000;
auto ret = WHvMapGpaRange(semPartition->PartitionHandle,
addr,
4096,
size,
WHvMapGpaRangeFlagRead | WHvMapGpaRangeFlagWrite);
// ret == E_INVALID_ARG
return 0;Metadata
Metadata
Assignees
Labels
No labels