> From: owner-svn-src-h...@freebsd.org [mailto:owner-svn-src-
> h...@freebsd.org] On Behalf Of Konstantin Belousov
> Sent: Thursday, April 13, 2017 23:50
> 
> Author: kib
> Date: Thu Apr 13 15:49:55 2017
> New Revision: 316767
> URL:
> 
> Log:
>   Map DMAP as nx.
> 
>   Demotions preserve PG_NX, so it is enough to set nx bit for initial
>   lowest-level paging entries.
> 
> Modified:
>   head/sys/amd64/amd64/pmap.c
 
Hi kib,
Unluckily this patch breaks Hyper-V VM:

In dev/hyperv/vmbus/hyperv.c: hypercall_create() we allocate one
page and pass its physical address to the hypervisor, which initializes
the page with executable code.

Later in dev/hyperv/vmbus/hyperv.c: hypercall_post_message(), we
"call" the executable code in the above page.

Now with NX, the "call" gets a fault and as a result FreeBSD VM
can't boot on Hyper-V.

It looks memory allocated by bus_dmamem_alloc() and malloc()
is not executable now.

What else can we use?
I guess we can only use contigmalloc() or kmem_malloc() to
get a page that can be executable and use vtophys() to get its
physical address?

Looking forward to your suggestion!

Thanks!
-- Dexuan

_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to