Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Jul 2018 00:41:04 +0000 (UTC)
From:      Dexuan Cui <dexuan@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r336054 - head/sys/dev/hyperv/vmbus
Message-ID:  <201807070041.w670f4da032261@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dexuan
Date: Sat Jul  7 00:41:04 2018
New Revision: 336054
URL: https://svnweb.freebsd.org/changeset/base/336054

Log:
  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

Modified:
  head/sys/dev/hyperv/vmbus/hyperv.c

Modified: head/sys/dev/hyperv/vmbus/hyperv.c
==============================================================================
--- head/sys/dev/hyperv/vmbus/hyperv.c	Fri Jul  6 23:49:17 2018	(r336053)
+++ head/sys/dev/hyperv/vmbus/hyperv.c	Sat Jul  7 00:41:04 2018	(r336054)
@@ -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. */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807070041.w670f4da032261>