summaryrefslogtreecommitdiff
path: root/arch/arm64/kvm/hyp/reserved_mem.c
diff options
context:
space:
mode:
authorQuentin Perret <qperret@google.com>2021-06-08 11:45:15 +0000
committerMarc Zyngier <maz@kernel.org>2021-06-11 13:24:11 +0100
commit7c350ea39e53ade33ca7be00b0947f2b9f53dda0 (patch)
tree87c5680e7761a070606843e4e7fbfeb678189f22 /arch/arm64/kvm/hyp/reserved_mem.c
parent914cde58a03cc5eef858db34687433e17d0e44be (diff)
KVM: arm64: Unify MMIO and mem host stage-2 pools
We currently maintain two separate memory pools for the host stage-2, one for pages used in the page-table when mapping memory regions, and the other to map MMIO regions. The former is large enough to map all of memory with page granularity and the latter can cover an arbitrary portion of IPA space, but allows to 'recycle' pages. However, this split makes accounting difficult to manage as pages at intermediate levels of the page-table may be used to map both memory and MMIO regions. Simplify the scheme by merging both pools into one. This means we can now hit the -ENOMEM case in the memory abort path, but we're still guaranteed forward-progress in the worst case by unmapping MMIO regions. On the plus side this also means we can usually map a lot more MMIO space at once if memory ranges happen to be mapped with block mappings. Signed-off-by: Quentin Perret <qperret@google.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20210608114518.748712-5-qperret@google.com
Diffstat (limited to 'arch/arm64/kvm/hyp/reserved_mem.c')
-rw-r--r--arch/arm64/kvm/hyp/reserved_mem.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/arm64/kvm/hyp/reserved_mem.c b/arch/arm64/kvm/hyp/reserved_mem.c
index 83ca23ac259b..d654921dd09b 100644
--- a/arch/arm64/kvm/hyp/reserved_mem.c
+++ b/arch/arm64/kvm/hyp/reserved_mem.c
@@ -71,8 +71,7 @@ void __init kvm_hyp_reserve(void)
}
hyp_mem_pages += hyp_s1_pgtable_pages();
- hyp_mem_pages += host_s2_mem_pgtable_pages();
- hyp_mem_pages += host_s2_dev_pgtable_pages();
+ hyp_mem_pages += host_s2_pgtable_pages();
/*
* The hyp_vmemmap needs to be backed by pages, but these pages