xen: introduce a newbus function to allocate unused memory
authorroyger <royger@FreeBSD.org>
Fri, 8 May 2015 14:48:40 +0000 (14:48 +0000)
committerroyger <royger@FreeBSD.org>
Fri, 8 May 2015 14:48:40 +0000 (14:48 +0000)
commitd9a8b7337bd9eac9574477b682f8bba0af827223
tree0df19d243cf9c3b5b078907ca41718eadb489e8f
parentb15170de41044ac77f0d019e6d5bb620d8a0f38f
xen: introduce a newbus function to allocate unused memory

In order to map memory from other domains when running on Xen FreeBSD uses
unused physical memory regions. Until now this memory has been allocated
using bus_alloc_resource, but this is not completely safe as we can end up
using unreclaimed MMIO or ACPI regions.

Fix this by introducing a new newbus method that can be used by Xen drivers
to request for unused memory regions. On amd64 we make sure this memory
comes from regions above 4GB in order to prevent clashes with MMIO/ACPI
regions. On i386 there's nothing we can do, so just fall back to the
previous mechanism.

Sponsored by: Citrix Systems R&D
Tested by: Gustau PĂ©rez <gperez@entel.upc.edu>
sys/conf/files
sys/dev/xen/blkback/blkback.c
sys/dev/xen/grant_table/grant_table.c
sys/dev/xen/netback/netback.c
sys/dev/xen/privcmd/privcmd.c
sys/x86/xen/xenpv.c
sys/xen/xen-os.h
sys/xen/xenmem/xenmem_if.m [new file with mode: 0644]