]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Provide the host_stage2_try() helper macro
authorQuentin Perret <qperret@google.com>
Mon, 9 Aug 2021 15:24:30 +0000 (16:24 +0100)
committerMarc Zyngier <maz@kernel.org>
Wed, 11 Aug 2021 10:39:36 +0000 (11:39 +0100)
commitd83d6aea27692c0bbea8edb72303ab361cc90e48
tree71f0adecb43a6ab075b8d0f7d145b2aed988bdbd
parent07c3654e7a8ca85cbe4e0e6ece3a9b28ff3acdb4
KVM: arm64: Provide the host_stage2_try() helper macro

We currently unmap all MMIO mappings from the host stage-2 to recycle
the pages whenever we run out. In order to make this pattern easy to
re-use from other places, factor the logic out into a dedicated macro.
While at it, apply the macro for the kvm_pgtable_stage2_set_owner()
calls. They're currently only called early on and are guaranteed to
succeed, but making them robust to the -ENOMEM case doesn't hurt and
will avoid painful debugging sessions later on.

Reviewed-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210809152448.1810400-4-qperret@google.com
arch/arm64/kvm/hyp/nvhe/mem_protect.c