[PATCH] KVM: arm64: Update comment of create_hyp_mappings

Wei-Lin Chang r09922117 at csie.ntu.edu.tw
Wed Nov 2 22:32:28 PDT 2022


HYP_PAGE_OFFSET is removed since 4.8, and the method for generating Hyp
VAs has evolved. Update the functional description of
create_hyp_mappings accordingly.

Signed-off-by: Wei-Lin Chang <r09922117 at csie.ntu.edu.tw>
---
 arch/arm64/kvm/mmu.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
index c9a13e487..a9ae4a3f9 100644
--- a/arch/arm64/kvm/mmu.c
+++ b/arch/arm64/kvm/mmu.c
@@ -424,9 +424,10 @@ void kvm_unshare_hyp(void *from, void *to)
  * @to:		The virtual kernel end address of the range (exclusive)
  * @prot:	The protection to be applied to this range
  *
- * The same virtual address as the kernel virtual address is also used
- * in Hyp-mode mapping (modulo HYP_PAGE_OFFSET) to the same underlying
- * physical pages.
+ * The Hyp virtual address is generated by masking the kernel VA with
+ * va_mask then inserting tag_val for the higher bits starting from
+ * tag_lsb. See kvm_compute_layout() in va_layout.c for more info.
+ * Both Hyp VA and kernel VA ranges map to the same underlying physical pages.
  */
 int create_hyp_mappings(void *from, void *to, enum kvm_pgtable_prot prot)
 {
-- 
2.34.1




More information about the linux-arm-kernel mailing list