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

2012-07-16 Thread Michael Ellerman
Hi all, This is a series for kvmtool that uses a newish kernel API to get MMU info, which is then fed to the guest. Currently we just make a good guess based on the PVR, but that is potentially flakey in a few ways. The most notable is that if you don't specify hugepages we don't boot - because t

[PATCH 03/10] kvm tools: Remember page size as kvm->ram_pagesize

2012-07-16 Thread Michael Ellerman
off-by: Michael Ellerman --- tools/kvm/include/kvm/util.h |4 +++- tools/kvm/powerpc/include/kvm/kvm-arch.h |1 + tools/kvm/powerpc/kvm.c |2 +- tools/kvm/util/util.c| 13 + tools/kvm/x86/include/kvm/kvm-arch.h |

[PATCH 08/10] kvm tools, powerpc: Use MMU info from the kernel for ibm,segment-page-sizes

2012-07-16 Thread Michael Ellerman
ist of page sizes against the page size of the memory backing guest RAM - this accounts for the unfortunate amount of code in setup_mmu_info(). Finally we need to turn the structure as returned by the kernel into the format expected in the device tree. Signed-off-by: Michael Ellerman --- tools/

[PATCH 09/10] kvm tools, powerpc: Use MMU info for ibm,processor-segment-sizes

2012-07-16 Thread Michael Ellerman
Signed-off-by: Michael Ellerman --- tools/kvm/powerpc/cpu_info.c |7 --- tools/kvm/powerpc/cpu_info.h |2 -- tools/kvm/powerpc/kvm.c |7 --- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/tools/kvm/powerpc/cpu_info.c b/tools/kvm/powerpc/cpu_info.c index

[PATCH 10/10] kvm tools, powerpc: Use MMU info for ibm,slb-size

2012-07-16 Thread Michael Ellerman
Signed-off-by: Michael Ellerman --- tools/kvm/powerpc/cpu_info.c |3 +-- tools/kvm/powerpc/cpu_info.h |1 - tools/kvm/powerpc/kvm.c |5 +++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/kvm/powerpc/cpu_info.c b/tools/kvm/powerpc/cpu_info.c index 82a9d4f

[PATCH 01/10] kvm tools: Move mmap_anon_or_hugetblfs() into util

2012-07-16 Thread Michael Ellerman
So we can use it on powerpc. Signed-off-by: Michael Ellerman --- tools/kvm/include/kvm/util.h |2 +- tools/kvm/util/util.c| 13 + tools/kvm/x86/kvm.c | 13 - 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tools/kvm/include/kvm

[PATCH 05/10] kvm tools, powerpc: Use ARRAY_SIZE() in find_cpu_info()

2012-07-16 Thread Michael Ellerman
Signed-off-by: Michael Ellerman --- tools/kvm/powerpc/cpu_info.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/kvm/powerpc/cpu_info.c b/tools/kvm/powerpc/cpu_info.c index ad27451..7326f5b 100644 --- a/tools/kvm/powerpc/cpu_info.c +++ b/tools/kvm/powerpc/cpu_info.c

[PATCH 07/10] kvm tools, powerpc: Restructure find_cpu_info()

2012-07-16 Thread Michael Ellerman
We are about to add more logic to find_cpu_info(). To support this we need to pass kvm through to it, and also restructure the return flow so we can operate on info before it is returned. Signed-off-by: Michael Ellerman --- tools/kvm/powerpc/cpu_info.c | 16 +++- tools/kvm/powerpc

[PATCH 06/10] kvm tools, powerpc: Reformatting in find_cpu_info()

2012-07-16 Thread Michael Ellerman
Matt's enter key was broken when he wrote this ;) Signed-off-by: Michael Ellerman --- tools/kvm/powerpc/cpu_info.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/kvm/powerpc/cpu_info.c b/tools/kvm/powerpc/cpu_info.c index 7326f5b..586b232 100644 --- a/

[PATCH 04/10] kvm tools, powerpc: Use designated initializers for struct cpu_info

2012-07-16 Thread Michael Ellerman
Using designated initializers for structs is preferable because it is self documenting, and more robust against changes to the structure layout. Signed-off-by: Michael Ellerman --- tools/kvm/powerpc/cpu_info.c | 38 +- tools/kvm/powerpc/cpu_info.h |6

[PATCH 02/10] kvm tools, powerpc: Use mmap_anon_or_hugetblfs() in kvm__arch_init()

2012-07-16 Thread Michael Ellerman
It implements essentially the same logic. The one difference is it sets MAP_NORESERVE when using anonymous mmap, but I think that is OK. Reword the comment about hugetblfs, we are no longer required to use hugepages to back the guest. Signed-off-by: Michael Ellerman --- tools/kvm/powerpc/kvm.c

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

2012-07-17 Thread Michael Ellerman
On Tue, 2012-07-17 at 10:33 +0100, Matt Evans wrote: > Hi Michael, > > On 2012-07-17 06:00, Michael Ellerman wrote: > > > This is a series for kvmtool that uses a newish kernel API to get > > MMU info, which is then fed to the guest. > > > > Currently we jus

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

