]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
14 years agoSeparate KVM code from the main loop
Pekka Enberg [Thu, 25 Mar 2010 15:40:51 +0000 (17:40 +0200)]
Separate KVM code from the main loop

This patch separates the KVM code in its own file and cleans everything up a
bit while at it.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoDon't die on old kernels without single-step debug support
Cyrill Gorcunov [Wed, 24 Mar 2010 21:15:36 +0000 (00:15 +0300)]
Don't die on old kernels without single-step debug support

Better inform the user that the host kernel do not
support single-stepping debug.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoAdd utility functions
Cyrill Gorcunov [Wed, 24 Mar 2010 21:14:25 +0000 (00:14 +0300)]
Add utility functions

Move helpers out to separate files.
Mostly borrowed from perf

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoEnable KVM guest single-stepping
Pekka Enberg [Wed, 24 Mar 2010 20:16:07 +0000 (22:16 +0200)]
Enable KVM guest single-stepping

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoMove KVM_SET_REGS to kvm__reset_vcpu()
Pekka Enberg [Wed, 24 Mar 2010 20:03:16 +0000 (22:03 +0200)]
Move KVM_SET_REGS to kvm__reset_vcpu()

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoDump KVM_EXIT_IO details
Pekka Enberg [Wed, 24 Mar 2010 19:33:45 +0000 (21:33 +0200)]
Dump KVM_EXIT_IO details

When KVM_RUN returns with KVM_EXIT_IO, dump the I/O details and exit.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoFix up rflags printing
Pekka Enberg [Wed, 24 Mar 2010 19:05:02 +0000 (21:05 +0200)]
Fix up rflags printing

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoSetup rflags properly to fix EXIT_UNKNOWN
Pekka Enberg [Wed, 24 Mar 2010 18:08:21 +0000 (20:08 +0200)]
Setup rflags properly to fix EXIT_UNKNOWN

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoFix guest code printout
Pekka Enberg [Wed, 24 Mar 2010 17:16:49 +0000 (19:16 +0200)]
Fix guest code printout

Doh, forgot to initialize 'c'...

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoShow dump of executed code at KVM exit
Pekka Enberg [Wed, 24 Mar 2010 17:04:31 +0000 (19:04 +0200)]
Show dump of executed code at KVM exit

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoPrint out constant names for KVM exit reasons
Pekka Enberg [Wed, 24 Mar 2010 16:49:32 +0000 (18:49 +0200)]
Print out constant names for KVM exit reasons

Things are way easier to debug that way.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoInitialize RIP before starting to run the guest
Pekka Enberg [Wed, 24 Mar 2010 16:13:46 +0000 (18:13 +0200)]
Initialize RIP before starting to run the guest

Use the return value of load_kernel() to initialize RIP register before
starting the guest with KVM_RUN ioctl().

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoDump registers after KVM_RUN returns
Pekka Enberg [Wed, 24 Mar 2010 16:09:16 +0000 (18:09 +0200)]
Dump registers after KVM_RUN returns

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoUpdate .gitignore to include object files
Pekka Enberg [Wed, 24 Mar 2010 15:57:08 +0000 (17:57 +0200)]
Update .gitignore to include object files

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoLoad bzImage to guest RAM
Pekka Enberg [Wed, 24 Mar 2010 15:56:17 +0000 (17:56 +0200)]
Load bzImage to guest RAM

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoInitialize guest memory region properly
Pekka Enberg [Wed, 24 Mar 2010 15:19:28 +0000 (17:19 +0200)]
Initialize guest memory region properly

Use posix_memalign() to allocate memory for the guest and register the region
to KVM.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoInitial version of kernel image loading
Pekka Enberg [Tue, 23 Mar 2010 20:18:31 +0000 (22:18 +0200)]
Initial version of kernel image loading

This patch adds support for checking whether the provided kernel image is a
bzImage or not.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoLoad kernel image to the VM
Pekka Enberg [Tue, 23 Mar 2010 20:04:20 +0000 (22:04 +0200)]
Load kernel image to the VM

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoMove CPU emulation code to cpu.c
Pekka Enberg [Tue, 23 Mar 2010 19:57:32 +0000 (21:57 +0200)]
Move CPU emulation code to cpu.c

The kvm.c file is getting bigger so move CPU emulation code to a separate file.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoMmap the kvm_run structure
Pekka Enberg [Tue, 23 Mar 2010 19:51:54 +0000 (21:51 +0200)]
Mmap the kvm_run structure

Mmap the kvm_run structure and print out ->exit_reason in human-readable form
upon exit to make it more visible what's happening after KVM_RUN ioctl() is
called.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoClean up struct kvm file descriptor names
Pekka Enberg [Tue, 23 Mar 2010 19:30:48 +0000 (21:30 +0200)]
Clean up struct kvm file descriptor names

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoSet up TSS address to make vcpu creation work
Pekka Enberg [Tue, 23 Mar 2010 19:24:59 +0000 (21:24 +0200)]
Set up TSS address to make vcpu creation work

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoInitialize KVM some more
Pekka Enberg [Tue, 23 Mar 2010 05:38:07 +0000 (07:38 +0200)]
Initialize KVM some more

This patch adds some more KVM initialization code. Doesn't work yet, though.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoClean up KVM initialization
Pekka Enberg [Mon, 22 Mar 2010 21:39:40 +0000 (23:39 +0200)]
Clean up KVM initialization

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoCheck for KVM_CAP_USER_MEMORY
Pekka Enberg [Mon, 22 Mar 2010 21:34:02 +0000 (23:34 +0200)]
Check for KVM_CAP_USER_MEMORY

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoMove KVM fds into 'struct kvm'
Pekka Enberg [Mon, 22 Mar 2010 21:30:10 +0000 (23:30 +0200)]
Move KVM fds into 'struct kvm'

This patch introduces a 'struct kvm' and moves the KVM related file descriptors
into it so that we can introduce helper functions more easily.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoCreate a VM using ioctl(KVM_CREATE_VM)
Pekka Enberg [Mon, 22 Mar 2010 21:12:14 +0000 (23:12 +0200)]
Create a VM using ioctl(KVM_CREATE_VM)

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoAdd .gitignore file
Pekka Enberg [Mon, 22 Mar 2010 21:06:27 +0000 (23:06 +0200)]
Add .gitignore file

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoCheck for KVM_API_VERSION at init
Pekka Enberg [Mon, 22 Mar 2010 21:05:28 +0000 (23:05 +0200)]
Check for KVM_API_VERSION at init

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agoInitial commit
Pekka Enberg [Mon, 22 Mar 2010 19:25:28 +0000 (21:25 +0200)]
Initial commit

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>