Re: [PATCH 3/5] KVM: PPC: Book3S HV: Handle memory slot deletion and modification correctly

2012-08-14 Thread Paul Mackerras
On Mon, Aug 13, 2012 at 01:34:11PM -0300, Marcelo Tosatti wrote: > On Sat, Aug 11, 2012 at 10:37:54AM +1000, Paul Mackerras wrote: > > In fact I need to remove any translations in the old range *before* > > the new memslot gets committed, whereas this happens after that. > > This is why I was doing

Re: [PATCH 3/4] s390/kvm: Add a channel I/O based virtio transport driver.

2012-08-14 Thread Rusty Russell
On Tue, 14 Aug 2012 13:03:34 +0200, Cornelia Huck wrote: > > It would be per-machine; per-device would be a bit crazy. We'd > > deprecate the old ring format. > > > > There's been no consistent thread on the ideas for a ring change, > > unfortunately, but you can find interesting parts here, of

Re: [PATCH RESEND] KVM: MMU: Fix mmu_shrink() so that it can free mmu pages as intended

2012-08-14 Thread Takuya Yoshikawa
On Tue, 14 Aug 2012 12:17:12 -0300 Marcelo Tosatti wrote: > - if (kvm->arch.n_used_mmu_pages > 0) { > - if (!nr_to_scan--) > - break; -- (*1) > + if (!kvm->arch.n_used_mmu_pages) > continue;

Re: [Qemu-devel] [PATCH v8] kvm: notify host when the guest is panicked\

2012-08-14 Thread Marcelo Tosatti
On Tue, Aug 14, 2012 at 05:59:06PM -0500, Anthony Liguori wrote: > Marcelo Tosatti writes: > > > On Tue, Aug 14, 2012 at 02:35:34PM -0500, Anthony Liguori wrote: > >> Marcelo Tosatti writes: > >> > >> > On Tue, Aug 14, 2012 at 01:53:01PM -0500, Anthony Liguori wrote: > >> >> Marcelo Tosatti wr

Re: [PATCH] configure: Add --disable-kvm-options

2012-08-14 Thread Marcelo Tosatti
On Mon, Aug 13, 2012 at 06:49:49PM -0400, Cole Robinson wrote: > In Fedora, our qemu package is based on qemu-kvm, and we go to convoluted > lengths to provide a qemu-kvm binary with KVM on by default, but all > qemu-system-* with KVM off by default (using ./configure --disable-kvm) > > For qemu-s

Re: [PATCHv2] kvm: drop parameter validation

2012-08-14 Thread Marcelo Tosatti
On Tue, Aug 14, 2012 at 07:20:28PM +0300, Michael S. Tsirkin wrote: > We validate irq pin number when routing is setup, so > code handling illegal irq # in pic and ioapic on each injection > is never called. > Drop it, replace with BUG_ON to catch out of bounds access bugs. > > Signed-off-by: Mich

Re: [PATCH 17/38] KVM: PPC: BookE: Add support for vcpu->mode

2012-08-14 Thread Scott Wood
On 08/14/2012 06:04 PM, Alexander Graf wrote: > + /* Going into guest context! Yay! */ > + vcpu->mode = IN_GUEST_MODE; > + smp_wmb(); > + > break; > } What is the wmb protecting against here? -Scott -- To unsubscribe from this list: send t

Re: [PATCH 19/38] KVM: PPC: Add cache flush on page map

2012-08-14 Thread Scott Wood
On 08/14/2012 06:04 PM, Alexander Graf wrote: > When we map a page that wasn't icache cleared before, do so when first > mapping it in KVM using the same information bits as the Linux mapping > logic. That way we are 100% sure that any page we map does not have stale > entries in the icache. We're

Re: [PATCH 18/38] KVM: PPC: E500: Implement MMU notifiers

2012-08-14 Thread Scott Wood
On 08/14/2012 06:04 PM, Alexander Graf wrote: > The e500 target has lived without mmu notifiers ever since it got > introduced, but fails for the user space check on them with hugetlbfs. > > So in order to get that one working, implement mmu notifiers in a > reasonably dumb fashion and be happy. O

Re: [PATCH 17/38] KVM: PPC: BookE: Add support for vcpu->mode

2012-08-14 Thread Scott Wood
On 08/14/2012 07:26 PM, Alexander Graf wrote: > > On 15.08.2012, at 02:17, Scott Wood wrote: > >> On 08/14/2012 06:04 PM, Alexander Graf wrote: >>> Generic KVM code might want to know whether we are inside guest context >>> or outside. It also wants to be able to push us out of guest context. >>>

Re: [PATCH 17/38] KVM: PPC: BookE: Add support for vcpu->mode

2012-08-14 Thread Alexander Graf
On 15.08.2012, at 02:17, Scott Wood wrote: > On 08/14/2012 06:04 PM, Alexander Graf wrote: >> Generic KVM code might want to know whether we are inside guest context >> or outside. It also wants to be able to push us out of guest context. >> >> Add support to the BookE code for the generic vcpu-

Re: [PATCH 16/38] KVM: PPC: BookE: Add check_requests helper function

2012-08-14 Thread Scott Wood
On 08/14/2012 07:13 PM, Alexander Graf wrote: > > On 15.08.2012, at 02:10, Scott Wood wrote: > >> On 08/14/2012 06:04 PM, Alexander Graf wrote: >>> We need a central place to check for pending requests in. Add one that >>> only does the timer check we already do in a different place. >>> >>> Late

Re: [PATCH 17/38] KVM: PPC: BookE: Add support for vcpu->mode

