monva_common.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * Linux 2.6.32 and later Kernel module for VMware MVP Hypervisor Support
  3. *
  4. * Copyright (C) 2010-2013 VMware, Inc. All rights reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License version 2 as published by
  8. * the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along with
  16. * this program; see the file COPYING. If not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18. */
  19. #line 5
  20. /**
  21. * @file
  22. *
  23. * @brief Constant definitions that describing the monitor memory layout
  24. * (common to both LPV and VE monitors).
  25. *
  26. */
  27. #ifndef _MONVA_COMMON_H_
  28. #define _MONVA_COMMON_H_
  29. #define INCLUDE_ALLOW_MVPD
  30. #define INCLUDE_ALLOW_VMX
  31. #define INCLUDE_ALLOW_MODULE
  32. #define INCLUDE_ALLOW_MONITOR
  33. #define INCLUDE_ALLOW_HOSTUSER
  34. #define INCLUDE_ALLOW_GUESTUSER
  35. #define INCLUDE_ALLOW_GPL
  36. #include "include_check.h"
  37. #include "mmu_defs.h"
  38. #include "mmu_types.h"
  39. /*
  40. * The monitor occupies a hole in the guest virtual address space.
  41. * The following macros define that hole.
  42. */
  43. #define MONITOR_VA_START ((MVA)0xE8000000)
  44. #define MONITOR_VA_LEN 0x03000000
  45. /*
  46. * Worldswitch page gets mapped right after the stack guard.
  47. */
  48. #define MONITOR_VA_WORLDSWITCH \
  49. ((MVA)(MONITOR_VA_START + 3 * PAGE_SIZE))
  50. #define MONITOR_VA_WORLDSWITCH_CODE \
  51. (MONITOR_VA_WORLDSWITCH + PAGE_SIZE)
  52. #define MONITOR_VA_UART \
  53. (MONITOR_VA_WORLDSWITCH_CODE + PAGE_SIZE)
  54. /**
  55. * @brief Type of physmem region mapping that we want the VMX to know about.
  56. * Helps to identify Guest page allocations.
  57. */
  58. typedef enum {
  59. MEMREGION_MAINMEM = 1,
  60. MEMREGION_MODULE = 2,
  61. MEMREGION_WSP = 3,
  62. MEMREGION_MONITOR_MISC = 4,
  63. MEMREGION_DEFAULT = 0
  64. } PACKED PhysMem_RegionType;
  65. typedef struct MonVA { /* Note that this struct is VE only */
  66. MA l2BaseMA; /**< MA of monitor L2 page table page */
  67. MVA excVec; /**< Monitor exception vector virtual address */
  68. } MonVA;
  69. /**
  70. * @brief Monitor VA mapping type, device or memory.
  71. *
  72. * These values are used to index HMAIR0 in the VE monitor - do not change
  73. * without making the required update to HMAIR0.
  74. */
  75. typedef enum {
  76. MVA_MEMORY = 0,
  77. MVA_DEVICE = 1
  78. } MVAType;
  79. /**
  80. * @name Monitor types, used in VMX, Mvpkm and monitors.
  81. *
  82. * This is not a C enumeration, as we may want to use the values in CPP macros.
  83. *
  84. * @{
  85. */
  86. #define MONITOR_TYPE_LPV 0
  87. #define MONITOR_TYPE_VE 1
  88. #define MONITOR_TYPE_UNKNOWN 0xf
  89. typedef uint32 MonitorType;
  90. /*@}*/
  91. #endif