]>
git.karo-electronics.de Git - karo-tx-linux.git/log
Pekka Enberg [Sat, 31 Jul 2010 20:20:01 +0000 (23:20 +0300)]
kvm, pci: Fix unaligned PCI accesses
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Sat, 31 Jul 2010 20:05:01 +0000 (23:05 +0300)]
kvm, pci: Don't calculate offset twice
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Sat, 31 Jul 2010 20:01:10 +0000 (23:01 +0300)]
kvm: Fix PCI config space emulation
This fixes the two problems:
1. Yes, 'register number' is offset in 4 bytes, not 1 byte
2. We must be able to return sane values for the whole 256 configuration
space, not just for the first 64 bytes that's covered by the fixed header
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Sat, 31 Jul 2010 19:51:07 +0000 (22:51 +0300)]
kvm, pci: Fix device probe accesses
The register number is offset in bytes, not in words.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cyrill Gorcunov [Sat, 31 Jul 2010 19:06:10 +0000 (23:06 +0400)]
kvm, pci: Add dummy virtio device for probing
[ penberg@cs.helsinki.fi: fixes, cleanups ]
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cyrill Gorcunov [Sat, 31 Jul 2010 16:04:24 +0000 (20:04 +0400)]
kvm, pci: Return "no device" by default
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Pekka Enberg [Sat, 31 Jul 2010 14:54:56 +0000 (17:54 +0300)]
kvm: Add PCI CONFIG_ADDRESS register layout
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cyrill Gorcunov [Sat, 31 Jul 2010 14:03:14 +0000 (18:03 +0400)]
pci: Fix typo in previous commit
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cyrill Gorcunov [Sat, 31 Jul 2010 13:50:15 +0000 (17:50 +0400)]
pci: Use proper PCI port names
[ penberg@cs.helsinki.fi: rename ops and variables ]
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Pekka Enberg [Sat, 31 Jul 2010 12:52:43 +0000 (15:52 +0300)]
kvm: Initial PCI probe emulation
This patch adds simple PCI Configuration Mechanism 1 probing emulation. It
doesn't expose any actual PCI devices yet.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Sat, 31 Jul 2010 13:09:36 +0000 (16:09 +0300)]
kvm: Force PCI Configuration Mechanism 1
This patch forces the guest Linux kernel to use PCI Configuration Mechanism 1.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Sat, 31 Jul 2010 12:10:45 +0000 (15:10 +0300)]
kvm: Enable Linux kernel PCI probing
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Sat, 31 Jul 2010 12:18:43 +0000 (15:18 +0300)]
kvm: Add some more ioport emulation
This patch adds some more ioport emulation code so that I can boot a Linux
kernel cleanly with "--ioport-debug" command line option enabled.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cyrill Gorcunov [Wed, 28 Jul 2010 17:13:27 +0000 (21:13 +0400)]
bios: clean predefined bios area early
otherwise say EBDA area could have some trash
values gotten from malloc.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Pekka Enberg [Fri, 16 Jul 2010 12:44:26 +0000 (15:44 +0300)]
kvm: Use proper segment + offset in e820 bios
This patch fixes E820 BIOS emulation on AMD CPUs that, unlike Intel ones,
require proper 16-bit segment/offset addressing in virtualized 16-bit mode.
Reported-by: Asias He <asias.hejun@gmail.com>
Tested-by: Asias He <asias.hejun@gmail.com>
Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Fri, 16 Jul 2010 13:42:13 +0000 (16:42 +0300)]
kvm: Exclude BIOS object files from header deps
This patch fixes build error reported by Asias.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Fri, 16 Jul 2010 13:40:01 +0000 (16:40 +0300)]
kvm: Clean header dependency files
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Fri, 16 Jul 2010 13:12:53 +0000 (16:12 +0300)]
kvm: Fix Makefile header dependencies
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Thu, 15 Jul 2010 15:04:41 +0000 (18:04 +0300)]
kvm: Update bios .gitignore list
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Thu, 15 Jul 2010 14:53:58 +0000 (17:53 +0300)]
kvm: Clear performance monitoring CPUID flags
Commit
3d446cf17faefd621c0842b58c92a50bd307eec7 ("kvm__setup_cpuid: use
KVM_GET_SUPPORTED_CPUID to simplify cpuid setup") causes the following errors
to be printed on host kernel dmesg:
[ 775.134693] kvm: 2882: cpu0 unhandled rdmsr: 0x345
[ 775.143130] kvm: 2882: cpu0 unhandled wrmsr: 0x40 data 0
[ 775.143136] kvm: 2882: cpu0 unhandled wrmsr: 0x60 data 0
[ 775.143141] kvm: 2882: cpu0 unhandled wrmsr: 0x41 data 0
[ 775.143146] kvm: 2882: cpu0 unhandled wrmsr: 0x61 data 0
[ 775.143150] kvm: 2882: cpu0 unhandled wrmsr: 0x42 data 0
[ 775.143155] kvm: 2882: cpu0 unhandled wrmsr: 0x62 data 0
[ 775.143159] kvm: 2882: cpu0 unhandled wrmsr: 0x43 data 0
[ 775.143164] kvm: 2882: cpu0 unhandled wrmsr: 0x63 data 0
As explained by Cyrill Gorcunov, these MSR accesses come from Linux performance
events subsystems which is not supported by our little hypervisor. Therefore,
clear the performance monitoring CPUID flags to let guest kernels know about
that.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Thu, 15 Jul 2010 14:44:23 +0000 (17:44 +0300)]
kvm: Use sizeof instead of magic number
The 'ecx' register contains size of copied data. Use sizeof(struct e820_entry)
instead of a magic number to make it obvious from the code.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Thu, 15 Jul 2010 09:39:07 +0000 (12:39 +0300)]
kvm: Cleanup BIOS setup code
This patch cleans up BIOS setup code by introducing struct irq_handler and
switching to more declarative setup.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cyrill Gorcunov [Wed, 14 Jul 2010 14:57:17 +0000 (18:57 +0400)]
kvm, bios: Make e820 map to look similar the real one
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Pekka Enberg [Thu, 15 Jul 2010 09:22:57 +0000 (12:22 +0300)]
kvm: Remove unused outb() function from e820.c
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cyrill Gorcunov [Wed, 14 Jul 2010 17:28:59 +0000 (21:28 +0400)]
kvm, bios: BIOS code redesign
Instead of keeping bios code in various bin junks make
it to host in one binary blob. This blob gets copied
to a predefined place at startup and IVT handlers set
as appropriate.
Also we need to generate header file which will contain
BIOS tourine offsets for symbols being used.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Pekka Enberg [Wed, 14 Jul 2010 12:28:45 +0000 (15:28 +0300)]
kvm: Use -Werror for building the thing
It's easy to miss warnings so use -Werror. We're a shiny new userspace project
so there's no reason not to use it.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Wed, 14 Jul 2010 12:20:21 +0000 (15:20 +0300)]
kvm: Use 32-bit operand size prefix for rdfs8()
E820 memory map resides in EBDA region which starts at address 0x9fc00 which
doesn't fit in 16 bits. Therefore, use 'addr32' operand size prefix to fix the
following error:
bios/e820.c: Assembler messages:
bios/e820.c:14: Warning: 654336 shortened to 64512
Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Wed, 14 Jul 2010 11:58:25 +0000 (14:58 +0300)]
kvm: Fix load_bzimage for flat binaries
We must not die if load_bzimage() fails because we want to fall-back to loading
flat binaries.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Wed, 14 Jul 2010 11:34:40 +0000 (14:34 +0300)]
kvm: Fix usage command line format
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Wed, 14 Jul 2010 11:32:15 +0000 (14:32 +0300)]
kvm: Check for read() return value in load_bzimage()
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Wed, 14 Jul 2010 11:30:50 +0000 (14:30 +0300)]
kvm: Fix VM support check for unrecognized CPUs
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Wed, 14 Jul 2010 11:26:47 +0000 (14:26 +0300)]
kvm: Use -Os optimization for GCC
GCC generates unreadable machine code with default optimization level.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Asias He [Mon, 12 Jul 2010 12:52:23 +0000 (20:52 +0800)]
kvm__setup_cpuid: use KVM_GET_SUPPORTED_CPUID to simplify cpuid setup
Let kernel setup "struct kvm_cpuid2" for us!
https://kerneltrap.org/mailarchive/linux-kernel/2010/4/27/
4563640
Avi Kivity:
'''
No. KVM_GET_CPUID2 reads what was set by KVM_SET_CPUID, as modified by
the guest executing the cpuid instruction. KVM_GET_SUPPORTED_CPUID
tells userspace which bits are supported by the host cpu and kvm.
The API for KVM_GET_SUPPORTED_CPUID returns all cpuid leaves supported
in one go, IIRC.
'''
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cyrill Gorcunov [Sun, 11 Jul 2010 10:06:30 +0000 (14:06 +0400)]
kvm: Add --mem= option
Which allow an user to specify the amount of memory
he would like to provide for kernel.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cyrill Gorcunov [Sat, 10 Jul 2010 20:57:47 +0000 (00:57 +0400)]
bios: No need for sti at int15 irq exit
iret will restore eflags anyway
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cyrill Gorcunov [Sat, 10 Jul 2010 20:56:33 +0000 (00:56 +0400)]
bios: Don't clobber 32bit registers
To be on safe side we better to save whole 32bit
of appropriate registers. Even in real mode.
At moment no code affected but it's possible in future.
Actually int15 code does touch 32bit registers but it
uses caller's stack.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Pekka Enberg [Thu, 8 Jul 2010 18:27:35 +0000 (21:27 +0300)]
kvm: BIOS E820 memory map emulation
This patch adds BIOS E820 memory map emulation to KVM.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cyrill Gorcunov [Thu, 8 Jul 2010 15:00:07 +0000 (19:00 +0400)]
kvm, bios: Rework BIOS setup
This is a really huge rework of our primitive BIOS emulator.
The initial idea was to implement stack management in BIOS
irq handlers. In turn it ends up in re-factoring of all BIOS
code.
Some code details
-----------------
1) BIOS stack is placed at predefined constant memory address.
2) BIOS stack is only 64 bytes deep. It must be enough even for
future irq handlers.
3) To be able to place irq handlers at almost arbitrary place of
guest memory their start address must be 16 byte aligned.
This makes easy to compute irq routines local variables addresses.
4) To eliminate address relocations in irq handlers code we use a
special loader script.
TODO
----
- Still needs e820 map implements, int15 is dummy at moment
P.S. Thanks H. Peter Anvin for advices.
[ penberg@cs.helsinki.fi: cleanups ]
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cyrill Gorcunov [Thu, 8 Jul 2010 11:05:46 +0000 (15:05 +0400)]
Exclude .cscope from .gitignore
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cyrill Gorcunov [Wed, 7 Jul 2010 19:19:34 +0000 (23:19 +0400)]
kvm, bios: Get rid of buggy int10 handler
At moment any BIOS code using which needs own stack
have to be remade. It's a bit not that easy task.
We're happily may live without int10 handler since we
switch to early_printk interface really early. And
actually we don't scan VGA memory anyway so that even
if there is something written we ignore the result.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Pekka Enberg [Mon, 5 Jul 2010 19:16:54 +0000 (22:16 +0300)]
kvm: Cleanup struct boot_params setup
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Mon, 5 Jul 2010 18:43:17 +0000 (21:43 +0300)]
kvm: Cleanup kvm__cpu_supports_vm()
This patch cleans up kvm__cpu_supports_vm() by unifying the VMX and SVM paths.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cyrill Gorcunov [Mon, 5 Jul 2010 17:10:48 +0000 (21:10 +0400)]
kvm: Check for SVM extension being supported for AMD cpus
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Asias He [Mon, 5 Jul 2010 06:01:11 +0000 (14:01 +0800)]
kvm: Check vmx capability using cpuid
[ penberg@cs.helsinki.fi: use host_cpuid(), cleanups ]
Reported-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Sun, 4 Jul 2010 18:57:14 +0000 (21:57 +0300)]
kvm: Introduce '--kvm-dev' command line option
This patch introduces a '--kvm-dev' command line option for debugging purposes.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Sun, 4 Jul 2010 16:24:35 +0000 (19:24 +0300)]
kvm: Introduce 'make devices' target
This patch adds a 'make devices' target to Makefile that sets up KVM device if
one does not exist in '/dev/kvm'.
Suggested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Sun, 4 Jul 2010 11:13:20 +0000 (14:13 +0300)]
kvm: Fix compilation warning
This patch fixes the following compilation warning:
main.c: In function ‘main’:
main.c:149: warning: label ‘out’ defined but not used
Reported-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Sun, 4 Jul 2010 11:02:05 +0000 (14:02 +0300)]
kvm: Don't stop on ioport errors by default
This patch introduces a '--ioport-debug' option that preserves the old
stop-on-error behavior and changes the default to keep on running despite of
ioport errors. This allows Linux kernel to boot to VFS mount phase.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Sun, 4 Jul 2010 10:59:10 +0000 (13:59 +0300)]
kvm: Add '--params' to usage
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Sun, 4 Jul 2010 10:41:45 +0000 (13:41 +0300)]
kvm: Add proper 00E0 ioport handling
We use 00E0 ioport for trapping to the hypervisor. This patch cleans up
handling of the ioport to call exit() in ioport emulation handler.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Sun, 4 Jul 2010 10:35:30 +0000 (13:35 +0300)]
kvm: Cleanup ioport_ops table
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Sun, 4 Jul 2010 10:32:20 +0000 (13:32 +0300)]
kvm: Cleanup command line parsing
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Sun, 4 Jul 2010 10:18:59 +0000 (13:18 +0300)]
kvm: Use 'nopci pci=off' kernel parameters by default
As pointed out by Cyrill, use 'nopci pci=off' by default to avoid the need for
emulating PCI.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cyrill Gorcunov [Sun, 4 Jul 2010 10:00:35 +0000 (14:00 +0400)]
kvm, cpuid: Use logical AND on bit ops
Otherwise we may push cleaned bits back.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cyrill Gorcunov [Sat, 3 Jul 2010 20:52:41 +0000 (00:52 +0400)]
kvm, cpuid: Fill up func 0 and 4
Retun "qemu64" largest function number and set
cpu to GenueIntel, fill up cache info and rename
cpuid to host_cpuid since we may need to distinguish
which cpuid (host or guest) is called.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cyrill Gorcunov [Sat, 3 Jul 2010 17:58:24 +0000 (21:58 +0400)]
kvm: KVM_CAP_EXT_CPUID is required
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cyrill Gorcunov [Sat, 3 Jul 2010 15:21:33 +0000 (19:21 +0400)]
kvm, cpuid: Fix XSTOR and VMX compatibility in cpuid
Under virtual environment we don't support XSTOR and VMX features.
Reported-by: Asias He <asias.hejun.hj@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cyrill Gorcunov [Thu, 10 Jun 2010 17:15:26 +0000 (21:15 +0400)]
kvm, tests: Use motherboard specific ports for testing
H. Peter Anvin suggested to use motherboard specific ports
for testing instead of ones well known. Thanks, Peter!
Reported-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cyrill Gorcunov [Thu, 10 Jun 2010 16:55:40 +0000 (20:55 +0400)]
kvm: Add force exit from tests
To make so we write any value to port 0 and
start kvm in --dbgtest mode so we are expecting
for this exit.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cyrill Gorcunov [Wed, 9 Jun 2010 20:05:07 +0000 (00:05 +0400)]
tests/pit: Increase PIT frequency up to 1KHz
Otherwise it's too boring ;)
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cyrill Gorcunov [Wed, 9 Jun 2010 19:05:58 +0000 (23:05 +0400)]
kvm: Check for HTL extension granted
We need it thought it seems it doesn't work in
all our testcases.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Pekka Enberg [Wed, 9 Jun 2010 18:32:29 +0000 (21:32 +0300)]
kvm: Add 'check' target to Makefile
This patch adds a 'check' target to Makefile that can be used to run some
simple test cases.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Wed, 9 Jun 2010 18:30:56 +0000 (21:30 +0300)]
kvm, test: Improve PIT test output
This patch makes the PIT test output less verbose.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Wed, 9 Jun 2010 18:25:49 +0000 (21:25 +0300)]
kvm: Add .gitignore for tests
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Wed, 9 Jun 2010 18:25:18 +0000 (21:25 +0300)]
kvm: Add Makefile for compiling all test cases
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cyrill Gorcunov [Wed, 9 Jun 2010 18:17:56 +0000 (22:17 +0400)]
test/pit: Fill up IDT with noop handler
To cover all IRQs.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cyrill Gorcunov [Wed, 9 Jun 2010 17:24:32 +0000 (21:24 +0400)]
tests/pit: Issue cli on ISR handling
Better to not allow any nested maskable IRQs
while we handle timer irq.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Pekka Enberg [Tue, 8 Jun 2010 17:21:40 +0000 (20:21 +0300)]
kvm, test: Move PIT tests to separate directory
This patch moves PIT tests to separate directory and adds Makefile for it.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Asias He [Tue, 8 Jun 2010 12:46:51 +0000 (20:46 +0800)]
kvm, test: add a counter to tick test in ISR
when the counter reaches zero, ISR print "TESK OK" then issue a hlt.
Reported-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Asias He [Tue, 8 Jun 2010 12:46:50 +0000 (20:46 +0800)]
kvm, test: add PIT 8254 and PIC 8259 test code
8254 ticks at 100HZ.
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Asias He [Tue, 1 Jun 2010 16:41:59 +0000 (20:41 +0400)]
kvm__setup_sregs: fix indentation
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cyrill Gorcunov [Sun, 30 May 2010 19:15:28 +0000 (23:15 +0400)]
early_printk: Simplify the code
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Asias He [Fri, 28 May 2010 07:48:19 +0000 (15:48 +0800)]
early_printk.c: add rep/outsb support
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cyrill Gorcunov [Sun, 30 May 2010 18:33:27 +0000 (22:33 +0400)]
kvm: The command line storage should not be too short
At moment boot protocol may hold up to 2048 symbols
from command line we should provide the same compatibility
for --params option.
Reported-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cyrill Gorcunov [Sun, 30 May 2010 18:23:55 +0000 (22:23 +0400)]
kvm: Append missing ending space for built-in command line
We have a predefined command line but when an user passes
additional parameters the last predefined argument and
first user's one get sticked together. Fix it by adding
ending space for built-in command line.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cyrill Gorcunov [Sun, 30 May 2010 16:32:13 +0000 (20:32 +0400)]
kvm: Check for required KVM extensions in one place
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Asias He [Fri, 28 May 2010 07:48:17 +0000 (15:48 +0800)]
kvm: kvm__setup_sregs initialize more registers
This allow to boot bzImage
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Asias He [Fri, 28 May 2010 07:48:16 +0000 (15:48 +0800)]
kvm: reimplement kvm__setup_sregs
It's better to get sregs which was initialized by kernel and change what
we need precisely. Actually vmx_vcpu_reset does the cpu initialization
before us.
This solves the problem of failing to run on x86-32 host kernel.
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Asias He [Fri, 28 May 2010 16:47:50 +0000 (20:47 +0400)]
kvm__init: the kernel should support irq and pit
We rely on kenrnel being fresh enough since we're
not going to support non built-in IRQ routing and
PIT emulation.
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Asias He [Tue, 11 May 2010 14:21:22 +0000 (22:21 +0800)]
kvm: remove unneccessary iotcl parameter
The last parameter of the following is unneccessary:
ret = ioctl(self->vm_fd, KVM_SET_USER_MEMORY_REGION, &mem, 1);
as seen in linux-2.6.32.12/virt/kvm/kvm_main.c:
case KVM_SET_USER_MEMORY_REGION: {
struct kvm_userspace_memory_region kvm_userspace_mem;
r = -EFAULT;
if (copy_from_user(&kvm_userspace_mem, argp,
sizeof kvm_userspace_mem))
goto out;
r = kvm_vm_ioctl_set_memory_region(kvm, &kvm_userspace_mem, 1);
if (r)
goto out;
break;
}
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cyrill Gorcunov [Mon, 10 May 2010 10:18:17 +0000 (14:18 +0400)]
kvm: Use strlcat helper for copying cmdline params
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cyrill Gorcunov [Wed, 28 Apr 2010 18:59:36 +0000 (22:59 +0400)]
kvm: Use PRIx qualificator for printf
In sake of portability better to use PRIx qualificator
for printf flags.
Reported-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Asias He [Wed, 28 Apr 2010 18:53:49 +0000 (22:53 +0400)]
bios: No new line at EOF nit fix
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Pekka Enberg [Mon, 26 Apr 2010 15:16:25 +0000 (18:16 +0300)]
kvm: Fix .gitignore patterns
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cyrill Gorcunov [Mon, 26 Apr 2010 11:08:00 +0000 (15:08 +0400)]
kvm: Print error code on unknown error
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cyrill Gorcunov [Mon, 26 Apr 2010 06:55:50 +0000 (10:55 +0400)]
Change __x86_x__ to CONFIG_X86_X
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Pekka Enberg [Sat, 24 Apr 2010 06:57:38 +0000 (09:57 +0300)]
kvm: Flush stdout for early printk
Make sure we flush stdout for early printk so that we can see what's really
going on when a kernel gets stuck.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Sat, 24 Apr 2010 06:54:52 +0000 (09:54 +0300)]
kvm: Dump state on SIGQUIT
This patch adds state dumping to SIGQUIT signal handler to make debugging
infinite loops easier. If a kernel gets stuck under KVM, you can press Ctrl-4
and then use 'addr2line' to figure out the exact location where it's stuck from
the reported 'rip':
^\[ 0.000000] Calibrating delay loop... Registers:
rip:
ffffffff816a0c83 rsp:
ffffffff81c01eb8 flags:
0000000000000246
rax:
00000000ffff8ad0 rbx:
ffffffff81d541a0 rcx:
00000000ffffffff
rdx:
00000000ffff8ad0 rsi:
0000000000000046 rdi:
0000000000002000
rbp:
ffffffff81c01f28 r8:
00000000000003fd r9:
0000000000000000
r10:
0000000000000000 r11:
000000000000000d r12:
ffffffff81d56d20
r13:
0000000000000000 r14:
ffffffffffffffff r15:
0000000000013690
cr0:
000000008005003b cr2:
0000000000000000 cr3:
0000000001c08000
cr4:
00000000000006b0 cr8:
0000000000000000
Segment registers:
register selector base limit type p dpl db s l g avl
cs 0010
0000000000000000 ffffffff 0b 1 0 0 1 1 1 0
ss 0000
0000000000000000 ffffffff 00 0 0 0 0 0 0 0
ds 0000
0000000000000000 ffffffff 00 0 0 0 0 0 0 0
es 0000
0000000000000000 ffffffff 00 0 0 0 0 0 0 0
fs 0000
0000000000000000 ffffffff 00 0 0 0 0 0 0 0
gs 0000
ffff880002000000 ffffffff 00 0 0 0 0 0 0 0
tr 0040
ffff880002011bc0 00002087 0b 1 0 0 0 0 0 0
ldt 0000
0000000000000000 ffffffff 00 0 0 0 0 0 0 0
gdt
ffff880002004000 0000007f
idt
ffffffff81de9000 00000fff
[ efer:
0000000000000d01 apic base:
0000000000000000 nmi: enabled ]
Interrupt bitmap:
0000000000000000 0000000000000000 0000000000000000 0000000000000000
Code:
Stack:
penberg@tiger:~/vm$ addr2line -e vmlinux
0xffffffff816a0c83
/home/penberg/linux/init/calibrate.c:149
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cyrill Gorcunov [Thu, 22 Apr 2010 14:46:31 +0000 (18:46 +0400)]
kvm: Don't touch 64 bit specific MSR registers on 32 bit
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cyrill Gorcunov [Sat, 17 Apr 2010 11:32:48 +0000 (15:32 +0400)]
kvm: Set more fields in boot protocol
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cyrill Gorcunov [Fri, 16 Apr 2010 17:33:04 +0000 (21:33 +0400)]
kvm: Command line update must honor ABI
This is a part of boot protocol, so that we
must honor it.
Reported-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cyrill Gorcunov [Wed, 14 Apr 2010 16:22:00 +0000 (20:22 +0400)]
Makefile: Add cpu specific definition
We need to figure out what kind of cpu we're
going to run on for bios code.
Suggested-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cyrill Gorcunov [Tue, 13 Apr 2010 19:48:17 +0000 (23:48 +0400)]
kvm: Kill the bin2c helper
Instead of calling bin2c helper we just include 16-bit pure code with .incbin
and export the symbols we need.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cyrill Gorcunov [Sun, 11 Apr 2010 18:21:09 +0000 (22:21 +0400)]
kvm: Add more default kernel command line parameters
We dont support ACPI, APIC, SMP yet, mark it so.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Pekka Enberg [Sun, 11 Apr 2010 18:07:45 +0000 (21:07 +0300)]
Merge branch 'master' of git://github.com/cyrillos/vm
Pekka Enberg [Sun, 11 Apr 2010 18:05:36 +0000 (21:05 +0300)]
kvm: Clean up early serial code
Use similar constants and variable names as in arch/x86/kernel/early_printk.c
in the Linux kernel.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cyrill Gorcunov [Sun, 11 Apr 2010 17:56:56 +0000 (21:56 +0400)]
ioport: Make all PIT channels being dummy
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Pekka Enberg [Sun, 11 Apr 2010 17:55:56 +0000 (20:55 +0300)]
kvm: Force 'notsc' and 'earlyprintk' kernel parameters
We don't support TSC calibration properly and we want early printk so force
them as kernel parameters.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Pekka Enberg [Sun, 11 Apr 2010 17:42:10 +0000 (20:42 +0300)]
kvm: Add support for early serial printk
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cyrill Gorcunov [Sun, 11 Apr 2010 16:09:28 +0000 (20:09 +0400)]
kvm: Make command line to be placed at predefined address
We support only 0x202 boot protocol at moment so that kernel command line is
copied into predefined address.
Reported-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>