diff options
author | Tony Lindgren <tony@atomide.com> | 2021-03-08 11:34:12 +0200 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2021-03-08 11:34:12 +0200 |
commit | 4c9f4865f4604744d4f1a43db22ac6ec9dc8e587 (patch) | |
tree | 46abf93c9b90b880464772ce7d23309ee3616b91 /arch/arm64/include/asm/trans_pgd.h | |
parent | effe89e40037038db7711bdab5d3401fe297d72c (diff) | |
parent | 77335a040178a0456d4eabc8bf17a7ca3ee4a327 (diff) | |
download | linux-4c9f4865f4604744d4f1a43db22ac6ec9dc8e587.tar.gz |
Merge branch 'fixes-rc2' into fixes
Diffstat (limited to 'arch/arm64/include/asm/trans_pgd.h')
-rw-r--r-- | arch/arm64/include/asm/trans_pgd.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/trans_pgd.h b/arch/arm64/include/asm/trans_pgd.h new file mode 100644 index 000000000000..5d08e5adf3d5 --- /dev/null +++ b/arch/arm64/include/asm/trans_pgd.h @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +/* + * Copyright (c) 2020, Microsoft Corporation. + * Pavel Tatashin <pasha.tatashin@soleen.com> + */ + +#ifndef _ASM_TRANS_TABLE_H +#define _ASM_TRANS_TABLE_H + +#include <linux/bits.h> +#include <linux/types.h> +#include <asm/pgtable-types.h> + +/* + * trans_alloc_page + * - Allocator that should return exactly one zeroed page, if this + * allocator fails, trans_pgd_create_copy() and trans_pgd_map_page() + * return -ENOMEM error. + * + * trans_alloc_arg + * - Passed to trans_alloc_page as an argument + */ + +struct trans_pgd_info { + void * (*trans_alloc_page)(void *arg); + void *trans_alloc_arg; +}; + +int trans_pgd_create_copy(struct trans_pgd_info *info, pgd_t **trans_pgd, + unsigned long start, unsigned long end); + +int trans_pgd_map_page(struct trans_pgd_info *info, pgd_t *trans_pgd, + void *page, unsigned long dst_addr, pgprot_t pgprot); + +int trans_pgd_idmap_page(struct trans_pgd_info *info, phys_addr_t *trans_ttbr0, + unsigned long *t0sz, void *page); + +#endif /* _ASM_TRANS_TABLE_H */ |