Re: [PATCH] kvm tools: powerpc: convert spapr pci to new device iterators

2012-11-28 Thread Matt Evans
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): Cc: Matt Evans Signed

RE: [RFC PATCH 16/16] kvm tools: add support for ARMv7 processors

2012-11-13 Thread Matt Evans
broken linewraps & legal autoappend signature (see above and below) wouldn't pollute the thread on-list. He'll use my IMAP address next time. ;-) I *think* Will was going to make some small changes, if you've already merged it then a follow-up set perhaps? (Modulo minor cha

Re: [RFC/PATCH] Use kernel supplied MMU info for kvm tool

2012-07-17 Thread Matt Evans
fo struct, whew, I heard the scream on IRC. Sorry. ;-) Acked-by: Matt Evans Matt -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] kvm tool: Fix powerpc/kvm-cpu.c for new KVM_SET_ONE_REG API

2012-07-04 Thread Matt Evans
On 04/07/2012, at 2:39 PM, Michael Ellerman wrote: > I think this code was based on an earlier version of the KVM_SET_ONE_REG > API, which at the time was in agraf's tree but not mainline? > > Either way it doesn't compile as is, so fix it up. Bit late, but I concur, all the patches look just s

Re: [RFC/PATCH 1/2] kvm tools, seabios: Add "--bios" option to "vm run"

2012-02-25 Thread Matt Evans
t firmware as other platforms also have firmware. For > instance, it may be desirable to use the same interface to load SLOF with > spapr. Seconded, "BIOS" is a bit of an arch-specific phrase... and antique ;) Matt > >> >> Cc: Yang Bai >> Cc: Matt Evans

[PATCH] kvm tools: Enable PPC64 to build static

2012-02-05 Thread Matt Evans
By "enable", I mean "fix"; the re-jigged commit 7ef85e8b builds libfdt using OBJS rather than OTHEROBJS hence ignores the relaxed CFLAGS. This commit builds it via OTHEROBJS. Signed-off-by: Matt Evans --- Pekka, not quite sure how this slipped through as I was buildi

[PATCH V3] kvm tools: Add build target for statically-linked binary

2012-02-01 Thread Matt Evans
e way (but not both), the feature detection now checks for both dynamic & static success. Intermediate objects build with correct flags (e.g. CONFIG_HAS_AIO) for the end target. Signed-off-by: Matt Evans --- V3: OK, I solved the problem of "probe for dynamic optional lib, fail to link

Re: [PATCH V4 3/7] kvm tools: Add SPAPR PPC64 hcall & rtascall structure

2012-01-31 Thread Matt Evans
On 31 Jan 2012, at 19:11, Pekka Enberg wrote: > On Tue, Jan 31, 2012 at 8:34 AM, Matt Evans wrote: >> +#define DEBUG_SPAPR_HCALLS > > I suppose this shouldn't be defined by default? Well, I had a bit of a debate about it. I left it on as it is actually interesting whils

Re: [PATCH V4 2/7] kvm tools: Generate SPAPR PPC64 guest device tree

