lguest.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 <asm/irq.h>
  7. #include <asm/lguest_hcall.h>
  8. #define LG_CLOCK_MIN_DELTA 100UL
  9. #define LG_CLOCK_MAX_DELTA ULONG_MAX
  10. /*G:032 The second method of communicating with the Host is to via "struct
  11. * lguest_data". The Guest's very first hypercall is to tell the Host where
  12. * this is, and then the Guest and Host both publish information in it. :*/
  13. struct lguest_data
  14. {
  15. /* 512 == enabled (same as eflags in normal hardware). The Guest
  16. * changes interrupts so often that a hypercall is too slow. */
  17. unsigned int irq_enabled;
  18. /* Fine-grained interrupt disabling by the Guest */
  19. DECLARE_BITMAP(blocked_interrupts, LGUEST_IRQS);
  20. /* The Host writes the virtual address of the last page fault here,
  21. * which saves the Guest a hypercall. CR2 is the native register where
  22. * this address would normally be found. */
  23. unsigned long cr2;
  24. /* Wallclock time set by the Host. */
  25. struct timespec time;
  26. /* Async hypercall ring. Instead of directly making hypercalls, we can
  27. * place them in here for processing the next time the Host wants.
  28. * This batching can be quite efficient. */
  29. /* 0xFF == done (set by Host), 0 == pending (set by Guest). */
  30. u8 hcall_status[LHCALL_RING_SIZE];
  31. /* The actual registers for the hypercalls. */
  32. struct hcall_ring hcalls[LHCALL_RING_SIZE];
  33. /* Fields initialized by the Host at boot: */
  34. /* Memory not to try to access */
  35. unsigned long reserve_mem;
  36. /* ID of this Guest (used by network driver to set ethernet address) */
  37. u16 guestid;
  38. /* KHz for the TSC clock. */
  39. u32 tsc_khz;
  40. /* Fields initialized by the Guest at boot: */
  41. /* Instruction range to suppress interrupts even if enabled */
  42. unsigned long noirq_start, noirq_end;
  43. };
  44. extern struct lguest_data lguest_data;
  45. #endif /* __ASSEMBLY__ */
  46. #endif /* _LINUX_LGUEST_H */