lguest.h 2.1 KB
Newer Older
R
Rusty Russell 已提交
1 2
/* Things the lguest guest needs to know.  Note: like all lguest interfaces,
 * this is subject to wild and random change between versions. */
3 4
#ifndef _LINUX_LGUEST_H
#define _LINUX_LGUEST_H
R
Rusty Russell 已提交
5 6

#ifndef __ASSEMBLY__
7
#include <linux/time.h>
R
Rusty Russell 已提交
8
#include <asm/irq.h>
9
#include <asm/lguest_hcall.h>
R
Rusty Russell 已提交
10

R
Rusty Russell 已提交
11 12 13
#define LG_CLOCK_MIN_DELTA	100UL
#define LG_CLOCK_MAX_DELTA	ULONG_MAX

R
Rusty Russell 已提交
14
/*G:032 The second method of communicating with the Host is to via "struct
R
Rusty Russell 已提交
15 16
 * lguest_data".  Once the Guest's initialization hypercall tells the Host where
 * this is, the Guest and Host both publish information in it. :*/
R
Rusty Russell 已提交
17 18
struct lguest_data
{
R
Rusty Russell 已提交
19 20
	/* 512 == enabled (same as eflags in normal hardware).  The Guest
	 * changes interrupts so often that a hypercall is too slow. */
R
Rusty Russell 已提交
21
	unsigned int irq_enabled;
R
Rusty Russell 已提交
22
	/* Fine-grained interrupt disabling by the Guest */
R
Rusty Russell 已提交
23 24
	DECLARE_BITMAP(blocked_interrupts, LGUEST_IRQS);

R
Rusty Russell 已提交
25 26 27
	/* The Host writes the virtual address of the last page fault here,
	 * which saves the Guest a hypercall.  CR2 is the native register where
	 * this address would normally be found. */
R
Rusty Russell 已提交
28 29
	unsigned long cr2;

30 31 32
	/* Wallclock time set by the Host. */
	struct timespec time;

R
Rusty Russell 已提交
33 34 35 36 37
	/* Async hypercall ring.  Instead of directly making hypercalls, we can
	 * place them in here for processing the next time the Host wants.
	 * This batching can be quite efficient. */

	/* 0xFF == done (set by Host), 0 == pending (set by Guest). */
R
Rusty Russell 已提交
38
	u8 hcall_status[LHCALL_RING_SIZE];
R
Rusty Russell 已提交
39
	/* The actual registers for the hypercalls. */
J
Jes Sorensen 已提交
40
	struct hcall_args hcalls[LHCALL_RING_SIZE];
R
Rusty Russell 已提交
41

R
Rusty Russell 已提交
42
/* Fields initialized by the Host at boot: */
R
Rusty Russell 已提交
43 44
	/* Memory not to try to access */
	unsigned long reserve_mem;
R
Rusty Russell 已提交
45 46
	/* KHz for the TSC clock. */
	u32 tsc_khz;
47 48
	/* Page where the top-level pagetable is */
	unsigned long pgdir;
R
Rusty Russell 已提交
49

R
Rusty Russell 已提交
50
/* Fields initialized by the Guest at boot: */
R
Rusty Russell 已提交
51 52
	/* Instruction range to suppress interrupts even if enabled */
	unsigned long noirq_start, noirq_end;
53 54
	/* Address above which page tables are all identical. */
	unsigned long kernel_address;
55 56
	/* The vector to try to use for system calls (0x40 or 0x80). */
	unsigned int syscall_vec;
R
Rusty Russell 已提交
57 58 59
};
extern struct lguest_data lguest_data;
#endif /* __ASSEMBLY__ */
60
#endif	/* _LINUX_LGUEST_H */