lguest.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* Things the lguest guest needs to know. Note: like all lguest interfaces,
  2. * this is subject to wild and random change between versions. */
  3. #ifndef _LINUX_LGUEST_H
  4. #define _LINUX_LGUEST_H
  5. #ifndef __ASSEMBLY__
  6. #include <linux/time.h>
  7. #include <asm/irq.h>
  8. #include <asm/lguest_hcall.h>
  9. #define LG_CLOCK_MIN_DELTA 100UL
  10. #define LG_CLOCK_MAX_DELTA ULONG_MAX
  11. /*G:032 The second method of communicating with the Host is to via "struct
  12. * lguest_data". The Guest's very first hypercall is to tell the Host where
  13. * this is, and then the Guest and Host both publish information in it. :*/
  14. struct lguest_data
  15. {
  16. /* 512 == enabled (same as eflags in normal hardware). The Guest
  17. * changes interrupts so often that a hypercall is too slow. */
  18. unsigned int irq_enabled;
  19. /* Fine-grained interrupt disabling by the Guest */
  20. DECLARE_BITMAP(blocked_interrupts, LGUEST_IRQS);
  21. /* The Host writes the virtual address of the last page fault here,
  22. * which saves the Guest a hypercall. CR2 is the native register where
  23. * this address would normally be found. */
  24. unsigned long cr2;
  25. /* Wallclock time set by the Host. */
  26. struct timespec time;
  27. /* Async hypercall ring. Instead of directly making hypercalls, we can
  28. * place them in here for processing the next time the Host wants.
  29. * This batching can be quite efficient. */
  30. /* 0xFF == done (set by Host), 0 == pending (set by Guest). */
  31. u8 hcall_status[LHCALL_RING_SIZE];
  32. /* The actual registers for the hypercalls. */
  33. struct hcall_args hcalls[LHCALL_RING_SIZE];
  34. /* Fields initialized by the Host at boot: */
  35. /* Memory not to try to access */
  36. unsigned long reserve_mem;
  37. /* KHz for the TSC clock. */
  38. u32 tsc_khz;
  39. /* Page where the top-level pagetable is */
  40. unsigned long pgdir;
  41. /* Fields initialized by the Guest at boot: */
  42. /* Instruction range to suppress interrupts even if enabled */
  43. unsigned long noirq_start, noirq_end;
  44. /* Address above which page tables are all identical. */
  45. unsigned long kernel_address;
  46. /* The vector to try to use for system calls (0x40 or 0x80). */
  47. unsigned int syscall_vec;
  48. };
  49. extern struct lguest_data lguest_data;
  50. #endif /* __ASSEMBLY__ */
  51. #endif /* _LINUX_LGUEST_H */