2012-01-31 Thread Matt Evans
On 31 Jan 2012, at 18:59, Pekka Enberg wrote: > On Tue, Jan 31, 2012 at 8:34 AM, Matt Evans wrote: >> +static struct cpu_info cpu_power7_info = { >> + "POWER7", >> + power7_page_sizes_prop, sizeof(power7_page_sizes_prop), >> +

[PATCH V4 5/7] kvm tools: Add PPC64 XICS interrupt controller support

2012-01-30 Thread Matt Evans
, kvm__irq_line() can be called to raise an IRQ on XICS. Signed-off-by: Matt Evans --- tools/kvm/Makefile |1 + tools/kvm/powerpc/include/kvm/kvm-arch.h |1 + tools/kvm/powerpc/include/kvm/kvm-cpu-arch.h |2 + tools/kvm/powerpc/irq.c | 25

[PATCH V4 6/7] kvm tools: Add PPC64 PCI Host Bridge

2012-01-30 Thread Matt Evans
This provides the PCI bridge, definitions for the address layout of the windows and wires in IRQs. Once PCI devices are all registered, they are enumerated and DT nodes generated for each. Signed-off-by: Matt Evans --- tools/kvm/powerpc/include/kvm/kvm-arch.h |3 + tools/kvm/powerpc/irq.c

[PATCH V4 3/7] kvm tools: Add SPAPR PPC64 hcall & rtascall structure

2012-01-30 Thread Matt Evans
tree. Signed-off-by: Matt Evans --- tools/kvm/Makefile |2 + tools/kvm/powerpc/kvm-cpu.c |6 + tools/kvm/powerpc/kvm.c | 41 +++- tools/kvm/powerpc/spapr.h | 84 ++ tools/kvm/powerpc/spapr_hcall.c | 134 +++ tools/kvm

[PATCH V4 7/7] kvm tools: Add PPC64 kvm_cpu__emulate_io()

2012-01-30 Thread Matt Evans
This is the final piece of the puzzle for PPC SPAPR PCI; this function splits MMIO accesses into the two PHB windows & directs things to MMIO/IO emulation as appropriate. Signed-off-by: Matt Evans --- tools/kvm/Makefile |1 + tools/kvm/powerpc/include/kvm/kvm

[PATCH V4 4/7] kvm tools: Add SPAPR PPC64 HV console

2012-01-30 Thread Matt Evans
This adds the console code, plus VIO HV terminal nodes are added to the device tree so the guest kernel will pick it up. Signed-off-by: Matt Evans --- tools/kvm/Makefile |1 + tools/kvm/powerpc/kvm.c | 33 tools/kvm/powerpc/spapr_hvcons.c | 102

[PATCH V4 2/7] kvm tools: Generate SPAPR PPC64 guest device tree

2012-01-30 Thread Matt Evans
POWER7 and PPC970 host CPUs. Future support of more CPUs is possible. libfdt is included from scripts/dtc/libfdt. Signed-off-by: Matt Evans --- tools/kvm/Makefile | 26 - tools/kvm/powerpc/cpu_info.c | 83 tools/kvm/powerpc/

[PATCH V4 1/7] kvm tools: PPC64, add HPT/SDR1 for -PR KVM

2012-01-30 Thread Matt Evans
isn't forced to use them. A new option, '--hugetlbfs default', uses a default path for 16M pages for HV mode, if required. Signed-off-by: Matt Evans --- tools/kvm/powerpc/include/kvm/kvm-arch.h |2 ++ tools/kvm/powerpc/kvm-cpu.c | 24 +--- too

[PATCH V4 0/7] Add initial SPAPR PPC64 architecture support

2012-01-30 Thread Matt Evans
external dependency on 64bit libfdt (which isn't in some distros). - Spit & polish Thanks to David & Alex for the PPC-related reviews! Matt Evans (7): kvm tools: PPC64, add HPT/SDR1 for -PR KVM kvm tools: Generate SPAPR PPC64 guest device tree kvm tools: Add SPAPR PPC64

[PATCH] kvm tools: Repair running on non ioeventfd-capable platforms

2012-01-30 Thread Matt Evans
'. Signed-off-by: Matt Evans --- Sasha, you screwed PPC64! And it took me a month to notice hahaha! tools/kvm/ioeventfd.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/kvm/ioeventfd.c b/tools/kvm/ioeventfd.c index 9133101..f2d5a30 100644 --- a/tools/

Re: [PATCH V2] kvm tools: Add build target for statically-linked binary

2012-01-29 Thread Matt Evans
On 30/01/12 14:51, Sasha Levin wrote: > On Mon, 2012-01-30 at 14:18 +1100, Matt Evans wrote: >> In lieu of any good lightweight solutions, can we include this patch as it is >> still useful for builds on systems without the offending optional libraries? > > How about we do

Re: [PATCH V2] kvm tools: Add build target for statically-linked binary

2012-01-29 Thread Matt Evans
Hi Asias, Remember this patch? :-) I didn't... oops. On 09/01/12 18:51, Asias He wrote: > On 01/09/2012 02:45 PM, Matt Evans wrote: >> This commit adds a target for 'lkvm-static' which is linked -static. >> >> (This can be useful to construct kvmtool binar

[PATCH V2] kvm tools: Add build target for statically-linked binary

2012-01-08 Thread Matt Evans
This commit adds a target for 'lkvm-static' which is linked -static. (This can be useful to construct kvmtool binaries for minimalist auto-test host filesystems.) Signed-off-by: Matt Evans --- V2: Argh! Let's remove it on make clean, too... tools/kvm/Makefile |6 +-

[PATCH] kvm tools: Add build target for statically-linked binary

2012-01-08 Thread Matt Evans
This commit adds a target for 'lkvm-static' which is linked -static. (This can be useful to construct kvmtool binaries for minimalist auto-test host filesystems.) Signed-off-by: Matt Evans --- Pekka, I found this useful in one of our test setups, hopefully others will too. Ch

Re: [PATCH V3 2/2] kvm tools: Create arch-specific kvm_cpu__emulate_{mm}io()

2012-01-05 Thread Matt Evans
Hey Alex, On 24/12/11 00:39, Alexander Graf wrote: > > On 23.12.2011, at 14:26, Matt Evans wrote: > >> >> On 23/12/2011, at 11:58 PM, Alexander Graf wrote: >> >>> >>> On 13.12.2011, at 07:21, Matt Evans wrote: >>> >>>> D

Re: [PATCH V3 2/2] kvm tools: Create arch-specific kvm_cpu__emulate_{mm}io()

2011-12-23 Thread Matt Evans
On 23/12/2011, at 11:58 PM, Alexander Graf wrote: > > On 13.12.2011, at 07:21, Matt Evans wrote: > >> Different architectures will deal with MMIO exits differently. For example, >> KVM_EXIT_IO is x86-specific, and I/O cycles are often synthesised by steering >> int

Re: [PATCH V2 4/6] kvm tools: Add PPC64 XICS interrupt controller support

2011-12-19 Thread Matt Evans
Hi David, On 14/12/11 13:35, David Gibson wrote: > On Tue, Dec 13, 2011 at 06:10:48PM +1100, Matt Evans wrote: >> This patch adds XICS emulation code (heavily borrowed from QEMU), and wires >> this into kvm_cpu__irq() to fire a CPU IRQ via KVM. A device tree entry is >> a

[PATCH] kvm tools: Fix running with --initrd and no real discs/rootfs

2011-12-14 Thread Matt Evans
e. Signed-off-by: Matt Evans --- tools/kvm/builtin-run.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c index 0879ab9..c4329ea 100644 --- a/tools/kvm/builtin-run.c +++ b/tools/kvm/builtin-run.c @@ -973,7 +973,7 @@ int k

[PATCH] kvm tools: Remove KVM_NR_CPUS

2011-12-14 Thread Matt Evans
a struct kvm* and therefore kvm->nrcpus). An unused #define in x86/mptable.c is also removed. Signed-off-by: Matt Evans --- tools/kvm/builtin-run.c |9 ++--- tools/kvm/kvm-cpu.c |8 ++-- tools/kvm/kvm.c |2 +-