2012-08-14 Thread Scott Wood
On 08/14/2012 06:04 PM, Alexander Graf wrote: > Generic KVM code might want to know whether we are inside guest context > or outside. It also wants to be able to push us out of guest context. > > Add support to the BookE code for the generic vcpu->mode field that describes > the above states. > >

Re: [PATCH 16/38] KVM: PPC: BookE: Add check_requests helper function

2012-08-14 Thread Alexander Graf
On 15.08.2012, at 02:10, Scott Wood wrote: > On 08/14/2012 06:04 PM, Alexander Graf wrote: >> We need a central place to check for pending requests in. Add one that >> only does the timer check we already do in a different place. >> >> Later, this central function can be extended by more checks.

Re: [PATCH 16/38] KVM: PPC: BookE: Add check_requests helper function

2012-08-14 Thread Scott Wood
On 08/14/2012 06:04 PM, Alexander Graf wrote: > We need a central place to check for pending requests in. Add one that > only does the timer check we already do in a different place. > > Later, this central function can be extended by more checks. > > Signed-off-by: Alexander Graf > --- > arch/

Re: [PATCH 35/38] booke: Added ONE_REG interface for IAC/DAC debug registers

2012-08-14 Thread Scott Wood
On 08/14/2012 06:47 PM, Alexander Graf wrote: > > On 15.08.2012, at 01:44, Scott Wood wrote: > >> On 08/14/2012 06:04 PM, Alexander Graf wrote: >>> From: Bharat Bhushan >>> >>> IAC/DAC are defined as 32 bit while they are 64 bit wide. So ONE_REG >>> interface is added to set/get them. >>> >>> Si

Re: [PATCH] kvm tools: Add initial virtio-scsi support

2012-08-14 Thread Nicholas A. Bellinger
On Tue, 2012-08-14 at 07:45 +0100, Stefan Hajnoczi wrote: > On Tue, Aug 14, 2012 at 09:52:55AM +0800, Asias He wrote: > > On Mon, Aug 13, 2012 at 3:24 PM, Pekka Enberg wrote: > > > On Thu, Aug 9, 2012 at 3:51 AM, Asias He wrote: > > >> --- > > >> diff --git a/tools/kvm/include/kvm/disk-image.h

[PATCH 3/4] kvmvapic: Disable if there is insufficient memory

2012-08-14 Thread Marcelo Tosatti
From: Jan Kiszka We need at least 1M of RAM to map the option ROM. Otherwise, we will corrupt host memory or even crash: $ qemu-system-x86_64 -nodefaults --enable-kvm -vnc :0 -m 640k Segmentation fault (core dumped) Reported-and-tested-by: Markus Armbruster Signed-off-by: Jan Kiszka S

[PATCH 2/4] kvm: i8254: Finish time conversion fix

2012-08-14 Thread Marcelo Tosatti
From: Jan Kiszka 0cdd3d1444 fixed reading back the counter load time from the kernel while assuming the kernel would always update its load time on writing the state. That is only true for channel 1, and so pit_get_channel_info returned wrong output pin states for high counter values. Fix this b

[PATCH 0/4] [PULL] qemu-kvm.git uq/master queue

2012-08-14 Thread Marcelo Tosatti
The following changes since commit 873359d411eeb380906761e46839a2b705dbcf75: Merge branch 'linux-user.next' of git://git.linaro.org/people/pmaydell/qemu-arm (2012-08-14 19:50:22 +) are available in the git repository at: git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git uq/master Jan

[PATCH 4/4] update-linux-headers.sh: Pull in asm-generic/kvm_para.h

2012-08-14 Thread Marcelo Tosatti
From: Peter Maydell Add asm-generic/kvm_para.h to the set of non-architecture specific KVM kernel headers we copy into QEMU. This header may be included by an architecture's kvm_para.h header. Reviewed-by: Jan Kiszka Signed-off-by: Peter Maydell Signed-off-by: Marcelo Tosatti --- scripts/upd

[PATCH 1/4] kvm: i8254: Cache kernel clock offset in KVMPITState

2012-08-14 Thread Marcelo Tosatti
From: Jan Kiszka To prepare the final fix for clock calibration issues with the in-kernel PIT, we want to cache the offset between vmclock and the clock used by the in-kernel PIT. So far, we only need to update it when the VM state changes between running and stopped because we only read the in-k

[PATCH] KVM: PPC: Use symbols for exit trace

2012-08-14 Thread Alexander Graf
Exit traces are a lot easier to read when you don't have to remember cryptic numbers for guest exit reasons. Symbolify them in our trace output. Signed-off-by: Alexander Graf --- arch/powerpc/kvm/trace.h | 58 - 1 files changed, 56 insertions(+), 2 d

Re: [PATCH 35/38] booke: Added ONE_REG interface for IAC/DAC debug registers

2012-08-14 Thread Alexander Graf
On 15.08.2012, at 01:44, Scott Wood wrote: > On 08/14/2012 06:04 PM, Alexander Graf wrote: >> From: Bharat Bhushan >> >> IAC/DAC are defined as 32 bit while they are 64 bit wide. So ONE_REG >> interface is added to set/get them. >> >> Signed-off-by: Bharat Bhushan >> Signed-off-by: Alexander

Re: [PATCH 35/38] booke: Added ONE_REG interface for IAC/DAC debug registers

