lpar_map.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * Copyright (C) 2001 Mike Corrigan IBM Corporation
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. */
  18. #ifndef _ASM_POWERPC_ISERIES_LPAR_MAP_H
  19. #define _ASM_POWERPC_ISERIES_LPAR_MAP_H
  20. #ifndef __ASSEMBLY__
  21. #include <asm/types.h>
  22. /*
  23. * The iSeries hypervisor will set up mapping for one or more
  24. * ESID/VSID pairs (in SLB/segment registers) and will set up
  25. * mappings of one or more ranges of pages to VAs.
  26. * We will have the hypervisor set up the ESID->VSID mapping
  27. * for the four kernel segments (C-F). With shared processors,
  28. * the hypervisor will clear all segment registers and reload
  29. * these four whenever the processor is switched from one
  30. * partition to another.
  31. */
  32. /* The Vsid and Esid identified below will be used by the hypervisor
  33. * to set up a memory mapping for part of the load area before giving
  34. * control to the Linux kernel. The load area is 64 MB, but this must
  35. * not attempt to map the whole load area. The Hashed Page Table may
  36. * need to be located within the load area (if the total partition size
  37. * is 64 MB), but cannot be mapped. Typically, this should specify
  38. * to map half (32 MB) of the load area.
  39. *
  40. * The hypervisor will set up page table entries for the number of
  41. * pages specified.
  42. *
  43. * In 32-bit mode, the hypervisor will load all four of the
  44. * segment registers (identified by the low-order four bits of the
  45. * Esid field. In 64-bit mode, the hypervisor will load one SLB
  46. * entry to map the Esid to the Vsid.
  47. */
  48. #define HvEsidsToMap 2
  49. #define HvRangesToMap 1
  50. /* Hypervisor initially maps 32MB of the load area */
  51. #define HvPagesToMap 8192
  52. struct LparMap {
  53. u64 xNumberEsids; // Number of ESID/VSID pairs
  54. u64 xNumberRanges; // Number of VA ranges to map
  55. u64 xSegmentTableOffs; // Page number within load area of seg table
  56. u64 xRsvd[5];
  57. struct {
  58. u64 xKernelEsid; // Esid used to map kernel load
  59. u64 xKernelVsid; // Vsid used to map kernel load
  60. } xEsids[HvEsidsToMap];
  61. struct {
  62. u64 xPages; // Number of pages to be mapped
  63. u64 xOffset; // Offset from start of load area
  64. u64 xVPN; // Virtual Page Number
  65. } xRanges[HvRangesToMap];
  66. };
  67. extern const struct LparMap xLparMap;
  68. #endif /* __ASSEMBLY__ */
  69. /* the fixed address where the LparMap exists */
  70. #define LPARMAP_PHYS 0x7000
  71. #endif /* _ASM_POWERPC_ISERIES_LPAR_MAP_H */