Re: [PATCH 1/2] kvm tools: Add kvm__has_cap() to check whether a cap is available on the host

2011-12-14 Thread Matt Evans
p;pause_lock); > mutex_unlock(&pause_lock); > } > + > +bool kvm__has_cap(struct kvm *kvm, u32 cap) > +{ > + return ioctl(kvm->sys_fd, KVM_CHECK_EXTENSION, cap) == 0; > +} D'oh, this ne

Re: [PATCH V2 1/2] kvm tools: Add initial SPAPR PPC64 architecture support

2011-12-14 Thread Matt Evans
On 15/12/11 12:37, Alexander Graf wrote: > > On 15.12.2011, at 02:27, Matt Evans wrote: > >> Heya Alex, >> >> On 13/12/11 19:23, Alexander Graf wrote: >>> >>> On 13.12.2011, at 08:00, Matt Evans wrote: >>> >>>> This patch adds a

Re: [PATCH V2 1/2] kvm tools: Add initial SPAPR PPC64 architecture support

2011-12-14 Thread Matt Evans
Heya Alex, On 13/12/11 19:23, Alexander Graf wrote: > > On 13.12.2011, at 08:00, Matt Evans wrote: > >> This patch adds a new arch directory, powerpc, basic file structure, register >> setup and where necessary stubs out arch-specific functions (e.g. interrupts, >>

Re: [PATCH 2/2] kvm tools: Don't use ioeventfds if no KVM_CAP_IOEVENTFD

2011-12-14 Thread Matt Evans
att.nastyhacks--; Acked-by: Matt Evans > --- > tools/kvm/builtin-run.c |2 +- > tools/kvm/include/kvm/ioeventfd.h |2 +- > tools/kvm/ioeventfd.c | 16 +++- > 3 files changed, 17 insertions(+), 3 deletions(-) > > diff --git a/tool

Re: can kvm tool load vmlinux?

2011-12-14 Thread Matt Evans
On 15/12/11 08:24, David Evensky wrote: > > I've been trying see if I can use a vmlinux kernel binary image with kvm tool. > If use a bzImage as > > lkvm run -k .../bzImage --console serial -d /dev/null > > which runs until it expectedly dies since I didn't give it an initramfs or > disk. >

Re: [PATCH] kvm tools: Clean up LINT assignment code

2011-12-14 Thread Matt Evans
On 14 Dec 2011, at 17:13, Sasha Levin wrote: > On Wed, 2011-12-14 at 13:06 +1100, Matt Evans wrote: >> Hi Sasha, >> >> On 12/12/11 06:50, Sasha Levin wrote: >>> Just set delivery mode directly without going through ugly casting. >>> >>> This cl

Re: [PATCH] kvm tools: Clean up LINT assignment code

2011-12-13 Thread Matt Evans
Hi Sasha, On 12/12/11 06:50, Sasha Levin wrote: > Just set delivery mode directly without going through ugly casting. > > This cleans up and simplifies the code. > > Signed-off-by: Sasha Levin > --- > tools/kvm/x86/kvm-cpu.c | 10 ++ > 1 files changed, 2 insertions(+), 8 deletions(-)

Re: [PATCH V3 1/2] kvm tools: Add ability to map guest RAM from hugetlbfs

2011-12-13 Thread Matt Evans
it) so identical to if it were simply a long, nice. Pekka, a re-jiggle fix attached. Thanks, Matt --- From: Matt Evans Date: Wed, 14 Dec 2011 12:10:03 +1100 Subject: [PATCH] kvm tools: Fix build of util.c on 32bit machines commit 378ee7e6dd301347c6bf2c740cb1fb40174bcb8b broke the -Werror bui

Re: [PATCH V2 0/2] kvm tools: PPC64 basic support

2011-12-13 Thread Matt Evans
On 13/12/11 21:23, Sasha Levin wrote: > On Tue, 2011-12-13 at 18:00 +1100, Matt Evans wrote: >> The second patch is a small fix for generic virtio code (now that we have a >> PPC build) which removes reliance on ioeventfds for PPC, which doesn't >> provide >>

Re: [PATCH V2 1/2] kvm tools: Add initial SPAPR PPC64 architecture support