2012-08-14 Thread Scott Wood
On 08/14/2012 06:04 PM, Alexander Graf wrote: > From: Bharat Bhushan > > IAC/DAC are defined as 32 bit while they are 64 bit wide. So ONE_REG > interface is added to set/get them. > > Signed-off-by: Bharat Bhushan > Signed-off-by: Alexander Graf > --- > arch/powerpc/include/asm/kvm.h |

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-14 Thread Alex Williamson
On Wed, 2012-08-15 at 02:04 +0300, Michael S. Tsirkin wrote: > On Tue, Aug 14, 2012 at 04:01:15PM -0600, Alex Williamson wrote: > > On Tue, 2012-08-14 at 15:35 +0300, Avi Kivity wrote: > > > On 08/12/2012 12:33 PM, Michael S. Tsirkin wrote: > > > >> > > > >> Michael, would the interface be more ac

[PATCH 02/38] KVM: PPC: use definitions in epapr header for hcalls

2012-08-14 Thread Alexander Graf
From: Stuart Yoder Signed-off-by: Stuart Yoder Signed-off-by: Alexander Graf --- arch/powerpc/include/asm/kvm_para.h | 21 +++-- arch/powerpc/kernel/kvm.c |2 +- arch/powerpc/kvm/powerpc.c | 10 +- 3 files changed, 17 insertions(+), 16 deletio

[PATCH 04/38] KVM: PPC: Add support for ePAPR idle hcall in host kernel

2012-08-14 Thread Alexander Graf
From: Liu Yu-B13201 And add a new flag definition in kvm_ppc_pvinfo to indicate whether the host supports the EV_IDLE hcall. Signed-off-by: Liu Yu [stuart.yo...@freescale.com: cleanup,fixes for conditions allowing idle] Signed-off-by: Stuart Yoder [agraf: fix typo] Signed-off-by: Alexander Gra

[PATCH 05/38] KVM: PPC: ev_idle hcall support for e500 guests

2012-08-14 Thread Alexander Graf
From: Liu Yu-B13201 Signed-off-by: Liu Yu [varun: 64-bit changes] Signed-off-by: Varun Sethi Signed-off-by: Stuart Yoder Signed-off-by: Alexander Graf --- arch/powerpc/include/asm/epapr_hcalls.h | 11 ++- arch/powerpc/kernel/epapr_hcalls.S | 28

[PATCH 07/38] powerpc/fsl-soc: use CONFIG_EPAPR_PARAVIRT for hcalls

2012-08-14 Thread Alexander Graf
From: Scott Wood Signed-off-by: Scott Wood Signed-off-by: Stuart Yoder Signed-off-by: Alexander Graf --- arch/powerpc/sysdev/fsl_msi.c |9 +++-- arch/powerpc/sysdev/fsl_soc.c |2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch

[PATCH 03/38] KVM: PPC: add pvinfo for hcall opcodes on e500mc/e5500

2012-08-14 Thread Alexander Graf
From: Stuart Yoder Signed-off-by: Liu Yu [stuart: factored this out from idle hcall support in host patch] Signed-off-by: Stuart Yoder Signed-off-by: Alexander Graf --- arch/powerpc/kvm/powerpc.c | 10 +- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kv

[PATCH 01/38] PPC: epapr: create define for return code value of success

2012-08-14 Thread Alexander Graf
From: Stuart Yoder Signed-off-by: Stuart Yoder Signed-off-by: Alexander Graf --- arch/powerpc/include/asm/epapr_hcalls.h |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/include/asm/epapr_hcalls.h b/arch/powerpc/include/asm/epapr_hcalls.h index bf2c06c..

[PATCH 13/38] KVM: PPC: Book3S HV: Fix incorrect branch in H_CEDE code

