iPXE
hvm.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2014 Michael Brown <mbrown@fensystems.co.uk>.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301, USA.
18 *
19 * You can also choose to distribute this program under the terms of
20 * the Unmodified Binary Distribution Licence (as given in the file
21 * COPYING.UBDL), provided that you have satisfied its requirements.
22 */
23
24FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
25FILE_SECBOOT ( PERMITTED );
26
27#include <stdint.h>
28#include <stdio.h>
29#include <string.h>
30#include <errno.h>
31#include <ipxe/malloc.h>
32#include <ipxe/pci.h>
33#include <ipxe/cpuid.h>
34#include <ipxe/msr.h>
35#include <ipxe/xen.h>
36#include <ipxe/xenver.h>
37#include <ipxe/xenmem.h>
38#include <ipxe/xenstore.h>
39#include <ipxe/xenbus.h>
40#include <ipxe/xengrant.h>
41#include "hvm.h"
42
43/** @file
44 *
45 * Xen HVM driver
46 *
47 */
48
49/**
50 * Get CPUID base
51 *
52 * @v hvm HVM device
53 * @ret rc Return status code
54 */
55static int hvm_cpuid_base ( struct hvm_device *hvm ) {
56 struct {
60 } __attribute__ (( packed )) signature;
63 uint32_t discard_eax;
64 uint32_t discard_ebx;
67
68 /* Scan for magic signature */
70 base += HVM_CPUID_STEP ) {
71 cpuid ( base, 0, &discard_eax, &signature.ebx, &signature.ecx,
72 &signature.edx );
74 sizeof ( signature ) ) == 0 ) {
75 hvm->cpuid_base = base;
76 cpuid ( ( base + HVM_CPUID_VERSION ), 0, &version,
77 &discard_ebx, &discard_ecx, &discard_edx );
78 DBGC2 ( hvm, "HVM using CPUID base %#08x (v%d.%d)\n",
79 base, ( version >> 16 ), ( version & 0xffff ) );
80 return 0;
81 }
82 }
83
84 DBGC ( hvm, "HVM could not find hypervisor\n" );
85 return -ENODEV;
86}
87
88/**
89 * Map hypercall page(s)
90 *
91 * @v hvm HVM device
92 * @ret rc Return status code
93 */
94static int hvm_map_hypercall ( struct hvm_device *hvm ) {
95 uint32_t pages;
96 uint32_t msr;
99 physaddr_t hypercall_phys;
102 int xenrc;
103 int rc;
104
105 /* Get number of hypercall pages and MSR to use */
106 cpuid ( ( hvm->cpuid_base + HVM_CPUID_PAGES ), 0, &pages, &msr,
108
109 /* Allocate pages */
110 hvm->hypercall_len = ( pages * PAGE_SIZE );
112 if ( ! hvm->xen.hypercall ) {
113 DBGC ( hvm, "HVM could not allocate %d hypercall page(s)\n",
114 pages );
115 return -ENOMEM;
116 }
117 hypercall_phys = virt_to_phys ( hvm->xen.hypercall );
118 DBGC2 ( hvm, "HVM hypercall page(s) at [%#08lx,%#08lx) via MSR %#08x\n",
119 hypercall_phys, ( hypercall_phys + hvm->hypercall_len ), msr );
120
121 /* Write to MSR */
122 wrmsr ( msr, hypercall_phys );
123
124 /* Check that hypercall mechanism is working */
125 version = xenver_version ( &hvm->xen );
126 if ( ( xenrc = xenver_extraversion ( &hvm->xen, &extraversion ) ) != 0){
127 rc = -EXEN ( xenrc );
128 DBGC ( hvm, "HVM could not get extraversion: %s\n",
129 strerror ( rc ) );
130 return rc;
131 }
132 DBGC2 ( hvm, "HVM found Xen version %d.%d%s\n",
133 ( version >> 16 ), ( version & 0xffff ) , extraversion );
134
135 return 0;
136}
137
138/**
139 * Unmap hypercall page(s)
140 *
141 * @v hvm HVM device
142 */
143static void hvm_unmap_hypercall ( struct hvm_device *hvm ) {
144
145 /* Free pages */
146 free_phys ( hvm->xen.hypercall, hvm->hypercall_len );
147}
148
149/**
150 * Allocate and map MMIO space
151 *
152 * @v hvm HVM device
153 * @v space Source mapping space
154 * @v len Length (must be a multiple of PAGE_SIZE)
155 * @ret mmio MMIO space address, or NULL on error
156 */
157static void * hvm_ioremap ( struct hvm_device *hvm, unsigned int space,
158 size_t len ) {
159 struct xen_add_to_physmap add;
161 unsigned int pages = ( len / PAGE_SIZE );
162 physaddr_t mmio_phys;
163 unsigned int i;
164 void *mmio;
165 int xenrc;
166 int rc;
167
168 /* Sanity check */
169 assert ( ( len % PAGE_SIZE ) == 0 );
170
171 /* Check for available space */
172 if ( ( hvm->mmio_offset + len ) > hvm->mmio_len ) {
173 DBGC ( hvm, "HVM could not allocate %zd bytes of MMIO space "
174 "(%zd of %zd remaining)\n", len,
175 ( hvm->mmio_len - hvm->mmio_offset ), hvm->mmio_len );
176 goto err_no_space;
177 }
178
179 /* Map this space */
180 mmio = pci_ioremap ( hvm->pci, ( hvm->mmio + hvm->mmio_offset ), len );
181 if ( ! mmio ) {
182 DBGC ( hvm, "HVM could not map MMIO space [%08lx,%08lx)\n",
183 ( hvm->mmio + hvm->mmio_offset ),
184 ( hvm->mmio + hvm->mmio_offset + len ) );
185 goto err_ioremap;
186 }
187 mmio_phys = virt_to_phys ( mmio );
188
189 /* Add to physical address space */
190 for ( i = 0 ; i < pages ; i++ ) {
191 add.domid = DOMID_SELF;
192 add.idx = i;
193 add.space = space;
194 add.gpfn = ( ( mmio_phys / PAGE_SIZE ) + i );
195 if ( ( xenrc = xenmem_add_to_physmap ( &hvm->xen, &add ) ) !=0){
196 rc = -EXEN ( xenrc );
197 DBGC ( hvm, "HVM could not add space %d idx %d at "
198 "[%08lx,%08lx): %s\n", space, i,
199 ( mmio_phys + ( i * PAGE_SIZE ) ),
200 ( mmio_phys + ( ( i + 1 ) * PAGE_SIZE ) ),
201 strerror ( rc ) );
202 goto err_add_to_physmap;
203 }
204 }
205
206 /* Update offset */
207 hvm->mmio_offset += len;
208
209 return mmio;
210
211 i = pages;
212 err_add_to_physmap:
213 for ( i-- ; ( signed int ) i >= 0 ; i-- ) {
214 remove.domid = DOMID_SELF;
215 add.gpfn = ( ( mmio_phys / PAGE_SIZE ) + i );
216 xenmem_remove_from_physmap ( &hvm->xen, &remove );
217 }
218 iounmap ( mmio );
219 err_ioremap:
220 err_no_space:
221 return NULL;
222}
223
224/**
225 * Unmap MMIO space
226 *
227 * @v hvm HVM device
228 * @v mmio MMIO space address
229 * @v len Length (must be a multiple of PAGE_SIZE)
230 */
231static void hvm_iounmap ( struct hvm_device *hvm, void *mmio, size_t len ) {
233 physaddr_t mmio_phys = virt_to_phys ( mmio );
234 unsigned int pages = ( len / PAGE_SIZE );
235 unsigned int i;
236 int xenrc;
237 int rc;
238
239 /* Unmap this space */
240 iounmap ( mmio );
241
242 /* Remove from physical address space */
243 for ( i = 0 ; i < pages ; i++ ) {
244 remove.domid = DOMID_SELF;
245 remove.gpfn = ( ( mmio_phys / PAGE_SIZE ) + i );
246 if ( ( xenrc = xenmem_remove_from_physmap ( &hvm->xen,
247 &remove ) ) != 0 ) {
248 rc = -EXEN ( xenrc );
249 DBGC ( hvm, "HVM could not remove space [%08lx,%08lx): "
250 "%s\n", ( mmio_phys + ( i * PAGE_SIZE ) ),
251 ( mmio_phys + ( ( i + 1 ) * PAGE_SIZE ) ),
252 strerror ( rc ) );
253 /* Nothing we can do about this */
254 }
255 }
256}
257
258/**
259 * Map shared info page
260 *
261 * @v hvm HVM device
262 * @ret rc Return status code
263 */
264static int hvm_map_shared_info ( struct hvm_device *hvm ) {
265 physaddr_t shared_info_phys;
266 int rc;
267
268 /* Map shared info page */
270 PAGE_SIZE );
271 if ( ! hvm->xen.shared ) {
272 rc = -ENOMEM;
273 goto err_alloc;
274 }
275 shared_info_phys = virt_to_phys ( hvm->xen.shared );
276 DBGC2 ( hvm, "HVM shared info page at [%#08lx,%#08lx)\n",
277 shared_info_phys, ( shared_info_phys + PAGE_SIZE ) );
278
279 /* Sanity check */
280 DBGC2 ( hvm, "HVM wallclock time is %d\n",
281 readl ( &hvm->xen.shared->wc_sec ) );
282
283 return 0;
284
285 hvm_iounmap ( hvm, hvm->xen.shared, PAGE_SIZE );
286 err_alloc:
287 return rc;
288}
289
290/**
291 * Unmap shared info page
292 *
293 * @v hvm HVM device
294 */
295static void hvm_unmap_shared_info ( struct hvm_device *hvm ) {
296
297 /* Unmap shared info page */
298 hvm_iounmap ( hvm, hvm->xen.shared, PAGE_SIZE );
299}
300
301/**
302 * Map grant table
303 *
304 * @v hvm HVM device
305 * @ret rc Return status code
306 */
307static int hvm_map_grant ( struct hvm_device *hvm ) {
308 physaddr_t grant_phys;
309 int rc;
310
311 /* Initialise grant table */
312 if ( ( rc = xengrant_init ( &hvm->xen ) ) != 0 ) {
313 DBGC ( hvm, "HVM could not initialise grant table: %s\n",
314 strerror ( rc ) );
315 return rc;
316 }
317
318 /* Map grant table */
320 hvm->xen.grant.len );
321 if ( ! hvm->xen.grant.table )
322 return -ENODEV;
323
324 grant_phys = virt_to_phys ( hvm->xen.grant.table );
325 DBGC2 ( hvm, "HVM mapped grant table at [%08lx,%08lx)\n",
326 grant_phys, ( grant_phys + hvm->xen.grant.len ) );
327 return 0;
328}
329
330/**
331 * Unmap grant table
332 *
333 * @v hvm HVM device
334 */
335static void hvm_unmap_grant ( struct hvm_device *hvm ) {
336
337 /* Unmap grant table */
338 hvm_iounmap ( hvm, hvm->xen.grant.table, hvm->xen.grant.len );
339}
340
341/**
342 * Map XenStore
343 *
344 * @v hvm HVM device
345 * @ret rc Return status code
346 */
347static int hvm_map_xenstore ( struct hvm_device *hvm ) {
348 uint64_t xenstore_evtchn;
349 uint64_t xenstore_pfn;
350 physaddr_t xenstore_phys;
351 char *name;
352 int xenrc;
353 int rc;
354
355 /* Get XenStore event channel */
356 if ( ( xenrc = xen_hvm_get_param ( &hvm->xen, HVM_PARAM_STORE_EVTCHN,
357 &xenstore_evtchn ) ) != 0 ) {
358 rc = -EXEN ( xenrc );
359 DBGC ( hvm, "HVM could not get XenStore event channel: %s\n",
360 strerror ( rc ) );
361 return rc;
362 }
363 hvm->xen.store.port = xenstore_evtchn;
364
365 /* Get XenStore PFN */
366 if ( ( xenrc = xen_hvm_get_param ( &hvm->xen, HVM_PARAM_STORE_PFN,
367 &xenstore_pfn ) ) != 0 ) {
368 rc = -EXEN ( xenrc );
369 DBGC ( hvm, "HVM could not get XenStore PFN: %s\n",
370 strerror ( rc ) );
371 return rc;
372 }
373 xenstore_phys = ( xenstore_pfn * PAGE_SIZE );
374
375 /* Map XenStore */
376 hvm->xen.store.intf = pci_ioremap ( hvm->pci, xenstore_phys,
377 PAGE_SIZE );
378 if ( ! hvm->xen.store.intf ) {
379 DBGC ( hvm, "HVM could not map XenStore at [%08lx,%08lx)\n",
380 xenstore_phys, ( xenstore_phys + PAGE_SIZE ) );
381 return -ENODEV;
382 }
383 DBGC2 ( hvm, "HVM mapped XenStore at [%08lx,%08lx) with event port "
384 "%d\n", xenstore_phys, ( xenstore_phys + PAGE_SIZE ),
385 hvm->xen.store.port );
386
387 /* Check that XenStore is working */
388 if ( ( rc = xenstore_read ( &hvm->xen, &name, "name", NULL ) ) != 0 ) {
389 DBGC ( hvm, "HVM could not read domain name: %s\n",
390 strerror ( rc ) );
391 return rc;
392 }
393 DBGC2 ( hvm, "HVM running in domain \"%s\"\n", name );
394 free ( name );
395
396 return 0;
397}
398
399/**
400 * Unmap XenStore
401 *
402 * @v hvm HVM device
403 */
404static void hvm_unmap_xenstore ( struct hvm_device *hvm ) {
405
406 /* Unmap XenStore */
407 iounmap ( hvm->xen.store.intf );
408}
409
410/**
411 * Probe PCI device
412 *
413 * @v pci PCI device
414 * @ret rc Return status code
415 */
416static int hvm_probe ( struct pci_device *pci ) {
417 struct hvm_device *hvm;
418 int rc;
419
420 /* Allocate and initialise structure */
421 hvm = zalloc ( sizeof ( *hvm ) );
422 if ( ! hvm ) {
423 rc = -ENOMEM;
424 goto err_alloc;
425 }
426 hvm->pci = pci;
429 DBGC2 ( hvm, "HVM has MMIO space [%08lx,%08lx)\n",
430 hvm->mmio, ( hvm->mmio + hvm->mmio_len ) );
431
432 /* Fix up PCI device */
434
435 /* Attach to hypervisor */
436 if ( ( rc = hvm_cpuid_base ( hvm ) ) != 0 )
437 goto err_cpuid_base;
438 if ( ( rc = hvm_map_hypercall ( hvm ) ) != 0 )
439 goto err_map_hypercall;
440 if ( ( rc = hvm_map_shared_info ( hvm ) ) != 0 )
441 goto err_map_shared_info;
442 if ( ( rc = hvm_map_grant ( hvm ) ) != 0 )
443 goto err_map_grant;
444 if ( ( rc = hvm_map_xenstore ( hvm ) ) != 0 )
445 goto err_map_xenstore;
446
447 /* Probe Xen devices */
448 if ( ( rc = xenbus_probe ( &hvm->xen, &pci->dev ) ) != 0 ) {
449 DBGC ( hvm, "HVM could not probe Xen bus: %s\n",
450 strerror ( rc ) );
451 goto err_xenbus_probe;
452 }
453
454 pci_set_drvdata ( pci, hvm );
455 return 0;
456
457 xenbus_remove ( &hvm->xen, &pci->dev );
458 err_xenbus_probe:
459 hvm_unmap_xenstore ( hvm );
460 err_map_xenstore:
461 hvm_unmap_grant ( hvm );
462 err_map_grant:
463 hvm_unmap_shared_info ( hvm );
464 err_map_shared_info:
465 hvm_unmap_hypercall ( hvm );
466 err_map_hypercall:
467 err_cpuid_base:
468 free ( hvm );
469 err_alloc:
470 return rc;
471}
472
473/**
474 * Remove PCI device
475 *
476 * @v pci PCI device
477 */
478static void hvm_remove ( struct pci_device *pci ) {
479 struct hvm_device *hvm = pci_get_drvdata ( pci );
480
481 xenbus_remove ( &hvm->xen, &pci->dev );
482 hvm_unmap_xenstore ( hvm );
483 hvm_unmap_grant ( hvm );
484 hvm_unmap_shared_info ( hvm );
485 hvm_unmap_hypercall ( hvm );
486 free ( hvm );
487}
488
489/** PCI device IDs */
490static struct pci_device_id hvm_ids[] = {
491 PCI_ROM ( 0x5853, 0x0001, "hvm", "hvm", 0 ),
492 PCI_ROM ( 0x5853, 0x0002, "hvm2", "hvm2", 0 ),
493};
494
495/** PCI driver */
496struct pci_driver hvm_driver __pci_driver = {
497 .ids = hvm_ids,
498 .id_count = ( sizeof ( hvm_ids ) / sizeof ( hvm_ids[0] ) ),
499 .probe = hvm_probe,
501};
502
503/* Drag in objects via hvm_driver */
504REQUIRING_SYMBOL ( hvm_driver );
505
506/* Drag in netfront driver */
507REQUIRE_OBJECT ( netfront );
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
u8 signature
CPU signature.
Definition CIB_PRM.h:7
struct arbelprm_rc_send_wqe rc
Definition arbel.h:3
uint32_t discard_edx
Definition hyperv.h:32
uint32_t discard_ecx
Definition hyperv.h:31
unsigned int uint32_t
Definition stdint.h:12
unsigned long physaddr_t
Definition stdint.h:20
unsigned long long uint64_t
Definition stdint.h:13
#define assert(condition)
Assert a condition at run-time.
Definition assert.h:50
u32 version
Driver version.
Definition ath9k_hw.c:1985
const char * name
Definition ath9k_hw.c:1986
x86 CPU feature detection
static uint32_t uint32_t uint32_t * ebx
Definition cpuid.h:90
static uint32_t uint32_t uint32_t uint32_t * ecx
Definition cpuid.h:91
static uint32_t uint32_t uint32_t uint32_t uint32_t * edx
Definition cpuid.h:91
ring len
Length.
Definition dwmac.h:226
Error codes.
#define DBGC2(...)
Definition compiler.h:522
#define DBGC(...)
Definition compiler.h:505
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define REQUIRE_OBJECT(object)
Require an object.
Definition compiler.h:202
#define ENOMEM
Not enough space.
Definition errno.h:535
#define ENODEV
No such device.
Definition errno.h:510
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
#define REQUIRING_SYMBOL(symbol)
Specify the file's requiring symbol.
Definition compiler.h:140
static void hvm_unmap_grant(struct hvm_device *hvm)
Unmap grant table.
Definition hvm.c:335
static int hvm_map_shared_info(struct hvm_device *hvm)
Map shared info page.
Definition hvm.c:264
static void hvm_iounmap(struct hvm_device *hvm, void *mmio, size_t len)
Unmap MMIO space.
Definition hvm.c:231
static void hvm_unmap_xenstore(struct hvm_device *hvm)
Unmap XenStore.
Definition hvm.c:404
static void * hvm_ioremap(struct hvm_device *hvm, unsigned int space, size_t len)
Allocate and map MMIO space.
Definition hvm.c:157
static int hvm_map_grant(struct hvm_device *hvm)
Map grant table.
Definition hvm.c:307
static void hvm_remove(struct pci_device *pci)
Remove PCI device.
Definition hvm.c:478
static int hvm_map_hypercall(struct hvm_device *hvm)
Map hypercall page(s)
Definition hvm.c:94
static int hvm_cpuid_base(struct hvm_device *hvm)
Get CPUID base.
Definition hvm.c:55
static void hvm_unmap_shared_info(struct hvm_device *hvm)
Unmap shared info page.
Definition hvm.c:295
static void hvm_unmap_hypercall(struct hvm_device *hvm)
Unmap hypercall page(s)
Definition hvm.c:143
static int hvm_probe(struct pci_device *pci)
Probe PCI device.
Definition hvm.c:416
static int hvm_map_xenstore(struct hvm_device *hvm)
Map XenStore.
Definition hvm.c:347
static struct pci_device_id hvm_ids[]
PCI device IDs.
Definition hvm.c:490
Xen HVM driver.
#define HVM_CPUID_MAGIC
Magic signature.
Definition hvm.h:28
#define HVM_CPUID_STEP
Increment between CPUID bases.
Definition hvm.h:25
#define HVM_CPUID_MIN
Minimum CPUID base.
Definition hvm.h:19
#define HVM_MMIO_BAR
PCI MMIO BAR.
Definition hvm.h:37
#define HVM_CPUID_VERSION
Get Xen version.
Definition hvm.h:31
#define HVM_CPUID_PAGES
Get number of hypercall pages.
Definition hvm.h:34
static int xen_hvm_get_param(struct xen_hypervisor *xen, unsigned int index, uint64_t *value)
Get HVM parameter value.
Definition hvm.h:65
#define HVM_CPUID_MAX
Maximum CPUID base.
Definition hvm.h:22
#define __attribute__(x)
Definition compiler.h:10
#define PAGE_SIZE
Page size.
Definition io.h:28
void iounmap(volatile const void *io_addr)
Unmap I/O address.
void * pci_ioremap(struct pci_device *pci, unsigned long bus_addr, size_t len)
Map PCI bus address as an I/O address.
Xen interface.
#define EXEN(xenrc)
Convert a Xen status code to an iPXE status code.
Definition xen.h:87
String functions.
#define DOMID_SELF
Definition xen.h:581
Xen device bus.
uint32_t base
Base.
Definition librm.h:3
void * zalloc(size_t size)
Allocate cleared memory.
Definition malloc.c:662
void * malloc_phys(size_t size, size_t phys_align)
Allocate memory with specified physical alignment.
Definition malloc.c:707
void free_phys(void *ptr, size_t size)
Free memory allocated with malloc_phys()
Definition malloc.c:723
Dynamic memory allocation.
#define XENMAPSPACE_shared_info
Definition memory.h:212
#define XENMAPSPACE_grant_table
Definition memory.h:213
Model-specific registers.
unsigned long pci_bar_size(struct pci_device *pci, unsigned int reg)
Get the size of a PCI BAR.
Definition pci.c:164
void adjust_pci_device(struct pci_device *pci)
Enable PCI device.
Definition pci.c:241
unsigned long pci_bar_start(struct pci_device *pci, unsigned int reg)
Find the start of a PCI BAR.
Definition pci.c:97
PCI bus.
#define __pci_driver
Declare a PCI driver.
Definition pci.h:278
static void pci_set_drvdata(struct pci_device *pci, void *priv)
Set PCI driver-private data.
Definition pci.h:366
#define PCI_ROM(_vendor, _device, _name, _description, _data)
Definition pci.h:308
static void * pci_get_drvdata(struct pci_device *pci)
Get PCI driver-private data.
Definition pci.h:376
static void(* free)(struct refcnt *refcnt))
Definition refcnt.h:55
char * strerror(int errno)
Retrieve string representation of error number.
Definition strerror.c:79
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
Definition string.c:115
A Xen HVM device.
Definition hvm.h:40
uint32_t cpuid_base
CPUID base.
Definition hvm.h:46
unsigned long mmio
MMIO base address.
Definition hvm.h:50
size_t hypercall_len
Length of hypercall table.
Definition hvm.h:48
struct xen_hypervisor xen
Xen hypervisor.
Definition hvm.h:42
size_t mmio_len
Length of MMIO address space.
Definition hvm.h:54
size_t mmio_offset
Current offset within MMIO address space.
Definition hvm.h:52
struct pci_device * pci
PCI device.
Definition hvm.h:44
A PCI device ID list entry.
Definition pci.h:175
A PCI device.
Definition pci.h:211
struct device dev
Generic device.
Definition pci.h:213
A PCI driver.
Definition pci.h:252
int(* probe)(struct pci_device *pci)
Probe device.
Definition pci.h:265
uint32_t wc_sec
Definition xen.h:794
size_t len
Total grant table length.
Definition xen.h:33
struct grant_entry_v1 * table
Grant table entries.
Definition xen.h:31
struct shared_info * shared
Shared info page.
Definition xen.h:55
struct xen_hypercall * hypercall
Hypercall table.
Definition xen.h:53
struct xen_grant grant
Grant table.
Definition xen.h:57
struct xen_store store
XenStore.
Definition xen.h:59
struct xenstore_domain_interface * intf
XenStore domain interface.
Definition xen.h:45
evtchn_port_t port
Event channel.
Definition xen.h:47
#define readl
Definition w89c840.c:157
#define HVM_PARAM_STORE_EVTCHN
Definition params.h:81
#define HVM_PARAM_STORE_PFN
Definition params.h:80
char xen_extraversion_t[16]
Definition version.h:31
void xenbus_remove(struct xen_hypervisor *xen __unused, struct device *parent)
Remove Xen bus.
Definition xenbus.c:392
int xenbus_probe(struct xen_hypervisor *xen, struct device *parent)
Probe Xen bus.
Definition xenbus.c:355
int xengrant_init(struct xen_hypervisor *xen)
Initialise grant table.
Definition xengrant.c:71
Xen grant tables.
Xen memory operations.
static struct xen_remove_from_physmap * remove
Definition xenmem.h:40
static struct xen_add_to_physmap * add
Definition xenmem.h:25
int xenstore_read(struct xen_hypervisor *xen, char **value,...)
Read XenStore value.
Definition xenstore.c:372
XenStore interface.
Xen version.
static xen_extraversion_t * extraversion
Definition xenver.h:38