On Wed, Jan 25, 2017 at 8:22 AM, Christoffer Dall <
[email protected]> 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/
_______________________________________________
kvmarm mailing list
[email protected]
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

Reply via email to