idmap_crosvm.S 800 B

12345678910111213141516171819202122232425
  1. .set .L_TT_TYPE_BLOCK, 0x1
  2. .set .L_TT_TYPE_PAGE, 0x3
  3. .set .L_TT_TYPE_TABLE, 0x3
  4. /* Access flag. */
  5. .set .L_TT_AF, 0x1 << 10
  6. /* Not global. */
  7. .set .L_TT_NG, 0x1 << 11
  8. .set .L_TT_XN, 0x3 << 53
  9. .set .L_TT_MT_DEV, 0x0 << 2 // MAIR #0 (DEV_nGnRE)
  10. .set .L_TT_MT_MEM, (0x1 << 2) | (0x3 << 8) // MAIR #1 (MEM_WBWA), inner shareable
  11. .set .L_BLOCK_DEV, .L_TT_TYPE_BLOCK | .L_TT_MT_DEV | .L_TT_AF | .L_TT_XN
  12. .set .L_BLOCK_MEM, .L_TT_TYPE_BLOCK | .L_TT_MT_MEM | .L_TT_AF | .L_TT_NG
  13. .section ".rodata.idmap", "a", %progbits
  14. .global idmap
  15. .align 12
  16. idmap:
  17. /* level 1 */
  18. .quad .L_BLOCK_DEV | 0x0 // 1 GiB of device mappings
  19. .quad .L_BLOCK_DEV | 0x40000000 // Another 1 GiB of device mappings
  20. .quad .L_BLOCK_MEM | 0x80000000 // 1 GiB of DRAM
  21. .fill 509, 8, 0x0 // 509 GiB of unmapped VA space