Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: arm64: Support unaligned fixmap in the pKVM hyp

Return the fixmap VA with the page offset, instead of the page base
address. This allows to use hyp_fixmap_map() seamlessly regardless of
the address alignment. While at it, do the same for hyp_fixblock_map().

Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Link: https://patch.msgid.link/20260309162516.2623589-23-vdonnefort@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>

authored by

Vincent Donnefort and committed by
Marc Zyngier
4cdf8dec 8bbeb4d1

+2 -2
+2 -2
arch/arm64/kvm/hyp/nvhe/mm.c
··· 244 244 245 245 void *hyp_fixmap_map(phys_addr_t phys) 246 246 { 247 - return fixmap_map_slot(this_cpu_ptr(&fixmap_slots), phys); 247 + return fixmap_map_slot(this_cpu_ptr(&fixmap_slots), phys) + offset_in_page(phys); 248 248 } 249 249 250 250 static void fixmap_clear_slot(struct hyp_fixmap_slot *slot) ··· 366 366 #ifdef HAS_FIXBLOCK 367 367 *size = PMD_SIZE; 368 368 hyp_spin_lock(&hyp_fixblock_lock); 369 - return fixmap_map_slot(&hyp_fixblock_slot, phys); 369 + return fixmap_map_slot(&hyp_fixblock_slot, phys) + offset_in_page(phys); 370 370 #else 371 371 *size = PAGE_SIZE; 372 372 return hyp_fixmap_map(phys);