- Jun 01, 2015
-
-
Fengguang Wu authored
Signed-off-by:
Fengguang Wu <fengguang.wu@intel.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Will Deacon authored
During the review process for the KVM ARM patches, the GIC device registration was subjected to some minor renaming, so update kvm tool appropriately. Signed-off-by:
Will Deacon <will.deacon@arm.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Michael Ellerman authored
The kernel can handle a missing timebase-frequency property much better than one that claims zero. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Michael Ellerman authored
We should hard-code less of this stuff, but for now this works. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Michael Ellerman authored
In xics_init() we set the maximum server to kvm->nrcpus, and then set the nr_servers using maximum server + 1. That is off by one, in the harmless direction. Simplify it to just set nr_servers = kvm->nrcpus. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Michael Ellerman authored
Currently if you redirect the output from "lkvm run" to a file then term_init() will fail, because it can't call the terminal ioctls. So check if stdin and stdout are ttys, if either is not then skip the rest of the terminal setup. Redirecting one but not the other is a little odd, but does work. Note that we skip registering the cleanup routines, so we don't need to modify them. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Michael Ellerman authored
Add perror() calls to a couple of exit paths, to ease debugging. There are also two places where we print "Failed starting IPC thread", but one is really an epoll failure, so make that obvious. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Michael Ellerman authored
Currently list always returns 0, even if there was an error. Instead have it accumulate any errors and return that. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Will Deacon authored
Commit 21692d19f744 ("kvm tools: Beautify debug output") changed the kvm__dump_mem prototype but only fixed up calls from x86. This patch fixes arm to pass the debug_fd as required. Signed-off-by:
Will Deacon <will.deacon@arm.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Michael Ellerman authored
Commit 21692d1 (Beautify debug output) broke the powerpc build because it changed the signature for kvm__dump_mem() but didn't update all callers. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Pekka Enberg authored
Use idiomatic way of checking for NULL pointer in pci_shmem__init(). Suggested-by:
"H. Peter Anvin" <hpa@zytor.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Asias He authored
In commit dfefbe9d4894efc44c39b2041bd667d0dea43eca kvm tools: allow arch's to provide their own command-line options, vidmode is not setup correctly. Signed-off-by:
Asias He <asias.hejun@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Asias He authored
1. print mem debug info into debugfd instead guest console 2. always print page table info Signed-off-by:
Asias He <asias.hejun@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Cong Ding authored
After we check (state.kcount != 0), state.kcount has to be 0 in all the "else" branchs. Signed-off-by:
Cong Ding <dinggnu@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Cong Ding authored
The file should be closed before return. Signed-off-by:
Cong Ding <dinggnu@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Will Deacon authored
If we're running a guest with a larger page size than the host, interesting things start to happen when communicating via a virtio-mmio device because the idea of buffer alignment between the guest and the host will be off by the misalignment of the guest memory buffer allocated by the host. This causes things like the index field of vring.used to be accessed at different addresses on the guest and the host, leading to deadlock. Fix this problem by allocating guest memory aligned to the maximum possible page size for the architecture (64K). Signed-off-by:
Will Deacon <will.deacon@arm.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Will Deacon authored
This patch adds support for ARMv8 processors (more specifically, Cortex-A57) to kvmtool. Both AArch64 and AArch32 guests are supported, so the existing AArch32 code is slightly restructured to allow for re-use of much of the current code. The implementation closely follows the ARMv7 code and reuses much of the work written there. Tested-by:
Marc Zyngier <marc.zyngier@arm.com> Signed-off-by:
Will Deacon <will.deacon@arm.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Will Deacon authored
ARM has recently published a document describing a firmware interface for CPU power management, which can be used for booting secondary cores on an SMP platform, amongst other things. As part of the mach-virt upstreaming for the kernel (that is, the virtual platform targetted by kvmtool), it was suggested that we use this interface instead of the current spin-table based approach. This patch implements PSCI support in kvmtool for ARM, removing a fair amount of code in the process. Signed-off-by:
Will Deacon <will.deacon@arm.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Will Deacon authored
It can sometimes be useful to dump the .dtb file generated by kvmtool when debugging a guest. Currently, this is achieved by rebuilding the tool and changing some #defines, which is fairly clumsy to use. This patch adds a new command-line option for ARM, allowing the dtb to be dumped to a named file at runtime. Signed-off-by:
Will Deacon <will.deacon@arm.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Will Deacon authored
s/extention/extension/ I should get out more... Signed-off-by:
Will Deacon <will.deacon@arm.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Will Deacon authored
virtio-based PCI devices deal only with 4k memory granules, making direct use of the VIRTIO_PCI_VRING_ALIGN and VIRTIO_PCI_QUEUE_ADDR_SHIFT constants when initialising the virtqueues for a device. For MMIO-based devices, the guest page size is arbitrary and may differ from that of the host (this is the case on AArch64, where both 4k and 64k pages are supported). This patch fixes the virtio drivers to honour the guest page size passed when configuring the virtio device and align the virtqueues accordingly. Signed-off-by:
Will Deacon <will.deacon@arm.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Sasha Levin authored
We already know q!=NULL at that point, no need to retest. Reviewed-by:
Jesper Juhl <jj@chaosbits.net> Signed-off-by:
Sasha Levin <sasha.levin@oracle.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Sasha Levin authored
We already know 'disk' is non-null. Signed-off-by:
Sasha Levin <sasha.levin@oracle.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Sasha Levin authored
Signed-off-by:
Sasha Levin <sasha.levin@oracle.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Michel Lespinasse authored
Since nothing depends on the max_high field values anymore, we can just remove the field and the code that was used to maintain it. Signed-off-by:
Michel Lespinasse <walken@google.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Michel Lespinasse authored
As the rbtree intervals are not overlapping, rb_int_search_single can trivially be implemented without making use of the max_high field. Signed-off-by:
Michel Lespinasse <walken@google.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Michel Lespinasse authored
The rbtree interval API is designed for handling non-overlapping intervals; modify rb_int_insert() to guarantee this property is maintained by returning -EEXIST when attempting to insert a new interval that overlaps an existing interval. Also fix an issue where the computation of 'result' could trigger an integer overflow which would break the rbtree ordering. Signed-off-by:
Michel Lespinasse <walken@google.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Will Deacon authored
Currently, only x86 has architecture command-line options (for setting the BIOS video mode) however this is likely to become more common in the future. This patch adds some simple macros and a struct definition to allow architectures to augment the command-line options with private definitions. The BIOS video mode option (--vidmode) is also migrated to the new framework. Signed-off-by:
Will Deacon <will.deacon@arm.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Will Deacon authored
Cosmetic patch to correct the pre-processor guards for arm in kvm-cpu-arch.h. It's not something to lose sleep over but I find it incredibly irritating! Signed-off-by:
Will Deacon <will.deacon@arm.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Marc Zyngier authored
A bug in the KVM GIC init code set the priority mask to the highest possible value, while the reset value should be zero. Now that the kernel bug is fixed, kvm-tool must properly configure its GIC CPU interface in order to receive the boot IPI. Just set the GICC_PMR register to the maximum value (0xff), and it "just works". Signed-off-by:
Marc Zyngier <marc.zyngier@arm.com> [will: added #define for PMR offset] Signed-off-by:
Will Deacon <will.deacon@arm.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Marc Zyngier authored
init.c is not very kind with processes that get reparented when their own parent die, leaving them hanging around. Looking at the code, it only seem to care about its own flesh and blood. Bad init. Teach it some basic zombie reaping skills. Signed-off-by:
Marc Zyngier <marc.zyngier@arm.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Will Deacon authored
Commit 8d35d32d0148 ("kvm tools: add generic device registration mechanism") introduced a tree-based device lookup-by-bus mechanism as well as iterators to enumerate the devices on a particular bus. Whilst both x86 and ppc were converted by the original patch, the spapr pci changes were incomplete, so include the required changes here. Compile-tested only on ppc64 970mp. Note that I had to hack the Makefile in order to build guest_init.o with a toolchain defaulting to ppc: $(GUEST_INIT): guest/init.c $(E) " LINK " $@ - $(Q) $(CC) -static guest/init.c -o $@ - $(Q) $(LD) -r -b binary -o guest/guest_init.o $(GUEST_INIT) + $(Q) $(CC) -m64 -static guest/init.c -o $@ + $(Q) $(LD) -m elf64ppc -r -b binary -o guest/guest_init.o $(GUEST_INIT) $(DEPS): Acked-by:
Matt Evans <matt@ozlabs.org> Signed-off-by:
Will Deacon <will.deacon@arm.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Will Deacon authored
This patch adds initial support for ARMv7 processors (more specifically, Cortex-A15) to kvmtool. Everything is driven by FDT, including dynamic generation of virtio nodes for MMIO devices (PCI is not used due to lack of a suitable host-bridge). The virtual timers and virtual interrupt controller (VGIC) are provided by the kernel and require very little in terms of userspace code. Tested-by:
Marc Zyngier <marc.zyngier@arm.com> Signed-off-by:
Will Deacon <will.deacon@arm.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Will Deacon authored
When generating a device tree for a guest, it is useful to have a helper for converting host addresses to guest addresses in order to populate the device nodes correctly. This patch adds such a helper, following a similar implementation to the reverse translation function that already exists. Signed-off-by:
Will Deacon <will.deacon@arm.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Will Deacon authored
Running a guest with multiple banks of memory based above 0 causes the guest_flat_to_host address conversion to fail, as it is assumed that guest memory addresses are offset linearly from 0. This patch changes the translation function so that the kvm_mem_bank structures registered by kvm__register_mem are used to translate guest addresses, rather than use an offset from the start of host memory. Signed-off-by:
Will Deacon <will.deacon@arm.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Will Deacon authored
When registering memory banks for a guest, it is useful to keep the range information around for translating between guest and host address spaces. This patch adds a list of kvm_mem_bank structures to struct kvm, which is updated when a new bank is registered. Signed-off-by:
Will Deacon <will.deacon@arm.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Will Deacon authored
PCI devices are currently registered into the pci_devices array via the pci__register function, which can then be indexed later by architecture code to construct device tree nodes. For MMIO devices, there is no such utility. Rather than invent a similar mechanism for MMIO, this patch creates a global device registration mechanism, which allows the device type to be specified when registered or indexing a device. Current users of the pci registration code are migrated to the new infrastructure and virtio MMIO devices are registered at init time. As part of the device registration, allocation of the device number is moved out of irq__register_device and performed when adding the device header to the relevant bus tree, allowing us to maintain separate device numberspaces for each bus. Signed-off-by:
Will Deacon <will.deacon@arm.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Will Deacon authored
Commit 5e980d372620 ("kvm tools: virtio: add dummy set_size_vq implementations") added dummy set_size_vq implementations for a number of devices now that they can use virtio MMIO as their transport. Unfortunately, it missed the balloon driver, so this patch adds the same implementation there. Signed-off-by:
Will Deacon <will.deacon@arm.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Will Deacon authored
linux/compiler.h will never give us a definition for __compiler_offsetof because __KERNEL__ isn't defined, so just use the simple definition that we have already. This patch removes the redundant code. Signed-off-by:
Will Deacon <will.deacon@arm.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Sasha Levin authored
A bug only seen with LTO enabled was reported by Ron Minnich. Since the issue appears to be a linker issue, we disable LTO by default until it's more stable. We can still run LTO builds by setting LTO=1. Reported-by:
Ron Minnich <rminnich@gmail.com> Signed-off-by:
Sasha Levin <sasha.levin@oracle.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-