KVM: arm64: Properly return allocated EL2 VA from hyp_alloc_private_va_range()
Marc Zyngier
maintainerPATCH 1/1 KVM: arm64: Properly return allocated EL2 VA from hyp_alloc_private_va_range()
Marek reports that his RPi4 spits out a warning at boot time, right at the point where the GICv2 virtual CPU interface gets mapped.
Upon investigation, it seems that we never return the allocated VA and use whatever was on the stack at this point. Yes, this is good stuff, and Marek was pretty lucky that he ended-up with a VA that intersected with something that was already mapped.
On my setup, this random value is plausible enough for the mapping to take place. Who knows what happens...
--- arch/arm64/kvm/mmu.c | 3 +++ 1 file changed, 3 insertions(+)
arch/arm64/kvm/mmu.c +3 -0
@@ -652,6 +652,9 @@ int hyp_alloc_private_va_range(size_t size, unsigned long *haddr)mutex_unlock (&kvm_hyp_pgd_mutex); +if (!ret) + *haddr = base; +return ret; }
Signature · 1 line
2.34.1
Hi Marc,
Quoted 9 lines · Marc Zyngier
Marek reports that his RPi4 spits out a warning at boot time, right at the point where the GICv2 virtual CPU interface gets mapped.
Upon investigation, it seems that we never return the allocated VA and use whatever was on the stack at this point. Yes, this is good stuff, and Marek was pretty lucky that he ended-up with a VA that intersected with something that was already mapped.
Quoted 5 lines
On my setup, this random value is plausible enough for the mapping to take place. Who knows what happens...
Cc Vincent Donnefort <[email protected]>Fixes f156a7d13fc3 ("KVM: arm64: Remove size-order align in the nVHE hyp private VA range")
I don't see your kvmarm-6.6 merged by Paolo, is it too late to squash and send a new PR? Anyhow:
Regards,
Phil.
Quoted 7 lines
Reported-by Marek Szyprowski <[email protected]>Tested-by Marek Szyprowski <[email protected]>Signed-off-by Marc Zyngier <[email protected]>--- arch/arm64/kvm/mmu.c | 3 +++ 1 file changed, 3 insertions(+)
Marc Zyngier
maintainerHi Philippe,
Quoted 13 lines · Philippe Mathieu-Daudé
Hi Marc,
Quoted 9 lines · Marc Zyngier
Marek reports that his RPi4 spits out a warning at boot time, right at the point where the GICv2 virtual CPU interface gets mapped.
Upon investigation, it seems that we never return the allocated VA and use whatever was on the stack at this point. Yes, this is good stuff, and Marek was pretty lucky that he ended-up with a VA that intersected with something that was already mapped.
Quoted 8 lines
Quoted 5 lines
On my setup, this random value is plausible enough for the mapping to take place. Who knows what happens...
Cc Vincent Donnefort <[email protected]>Fixes f156a7d13fc3 ("KVM: arm64: Remove size-order align in the nVHE hyp private VA range")I don't see your kvmarm-6.6 merged by Paolo, is it too late to squash and send a new PR?
In general, I keep the commits that are in -next stable (no squashing, no rebasing), and only the merge commits that drag these commits onto -next are throw-away (this allows me to rebuild the whole branch without changing any of the commit SHAs).
So no, I won't send a new PR right now. However, I'll stick the patch in -next and will aim to send Paolo another PR later this week or early next week.
Quoted 3 lines
Anyhow:
Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Thanks!
M.
Signature · 1 line
Without deviation from the norm, progress is not possible.
Quoted 26 lines · Marc Zyngier
Hi Philippe,
Quoted 13 lines · Philippe Mathieu-Daudé
Hi Marc,
Quoted 9 lines · Marc Zyngier
Marek reports that his RPi4 spits out a warning at boot time, right at the point where the GICv2 virtual CPU interface gets mapped.
Upon investigation, it seems that we never return the allocated VA and use whatever was on the stack at this point. Yes, this is good stuff, and Marek was pretty lucky that he ended-up with a VA that intersected with something that was already mapped.
Quoted 8 lines
Quoted 5 lines
On my setup, this random value is plausible enough for the mapping to take place. Who knows what happens...
Cc Vincent Donnefort <[email protected]>Fixes f156a7d13fc3 ("KVM: arm64: Remove size-order align in the nVHE hyp private VA range")I don't see your kvmarm-6.6 merged by Paolo, is it too late to squash and send a new PR?
Quoted 8 lines
In general, I keep the commits that are in -next stable (no squashing, no rebasing), and only the merge commits that drag these commits onto -next are throw-away (this allows me to rebuild the whole branch without changing any of the commit SHAs).
So no, I won't send a new PR right now. However, I'll stick the patch in -next and will aim to send Paolo another PR later this week or early next week.
Ah, I didn't know. Thanks for explaining :)
Phil.
Quoted 12 lines · Marc Zyngier
Marek reports that his RPi4 spits out a warning at boot time, right at the point where the GICv2 virtual CPU interface gets mapped.
Upon investigation, it seems that we never return the allocated VA and use whatever was on the stack at this point. Yes, this is good stuff, and Marek was pretty lucky that he ended-up with a VA that intersected with something that was already mapped.
On my setup, this random value is plausible enough for the mapping to take place. Who knows what happens...
Quoted 6 lines
Cc Vincent Donnefort <[email protected]>Fixes f156a7d13fc3 ("KVM: arm64: Remove size-order align in the nVHE hyp private VA range")Reported-by Marek Szyprowski <[email protected]>Tested-by Marek Szyprowski <[email protected]>Signed-off-by Marc Zyngier <[email protected]>
Having a hard time reproducing the issue, but clearly that set is missing from the original patch!
Sorry about that extra work.
Quoted 21 lines
--- arch/arm64/kvm/mmu.c | 3 +++ 1 file changed, 3 insertions(+)arch/arm64/kvm/mmu.c +3
-0@@ -652,6 +652,9 @@ int hyp_alloc_private_va_range(size_t size, unsigned long *haddr)mutex_unlock (&kvm_hyp_pgd_mutex); +if (!ret) + *haddr = base; +return ret; }Signature · 1 line
2.34.1
Vincent Donnefort
Reviewed-byQuoted 20 lines · Vincent Donnefort
Quoted 12 lines · Marc Zyngier
Marek reports that his RPi4 spits out a warning at boot time, right at the point where the GICv2 virtual CPU interface gets mapped.
Upon investigation, it seems that we never return the allocated VA and use whatever was on the stack at this point. Yes, this is good stuff, and Marek was pretty lucky that he ended-up with a VA that intersected with something that was already mapped.
On my setup, this random value is plausible enough for the mapping to take place. Who knows what happens...
Quoted 6 lines
Cc Vincent Donnefort <[email protected]>Fixes f156a7d13fc3 ("KVM: arm64: Remove size-order align in the nVHE hyp private VA range")Reported-by Marek Szyprowski <[email protected]>Tested-by Marek Szyprowski <[email protected]>Signed-off-by Marc Zyngier <[email protected]>
Quoted 4 lines
Having a hard time reproducing the issue, but clearly that set is missing from the original patch!
Sorry about that extra work.
Quoted 22 lines
Quoted 22 lines
--- arch/arm64/kvm/mmu.c | 3 +++ 1 file changed, 3 insertions(+)arch/arm64/kvm/mmu.c +3
-0@@ -652,6 +652,9 @@ int hyp_alloc_private_va_range(size_t size, unsigned long *haddr)mutex_unlock (&kvm_hyp_pgd_mutex); +if (!ret) + *haddr = base; +return ret; }Signature · 1 line
2.34.1