[PATCH v6 15/24] KVM: arm64: Support unaligned fixmap in the pKVM hyp

Vincent Donnefort posted 24 patches 1 month, 1 week ago
There is a newer version of this series
[PATCH v6 15/24] KVM: arm64: Support unaligned fixmap in the pKVM hyp
Posted by Vincent Donnefort 1 month, 1 week ago
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.

Signed-off-by: Vincent Donnefort <vdonnefort@google.com>

diff --git a/arch/arm64/kvm/hyp/nvhe/mm.c b/arch/arm64/kvm/hyp/nvhe/mm.c
index ae8391baebc3..75014dc7d82e 100644
--- a/arch/arm64/kvm/hyp/nvhe/mm.c
+++ b/arch/arm64/kvm/hyp/nvhe/mm.c
@@ -239,7 +239,7 @@ static void *fixmap_map_slot(struct hyp_fixmap_slot *slot, phys_addr_t phys)
 	WRITE_ONCE(*ptep, pte);
 	dsb(ishst);
 
-	return (void *)slot->addr;
+	return (void *)slot->addr + offset_in_page(phys);
 }
 
 void *hyp_fixmap_map(phys_addr_t phys)
-- 
2.51.0.rc2.233.g662b1ed5c5-goog
Re: [PATCH v6 15/24] KVM: arm64: Support unaligned fixmap in the pKVM hyp
Posted by Steven Rostedt 3 weeks, 2 days ago
Would be nice if the arm KVM folks could review the second part of this
patch series.

Vincent, I finished my review, and you can post a new version. But it would
still be good to get some input from the architecture folks.

-- Steve


On Thu, 21 Aug 2025 09:14:03 +0100
Vincent Donnefort <vdonnefort@google.com> wrote:

> 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.
> 
> Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
> 
> diff --git a/arch/arm64/kvm/hyp/nvhe/mm.c b/arch/arm64/kvm/hyp/nvhe/mm.c
> index ae8391baebc3..75014dc7d82e 100644
> --- a/arch/arm64/kvm/hyp/nvhe/mm.c
> +++ b/arch/arm64/kvm/hyp/nvhe/mm.c
> @@ -239,7 +239,7 @@ static void *fixmap_map_slot(struct hyp_fixmap_slot *slot, phys_addr_t phys)
>  	WRITE_ONCE(*ptep, pte);
>  	dsb(ishst);
>  
> -	return (void *)slot->addr;
> +	return (void *)slot->addr + offset_in_page(phys);
>  }
>  
>  void *hyp_fixmap_map(phys_addr_t phys)
Re: [PATCH v6 15/24] KVM: arm64: Support unaligned fixmap in the pKVM hyp
Posted by Vincent Donnefort 3 weeks, 2 days ago
On Wed, Sep 10, 2025 at 12:47:42PM -0400, Steven Rostedt wrote:
> 
> Would be nice if the arm KVM folks could review the second part of this
> patch series.
> 
> Vincent, I finished my review, and you can post a new version. But it would
> still be good to get some input from the architecture folks.

Thanks a lot for your time!