trans_pgd.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2021, Microsoft Corporation.
  4. * Pasha Tatashin <[email protected]>
  5. */
  6. #ifndef _ASM_TRANS_TABLE_H
  7. #define _ASM_TRANS_TABLE_H
  8. #include <linux/bits.h>
  9. #include <linux/types.h>
  10. #include <asm/pgtable-types.h>
  11. /*
  12. * trans_alloc_page
  13. * - Allocator that should return exactly one zeroed page, if this
  14. * allocator fails, trans_pgd_create_copy() and trans_pgd_idmap_page()
  15. * return -ENOMEM error.
  16. *
  17. * trans_alloc_arg
  18. * - Passed to trans_alloc_page as an argument
  19. */
  20. struct trans_pgd_info {
  21. void * (*trans_alloc_page)(void *arg);
  22. void *trans_alloc_arg;
  23. };
  24. int trans_pgd_create_copy(struct trans_pgd_info *info, pgd_t **trans_pgd,
  25. unsigned long start, unsigned long end);
  26. int trans_pgd_idmap_page(struct trans_pgd_info *info, phys_addr_t *trans_ttbr0,
  27. unsigned long *t0sz, void *page);
  28. int trans_pgd_copy_el2_vectors(struct trans_pgd_info *info,
  29. phys_addr_t *el2_vectors);
  30. extern char trans_pgd_stub_vectors[];
  31. #endif /* _ASM_TRANS_TABLE_H */