mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-06-15 18:05:49 +00:00
5614f9d933
Add the tiny x86/init.S which just mounts /host and execs /virt/init. NOTE: of course, the usage of CONFIG_GUEST_PRE_INIT is ugly, we need to cleanup this code. But I'd prefer to do this on top of this minimal/simple change. And I think this needs cleanups in any case, for example I think lkvm shouldn't abuse the "init=" kernel parameter at all. Acked-by: Pekka Enberg <penberg@kernel.org> Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
39 lines
572 B
ArmAsm
39 lines
572 B
ArmAsm
.data
|
|
|
|
.m_dev:
|
|
.string "hostfs"
|
|
.m_dir:
|
|
.string "/host"
|
|
.m_typ:
|
|
.string "9p"
|
|
.m_opt:
|
|
.string "trans=virtio,version=9p2000.L"
|
|
|
|
.e_nam:
|
|
.string "/virt/init"
|
|
|
|
.text
|
|
.globl _start
|
|
_start:
|
|
|
|
mov $165, %rax # __NR_mount
|
|
mov $.m_dev, %rdi
|
|
mov $.m_dir, %rsi
|
|
mov $.m_typ, %rdx
|
|
mov $1, %r10 # MS_RDONLY
|
|
mov $.m_opt, %r8
|
|
syscall
|
|
|
|
mov $59, %rax # __NR_execve
|
|
mov $.e_nam, %rdi
|
|
lea 8(%rsp), %rsi # argv[]
|
|
mov %rdi, (%rsi) # change argv[0]
|
|
pop %rcx # argc
|
|
inc %rcx
|
|
lea (%rsi,%rcx,8), %rdx # envp[]
|
|
syscall
|
|
|
|
mov $60, %rax # __NR_exit
|
|
mov $1, %rdi
|
|
syscall # panic
|