Quantcast
Channel: Active questions tagged hypervisor - Stack Overflow
Viewing all articles
Browse latest Browse all 248

Enter Hypervisor Mode on ARMv7 through Kernel Module

$
0
0

I am working on a project where I have a router with ARMv7 processor (Cortex A15) and OpenWRT OS. I have a shell on the router and can load kernel modules with insmod.

My goal is to write a kernel module in C which changes the HVBAR register and then executes the hvc instruction to get the processor in the hyp mode.This is a scientific project where I want to check if I can place my own hypervisor on a running system. But before I start to write my own hypervisor I want to check if and how I can bring the processor in the hyp mode.

According to this picture take from armv7-a manual B.9.3.4 the system must be in insecure mode, not in user mode and the SCR.HCE bit must be set to 1.

enter image description here

My question is how I can prepare the processor with a C kernel module and inline assembly and then execute the hvc instruction. I want to do this with a kernel module because then I start in PL1. This pseudocode describes what I want to achieve:

  1. call smc // to get in monitor mode
  2. set SRC.HCE to 1 // to enable hvc instruction
  3. set SRC.NS to 1 // to set the system to not secure
  4. call hvc #0 // call the hvc instruction to produce a hypervisor exception

Viewing all articles
Browse latest Browse all 248

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>