2012-07-17 Thread Michael Ellerman
On Tue, 2012-07-17 at 17:09 +0300, Pekka Enberg wrote: > On Tue, Jul 17, 2012 at 12:33 PM, Matt Evans wrote: > > Just had a look, all good. Thanks for tidying some old FIXMEs, especially > > the page/segment DT props encoding grot -- and the designated inits in the > > cpuinfo struct, whew, I hea

[PATCH] kvm tools: Fix crash when /etc/resolv.conf doesn't exist

2012-08-09 Thread Michael Ellerman
In uip_dhcp_get_dns() we try to open /etc/resolv.conf. If we fail to open it we then SEGV trying to fclose() it. Fix the code to just return directly if we can't open it. Signed-off-by: Michael Ellerman --- tools/kvm/net/uip/dhcp.c |3 +-- 1 file changed, 1 insertion(+), 2 dele

[PATCH 1/2] kvm tools: Fix formatting of error message in TAP handling

2012-08-09 Thread Michael Ellerman
on't split the line to improve grepability. Signed-off-by: Michael Ellerman --- tools/kvm/virtio/net.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/kvm/virtio/net.c b/tools/kvm/virtio/net.c index 10420ae..8f3735b 100644 --- a/tools/kvm/virtio/net.c +++ b/tools/kvm/vi

[PATCH 2/2] kvm tools: Check for unknown parameters in network option handling

2012-08-09 Thread Michael Ellerman
Currently the parsing of network command line parameters doesn't check for unknown parameters. For example "-n mod=none" will cause kvmtool to setup TAP networking. Save users from their typos by checking for unknown parameters and bailing. Signed-off-by: Michael Ellerman

Re: [PATCH 2/2] kvm tools: Check for unknown parameters in network option handling

2012-08-12 Thread Michael Ellerman
On Sat, 2012-08-11 at 08:21 +0800, Asias He wrote: > On Fri, Aug 10, 2012 at 1:38 PM, Michael Ellerman > wrote: > > Currently the parsing of network command line parameters doesn't check > > for unknown parameters. > > > > For example "-n mod=none&quo

[PATCH 2/4] kvm tools: Use asm/barrier.h on powerpc

2012-07-04 Thread Michael Ellerman
Commit 141124c deleted system.h, we really want barrier.h Signed-off-by: Michael Ellerman --- tools/kvm/powerpc/include/kvm/barrier.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/kvm/powerpc/include/kvm/barrier.h b/tools/kvm/powerpc/include/kvm/barrier.h index

[PATCH 1/4] kvm tools: Define KVM_VIRTIO_MMIO_AREA for powerpc

2012-07-04 Thread Michael Ellerman
idea, or whether it works at all. Signed-off-by: Michael Ellerman --- I don't see any logic in pci_get_io_space_block() to stop it running into the VIRTIO area? But I haven't dug any further. --- tools/kvm/powerpc/include/kvm/kvm-arch.h |1 + 1 file changed, 1 insertion(+)

[PATCH 3/4] kvm tools: Support cross compilation

2012-07-04 Thread Michael Ellerman
: Michael Ellerman --- Tested on x86_64 and powerpc, and cross compiling powerpc. I don't have an i386 box around sorry. --- tools/kvm/Makefile |8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/kvm/Makefile b/tools/kvm/Makefile index 7a9d3b6..501387b 1

[PATCH 4/4] kvm tools: Cleanup ARCH & uname_M in Makefile

2012-07-04 Thread Michael Ellerman
The sed expression for ARCH seems to have been cribbed from the top-level kernel Makefile, and includes lots of architectures kvmtool doesn't support - strip it down. Also call uname -m directly there and get rid of uname_M. Signed-off-by: Michael Ellerman --- tools/kvm/Makefile |

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

2012-07-04 Thread Michael Ellerman
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. Signed-off-by: Michael Ellerman --- tools/kvm/powerpc/kvm-cpu.c |6 -- 1 file changed, 4

[PATCH 1/2] kvm tool: Report error and don't segfault if kvm__init() fails

2012-02-05 Thread Michael Ellerman
Signed-off-by: Michael Ellerman --- tools/kvm/builtin-run.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c index 95d35a5..569246e 100644 --- a/tools/kvm/builtin-run.c +++ b/tools/kvm/builtin-run.c @@ -997,6 +997,11

[PATCH 2/2] kvm tool: Initialise kvm fd's to -1 in kvm__new()

2012-02-05 Thread Michael Ellerman
we have closed stdin term_cleanup() doesn't work and the users terminal is fubared. Set both fd's to -1 in kvm__new() to avoid the problem. Signed-off-by: Michael Ellerman --- tools/kvm/kvm.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/tools/kvm/kvm.c b

[PATCH] kvm-tool: Don't try to cleanup ioeventfd if we never initialised it

