hyperv: Fix boot-up after malloc() returns memory of NX by default now

FreeBSD VM can't boot up on Hyper-V after the recent malloc change in
r335068: Make UMA and malloc(9) return non-executable memory in most cases.

The hypercall page here must be executable.
Fix the boot-up issue by adding M_EXEC.

PR:		229167
Sponsored by:	Microsoft
This commit is contained in:
Dexuan Cui 2018-07-07 00:41:04 +00:00
parent a9c91abd3b
commit 96f105d11f

View File

@ -284,7 +284,7 @@ hypercall_create(void *arg __unused)
* - Assume kmem_malloc() returns properly aligned memory.
*/
hypercall_context.hc_addr = (void *)kmem_malloc(kernel_arena, PAGE_SIZE,
M_WAITOK);
M_EXEC | M_WAITOK);
hypercall_context.hc_paddr = vtophys(hypercall_context.hc_addr);
/* Get the 'reserved' bits, which requires preservation. */