* Booting a kernel to EL1 in Armv8.1
@ 2017-01-24 21:50 Raz
2017-01-25 8:22 ` Christoffer Dall
0 siblings, 1 reply; 3+ messages in thread
From: Raz @ 2017-01-24 21:50 UTC (permalink / raw)
To: kvmarm
[-- Attachment #1.1: Type: text/plain, Size: 472 bytes --]
Hello
I am trying to boot EL1 kernel in a platform based on Armv8.1.
I am using fvp as a hardware.
What I am trying to achieve is to execute some kernel code in
EL2 exception level..
The current VHE patch is booting the kernel into EL2. So I took an older
kernel
and I tried to set TTBR1_EL2 to access kernel memory as if it is TTBR1_EL1
.
It is theoretically possible ?
Setting TTBR1_EL2 to TTBR1_EL1
and enabling mmu thtough sctlr_el2 does not work.
thank you
Raz
[-- Attachment #1.2: Type: text/html, Size: 674 bytes --]
[-- Attachment #2: Type: text/plain, Size: 151 bytes --]
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Booting a kernel to EL1 in Armv8.1
2017-01-24 21:50 Booting a kernel to EL1 in Armv8.1 Raz
@ 2017-01-25 8:22 ` Christoffer Dall
2017-02-14 22:08 ` Raz
0 siblings, 1 reply; 3+ messages in thread
From: Christoffer Dall @ 2017-01-25 8:22 UTC (permalink / raw)
To: Raz; +Cc: kvmarm
On Tue, Jan 24, 2017 at 09:50:04PM +0000, Raz wrote:
> Hello
>
> I am trying to boot EL1 kernel in a platform based on Armv8.1.
> I am using fvp as a hardware.
> What I am trying to achieve is to execute some kernel code in
> EL2 exception level..
When you boot a reasonably recent kernel on VHE, it will execute in EL2,
so all the code you're executing will be at EL2, so I think you've
already achieved what you're trying to do.
>
> The current VHE patch is booting the kernel into EL2. So I took an older
> kernel
> and I tried to set TTBR1_EL2 to access kernel memory as if it is TTBR1_EL1
> .
That won't work unless you set the E2H bit, see the ARMv8.1
documentation.
If you boot a kernel that doesn't have the necessary bits to enable VHE,
then you'll just run as on a non-VHE system with the main kernel running
at EL1 and a stub installed at EL2 which eventually gets replaced by the
KVM hyp lowvisor code in EL2.
>
> It is theoretically possible ?
I'm not sure what you're asking?
> Setting TTBR1_EL2 to TTBR1_EL1
> and enabling mmu thtough sctlr_el2 does not work.
>
Again, not sure what you're trying to do. If you're running in EL1
(because you're old kernel drops you to EL1) then trying to access EL2
registers obviously won't work.
If you run a VHE kernel, it will have already set the _EL2 registers to
the values you want (but it will use _EL1 register access intructions to
do so, and they are transparently rewritten by hardware to program the
corresponding _EL2 registers).
Hope this helps,
-Christoffer
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Booting a kernel to EL1 in Armv8.1
2017-01-25 8:22 ` Christoffer Dall
@ 2017-02-14 22:08 ` Raz
0 siblings, 0 replies; 3+ messages in thread
From: Raz @ 2017-02-14 22:08 UTC (permalink / raw)
To: Christoffer Dall; +Cc: kvmarm
[-- Attachment #1.1: Type: text/plain, Size: 2023 bytes --]
On Wed, Jan 25, 2017 at 8:22 AM, Christoffer Dall <
christoffer.dall@linaro.org> wrote:
> On Tue, Jan 24, 2017 at 09:50:04PM +0000, Raz wrote:
> > Hello
> >
> > I am trying to boot EL1 kernel in a platform based on Armv8.1.
> > I am using fvp as a hardware.
> > What I am trying to achieve is to execute some kernel code in
> > EL2 exception level..
>
> When you boot a reasonably recent kernel on VHE, it will execute in EL2,
> so all the code you're executing will be at EL2, so I think you've
> already achieved what you're trying to do.
>
> >
> > The current VHE patch is booting the kernel into EL2. So I took an older
> > kernel
> > and I tried to set TTBR1_EL2 to access kernel memory as if it is
> TTBR1_EL1
> > .
>
> That won't work unless you set the E2H bit, see the ARMv8.1
> documentation.
>
> If you boot a kernel that doesn't have the necessary bits to enable VHE,
> then you'll just run as on a non-VHE system with the main kernel running
> at EL1 and a stub installed at EL2 which eventually gets replaced by the
> KVM hyp lowvisor code in EL2.
>
> >
> > It is theoretically possible ?
>
> I'm not sure what you're asking?
>
> > Setting TTBR1_EL2 to TTBR1_EL1
> > and enabling mmu thtough sctlr_el2 does not work.
> >
>
> Again, not sure what you're trying to do. If you're running in EL1
> (because you're old kernel drops you to EL1) then trying to access EL2
> registers obviously won't work.
>
> I created my own vector instead of kvm's . I am doing that because I want
to create a sort of secured execution context by using a hypervisor. It is
an academic work.
I managed to do that by the way. I am calling regular kernel code in EL2.
so thank you.
If you run a VHE kernel, it will have already set the _EL2 registers to
> the values you want (but it will use _EL1 register access intructions to
> do so, and they are transparently rewritten by hardware to program the
> corresponding _EL2 registers).
>
> Hope this helps,
> -Christoffer
>
--
https://sites.google.com/site/ironspeedlinux/
[-- Attachment #1.2: Type: text/html, Size: 3018 bytes --]
[-- Attachment #2: Type: text/plain, Size: 151 bytes --]
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-02-14 22:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-24 21:50 Booting a kernel to EL1 in Armv8.1 Raz
2017-01-25 8:22 ` Christoffer Dall
2017-02-14 22:08 ` Raz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.