2012-02-05 Thread Michael Ellerman
nd do nothing if it is false. Signed-off-by: Michael Ellerman --- tools/kvm/ioeventfd.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/tools/kvm/ioeventfd.c b/tools/kvm/ioeventfd.c index f2d5a30..9b328cd 100644 --- a/tools/kvm/ioeventfd.c +++ b/tools/kvm/ioeven

Re: [PATCH 1/2] kvm tool: Report error and don't segfault if kvm__init() fails

2012-02-06 Thread Michael Ellerman
On Mon, 2012-02-06 at 12:22 +0200, Pekka Enberg wrote: > On Mon, 6 Feb 2012, Michael Ellerman wrote: > > diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c > > index 95d35a5..569246e 100644 > > --- a/tools/kvm/builtin-run.c > > +++ b/tools/kvm/builtin-

[PATCH] KVM: x86: Avoid NULL dereference in kvm_apic_accept_pic_intr()

2012-02-06 Thread Michael Ellerman
t;sets up future vcpus to have a local APIC". So the simplest fix seems to be to enforce that ordering in the code. Signed-off-by: Michael Ellerman --- arch/x86/kvm/x86.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c i

Re: [Qemu-devel] [RFC] Next gen kvm api

2012-02-06 Thread Michael Ellerman
On Mon, 2012-02-06 at 13:46 -0600, Scott Wood wrote: > On 02/03/2012 04:52 PM, Anthony Liguori wrote: > > On 02/03/2012 12:07 PM, Eric Northup wrote: > >> On Thu, Feb 2, 2012 at 8:09 AM, Avi Kivity wrote: > >> [...] > >>> > >>> Moving to syscalls avoids these problems, but introduces new ones: > >

Re: [PATCH] KVM: x86: Avoid NULL dereference in kvm_apic_accept_pic_intr()