2012-08-14 Thread Alexander Graf
From: Paul Mackerras In handling the H_CEDE hypercall, if this vcpu has already been prodded (with the H_PROD hypercall, which Linux guests don't in fact use), we branch to a numeric label '1f'. Unfortunately there is another '1:' label before the one that we want to jump to. This fixes the pro

[PATCH 14/38] KVM: PPC: Quieten message about allocating linear regions

2012-08-14 Thread Alexander Graf
From: Paul Mackerras This is printed once for every RMA or HPT region that get preallocated. If one preallocates hundreds of such regions (in order to run hundreds of KVM guests), that gets rather painful, so make it a bit quieter. Signed-off-by: Paul Mackerras Signed-off-by: Alexander Graf -

[PATCH 17/38] KVM: PPC: BookE: Add support for vcpu->mode

2012-08-14 Thread Alexander Graf
Generic KVM code might want to know whether we are inside guest context or outside. It also wants to be able to push us out of guest context. Add support to the BookE code for the generic vcpu->mode field that describes the above states. Signed-off-by: Alexander Graf --- arch/powerpc/kvm/booke.

[PATCH 16/38] KVM: PPC: BookE: Add check_requests helper function

2012-08-14 Thread Alexander Graf
We need a central place to check for pending requests in. Add one that only does the timer check we already do in a different place. Later, this central function can be extended by more checks. Signed-off-by: Alexander Graf --- arch/powerpc/kvm/booke.c | 24 +--- 1 files c

[PATCH 09/38] KVM: PPC: PR: Use generic tracepoint for guest exit

2012-08-14 Thread Alexander Graf
We want to have tracing information on guest exits for booke as well as book3s. Since most information is identical, use a common trace point. Signed-off-by: Alexander Graf --- arch/powerpc/kvm/book3s_pr.c |2 +- arch/powerpc/kvm/booke.c |3 ++ arch/powerpc/kvm/trace.h | 79 +++

[PATCH 18/38] KVM: PPC: E500: Implement MMU notifiers

2012-08-14 Thread Alexander Graf
The e500 target has lived without mmu notifiers ever since it got introduced, but fails for the user space check on them with hugetlbfs. So in order to get that one working, implement mmu notifiers in a reasonably dumb fashion and be happy. On embedded hardware, we almost never end up with mmu not

[PATCH 08/38] PPC: Don't use hardcoded opcode for ePAPR hcall invocation

2012-08-14 Thread Alexander Graf
From: Liu Yu-B13201 Signed-off-by: Liu Yu Signed-off-by: Stuart Yoder Signed-off-by: Alexander Graf --- arch/powerpc/include/asm/epapr_hcalls.h | 22 +- arch/powerpc/include/asm/fsl_hcalls.h | 36 +++--- 2 files changed, 29 insertions(+), 29 delet

[PATCH 19/38] KVM: PPC: Add cache flush on page map

2012-08-14 Thread Alexander Graf
When we map a page that wasn't icache cleared before, do so when first mapping it in KVM using the same information bits as the Linux mapping logic. That way we are 100% sure that any page we map does not have stale entries in the icache. Signed-off-by: Alexander Graf --- arch/powerpc/include/as

[PATCH 24/38] KVM: PPC: BookE: Drop redundant vcpu->mode set

2012-08-14 Thread Alexander Graf
We only need to set vcpu->mode to outside once. Signed-off-by: Alexander Graf --- arch/powerpc/kvm/booke.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index 4652e0b..492c343 100644 --- a/arch/powerpc/kvm/booke.c ++

[PATCH 23/38] KVM: PPC: Book3s: PR: Add (dumb) MMU Notifier support

2012-08-14 Thread Alexander Graf
Now that we have very simple MMU Notifier support for e500 in place, also add the same simple support to book3s. It gets us one step closer to actual fast support. Signed-off-by: Alexander Graf --- arch/powerpc/include/asm/kvm_host.h |3 +- arch/powerpc/kvm/Kconfig |1 + a

[PATCH 20/38] KVM: PPC: BookE: Add some more trace points

2012-08-14 Thread Alexander Graf
Without trace points, debugging what exactly is going on inside guest code can be very tricky. Add a few more trace points at places that hopefully tell us more when things go wrong. Signed-off-by: Alexander Graf --- arch/powerpc/kvm/booke.c|3 ++ arch/powerpc/kvm/e500_tlb.c |3 ++ a

[PATCH 22/38] KVM: PPC: Use same kvmppc_prepare_to_enter code for booke and book3s_pr

2012-08-14 Thread Alexander Graf
We need to do the same things when preparing to enter a guest for booke and book3s_pr cores. Fold the generic code into a generic function that both call. Signed-off-by: Alexander Graf --- arch/powerpc/include/asm/kvm_ppc.h |3 ++ arch/powerpc/kvm/book3s_pr.c | 22 -- arc

[PATCH 26/38] KVM: PPC: Exit guest context while handling exit

2012-08-14 Thread Alexander Graf
The x86 implementation of KVM accounts for host time while processing guest exits. Do the same for us. Signed-off-by: Alexander Graf --- arch/powerpc/kvm/book3s_pr.c |2 ++ arch/powerpc/kvm/booke.c |3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kv

[PATCH 25/38] KVM: PPC: Book3S: PR: Only do resched check once per exit

2012-08-14 Thread Alexander Graf
Now that we use our generic exit helper, we can safely drop our previous kvm_resched that we used to trigger at the beginning of the exit handler function. Signed-off-by: Alexander Graf --- arch/powerpc/kvm/book3s_pr.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arc

[PATCH 27/38] KVM: PPC: Book3S: PR: Indicate we're out of guest mode

2012-08-14 Thread Alexander Graf
When going out of guest mode, indicate that we are in vcpu->mode. That way requests from other CPUs don't needlessly need to kick us to process them, because it'll just happen next time we enter the guest. Signed-off-by: Alexander Graf --- arch/powerpc/kvm/book3s_pr.c |1 + 1 files changed,

[PATCH 10/38] KVM: PPC: Expose SYNC cap based on mmu notifiers

2012-08-14 Thread Alexander Graf
Semantically, the "SYNC" cap means that we have mmu notifiers available. Express this in our #ifdef'ery around the feature, so that we can be sure we don't miss out on ppc targets when they get their implementation. Signed-off-by: Alexander Graf --- arch/powerpc/kvm/powerpc.c |8 +++- 1

[PATCH 28/38] KVM: PPC: Consistentify vcpu exit path

2012-08-14 Thread Alexander Graf
When getting out of __vcpu_run, let's be consistent about the state we return in. We want to always * have IRQs enabled * have called kvm_guest_exit before Signed-off-by: Alexander Graf --- arch/powerpc/kvm/book3s_pr.c |8 ++-- arch/powerpc/kvm/booke.c | 13 - 2 fi

[PATCH 30/38] KVM: PPC: Move kvm_guest_enter call into generic code

2012-08-14 Thread Alexander Graf
We need to call kvm_guest_enter in booke and book3s, so move its call to generic code. Signed-off-by: Alexander Graf --- arch/powerpc/kvm/book3s_pr.c |2 -- arch/powerpc/kvm/booke.c |2 -- arch/powerpc/kvm/powerpc.c |3 +++ 3 files changed, 3 insertions(+), 4 deletions(-) diff

[PATCH 31/38] KVM: PPC: Ignore EXITING_GUEST_MODE mode

2012-08-14 Thread Alexander Graf
We don't need to do anything when mode is EXITING_GUEST_MODE, because we essentially are outside of guest mode and did everything it asked us to do by the time we check it. Signed-off-by: Alexander Graf --- arch/powerpc/kvm/powerpc.c |5 - 1 files changed, 0 insertions(+), 5 deletions(-)

[PATCH 32/38] KVM: PPC: Add return value in prepare_to_enter

2012-08-14 Thread Alexander Graf
Our prepare_to_enter helper wants to be able to return in more circumstances to the host than only when an interrupt is pending. Broaden the interface a bit and move even more generic code to the generic helper. Signed-off-by: Alexander Graf --- arch/powerpc/kvm/book3s_pr.c | 12 ++--

[PATCH 11/38] KVM: PPC: BookE: Expose remote TLB flushes in debugfs

2012-08-14 Thread Alexander Graf
We're already counting remote TLB flushes in a variable, but don't export it to user space yet. Do so, so we know what's going on. Signed-off-by: Alexander Graf --- arch/powerpc/kvm/booke.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kvm/booke.c b/arch/p

[PATCH 33/38] KVM: PPC: Add return value to core_check_requests

2012-08-14 Thread Alexander Graf
Requests may want to tell us that we need to go back into host state, so add a return value for the checks. Signed-off-by: Alexander Graf --- arch/powerpc/include/asm/kvm_ppc.h |2 +- arch/powerpc/kvm/book3s_pr.c |6 +- arch/powerpc/kvm/booke.c |6 +- arch/pow

[PATCH 15/38] powerpc/epapr: export epapr_hypercall_start

2012-08-14 Thread Alexander Graf
From: Scott Wood This fixes breakage introduced by the following commit: commit 6d2d82627f4f1e96a33664ace494fa363e0495cb Author: Liu Yu-B13201 Date: Tue Jul 3 05:48:56 2012 + PPC: Don't use hardcoded opcode for ePAPR hcall invocation when a driver that uses ePAPR hypercalls is

[PATCH 34/38] KVM: PPC: booke: Add watchdog emulation

2012-08-14 Thread Alexander Graf
From: Bharat Bhushan This patch adds the watchdog emulation in KVM. The watchdog emulation is enabled by KVM_ENABLE_CAP(KVM_CAP_PPC_BOOKE_WATCHDOG) ioctl. The kernel timer are used for watchdog emulation and emulates h/w watchdog state machine. On watchdog timer expiry, it exit to QEMU if TCR.WRC

[PATCH 37/38] KVM: PPC: BookE: Add MCSR SPR support

2012-08-14 Thread Alexander Graf
Add support for the MCSR SPR. This only implements the SPR storage bits, not actual machine checks. Signed-off-by: Alexander Graf --- arch/powerpc/kvm/booke_emulate.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kvm/booke_emulate.c b/arch/powerpc/kvm

[PATCH 35/38] booke: Added ONE_REG interface for IAC/DAC debug registers

2012-08-14 Thread Alexander Graf
From: Bharat Bhushan IAC/DAC are defined as 32 bit while they are 64 bit wide. So ONE_REG interface is added to set/get them. Signed-off-by: Bharat Bhushan Signed-off-by: Alexander Graf --- arch/powerpc/include/asm/kvm.h | 12 arch/powerpc/include/asm/kvm_host.h | 24 +++

[PATCH 36/38] KVM: PPC: 44x: Initialize PVR

2012-08-14 Thread Alexander Graf
We need to make sure that vcpu->arch.pvr is initialized to a sane value, so let's just take the host PVR. Signed-off-by: Alexander Graf --- arch/powerpc/kvm/44x.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kvm/44x.c b/arch/powerpc/kvm/44x.c index 50e7db

[PATCH 38/38] ppc: e500_tlb memset clears nothing

2012-08-14 Thread Alexander Graf
From: Alan Cox Put the parameters the right way around Addresses https://bugzilla.kernel.org/show_bug.cgi?id=44031 Reported-by: David Binderman Signed-off-by: Alan Cox Signed-off-by: Andrew Morton Signed-off-by: Alexander Graf --- arch/powerpc/kvm/e500_tlb.c |8 1 files change

[PATCH 21/38] KVM: PPC: BookE: No duplicate request != 0 check

2012-08-14 Thread Alexander Graf
We only call kvmppc_check_requests() when vcpu->requests != 0, so drop the redundant check in the function itself Signed-off-by: Alexander Graf --- arch/powerpc/kvm/booke.c | 12 +--- 1 files changed, 5 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc

[PATCH 29/38] KVM: PPC: Book3S: PR: Rework irq disabling

2012-08-14 Thread Alexander Graf
Today, we disable preemption while inside guest context, because we need to expose to the world that we are not in a preemptible context. However, during that time we already have interrupts disabled, which would indicate that we are in a non-preemptible context. The reason the checks for irqs_dis

[PATCH 12/38] KVM: PPC: E500: Fix clear_tlb_refs

2012-08-14 Thread Alexander Graf
Our mapping code assumes that TLB0 entries are always mapped. However, after calling clear_tlb_refs() this is no longer the case. Map them dynamically if we find an entry unmapped in TLB0. Signed-off-by: Alexander Graf --- arch/powerpc/kvm/e500_tlb.c |8 ++-- 1 files changed, 6 insertio

[PATCH 06/38] PPC: select EPAPR_PARAVIRT for all users of epapr hcalls

2012-08-14 Thread Alexander Graf
From: Stuart Yoder Signed-off-by: Stuart Yoder Signed-off-by: Alexander Graf --- arch/powerpc/platforms/Kconfig |1 + drivers/tty/Kconfig|1 + drivers/virt/Kconfig |1 + 3 files changed, 3 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/platforms/Kcon

[PULL 00/38] ppc patch queue 2012-08-15

2012-08-14 Thread Alexander Graf
Hi Avi, This is my current patch queue for ppc. It contains the following improvements: * add support for idle hcall on booke * icache clear on map * mmu notifier support for e500 and book3s_pr * revive the 440 support slightly (still not 100% happy) * unify booke and book3s_pr entry/ex

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-14 Thread Michael S. Tsirkin
On Tue, Aug 14, 2012 at 04:01:15PM -0600, Alex Williamson wrote: > On Tue, 2012-08-14 at 15:35 +0300, Avi Kivity wrote: > > On 08/12/2012 12:33 PM, Michael S. Tsirkin wrote: > > >> > > >> Michael, would the interface be more acceptable to you if we added > > >> separate ioctls to allocate and free

Re: [Qemu-devel] [PATCH v8] kvm: notify host when the guest is panicked

2012-08-14 Thread Anthony Liguori
Marcelo Tosatti writes: > On Tue, Aug 14, 2012 at 02:35:34PM -0500, Anthony Liguori wrote: >> Marcelo Tosatti writes: >> >> > On Tue, Aug 14, 2012 at 01:53:01PM -0500, Anthony Liguori wrote: >> >> Marcelo Tosatti writes: >> >> >> >> > On Tue, Aug 14, 2012 at 05:55:54PM +0300, Yan Vugenfirer w

Re: [Qemu-devel] [PATCH v8] kvm: notify host when the guest is panicked

2012-08-14 Thread Marcelo Tosatti
On Tue, Aug 14, 2012 at 02:35:34PM -0500, Anthony Liguori wrote: > Marcelo Tosatti writes: > > > On Tue, Aug 14, 2012 at 01:53:01PM -0500, Anthony Liguori wrote: > >> Marcelo Tosatti writes: > >> > >> > On Tue, Aug 14, 2012 at 05:55:54PM +0300, Yan Vugenfirer wrote: > >> >> > >> >> On Aug 14,

Re: [patch 1/1] ppc: e500_tlb memset clears nothing

2012-08-14 Thread Alexander Graf
On 15.08.2012, at 00:10, a...@linux-foundation.org wrote: > From: Alan Cox > Subject: ppc: e500_tlb memset clears nothing > > Put the parameters the right way around > > Addresses https://bugzilla.kernel.org/show_bug.cgi?id=44031 > > Reported-by: David Binderman > Signed-off-by: Alan Cox >

[patch 1/1] ppc: e500_tlb memset clears nothing

2012-08-14 Thread akpm
From: Alan Cox Subject: ppc: e500_tlb memset clears nothing Put the parameters the right way around Addresses https://bugzilla.kernel.org/show_bug.cgi?id=44031 Reported-by: David Binderman Signed-off-by: Alan Cox Cc: Avi Kivity Cc: Marcelo Tosatti Cc: Alexander Graf Cc: Benjamin Herrenschm

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-14 Thread Alex Williamson
On Tue, 2012-08-14 at 15:35 +0300, Avi Kivity wrote: > On 08/12/2012 12:33 PM, Michael S. Tsirkin wrote: > >> > >> Michael, would the interface be more acceptable to you if we added > >> separate ioctls to allocate and free some representation of an irq > >> source ID, gsi pair? For instance, an

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-14 Thread Alex Williamson
On Tue, 2012-08-14 at 11:35 +0300, Michael S. Tsirkin wrote: > On Mon, Aug 13, 2012 at 09:09:43PM -0600, Alex Williamson wrote: > > On Tue, 2012-08-14 at 02:00 +0300, Michael S. Tsirkin wrote: > > > On Mon, Aug 13, 2012 at 04:41:05PM -0600, Alex Williamson wrote: > > > > On Tue, 2012-08-14 at 01:06

Re: [Qemu-devel] [RFC-v2 3/6] vhost-scsi: add -vhost-scsi host device for use with tcm-vhost

2012-08-14 Thread Nicholas A. Bellinger
On Mon, 2012-08-13 at 19:47 +, Blue Swirl wrote: > On Mon, Aug 13, 2012 at 8:35 AM, Nicholas A. Bellinger > wrote: > > From: Stefan Hajnoczi > > > > This patch adds a new type of host device that drives the vhost_scsi > > device. The syntax to add vhost-scsi is: > > > > qemu -vhost-scsi id

Re: [RFC-v2 3/6] vhost-scsi: add -vhost-scsi host device for use with tcm-vhost

2012-08-14 Thread Nicholas A. Bellinger
On Mon, 2012-08-13 at 11:59 +0300, Michael S. Tsirkin wrote: > On Mon, Aug 13, 2012 at 08:35:14AM +, Nicholas A. Bellinger wrote: > > From: Stefan Hajnoczi > > > > This patch adds a new type of host device that drives the vhost_scsi > > device. The syntax to add vhost-scsi is: > > > > qem

[PATCH v3 4/4] vfio: Enable vfio-pci and mark supported

2012-08-14 Thread Alex Williamson
Signed-off-by: Alex Williamson --- MAINTAINERS |5 + configure |6 ++ hw/i386/Makefile.objs |1 + 3 files changed, 12 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 708ad54..327b219 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -468,6 +468,1

Re: [PATCH v2 3/4] vfio: vfio-pci device assignment driver

2012-08-14 Thread Jan Kiszka
On 2012-08-14 21:09, Alex Williamson wrote: >>> +static void vfio_map_bar(VFIODevice *vdev, int nr) >>> +{ >>> +VFIOBAR *bar = &vdev->bars[nr]; >>> +unsigned size = bar->size; >>> +char name[64]; >>> +uint32_t pci_bar; >>> +uint8_t type; >>> +int ret; >>> + >>> +/* Skip

[PATCH v3 2/4] Update Linux kernel headers

2012-08-14 Thread Alex Williamson
Based on Linux as of ddf343f6. Note that vfio.h isn't yet an installed header at this commit, but is fixed by trivial update to include/linux/Kbuild. Signed-off-by: Alex Williamson --- linux-headers/asm-s390/kvm.h |2 linux-headers/asm-s390/kvm_para.h |2 linux-headers/asm-x86/k

[PATCH v3 1/4] Update kernel header script to include vfio

2012-08-14 Thread Alex Williamson
Signed-off-by: Alex Williamson --- scripts/update-linux-headers.sh |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index 9d2a4bc..270d32b 100755 --- a/scripts/update-linux-headers.sh +++ b/scripts/update-lin

[PATCH v3 0/4] VFIO-based PCI device assignment for QEMU 1.2

2012-08-14 Thread Alex Williamson
v3: - Incorporate feedback from Anthony, Avi, and Jan (Thank you!) I've also added a new tag to my github tree, so those who have already reviewed can check the delta by comparing: git://github.com/awilliam/qemu-vfio.git tags/vfio-pci-for-qemu-1.2 tags/vfio-pci-for-qemu-1.2-v2

Re: [RFC-v2 3/6] vhost-scsi: add -vhost-scsi host device for use with tcm-vhost

2012-08-14 Thread Nicholas A. Bellinger
On Mon, 2012-08-13 at 11:53 +0300, Michael S. Tsirkin wrote: > On Mon, Aug 13, 2012 at 08:35:14AM +, Nicholas A. Bellinger wrote: > > From: Stefan Hajnoczi > > > > This patch adds a new type of host device that drives the vhost_scsi > > device. The syntax to add vhost-scsi is: > > > > qem

Re: [RFC-v2 6/6] virtio-scsi: Fix incorrect VirtIOSCSI->cmd_vqs[0] definition

2012-08-14 Thread Nicholas A. Bellinger
On Mon, 2012-08-13 at 12:02 +0300, Michael S. Tsirkin wrote: > On Mon, Aug 13, 2012 at 08:35:17AM +, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger > > > > This patch fixes bug in the definition of VirtIOSCSI->cmd_vqs[0], > > where the return of virtio_add_queue() in virtio_scsi_in

Re: [RFC-v2 1/6] msix: Work-around for vhost-scsi with KVM in-kernel MSI injection

2012-08-14 Thread Nicholas A. Bellinger
On Mon, 2012-08-13 at 21:17 +0300, Michael S. Tsirkin wrote: > On Mon, Aug 13, 2012 at 08:06:17PM +0200, Jan Kiszka wrote: > > On 2012-08-13 20:03, Michael S. Tsirkin wrote: > > > On Mon, Aug 13, 2012 at 02:06:10PM +0200, Jan Kiszka wrote: > > >> On 2012-08-13 10:35, Nicholas A. Bellinger wrote: >

Re: [Qemu-devel] [PATCH v8] kvm: notify host when the guest is panicked

2012-08-14 Thread Peter Maydell
On 14 August 2012 19:53, Anthony Liguori wrote: > Forget about !x86 platforms. They have their own way to do this sort of > thing. Think of this feature like a status LED on a motherboard. These > are very common and usually controlled by IO ports. Please don't forget !x86 platforms, we are cu

Re: [GIT PULL] VFIO update for 3.6-rc1

2012-08-14 Thread Alex Williamson
On Tue, 2012-08-07 at 13:05 -0600, Alex Williamson wrote: > Hi Linus, > > The following changes since commit 42a579a0f960081cd16fc945036e4780c3ad3202: > > Merge branches 'timers-urgent-for-linus' and 'perf-urgent-for-linus' of > git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip (2012-08-05

Re: [PATCH 3/4] s390/kvm: Add a channel I/O based virtio transport driver.

2012-08-14 Thread Anthony Liguori
Cornelia Huck writes: > Add a driver for kvm guests that matches virtual ccw devices provided > by the host as virtio bridge devices. > > These virtio-ccw devices use a special set of channel commands in order > to perform virtio functions. > > Signed-off-by: Cornelia Huck Hi, Have you written

Re: [Qemu-devel] [PATCH v8] kvm: notify host when the guest is panicked

2012-08-14 Thread Anthony Liguori
Marcelo Tosatti writes: > On Tue, Aug 14, 2012 at 01:53:01PM -0500, Anthony Liguori wrote: >> Marcelo Tosatti writes: >> >> > On Tue, Aug 14, 2012 at 05:55:54PM +0300, Yan Vugenfirer wrote: >> >> >> >> On Aug 14, 2012, at 1:42 PM, Jan Kiszka wrote: >> >> >> >> > On 2012-08-14 10:56, Daniel P.

Re: [Qemu-devel] [PATCH v8] kvm: notify host when the guest is panicked

2012-08-14 Thread Marcelo Tosatti
On Tue, Aug 14, 2012 at 01:53:01PM -0500, Anthony Liguori wrote: > Marcelo Tosatti writes: > > > On Tue, Aug 14, 2012 at 05:55:54PM +0300, Yan Vugenfirer wrote: > >> > >> On Aug 14, 2012, at 1:42 PM, Jan Kiszka wrote: > >> > >> > On 2012-08-14 10:56, Daniel P. Berrange wrote: > >> >> On Mon, Au

Re: [PATCH v2 3/4] vfio: vfio-pci device assignment driver

2012-08-14 Thread Alex Williamson
On Tue, 2012-08-14 at 19:40 +0200, Jan Kiszka wrote: > Just some comments, didn't look at all details. Thanks! I'll send out a v3 soon. I think that the off-by-one in strncat doesn't exist though, so would appreciate if you could double check. Individual comments below... > On 2012-08-02 21:17

Re: [PATCH uq/master 1/2] kvm: i8254: Cache kernel clock offset in KVMPITState

2012-08-14 Thread Marcelo Tosatti
On Tue, Aug 14, 2012 at 10:24:03AM +0200, Jan Kiszka wrote: > To prepare the final fix for clock calibration issues with the in-kernel > PIT, we want to cache the offset between vmclock and the clock used by > the in-kernel PIT. So far, we only need to update it when the VM state > changes between

Re: [PATCH v2 uq/master] kvmvapic: Disable if there is insufficient memory

2012-08-14 Thread Marcelo Tosatti
On Tue, Aug 14, 2012 at 01:43:12PM +0200, Jan Kiszka wrote: > We need at least 1M of RAM to map the option ROM. Otherwise, we will > corrupt host memory or even crash: > > $ qemu-system-x86_64 -nodefaults --enable-kvm -vnc :0 -m 640k > Segmentation fault (core dumped) > > Reported-and-tes

Re: [Qemu-devel] [PATCH v8] kvm: notify host when the guest is panicked

2012-08-14 Thread Anthony Liguori
Marcelo Tosatti writes: > On Tue, Aug 14, 2012 at 05:55:54PM +0300, Yan Vugenfirer wrote: >> >> On Aug 14, 2012, at 1:42 PM, Jan Kiszka wrote: >> >> > On 2012-08-14 10:56, Daniel P. Berrange wrote: >> >> On Mon, Aug 13, 2012 at 03:21:32PM -0300, Marcelo Tosatti wrote: >> >>> On Wed, Aug 08, 201

Re: [PATCH v2 3/4] vfio: vfio-pci device assignment driver

2012-08-14 Thread Jan Kiszka
Just some comments, didn't look at all details. On 2012-08-02 21:17, Alex Williamson wrote: > + > +static int vfio_msix_vector_use(PCIDevice *pdev, > +unsigned int vector, MSIMessage msg) > +{ > +VFIODevice *vdev = DO_UPCAST(VFIODevice, pdev, pdev); > +int r

Re: [PATCH 2/3] vfio: vfio-pci device assignment driver

2012-08-14 Thread Alex Williamson
On Tue, 2012-08-14 at 18:53 +0300, Avi Kivity wrote: > On 08/01/2012 08:18 AM, Alex Williamson wrote: > > This adds the core of the QEMU VFIO-based PCI device assignment driver. > > To make use of this driver, enable CONFIG_VFIO, CONFIG_VFIO_IOMMU_TYPE1, > > and CONFIG_VFIO_PCI in your host Linux k

Re: [PATCH 0/8] use jump labels to streamline common APIC configuration

2012-08-14 Thread Jan Kiszka
On 2012-08-14 19:00, Avi Kivity wrote: > On 08/14/2012 07:38 PM, Jan Kiszka wrote: >> On 2012-08-14 18:21, Avi Kivity wrote: >>> On 08/14/2012 05:58 PM, Jan Kiszka wrote: >> >> And regarding how common they are: Do standard OSes trigger any >> jump-label optimized switch during at least

Re: [PATCH 0/8] use jump labels to streamline common APIC configuration

2012-08-14 Thread Avi Kivity
On 08/14/2012 07:38 PM, Jan Kiszka wrote: > On 2012-08-14 18:21, Avi Kivity wrote: >> On 08/14/2012 05:58 PM, Jan Kiszka wrote: > > And regarding how common they are: Do standard OSes trigger any > jump-label optimized switch during at least their boot-up? I thought so. > In that ca

Re: [PATCH 0/8] use jump labels to streamline common APIC configuration

2012-08-14 Thread Jan Kiszka
On 2012-08-14 18:21, Avi Kivity wrote: > On 08/14/2012 05:58 PM, Jan Kiszka wrote: And regarding how common they are: Do standard OSes trigger any jump-label optimized switch during at least their boot-up? I thought so. In that case, if you co-locate RT and standard OSes on a sh

Re: [PATCH 0/8] use jump labels to streamline common APIC configuration

2012-08-14 Thread Avi Kivity
On 08/14/2012 05:58 PM, Jan Kiszka wrote: >>> >>> And regarding how common they are: Do standard OSes trigger any >>> jump-label optimized switch during at least their boot-up? I thought so. >>> In that case, if you co-locate RT and standard OSes on a shared host, >>> you would have a conflict. >>>

[PATCHv2] kvm: drop parameter validation

2012-08-14 Thread Michael S. Tsirkin
We validate irq pin number when routing is setup, so code handling illegal irq # in pic and ioapic on each injection is never called. Drop it, replace with BUG_ON to catch out of bounds access bugs. Signed-off-by: Michael S. Tsirkin --- Changes from v1: add BUG_ON at Gleb's suggestion

Re: [PATCH 2/3] vfio: vfio-pci device assignment driver

2012-08-14 Thread Avi Kivity
On 08/01/2012 08:18 AM, Alex Williamson wrote: > This adds the core of the QEMU VFIO-based PCI device assignment driver. > To make use of this driver, enable CONFIG_VFIO, CONFIG_VFIO_IOMMU_TYPE1, > and CONFIG_VFIO_PCI in your host Linux kernel config. Load the vfio-pci > module. To assign device

Re: [PATCH v5 00/12] KVM: introduce readonly memslot

2012-08-14 Thread Marcelo Tosatti
On Tue, Aug 14, 2012 at 05:00:33PM +0300, Avi Kivity wrote: > On 08/10/2012 09:14 PM, Marcelo Tosatti wrote: > > On Tue, Aug 07, 2012 at 05:47:15PM +0800, Xiao Guangrong wrote: > >> Changelog: > >> - introduce KVM_PFN_ERR_RO_FAULT instead of dummy page > >> - introduce KVM_HVA_ERR_BAD and optimize

  1   2   >