xen: init gnttab from xenpv

Currently the grant table is initialized from xenstore, but a better
place to do this would be xenpv, so move grant table initialization
there.

Sponsored by: Citrix Systems R&D
Approved by: gibbs

x86/xen/xenpv.c:
 - Add gnttab initialization.

xen/xenstore/xenstore.c:
 - Remove gnttab initialization.
This commit is contained in:
Roger Pau Monné 2014-06-16 08:48:06 +00:00
parent 9a522f8203
commit 3593fa95ef

View File

@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$");
#include <machine/stdarg.h>
#include <xen/xen-os.h>
#include <xen/gnttab.h>
#include <xen/hypervisor.h>
#include <xen/xen_intr.h>
@ -1128,20 +1127,6 @@ xs_attach(device_t dev)
xs.xs_dev = dev;
device_set_softc(dev, &xs);
/*
* This seems to be a layering violation. The XenStore is just
* one of many clients of the Grant Table facility. It happens
* to be the first and a gating consumer to all other devices,
* so this does work. A better place would be in the PV support
* code for fully PV kernels and the xenpci driver for HVM kernels.
*/
error = gnttab_init();
if (error != 0) {
log(LOG_WARNING,
"XENSTORE: Error initializing grant tables: %d\n", error);
return (ENXIO);
}
/* Initialize the interface to xenstore. */
struct proc *p;