2012-02-08 Thread Michael Ellerman
On Tue, 2012-02-07 at 17:38 -0200, Marcelo Tosatti wrote: > On Tue, Feb 07, 2012 at 05:32:07PM +1100, Michael Ellerman wrote: > > A test case which does the following: > > > > ioctl(vmfd, KVM_CREATE_VCPU, 0); > > ioctl(vmfd, KVM_CREATE_IRQCHIP); > > ioctl(cpuf

Re: [PATCH] KVM: x86: Avoid NULL dereference in kvm_apic_accept_pic_intr()

2012-02-08 Thread Michael Ellerman
On Wed, 2012-02-08 at 21:41 +1100, Michael Ellerman wrote: > On Tue, 2012-02-07 at 17:38 -0200, Marcelo Tosatti wrote: > > On Tue, Feb 07, 2012 at 05:32:07PM +1100, Michael Ellerman wrote: > > > A test case which does the following: > > > > > > ioctl(vmfd, KV

Re: [Qemu-devel] [RFC] Next gen kvm api

2012-02-15 Thread Michael Ellerman
On Wed, 2012-02-15 at 22:21 +, Arnd Bergmann wrote: > On Tuesday 07 February 2012, Alexander Graf wrote: > > On 07.02.2012, at 07:58, Michael Ellerman wrote: > > > > > On Mon, 2012-02-06 at 13:46 -0600, Scott Wood wrote: > > >> You're exposing a large

Re: [Qemu-devel] [RFC] Next gen kvm api

2012-02-16 Thread Michael Ellerman
On Thu, 2012-02-16 at 21:28 +0200, Avi Kivity wrote: > On 02/16/2012 03:04 AM, Michael Ellerman wrote: > > > > > > ioctl is good for hardware devices and stuff that you want to enumerate > > > and/or control permissions on. For something like KVM that is really

Re: [PATCH] KVM: Ensure all vcpus are consistent with in-kernel irqchip settings

2012-03-05 Thread Michael Ellerman
On Mon, 2012-03-05 at 14:29 +0200, Avi Kivity wrote: > If some vcpus are created before KVM_CREATE_IRQCHIP, then > irqchip_in_kernel() and vcpu->arch.apic will be inconsistent, leading > to potential NULL pointer dereferences. > > Fix by: > - ensuring that no vcpus are installed when KVM_CREATE_IR

[PATCH] kvm tools: Fix powerpc build after kvm__dump_mem() change

2013-02-04 Thread Michael Ellerman
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 --- tools/kvm/powerpc/kvm-cpu.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool

[PATCH 3/6] kvm tools: Rework stdio/stdout handling to support redirection

2013-02-06 Thread Michael Ellerman
, but does work. Note that we skip registering the cleanup routines, so we don't need to modify them. Signed-off-by: Michael Ellerman --- tools/kvm/term.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/kvm/term.c b/tools/kvm/term.c index 4413450..

[PATCH 2/6] kvm tools: More error handling in the ipc code

2013-02-06 Thread Michael Ellerman
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 --- tools/kvm/kvm-ipc.c | 17 + 1 file c

[PATCH 4/6] kvm tools: powerpc: Fix buglet in xics_init() handling of nrcpus

2013-02-06 Thread Michael Ellerman
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 --- tools/kvm/powerpc/xics.c |5 +

[PATCH 1/6] kvm tools: Return error status in lkvm list

2013-02-06 Thread Michael Ellerman
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 --- tools/kvm/builtin-list.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/kvm/builtin-list.c b/tools/kvm

[PATCH 6/6] kvm tools: powerpc: Only emit TB freq if it's non-zero

2013-02-06 Thread Michael Ellerman
The kernel can handle a missing timebase-frequency property much better than one that claims zero. Signed-off-by: Michael Ellerman --- tools/kvm/powerpc/kvm.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/kvm/powerpc/kvm.c b/tools/kvm/powerpc/kvm.c index

[PATCH 5/6] kvm tools: powerpc: Add cpu info entry for POWER8

2013-02-06 Thread Michael Ellerman
We should hard-code less of this stuff, but for now this works. Signed-off-by: Michael Ellerman --- tools/kvm/powerpc/cpu_info.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/tools/kvm/powerpc/cpu_info.c b/tools/kvm/powerpc/cpu_info.c index 11ca14e..a9dfe39 100644 --- a

Re: [PATCH] kvm tools: remove arbitrary minimum RAM limitation

2013-04-24 Thread Michael Ellerman
On Tue, 2013-04-23 at 10:57 -0400, Sasha Levin wrote: > We don't really need 64MB of RAM to boot, it's a nice default if we don't > have anything else - but it's not actually required for anything: Nice, I am carrying something similar locally so I can boot in 4K :) cheers -- To unsubscribe from

Re: [RFC PATCH 00/11] kvm tools: allow ioport emulation to be used on ARM

2013-05-02 Thread Michael Ellerman
On Wed, 2013-05-01 at 16:50 +0100, Will Deacon wrote: > Hi guys, > > This RFC series does a number of things, but the main goal is to allow > re-use of the emulation code under hw/ on architectures other than x86. > It also comes about after discussions concerning virtio-console for > earlyprintk:

Re: [PATCH] kvm tools: fix boot of guests with more than 4gb of ram

2013-06-24 Thread Michael Ellerman
On Sun, 2013-06-23 at 21:23 -0400, Sasha Levin wrote: > Commit "kvm tools: virtio: remove hardcoded assumptions > about guest page size" has introduced a bug that prevented > guests with more than 4gb of ram from booting. > > The issue is that 'pfn' is a 32bit integer, so when multiplying > it by

Re: [v1][PATCH 1/1] powerpc/ppc64: rename SOFT_DISABLE_INTS with RECONCILE_IRQ_STATE

2013-07-23 Thread Michael Ellerman
On Tue, Jul 16, 2013 at 11:09:30AM +0800, Tiejun Chen wrote: > The SOFT_DISABLE_INTS seems an odd name for something that updates the > software state to be consistent with interrupts being hard disabled, so > rename SOFT_DISABLE_INTS with RECONCILE_IRQ_STATE to avoid this confusion. Yes! I have

[PATCH] kvm tools: Fix build of guest init with biarch powerpc compilers

2013-08-07 Thread Michael Ellerman
and x86-64. Signed-off-by: Michael Ellerman --- tools/kvm/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/kvm/Makefile b/tools/kvm/Makefile index 8f996cd..b614aab 100644 --- a/tools/kvm/Makefile +++ b/tools/kvm/Makefile @@ -150,6 +150,7 @@ ifeq ($(ARCH

[PATCH] kvm tools: powerpc: Implement "system-reboot" RTAS call

2013-08-12 Thread Michael Ellerman
oot, and end up spinning in the guest. We can't implement reboot properly, ie. causing a reboot, but it's still preferable to implement it as halt rather than not implementing it at all. Signed-off-by: Michael Ellerman --- tools/kvm/powerpc/spapr_rtas.c | 14 ++ 1 fi

[PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-09-25 Thread Michael Ellerman
Some powernv systems include a hwrng. Guests can access it via the H_RANDOM hcall. We add a real mode implementation of H_RANDOM when a hwrng is found. Userspace can detect the presence of the hwrng by quering the KVM_CAP_PPC_HWRNG capability. Signed-off-by: Michael Ellerman --- arch/powerpc

[PATCH 1/3] powerpc: Implement arch_get_random_long/int() for powernv

2013-09-25 Thread Michael Ellerman
l the dieharder tests. Signed-off-by: Michael Ellerman --- arch/powerpc/Kconfig| 3 + arch/powerpc/include/asm/archrandom.h | 32 + arch/powerpc/include/asm/machdep.h | 4 ++ arch/powerpc/platforms/powernv/Kconfig | 1 + arch/powerpc/platforms/powernv/Makefile

[PATCH 3/6] kvm_stat: Rework platform detection

2014-06-17 Thread Michael Ellerman
e, but isn't in this case. We'd also like to add another platform, powerpc, which will just make it worse. So clean it up in preparation. Signed-off-by: Michael Ellerman --- scripts/kvm/kvm_stat | 44 +--- 1 file changed, 29 insertions(+), 15 del

[PATCH 5/6] kvm_stat: Abstract ioctl numbers

2014-06-17 Thread Michael Ellerman
Unfortunately ioctl numbers are platform specific, so abstract them out of the code so they can be overridden. As it happens x86 and s390 share the same values, so nothing needs to change yet. Signed-off-by: Michael Ellerman --- scripts/kvm/kvm_stat | 12 +--- 1 file changed, 9

[PATCH 4/6] kvm_stat: Fix tracepoint filter definition for s390

2014-06-17 Thread Michael Ellerman
the filter parameter is 'reason'. So invert the way we setup filters, define it by default for the generic tracepoint 'kvm_userspace_exit', and let x86 override it. Doing it this way will also work for powerpc when we add it. Signed-off-by: Michael Ellerman --- scripts/

[PATCH 1/6] kvm_stat: Only consider online cpus

2014-06-17 Thread Michael Ellerman
, the online file will not be present at all. Signed-off-by: Michael Ellerman --- scripts/kvm/kvm_stat | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat index d7e97e7..2a788bc 100755 --- a/scripts/kvm/kvm_stat

[PATCH 2/6] kvm_stat: Fix the non-x86 exit reasons

2014-06-17 Thread Michael Ellerman
are incorrect. As far as I can tell this does not matter in practice because s390 does not define a kvm_exit trace point. While we're there, fix the whitespace to match the rest of the file. Signed-off-by: Michael Ellerman --- scripts/kvm/kvm_stat

[PATCH 6/6] kvm_stat: Add powerpc support

2014-06-17 Thread Michael Ellerman
Add support for powerpc platforms. We use uname -m, which allows us to detect ppc, ppc64 and ppc64le/el. Signed-off-by: Michael Ellerman --- scripts/kvm/kvm_stat | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat

Re: [PATCH 6/6] kvm_stat: Add powerpc support

2014-06-17 Thread Michael Ellerman
On Tue, 2014-06-17 at 10:27 +0200, Alexander Graf wrote: > On 17.06.14 09:54, Michael Ellerman wrote: > > Add support for powerpc platforms. We use uname -m, which allows us to > > detect ppc, ppc64 and ppc64le/el. > > > > Signed-off-by: Michael Ellerman > > Co

Re: [PATCH 6/6] kvm_stat: Add powerpc support

2014-06-17 Thread Michael Ellerman
On Wed, 2014-06-18 at 02:59 +0200, Alexander Graf wrote: > On 18.06.14 02:50, Michael Ellerman wrote: > > On Tue, 2014-06-17 at 10:27 +0200, Alexander Graf wrote: > >> On 17.06.14 09:54, Michael Ellerman wrote: > >>> Add support for powerpc platforms. We us

[PATCH] powerpc/kvm: Fix build break with CONFIG_KVM_BOOK3S_64_HV=y

2014-06-23 Thread Michael Ellerman
Commit e58e263 "PPC, KVM, CMA: use general CMA reserved area management framework" in next-20140624 removed arch/powerpc/kvm/book3s_hv_cma.c but neglected to update the Makefile, thus breaking the build. Signed-off-by: Michael Ellerman --- Hi Andrew, This is in your akpm-curr

Re: [PATCH] powerpc/kvm: Fix build break with CONFIG_KVM_BOOK3S_64_HV=y

2014-06-24 Thread Michael Ellerman
On Tue, 2014-06-24 at 15:51 +0900, Joonsoo Kim wrote: > On Tue, Jun 24, 2014 at 04:36:47PM +1000, Michael Ellerman wrote: > > Commit e58e263 "PPC, KVM, CMA: use general CMA reserved area management > > framework" in next-20140624 removed arch/powerpc/kvm/book3s_hv_cma.c bu

[PATCH] powerpc/kvm: Create proper names for the kvm_host_state PMU fields

2014-07-10 Thread Michael Ellerman
, particularly for the MMCRx/SIxR/SDAR fields, and might have helped us notice the recent double restore bug we had in this code. Signed-off-by: Michael Ellerman --- This is on top of "powerpc/kvm: Remove redundant save of SIER AND MMCR2". arch/powerpc/kernel/asm-offsets.c

Re: [PATCH] powerpc/kvm: Create proper names for the kvm_host_state PMU fields

2014-07-10 Thread Michael Ellerman
On Thu, 2014-07-10 at 12:16 +0200, Alexander Graf wrote: > On 10.07.14 11:34, Michael Ellerman wrote: > > We have two arrays in kvm_host_state that contain register values for > > the PMU. Currently we only create an asm-offsets symbol for the base of > > the arrays, and do th

Re: [PATCH 6/6] kvm_stat: Add powerpc support

2014-11-02 Thread Michael Ellerman
On Fri, 2014-10-31 at 16:36 +0100, Paolo Bonzini wrote: > Thanks, applied the series at last. Thanks. cheers -- 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

[PATCH 2/3] hwrng: Add a driver for the hwrng found in power7+ systems

2013-09-25 Thread Michael Ellerman
"closest" device, avoiding inter-chip memory traffic. Signed-off-by: Guo Chao Signed-off-by: Michael Ellerman --- drivers/char/hw_random/Kconfig | 13 ++ drivers/char/hw_random/Makefile | 1 + drivers/char/hw_random/powernv-rng.c | 81 +++

Re: [PATCH 2/3] hwrng: Add a driver for the hwrng found in power7+ systems

2013-10-01 Thread Michael Ellerman
On Thu, Sep 26, 2013 at 06:01:27PM +1000, Benjamin Herrenschmidt wrote: > On Thu, 2013-09-26 at 16:31 +1000, Michael Ellerman wrote: > > > + pr_info("registered powernv hwrng.\n"); > > First letter of a line should get a capital :-) Also since > it's

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-01 Thread Michael Ellerman
On Thu, Sep 26, 2013 at 11:06:59AM +0200, Paolo Bonzini wrote: > Il 26/09/2013 08:31, Michael Ellerman ha scritto: > > Some powernv systems include a hwrng. Guests can access it via the > > H_RANDOM hcall. > > Is there any reason to do this in the kernel? It's

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-01 Thread Michael Ellerman
On Fri, Sep 27, 2013 at 07:45:45PM +0530, Anshuman Khandual wrote: > On 09/26/2013 12:01 PM, Michael Ellerman wrote: > > +int powernv_hwrng_present(void) > > +{ > > + return __raw_get_cpu_var(powernv_rng) != NULL; > > +} > > + > > static unsigned

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-02 Thread Michael Ellerman
On Wed, 2013-10-02 at 13:02 +0300, Gleb Natapov wrote: > On Wed, Oct 02, 2013 at 11:50:50AM +0200, Alexander Graf wrote: > > > > On 02.10.2013, at 11:11, Alexander Graf wrote: > > > > So how do you solve live migration between a kernel that has this patch and > > one that doesn't? > > > Yes, I

[PATCH 1/3] kvm tools: Fix powerpc build errors caused by recent changes

2012-10-04 Thread Michael Ellerman
char() & h_get_term_char() of kvm->cfg.active_console but needs to be vcpu->kvm->cfg.active_console. That commit also missed updates to term_putc() & term_getc() in spapr_rtas.c, and I'm guessing that we need similar checks of active_console in rtas_put_term_char() & rtas

[PATCH 2/3] kvm tools: Fix segfault on powerpc in xics_register()

2012-10-04 Thread Michael Ellerman
Finally drop irq__exit(), it does nothing and is never called. Signed-off-by: Michael Ellerman --- tools/kvm/powerpc/irq.c | 19 --- tools/kvm/powerpc/kvm-cpu.c |3 --- tools/kvm/powerpc/xics.c| 38 +++--- tools/kvm/powerpc/xics.h

[PATCH 3/3] kvm tools: Do setup_fdt() later, get powerpc to boot again

2012-10-04 Thread Michael Ellerman
_fdt() out of kvm__arch_setup_firmware() and make it a firmware_init() call of its own. With this patch I am able to boot guests again on HV KVM. Signed-off-by: Michael Ellerman --- tools/kvm/powerpc/kvm.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/kvm/powerpc/kvm.c b/tool

Re: [PATCH 1/3] kvm tools: Fix powerpc build errors caused by recent changes

2012-10-04 Thread Michael Ellerman
On Fri, 2012-10-05 at 09:30 +0300, Pekka Enberg wrote: > Applied all three patches, thanks Michael! Thanks Pekka. cheers -- 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/majord

[PATCH] MAINTAINERS: Add git tree link for PPC KVM

2012-10-15 Thread Michael Ellerman
Signed-off-by: Michael Ellerman --- MAINTAINERS |1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index e73060f..32dc107 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4244,6 +4244,7 @@ KERNEL VIRTUAL MACHINE (KVM) FOR POWERPC M: Alexander Graf L: kvm

Re: powerpc/pseries: Use new defines when calling h_set_mode

2014-05-30 Thread Michael Ellerman
On Thu, 2014-05-29 at 17:45 +1000, Michael Neuling wrote: > > > +/* Values for 2nd argument to H_SET_MODE */ > > > +#define H_SET_MODE_RESOURCE_SET_CIABR1 > > > +#define H_SET_MODE_RESOURCE_SET_DAWR2 > > > +#define H_SET_MODE_RESOURCE_ADDR_TRANS_MODE3 > > > +#define H_SET_MODE_R

Re: Extending virtio_console to support multiple ports

2009-08-26 Thread Michael Ellerman
On Wed, 2009-08-26 at 21:15 +0530, Amit Shah wrote: > [cc'ing some people who have made some commits in hvc_console.c] > > On (Wed) Aug 26 2009 [16:57:18], Amit Shah wrote: > > On (Tue) Aug 25 2009 [11:47:20], Amit Shah wrote: > > > > > > Hello all, > > > > > > Here is a new iteration of the pat

Re: [PATCH] msi-x: let drivers retry when not enough vectors

2009-05-07 Thread Michael Ellerman
On Thu, 2009-05-07 at 03:53 -0600, Matthew Wilcox wrote: > On Thu, May 07, 2009 at 05:40:15PM +0800, Sheng Yang wrote: > > It's indeed weird. Why the semantic of pci_enable_msix can be changed to > > "enable msix, or tell me how many vector do you have"? You can simply call > > pci_msix_table_siz

Re: [PATCH] msi-x: let drivers retry when not enough vectors

2009-05-07 Thread Michael Ellerman
On Fri, 2009-05-08 at 09:25 +0930, Rusty Russell wrote: > On Thu, 7 May 2009 07:49:53 pm Sheng Yang wrote: > > On Thursday 07 May 2009 17:53:02 Matthew Wilcox wrote: > > > Here's a good example. Let's suppose you have a driver which supports > > > two different models of cards, one has 16 MSI-X in

Re: [kbuild-all] [PATCH 5/6] KVM: PPC: Book3S HV: Send IPI to host core to wake VCPU

2015-11-02 Thread Michael Ellerman
On Mon, 2015-11-02 at 16:10 -0600, Suresh E. Warrier wrote: > Hi Fengguang, > > I understand the problem. > > I will send you the URL for the powerpc git tree once my patches > are pulled in so that we can then pass that to the robot. The robot already knows about the powerpc next tree. It cho

Re: [v2,2/9] powerpc/smp: Add smp_muxed_ipi_set_message

2015-12-06 Thread Michael Ellerman
On Wed, 2015-25-11 at 23:44:49 UTC, "Suresh E. Warrier" wrote: > smp_muxed_ipi_message_pass() invokes smp_ops->cause_ipi, which > updates the MFFR through an ioremapped address, to cause the > IPI. Because of this real mode callers cannot call > smp_muxed_ipi_message_pass() for IPI messaging. You'

Re: [v2,3/9] powerpc/powernv: Add icp_native_cause_ipi_rm

2015-12-06 Thread Michael Ellerman
Subject would be better as "powerpc/xics". On Wed, 2015-25-11 at 23:44:50 UTC, "Suresh E. Warrier" wrote: > Function to cause an IPI. Requires kvm_hstate.xics_phys > to be initialized with physical address of XICS. Please expand the change log a bit, this is a bit terse. > diff --git a/arch/powe

Re: [PATCH 1/3] powerpc: implement barrier primitives

2015-06-18 Thread Michael Ellerman
On Wed, 2015-06-17 at 11:15 +0100, Will Deacon wrote: > On Wed, Jun 17, 2015 at 10:43:48AM +0100, Andre Przywara wrote: > > Instead of referring to the Linux header including the barrier > > macros, copy over the rather simple implementation for the PowerPC > > barrier instructions kvmtool uses. Th

Re: [PATCH 3/3] powerpc: add hvcall.h header from Linux

2015-06-18 Thread Michael Ellerman
On Wed, 2015-06-17 at 11:13 +0100, Will Deacon wrote: > On Wed, Jun 17, 2015 at 10:43:50AM +0100, Andre Przywara wrote: > > The powerpc code uses some PAPR hypercalls, of which we need the > > hypercall number. Copy the macro definition parts from the kernel's > > (private) hvcall.h file and remove

Re: [PATCH 2/3] powerpc: use default endianness for converting guest/init

2015-06-18 Thread Michael Ellerman
On Thu, 2015-06-18 at 15:52 +0100, Andre Przywara wrote: > Hi, > > On 06/17/2015 10:43 AM, Andre Przywara wrote: > > For converting the guest/init binary into an object file, we call > > the linker binary, setting the endianness to big endian explicitly > > when compiling kvmtool for powerpc. > >

Re: [PATCH] kvmtool: Makefile: allow overriding CC and LD

2015-06-18 Thread Michael Ellerman
On Thu, 2015-06-18 at 16:50 +0100, Andre Przywara wrote: > Currently we set CC unconditionally to ${CROSS_COMPILE}gcc, the same > for LD. > Allow people to override the compiler name by specifying it explicitly > on the command line or via the environment. > Beside calling a certain compiler binary

[PATCH 1/2] powerpc: Define the hcall opcodes & return values we need

2015-06-19 Thread Michael Ellerman
Now that we don't have the kernel header on hand, just define the minimum set of hcall opcodes and return values we need in order to build. Signed-off-by: Michael Ellerman --- powerpc/spapr.h | 25 - 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/po

[PATCH 2/2] powerpc: Enable 32-bit build

2015-06-19 Thread Michael Ellerman
We have always built kvmtool as 64-bit on powerpc, but mainly just out of habit. There's not AFAIK any reason we *can't* build 32-bit. So fix up a few places where we were assuming 64-bit, and drop the Makefile logic that forces 64-bit. Signed-off-by: Michael Ellerman ---

Re: [PATCH 1/2] powerpc: Define the hcall opcodes & return values we need

2015-06-19 Thread Michael Ellerman
On Fri, 2015-06-19 at 17:21 +1000, Michael Ellerman wrote: > Now that we don't have the kernel header on hand, just define the > minimum set of hcall opcodes and return values we need in order to > build. Hi Andre, I hope you don't mind me jumping in here but I thought I sho

Re: [PATCH 2/3] powerpc: use default endianness for converting guest/init

2015-06-21 Thread Michael Ellerman
On Fri, 2015-06-19 at 17:15 +0100, Andre Przywara wrote: > > What works though is using xxd to convert the binary guest/init into a C > array: > $ xxd -i guest/init | $(CC) -x c -c - -o guest/guest_init.o > This has the nice property of using the same compiler that generates the > other object file

Re: [PATCH 1/2] powerpc: Define the hcall opcodes & return values we need

2015-06-23 Thread Michael Ellerman
On Tue, 2015-06-23 at 11:33 +0200, Paolo Bonzini wrote: > On 19/06/2015 09:21, Michael Ellerman wrote: > > diff --git a/powerpc/spapr.h b/powerpc/spapr.h > > index 0537f881c0e4..7a377d093ef4 100644 > > --- a/powerpc/spapr.h > > +++ b/powerpc/spapr.h > > @@ -16

Re: [PATCH] mm: rename and document alloc_pages_exact_node

2015-07-21 Thread Michael Ellerman
_node(area->nid, > GFP_KERNEL|__GFP_THISNODE, > area->order); Yeah that looks right to me. This code enables some firmware memory calibration so I think it really does want to get memory on the

Re: [PATCH] kvm:powerpc:Fix return statements for wrapper functions in the file book3s_64_mmu_hv.c

2015-08-13 Thread Michael Ellerman
On Wed, 2015-08-12 at 21:06 +0200, Alexander Graf wrote: > > On 10.08.15 17:27, Nicholas Krause wrote: > > This fixes the wrapper functions kvm_umap_hva_hv and the function > > kvm_unmap_hav_range_hv to return the return value of the function > > kvm_handle_hva or kvm_handle_hva_range that they ar

Re: [Qemu-devel] [PATCH 19/23] userfaultfd: activate syscall

2015-09-07 Thread Michael Ellerman
On Wed, 2015-08-12 at 10:53 +0530, Bharata B Rao wrote: > On Tue, Aug 11, 2015 at 03:48:26PM +0200, Andrea Arcangeli wrote: > > Hello Bharata, > > > > On Tue, Aug 11, 2015 at 03:37:29PM +0530, Bharata B Rao wrote: > > > May be it is a bit late to bring this up, but I needed the following fix > > >

Re: [Qemu-devel] [PATCH 19/23] userfaultfd: activate syscall

2015-09-08 Thread Michael Ellerman
On Tue, 2015-09-08 at 12:09 +0530, Bharata B Rao wrote: > On Tue, Sep 08, 2015 at 04:08:06PM +1000, Michael Ellerman wrote: > > On Wed, 2015-08-12 at 10:53 +0530, Bharata B Rao wrote: > > > On Tue, Aug 11, 2015 at 03:48:26PM +0200, Andrea Arcangeli wrote: > > > > Hell

Re: [Qemu-devel] [PATCH 19/23] userfaultfd: activate syscall

2015-09-08 Thread Michael Ellerman
On Tue, 2015-09-08 at 17:14 +1000, Michael Ellerman wrote: > On Tue, 2015-09-08 at 12:09 +0530, Bharata B Rao wrote: > > On Tue, Sep 08, 2015 at 04:08:06PM +1000, Michael Ellerman wrote: > > > Hmm, not for me. See below. > > > > > > What setup were you testing

Re: [PATCH] powerpc: powernv: Return to cpu offline loop when finished in KVM guest

2014-12-21 Thread Michael Ellerman
On Sun, 2014-12-21 at 23:56 +0100, Alexander Graf wrote: > On 21.12.14 15:13, Andreas Schwab wrote: > > arch/powerpc/kvm/built-in.o: In function `kvm_no_guest': > > arch/powerpc/kvm/book3s_hv_rmhandlers.o:(.text+0x724): undefined reference > > to `power7_wakeup_loss' > > Ugh. We just removed supp

Re: [PATCH 1/8] ppc/kvm: Replace ACCESS_ONCE with READ_ONCE

2015-01-15 Thread Michael Ellerman
On Thu, 2015-01-15 at 09:58 +0100, Christian Borntraeger wrote: > ACCESS_ONCE does not work reliably on non-scalar types. For > example gcc 4.6 and 4.7 might remove the volatile tag for such > accesses during the SRA (scalar replacement of aggregates) step > (https://gcc.gnu.org/bugzilla/show_bug.c

Re: [kvm-ppc:kvm-ppc-queue 7/9] ERROR: ".__spin_yield" [arch/powerpc/kvm/kvm.ko] undefined!

2015-03-22 Thread Michael Ellerman
.__spin_yield" [arch/powerpc/kvm/kvm.ko] undefined! > > Yes, this is the patch that depends on the "powerpc: Export > __spin_yield" patch that Suresh posted to linuxppc-...@ozlabs.org and > I acked. > > I think the best thing at this stage is probably for Alex to t