2011-12-13 Thread Matt Evans
On 14 Dec 2011, at 04:43, Pekka Enberg wrote: > On Tue, Dec 13, 2011 at 9:00 AM, Matt Evans wrote: >> +int irq__register_device(u32 dev, u8 *num, u8 *pin, u8 *line) >> +{ >> + fprintf(stderr, "irq__register_device(%d, [%d], [%d], [%d]\n", >> +

[PATCH V2 3/6] kvm tools: Add SPAPR PPC64 HV console

2011-12-12 Thread Matt Evans
This adds the console code, plus VIO HV terminal nodes are added to the device tree so the guest kernel will pick it up. Signed-off-by: Matt Evans --- tools/kvm/Makefile |1 + tools/kvm/powerpc/kvm.c | 33 tools/kvm/powerpc/spapr_hvcons.c | 102

[PATCH V2 4/6] kvm tools: Add PPC64 XICS interrupt controller support

2011-12-12 Thread Matt Evans
, kvm__irq_line() can be called to raise an IRQ on XICS. Signed-off-by: Matt Evans --- tools/kvm/Makefile |1 + tools/kvm/powerpc/include/kvm/kvm-arch.h |1 + tools/kvm/powerpc/include/kvm/kvm-cpu-arch.h |2 + tools/kvm/powerpc/irq.c | 17

[PATCH V2 5/6] kvm tools: Add PPC64 PCI Host Bridge

2011-12-12 Thread Matt Evans
This provides the PCI bridge, definitions for the address layout of the windows and wires in IRQs. Once PCI devices are all registered, they are enumerated and DT nodes generated for each. Signed-off-by: Matt Evans --- tools/kvm/powerpc/include/kvm/kvm-arch.h |3 + tools/kvm/powerpc/irq.c

[PATCH V2 6/6] kvm tools: Add PPC64 kvm_cpu__emulate_io()

2011-12-12 Thread Matt Evans
This is the final piece of the puzzle for PPC SPAPR PCI; this function splits MMIO accesses into the two PHB windows & directs things to MMIO/IO emulation as appropriate. Signed-off-by: Matt Evans --- tools/kvm/Makefile |1 + tools/kvm/powerpc/include/kvm/kvm

[PATCH V2 2/6] kvm tools: Add SPAPR PPC64 hcall & rtascall structure

2011-12-12 Thread Matt Evans
tree. Signed-off-by: Matt Evans --- tools/kvm/Makefile |2 + tools/kvm/powerpc/kvm-cpu.c |6 + tools/kvm/powerpc/kvm.c | 46 - tools/kvm/powerpc/spapr.h | 105 ++ tools/kvm/powerpc/spapr_hcall.c | 132 ++ tools

[PATCH V2 1/6] kvm tools: Generate SPAPR PPC64 guest device tree

2011-12-12 Thread Matt Evans
a variety of POWER CPUs should acquire this info from the host and encode appropriately. This requires a 64-bit libfdt. Signed-off-by: Matt Evans --- tools/kvm/Makefile |3 +- tools/kvm/powerpc/include/kvm/kvm-arch.h | 10 ++ tools/kvm/powerpc/kvm.c

[PATCH V2 0/6] Add initial SPAPR PPC64 architecture support

2011-12-12 Thread Matt Evans
LOF. Some of the code within is borrowed/based upon code in QEMU, particularly the XICS emulation, device tree construction and PCI setup. Matt Evans (6): kvm tools: Generate SPAPR PPC64 guest device tree kvm tools: Add SPAPR PPC64 hcall & rtascall structure kvm tools: Add SPAPR PPC64 HV

[PATCH V2 2/2] kvm tools: Make virtio-pci's ioeventfd__add_event() fall back gracefully if ioeventfds unavailable

2011-12-12 Thread Matt Evans
Some KVM implementations (e.g. PPC) don't yet support ioeventfds, so don't bomb out/die. virtio-pci is able to function if it instead uses normal IO port notification. Signed-off-by: Matt Evans --- tools/kvm/Makefile|2 +- tools/kvm/include/kvm/ioeventfd.h |3

[PATCH V2 1/2] kvm tools: Add initial SPAPR PPC64 architecture support

2011-12-12 Thread Matt Evans
lat binary kernels (plus initrd). (bzImages are not used on PPC, and this series does not add zImage support or an ELF loader.) The intention is to later support loading firmware such as SLOF. Signed-off-by: Matt Evans --- tools/kvm/Makefile | 10

[PATCH V2 0/2] kvm tools: PPC64 basic support

2011-12-12 Thread Matt Evans
which doesn't provide them. Matt Evans (2): kvm tools: Add initial SPAPR PPC64 architecture support kvm tools: Make virtio-pci's ioeventfd__add_event() fall back gracefully if ioeventfds unavailable tools/kvm/Makefile | 10 + tools/kvm/include/kvm/ioeve

Re: [PATCH V2 04/23] kvm tools: Get correct 64-bit types on PPC64 and link appropriately

2011-12-12 Thread Matt Evans
Hi Pekka, On 09/12/11 17:53, Matt Evans wrote: > kvmtool's types.h includes , which by default on PPC64 brings in > int-l64.h; define __SANE_USERSPACE_TYPES__ to get LL64 types. > > This patch also adds CFLAGS to the final link, so that any -m64 is obeyed > when linking, too

[PATCH V3 2/2] kvm tools: Create arch-specific kvm_cpu__emulate_{mm}io()

2011-12-12 Thread Matt Evans
main runloop's IO and MMIO exit handlers. For x86, these directly call kvm__emulate_io() and kvm__emulate_mmio() but other architectures will perform some address munging before passing on the call. Signed-off-by: Matt Evans --- tools/kvm/kvm-cpu.c |

[PATCH V3 1/2] kvm tools: Add ability to map guest RAM from hugetlbfs

2011-12-12 Thread Matt Evans
MADV_HUGEPAGES so that, if the user asks for hugepages, we definitely are using hugepages. (This is particularly useful for architectures that don't yet support KVM without hugepages, so we definitely need to use them for the whole of guest RAM.) Signed-off-by: Matt Evans --- tools/kvm/bu

[PATCH V3 0/2] kvm tools: Prepare kvmtool for another architecture

2011-12-12 Thread Matt Evans
The last remaining patches from the preparation series, with changes: - Map from hugetlbfs does plain statfs (without odd error checking), checks result of ftruncate() - Remove typo whereby kvm_cpu__emulate_mmio() calls self. Cheers, Matt Matt Evans (2): kvm tools: Add ability to map

Re: [PATCH V2 17/23] kvm tools: Add ability to map guest RAM from hugetlbfs

2011-12-11 Thread Matt Evans
On 09/12/11 19:38, Pekka Enberg wrote: > On Fri, Dec 9, 2011 at 8:55 AM, Matt Evans wrote: >> Add a --hugetlbfs commandline option to give a path to hugetlbfs-map guest >> memory (down in kvm__arch_init()). For x86, guest memory is a normal >> ANON mmap() if this o

Re: [PATCH V2 17/23] kvm tools: Add ability to map guest RAM from hugetlbfs

2011-12-11 Thread Matt Evans
On 09/12/11 19:42, Pekka Enberg wrote: > On Fri, Dec 9, 2011 at 8:55 AM, Matt Evans wrote: >> Add a --hugetlbfs commandline option to give a path to hugetlbfs-map guest >> memory (down in kvm__arch_init()). For x86, guest memory is a normal >> ANON mmap() if this o

Re: [PATCH V2 17/23] kvm tools: Add ability to map guest RAM from hugetlbfs

2011-12-11 Thread Matt Evans
On 09/12/11 18:39, Sasha Levin wrote: > On Fri, 2011-12-09 at 17:55 +1100, Matt Evans wrote: >> Add a --hugetlbfs commandline option to give a path to hugetlbfs-map guest >> memory (down in kvm__arch_init()). For x86, guest memory is a normal >> ANON mmap() if this o

Re: [PATCH V2 23/23] kvm tools: Create arch-specific kvm_cpu__emulate_{mm}io()

2011-12-11 Thread Matt Evans
On 09/12/11 18:53, Sasha Levin wrote: > On Fri, 2011-12-09 at 17:56 +1100, Matt Evans wrote: >> @@ -30,4 +31,18 @@ struct kvm_cpu { >> struct kvm_coalesced_mmio_ring *ring; >> }; >> >> +/* >> + * As these are such simple wrappers, let's have

Re: [PATCH V2 04/23] kvm tools: Get correct 64-bit types on PPC64 and link appropriately

2011-12-11 Thread Matt Evans
On 09/12/11 19:29, Pekka Enberg wrote: > On Fri, Dec 9, 2011 at 10:24 AM, Sasha Levin wrote: >> If you also got kernel patches that add __SANE_USERSPACE_TYPES__ to the >> headers, and KVM_CAP_NR_VCPUS to KVM PPC, we can carry them in the KVM >> tools tree as well. > > Yup, all we need is ACKs fro

[PATCH V2 23/23] kvm tools: Create arch-specific kvm_cpu__emulate_{mm}io()

2011-12-08 Thread Matt Evans
main runloop's IO and MMIO exit handlers. For x86, these directly call kvm__emulate_io() and kvm__emulate_mmio() but other architectures will perform some address munging before passing on the call. Signed-off-by: Matt Evans --- tools/kvm/kvm-cpu.c |

[PATCH V2 22/23] kvm tools: Arch-specific define for PCI MMIO allocation area

2011-12-08 Thread Matt Evans
pci_get_io_space_block() used to grab addresses from KVM_32BIT_GAP_START + 0x100, which is x86-specific. Create a new define, KVM_PCI_MMIO_AREA, to specify a bus address these allocations can come from. Signed-off-by: Matt Evans --- tools/kvm/pci.c |8

[PATCH V2 21/23] kvm tools: Add pci__config_{rd,wr}(), pci__find_dev()

2011-12-08 Thread Matt Evans
This allows config space access in a more natural manner than clunky x86 IO ports, and is useful for other architectures. Internally, the x86 IO port access uses these new config space interfaces. Signed-off-by: Matt Evans --- tools/kvm/include/kvm/pci.h |9 +- tools/kvm/pci.c

[PATCH V2 20/23] kvm tools: Correctly set virtio-pci bar_size and remove hardwired address

2011-12-08 Thread Matt Evans
The BAR addresses are set up fine, but missed the bar_size[] array which is now updated correspondingly. Use PCI_IO_SIZE instead of '0x100'. Signed-off-by: Matt Evans --- tools/kvm/virtio/pci.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/

[PATCH V2 19/23] kvm tools: Endian-sanitise pci.h and PCI device setup

2011-12-08 Thread Matt Evans
vesa, pci-shmem and virtio-pci devices need to set up config space with little-endian conversions (as config space is LE). The pci_config_address bitfield also needs to be reversed when building on BE systems. Signed-off-by: Matt Evans --- tools/kvm/hw/pci-shmem.c | 23

[PATCH V2 18/23] kvm tools: Move PCI_MAX_DEVICES to pci.h

2011-12-08 Thread Matt Evans
Other pieces of kvmtool may be interested in PCI_MAX_DEVICES. Signed-off-by: Matt Evans --- tools/kvm/include/kvm/pci.h |1 + tools/kvm/pci.c |1 - 2 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/kvm/include/kvm/pci.h b/tools/kvm/include/kvm/pci.h index

[PATCH V2 17/23] kvm tools: Add ability to map guest RAM from hugetlbfs

2011-12-08 Thread Matt Evans
Add a --hugetlbfs commandline option to give a path to hugetlbfs-map guest memory (down in kvm__arch_init()). For x86, guest memory is a normal ANON mmap() if this option is not provided, otherwise a hugetlbfs mmap. Signed-off-by: Matt Evans --- tools/kvm/builtin-run.c |4 ++- tools

[PATCH V2 16/23] kvm tools: Init IRQs after determining nrcpus

2011-12-08 Thread Matt Evans
IRQ init may involve per-CPU setup/allocation of resources, so make sure kvm->nrcpus is initialised before calling irq__init(). Signed-off-by: Matt Evans --- tools/kvm/builtin-run.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/kvm/builtin-run.c b/tools/

[PATCH V2 15/23] kvm tools: Perform CPU and firmware setup after devices are added

2011-12-08 Thread Matt Evans
setup, cpu init to occur last. Signed-off-by: Matt Evans --- tools/kvm/builtin-run.c | 24 ++-- 1 files changed, 14 insertions(+), 10 deletions(-) diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c index 99db522..7491428 100644 --- a/tools/kvm/builtin-run.c +++ b

[PATCH V2 14/23] kvm tools: Initialise PCI before devices start getting registered with PCI

2011-12-08 Thread Matt Evans
Re-arrange pci__init() in builtin-run such that it comes before devices are initialised. Signed-off-by: Matt Evans --- tools/kvm/builtin-run.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c index c067685..99db522

[PATCH V2 13/23] kvm tools: Allow load_flat_binary() to load an initrd alongside

2011-12-08 Thread Matt Evans
ular architecture. :-) Signed-off-by: Matt Evans --- tools/kvm/include/kvm/kvm.h |2 +- tools/kvm/kvm.c | 10 ++ tools/kvm/x86/kvm.c | 13 ++--- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/tools/kvm/include/kvm/kvm.h b/tools/kvm/include

[PATCH V2 12/23] kvm tools: Allow initrd_check() to match a cpio

2011-12-08 Thread Matt Evans
cpios are valid as initrds too, so allow them through the check. Signed-off-by: Matt Evans --- tools/kvm/kvm.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/kvm/kvm.c b/tools/kvm/kvm.c index 0bbe9ba..d26e3d7 100644 --- a/tools/kvm/kvm.c +++ b/tools/kvm

[PATCH V2 11/23] kvm tools: Fix term_getc(), term_getc_iov() endian bugs

2011-12-08 Thread Matt Evans
iov rather than an int. Signed-off-by: Matt Evans --- tools/kvm/term.c |7 ++- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/kvm/term.c b/tools/kvm/term.c index fb5d71c..b7d8934 100644 --- a/tools/kvm/term.c +++ b/tools/kvm/term.c @@ -30,16 +30,13 @@ int ter

[PATCH V2 10/23] kvm tools: Add CONSOLE_HV term type and allow it to be selected

2011-12-08 Thread Matt Evans
This patch paves the way for adding a hypervisor console, useful on systems that support one out of the box yet don't have either serial port or virtio console support (e.g. kernels expecting POWER SPAPR). Signed-off-by: Matt Evans --- tools/kvm/builtin-run.c |8 ++-- tool

[PATCH V2 09/23] kvm tools: Move arch-specific cmdline init into kvm__arch_set_cmdline()

2011-12-08 Thread Matt Evans
Different systems will want different base kernel commandlines, e.g. non-x86 systems probably don't need noapic, i8042.* etc., so set the commandline up in arch-specific code. Then, if the resulting commandline is empty, don't strcat a space onto the front. Signed-off-by: Matt Evans

[PATCH V2 08/23] kvm tools: Add kvm__arch_periodic_poll()

2011-12-08 Thread Matt Evans
Currently, the SIGALRM handler calls device poll functions (for serial, virtio console) directly. Which devices are present and which require polling is a system-specific decision, so create a new function called from common code & move the x86-specific poll calls into it. Signed-off-by:

[PATCH V2 07/23] kvm tools: Fix KVM_RUN exit code check

2011-12-08 Thread Matt Evans
kvm_cpu__run() currently die()s if KVM_RUN returns non-zero. Some architectures may return positive values in non-error cases, whereas real errors are always negative return values. Check for those instead. Signed-off-by: Matt Evans --- tools/kvm/kvm-cpu.c |2 +- 1 files changed, 1

[PATCH V2 06/23] kvm tools: Don't die if KVM_CAP_NR_VCPUS isn't available

2011-12-08 Thread Matt Evans
We die() if we can't read KVM_CAP_NR_VCPUS, but the API docs suggest to assume the value 4 in this case. This is pertinent to PPC KVM, which currently does not support this CAP. Signed-off-by: Matt Evans --- tools/kvm/kvm.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-)

[PATCH V2 05/23] kvm tools: Add arch-specific KVM_RUN exit handling via kvm_cpu__handle_exit()

2011-12-08 Thread Matt Evans
This patch creates a new function in x86/kvm-cpu.c, kvm_cpu__handle_exit(), in which arch-specific exit reasons can be handled outside of the common runloop. Signed-off-by: Matt Evans --- tools/kvm/include/kvm/kvm-cpu.h |2 ++ tools/kvm/kvm-cpu.c | 10 -- tools/kvm/x86

[PATCH V2 04/23] kvm tools: Get correct 64-bit types on PPC64 and link appropriately

2011-12-08 Thread Matt Evans
kvmtool's types.h includes , which by default on PPC64 brings in int-l64.h; define __SANE_USERSPACE_TYPES__ to get LL64 types. This patch also adds CFLAGS to the final link, so that any -m64 is obeyed when linking, too. Signed-off-by: Matt Evans --- tools/kvm/Makefile |

[PATCH V2 02/23] kvm tools: Add Makefile parameter for kernel include path

2011-12-08 Thread Matt Evans
This patch adds an 'I' parameter to override the default kernel include path of '../../include'. Signed-off-by: Matt Evans --- tools/kvm/Makefile |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/kvm/Makefile b/tools/kvm/Makefile in

[PATCH V2 03/23] kvm tools: Re-arrange Makefile to heed CFLAGS before checking for optional libs

2011-12-08 Thread Matt Evans
The checks for optional libraries build code to perform the tests, so should respect certain CFLAGS -- in particular, -m64 so we check for 64bit libraries if they're required. Signed-off-by: Matt Evans --- tools/kvm/Makefile | 86 ++- 1

[PATCH V2 01/23] kvm tools: Only build/init i8042 on x86

2011-12-08 Thread Matt Evans
Not every architecture has an i8042 kbd controller, so only use this when building for x86. Signed-off-by: Matt Evans --- tools/kvm/Makefile |2 +- tools/kvm/builtin-run.c |2 ++ 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/tools/kvm/Makefile b/tools/kvm/Makefile

[PATCH V2 00/23] kvm tools: Prepare kvmtool for another architecture

2011-12-08 Thread Matt Evans
vm_cpu__emulate_mmio and _io) Applies on top of Pekka's linux-kvm.git as of today. Cheers, Matt Matt Evans (23): kvm tools: Only build/init i8042 on x86 kvm tools: Add Makefile parameter for kernel include path kvm tools: Re-arrange Makefile to heed CFLAGS before checking for optional

Re: [PATCH 05/28] kvm tools: 64-bit tidy; use PRIx64 when printf'ing u64s and link appropriately

2011-12-07 Thread Matt Evans
On 08/12/11 16:49, Ingo Molnar wrote: > > * Matt Evans wrote: > >> Since tools/kvm/include/linux/types.h only requires __u32, >> __u64 et al from , wouldn't it be most >> straightforward to just #include ? >> This avoids #define __KERNEL__ breaking ot

Re: [PATCH 05/28] kvm tools: 64-bit tidy; use PRIx64 when printf'ing u64s and link appropriately

2011-12-07 Thread Matt Evans
On 08/12/11 15:56, Matt Evans wrote: > On 08/12/11 15:49, Ingo Molnar wrote: >> >> * Matt Evans wrote: >> >>> On 08/12/11 04:14, Pekka Enberg wrote: >>>> On Wed, 7 Dec 2011, Ingo Molnar wrote: >>>> >>>>> >>>&g

Re: [PATCH 05/28] kvm tools: 64-bit tidy; use PRIx64 when printf'ing u64s and link appropriately

2011-12-07 Thread Matt Evans
On 08/12/11 15:49, Ingo Molnar wrote: > > * Matt Evans wrote: > >> On 08/12/11 04:14, Pekka Enberg wrote: >>> On Wed, 7 Dec 2011, Ingo Molnar wrote: >>> >>>> >>>> * Matt Evans wrote: >>>> >>>>>>> [...]

Re: [PATCH 05/28] kvm tools: 64-bit tidy; use PRIx64 when printf'ing u64s and link appropriately

2011-12-07 Thread Matt Evans
On 08/12/11 04:14, Pekka Enberg wrote: > On Wed, 7 Dec 2011, Ingo Molnar wrote: > >> >> * Matt Evans wrote: >> >>>>> [...] I haven't looked closely at Matt's >>>>> patches, but it should be possible to use [un]signed long long &g

Re: [PATCH 08/28] kvm tools: Fix KVM_RUN exit code check

2011-12-07 Thread Matt Evans
or these reasons, until I hear more complaint ;) ) Cheers, Matt > > On Tue, 2011-12-06 at 14:39 +1100, Matt Evans wrote: >> kvm_cpu__run() currently die()s if KVM_RUN returns non-zero. Some >> architectures >> may return positive values in non-error cases, where

Re: [PATCH 1/8] kvm tools: Add initial SPAPR PPC64 architecture support

2011-12-07 Thread Matt Evans
On 08/12/11 05:31, Scott Wood wrote: > On 12/07/2011 01:35 AM, Matt Evans wrote: >> Hi Scott, >> >> On 07/12/11 05:03, Scott Wood wrote: >>> On 12/05/2011 10:05 PM, Matt Evans wrote: >>>> This patch adds a new arch directory, powerpc, basic file stru

[PATCH] kvm tools: Correctly limit nrcpus to max_cpus

2011-12-07 Thread Matt Evans
Fix a typo where kvm->nrcpus was set, then immediately overwritten with older value. Signed-off-by: Matt Evans --- tools/kvm/builtin-run.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c index cbf8777..84db7ea 100

Re: [PATCH 02/28] kvm tools: Only build/init i8042 on x86

2011-12-06 Thread Matt Evans
On 07/12/11 05:59, Scott Wood wrote: > On 12/05/2011 09:37 PM, Matt Evans wrote: >> Not every architecture has an i8042 kbd controller, so only use this when >> building for x86. > > There are non-x86 machines that have one, though -- does KVM tool have > any sort

Re: [PATCH 1/8] kvm tools: Add initial SPAPR PPC64 architecture support

2011-12-06 Thread Matt Evans
Hi Scott, On 07/12/11 05:03, Scott Wood wrote: > On 12/05/2011 10:05 PM, Matt Evans wrote: >> This patch adds a new arch directory, powerpc, basic file structure, register >> setup and where necessary stubs out arch-specific functions (e.g. interrupts, >> runloop exits) th

Re: [PATCH 07/28] kvm tools: Move 'kvm__recommended_cpus' to arch-specific code

2011-12-06 Thread Matt Evans
On 07/12/11 18:24, Alexander Graf wrote: > > On 07.12.2011, at 08:19, Matt Evans wrote: > >> On 07/12/11 17:34, Sasha Levin wrote: >>> On Wed, 2011-12-07 at 17:17 +1100, Matt Evans wrote: >>>> On 06/12/11 19:20, Sasha Levin wrote: >>>&

Re: [PATCH 07/28] kvm tools: Move 'kvm__recommended_cpus' to arch-specific code

2011-12-06 Thread Matt Evans
On 07/12/11 17:34, Sasha Levin wrote: > On Wed, 2011-12-07 at 17:17 +1100, Matt Evans wrote: >> On 06/12/11 19:20, Sasha Levin wrote: >>> Why is it getting moved out of generic code? >>> >>> This is used to determine the maximum amount of vcpus supported by the

Re: [PATCH 05/28] kvm tools: 64-bit tidy; use PRIx64 when printf'ing u64s and link appropriately

2011-12-06 Thread Matt Evans
Hi Ingo, On 06/12/11 21:24, Ingo Molnar wrote: > > * Paul Mackerras wrote: > >> On Tue, Dec 06, 2011 at 09:28:27AM +0100, Ingo Molnar wrote: >>> >>> * Sasha Levin wrote: >>> Ingo actually got us to remove all the PRI* specifiers, but that was back when we only did x86 :)

Re: [PATCH 28/28] kvm tools: Create arch-specific kvm_cpu__emulate_io()

2011-12-06 Thread Matt Evans
's nicer, I'll make that change... less invasive. Cheers, Matt > > On Tue, 2011-12-06 at 14:43 +1100, Matt Evans wrote: >> Different architectures will deal with MMIO exits differently. For example, >> KVM_EXIT_IO is x86-specific, and I/O cycles are often s

Re: [PATCH 07/28] kvm tools: Move 'kvm__recommended_cpus' to arch-specific code

2011-12-06 Thread Matt Evans
I repost. This will have the effect of PPC being limited to 4 CPUs until the kernel supports that CAP. (I'll see about this part too.) Thanks, Matt > > On Tue, 2011-12-06 at 14:39 +1100, Matt Evans wrote: >> Architectures can recommend/count/determine number of CPUs differ

Re: [PATCH 17/28] kvm tools: Only call symbol__init() if we have BFD

2011-12-06 Thread Matt Evans
arrassing so I'll just drop this patch from the series. ;-) Thanks, Matt > > On Tue, 2011-12-06 at 14:41 +1100, Matt Evans wrote: >> CONFIG_HAS_BFD is optional, symbol.c inclusion is optional -- so make its >> init >> call dependent on CONFIG_HAS_BFD. >> &

Re: [PATCH 23/28] kvm tools: Endian-sanitise pci.h and PCI device setup

2011-12-06 Thread Matt Evans
On 07/12/11 00:38, Cyrill Gorcunov wrote: > On Tue, Dec 06, 2011 at 03:29:00PM +0200, Pekka Enberg wrote: >>> >>> Hehe, this is because it should be rtaher defined as >>> >>> union pci_config_address { >>> struct { >>> #if __BYTE_ORDER == __LITTLE_ENDIAN >>> unsignedzeros : 2; >

Re: [PATCH 14/28] kvm tools: Fix term_getc(), term_getc_iov() endian bugs

2011-12-06 Thread Matt Evans
Hi Asias, On 06/12/11 23:00, Asias He wrote: > On 12/06/2011 06:24 PM, Pekka Enberg wrote: >> On Tue, Dec 6, 2011 at 5:40 AM, Matt Evans wrote: >>> term_getc()'s int c has one byte written into it (at its lowest address) by >>> read_in_full(). This is expected

Re: [PATCH 16/28] kvm tools: Allow load_flat_binary() to load an initrd alongside

2011-12-06 Thread Matt Evans
Hi Cyrill, On 06/12/11 23:04, Cyrill Gorcunov wrote: > On Tue, Dec 06, 2011 at 12:29:48PM +0200, Pekka Enberg wrote: > ... >> >> Otherwise looks OK to me. Cyrill? >> > > It might be not seen from patch (or my local kvm repo > is not yet updated well) but I somehow miss who will be > reading initr

Re: [PATCH 21/28] kvm tools: Add --hugetlbfs option to specify memory path

2011-12-06 Thread Matt Evans
ation for the later "[PATCH 1/8] kvm tools: Add initial SPAPR PPC64 architecture support" patch, which uses it. I could've mushed that into the later PPC series but I thought it'd be clearer to do the generic/x86 stuff separately. Matt > > On Tue, 2011-12-06 at

Re: [PATCH 08/28] kvm tools: Fix KVM_RUN exit code check

2011-12-06 Thread Matt Evans
or is there any value to the expanded the return codes (and updating api.txt) for varying kinds of positive success? Cheers, Matt > > On Tue, 2011-12-06 at 14:39 +1100, Matt Evans wrote: >> kvm_cpu__run() currently die()s if KVM_RUN returns non-zero. Some >> architectures >

  1   2   >