* [PATCH] KVM: arm64: Move __hyp_set_vectors out of .hyp.text
@ 2021-01-28 17:38 Quentin Perret
2021-01-28 18:11 ` Marc Zyngier
2021-01-28 21:07 ` Will Deacon
0 siblings, 2 replies; 4+ messages in thread
From: Quentin Perret @ 2021-01-28 17:38 UTC (permalink / raw)
To: catalin.marinas, will, maz; +Cc: kernel-team, kvmarm, linux-arm-kernel, qperret
The .hyp.text section is supposed to be reserved for the nVHE EL2 code.
However, there is currently one occurrence of EL1 executing code located
in .hyp.text when calling __hyp_{re}set_vectors(), which happen to sit
next to the EL2 stub vectors. While not a problem yet, such patterns
will cause issues when removing the host kernel from the TCB, so a
cleaner split would be preferable.
Fix this by delimiting the end of the .hyp.text section in hyp-stub.S.
Signed-off-by: Quentin Perret <qperret@google.com>
---
arch/arm64/kernel/hyp-stub.S | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/kernel/hyp-stub.S b/arch/arm64/kernel/hyp-stub.S
index 160f5881a0b7..8a60f9c586bb 100644
--- a/arch/arm64/kernel/hyp-stub.S
+++ b/arch/arm64/kernel/hyp-stub.S
@@ -85,6 +85,8 @@ SYM_CODE_END(\label)
invalid_vector el1_fiq_invalid
invalid_vector el1_error_invalid
+ .popsection
+
/*
* __hyp_set_vectors: Call this after boot to set the initial hypervisor
* vectors as part of hypervisor installation. On an SMP system, this should
--
2.30.0.280.ga3ce27912f-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] KVM: arm64: Move __hyp_set_vectors out of .hyp.text
2021-01-28 17:38 [PATCH] KVM: arm64: Move __hyp_set_vectors out of .hyp.text Quentin Perret
@ 2021-01-28 18:11 ` Marc Zyngier
2021-01-28 20:11 ` Will Deacon
2021-01-28 21:07 ` Will Deacon
1 sibling, 1 reply; 4+ messages in thread
From: Marc Zyngier @ 2021-01-28 18:11 UTC (permalink / raw)
To: Quentin Perret
Cc: catalin.marinas, kernel-team, will, kvmarm, linux-arm-kernel
On 2021-01-28 17:38, Quentin Perret wrote:
> The .hyp.text section is supposed to be reserved for the nVHE EL2 code.
> However, there is currently one occurrence of EL1 executing code
> located
> in .hyp.text when calling __hyp_{re}set_vectors(), which happen to sit
> next to the EL2 stub vectors. While not a problem yet, such patterns
> will cause issues when removing the host kernel from the TCB, so a
> cleaner split would be preferable.
>
> Fix this by delimiting the end of the .hyp.text section in hyp-stub.S.
>
> Signed-off-by: Quentin Perret <qperret@google.com>
> ---
> arch/arm64/kernel/hyp-stub.S | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm64/kernel/hyp-stub.S
> b/arch/arm64/kernel/hyp-stub.S
> index 160f5881a0b7..8a60f9c586bb 100644
> --- a/arch/arm64/kernel/hyp-stub.S
> +++ b/arch/arm64/kernel/hyp-stub.S
> @@ -85,6 +85,8 @@ SYM_CODE_END(\label)
> invalid_vector el1_fiq_invalid
> invalid_vector el1_error_invalid
>
> + .popsection
> +
> /*
> * __hyp_set_vectors: Call this after boot to set the initial
> hypervisor
> * vectors as part of hypervisor installation. On an SMP system, this
> should
Thanks for tracking this one down, Quentin.
Catalin, Will: should you want to take this one via the arm64 tree,
please add my
Acked-by: Marc Zyngier <maz:kernel.org>
Thanks,
M.
--
Jazz is not dead. It just smells funny...
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] KVM: arm64: Move __hyp_set_vectors out of .hyp.text
2021-01-28 18:11 ` Marc Zyngier
@ 2021-01-28 20:11 ` Will Deacon
0 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2021-01-28 20:11 UTC (permalink / raw)
To: Marc Zyngier
Cc: catalin.marinas, kernel-team, kvmarm, linux-arm-kernel, Quentin Perret
On Thu, Jan 28, 2021 at 06:11:52PM +0000, Marc Zyngier wrote:
> On 2021-01-28 17:38, Quentin Perret wrote:
> > The .hyp.text section is supposed to be reserved for the nVHE EL2 code.
> > However, there is currently one occurrence of EL1 executing code located
> > in .hyp.text when calling __hyp_{re}set_vectors(), which happen to sit
> > next to the EL2 stub vectors. While not a problem yet, such patterns
> > will cause issues when removing the host kernel from the TCB, so a
> > cleaner split would be preferable.
> >
> > Fix this by delimiting the end of the .hyp.text section in hyp-stub.S.
> >
> > Signed-off-by: Quentin Perret <qperret@google.com>
> > ---
> > arch/arm64/kernel/hyp-stub.S | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/arch/arm64/kernel/hyp-stub.S b/arch/arm64/kernel/hyp-stub.S
> > index 160f5881a0b7..8a60f9c586bb 100644
> > --- a/arch/arm64/kernel/hyp-stub.S
> > +++ b/arch/arm64/kernel/hyp-stub.S
> > @@ -85,6 +85,8 @@ SYM_CODE_END(\label)
> > invalid_vector el1_fiq_invalid
> > invalid_vector el1_error_invalid
> >
> > + .popsection
> > +
> > /*
> > * __hyp_set_vectors: Call this after boot to set the initial
> > hypervisor
> > * vectors as part of hypervisor installation. On an SMP system, this
> > should
>
> Thanks for tracking this one down, Quentin.
>
> Catalin, Will: should you want to take this one via the arm64 tree,
> please add my
>
> Acked-by: Marc Zyngier <maz:kernel.org>
Cheers, I'll pick this up for 5.12 with your Ack.
Will
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] KVM: arm64: Move __hyp_set_vectors out of .hyp.text
2021-01-28 17:38 [PATCH] KVM: arm64: Move __hyp_set_vectors out of .hyp.text Quentin Perret
2021-01-28 18:11 ` Marc Zyngier
@ 2021-01-28 21:07 ` Will Deacon
1 sibling, 0 replies; 4+ messages in thread
From: Will Deacon @ 2021-01-28 21:07 UTC (permalink / raw)
To: Quentin Perret, catalin.marinas, maz
Cc: Will Deacon, kernel-team, kvmarm, linux-arm-kernel
On Thu, 28 Jan 2021 17:38:50 +0000, Quentin Perret wrote:
> The .hyp.text section is supposed to be reserved for the nVHE EL2 code.
> However, there is currently one occurrence of EL1 executing code located
> in .hyp.text when calling __hyp_{re}set_vectors(), which happen to sit
> next to the EL2 stub vectors. While not a problem yet, such patterns
> will cause issues when removing the host kernel from the TCB, so a
> cleaner split would be preferable.
>
> [...]
Applied to arm64 (for-next/misc), thanks!
[1/1] KVM: arm64: Move __hyp_set_vectors out of .hyp.text
https://git.kernel.org/arm64/c/e30be1455bd3
Cheers,
--
Will
https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-01-28 21:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-28 17:38 [PATCH] KVM: arm64: Move __hyp_set_vectors out of .hyp.text Quentin Perret
2021-01-28 18:11 ` Marc Zyngier
2021-01-28 20:11 ` Will Deacon
2021-01-28 21:07 ` Will Deacon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).