Re: perf uncore lkvm woes

2012-08-21 Thread Peter Zijlstra
On Sun, 2012-08-19 at 12:55 +0300, Avi Kivity wrote: I think Avi prefers the method where KVM 'fakes' the MSRs and we have to detect if the MSRs actually work or not. s/we have/we don't have/. So for the 'normal' PMU we actually do check to see if the MSRs are being faked and bail if they

Re: [Qemu-devel] x86, nops settings result in kernel crash

2012-08-21 Thread Michael Tokarev
On 20.08.2012 21:13, Tomas Racek wrote: [] Can we trim the old, large and now not-so-relevant discussion please? ;) I can provide you with more different traces if it can help. But I thought that maybe it will be more useful for you to try it on your own. So I've prepared some minimal debian

Re: qemu-kvm-1.0.1 - unable to exit if vcpu is in infinite loop

2012-08-21 Thread Jan Kiszka
On 2012-08-19 11:42, Avi Kivity wrote: On 08/17/2012 06:04 PM, Jan Kiszka wrote: Can anyone imagine that such a barrier may actually be required? If it is currently possible that env-stop is evaluated before we called into sigtimedwait in qemu_kvm_eat_signals, then we could actually eat the

Re: [PATCH v2] kvm-all.c: Move init of irqchip_inject_ioctl out of kvm_irqchip_create()

2012-08-21 Thread Jan Kiszka
On 2012-08-15 13:08, Peter Maydell wrote: Move the init of the irqchip_inject_ioctl field of KVMState out of kvm_irqchip_create() and into kvm_init(), so that kvm_set_irq() can be used even when no irqchip is created (for architectures that support async interrupt notification even without an

Re: [PATCH v10 08/14] KVM: ARM: Inject IRQs and FIQs from userspace

2012-08-21 Thread Jan Kiszka
On 2012-08-16 17:29, Christoffer Dall wrote: From: Christoffer Dall cd...@cs.columbia.edu Userspace can inject IRQs and FIQs through the KVM_IRQ_LINE VM ioctl. This ioctl is used since the sematics are in fact two lines that can be either raised or lowered on the VCPU - the IRQ and FIQ

Re: qemu-kvm-1.0.1 - unable to exit if vcpu is in infinite loop

2012-08-21 Thread Stefan Hajnoczi
On Tue, Aug 21, 2012 at 8:21 AM, Jan Kiszka jan.kis...@siemens.com wrote: On 2012-08-19 11:42, Avi Kivity wrote: On 08/17/2012 06:04 PM, Jan Kiszka wrote: Can anyone imagine that such a barrier may actually be required? If it is currently possible that env-stop is evaluated before we called

Re: [PATCH v2] kvm-all.c: Move init of irqchip_inject_ioctl out of kvm_irqchip_create()

2012-08-21 Thread Peter Maydell
On 21 August 2012 09:19, Jan Kiszka jan.kis...@siemens.com wrote: On 2012-08-15 13:08, Peter Maydell wrote: Move the init of the irqchip_inject_ioctl field of KVMState out of kvm_irqchip_create() and into kvm_init(), so that kvm_set_irq() can be used even when no irqchip is created (for

Re: perf uncore lkvm woes

2012-08-21 Thread Avi Kivity
On 08/21/2012 04:11 AM, Yan, Zheng wrote: There is only one kvm_pmu structure in struct kvm_vcpu_arch, but the uncore driver may define dozens of PMUs. Besides the uncore PMUs make extensive use of extra registers, I don't think we can store these information in kvm_pmu structure. We don't

Re: perf uncore lkvm woes

2012-08-21 Thread Avi Kivity
On 08/21/2012 10:11 AM, Peter Zijlstra wrote: On Sun, 2012-08-19 at 12:55 +0300, Avi Kivity wrote: I think Avi prefers the method where KVM 'fakes' the MSRs and we have to detect if the MSRs actually work or not. s/we have/we don't have/. So for the 'normal' PMU we actually do check to

Re: Windows slow boot: contractor wanted

2012-08-21 Thread Avi Kivity
On 08/20/2012 04:56 PM, Richard Davies wrote: We're running host kernel 3.5.1 and qemu-kvm 1.1.1. I hadn't though about it, but I agree this is related to cpu overcommit. The slow boots are intermittent (and infrequent) with cpu overcommit whereas I don't think it occurs without cpu

Re: perf uncore lkvm woes

2012-08-21 Thread Yan, Zheng
On 08/21/2012 04:32 PM, Avi Kivity wrote: On 08/21/2012 04:11 AM, Yan, Zheng wrote: There is only one kvm_pmu structure in struct kvm_vcpu_arch, but the uncore driver may define dozens of PMUs. Besides the uncore PMUs make extensive use of extra registers, I don't think we can store these

Re: [Qemu-devel] x86, nops settings result in kernel crash

2012-08-21 Thread Tomas Racek
On 20.08.2012 21:13, Tomas Racek wrote: [] Can we trim the old, large and now not-so-relevant discussion please? ;) I can provide you with more different traces if it can help. But I thought that maybe it will be more useful for you to try it on your own. So I've prepared some minimal

[PATCH] mm: mmu_notifier: fix inconsistent memory between secondary MMU and host

2012-08-21 Thread Xiao Guangrong
There has a bug in set_pte_at_notify which always set the pte to the new page before release the old page in secondary MMU, at this time, the process will access on the new page, but the secondary MMU still access on the old page, the memory is inconsistent between them Below scenario shows the

[PATCH] KVM: trace the events of mmu_notifier

2012-08-21 Thread Xiao Guangrong
mmu_notifier is the interface to broadcast the mm events to KVM, the tracepoints introduced in this patch can trace all these events, it is very helpful for us to notice and fix the bug caused by mm Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- include/trace/events/kvm.h |

Re: [PATCH v2] kvm-all.c: Move init of irqchip_inject_ioctl out of kvm_irqchip_create()

2012-08-21 Thread Jan Kiszka
On 2012-08-21 10:25, Peter Maydell wrote: On 21 August 2012 09:19, Jan Kiszka jan.kis...@siemens.com wrote: On 2012-08-15 13:08, Peter Maydell wrote: Move the init of the irqchip_inject_ioctl field of KVMState out of kvm_irqchip_create() and into kvm_init(), so that kvm_set_irq() can be used

Re: perf uncore lkvm woes

2012-08-21 Thread Peter Zijlstra
On Tue, 2012-08-21 at 11:34 +0300, Avi Kivity wrote: On 08/21/2012 10:11 AM, Peter Zijlstra wrote: On Sun, 2012-08-19 at 12:55 +0300, Avi Kivity wrote: I think Avi prefers the method where KVM 'fakes' the MSRs and we have to detect if the MSRs actually work or not. s/we have/we don't

[PATCH v4 0/8] KVM paravirt remote flush tlb

2012-08-21 Thread Nikunj A. Dadhania
Remote flushing api's does a busy wait which is fine in bare-metal scenario. But with-in the guest, the vcpus might have been pre-empted or blocked. In this scenario, the initator vcpu would end up busy-waiting for a long amount of time. This was discovered in our gang scheduling test and other

[PATCH v4 1/8] mm, x86: Add HAVE_RCU_TABLE_FREE support

2012-08-21 Thread Nikunj A. Dadhania
From: Peter Zijlstra a.p.zijls...@chello.nl Implements optional HAVE_RCU_TABLE_FREE support for x86. This is useful for things like Xen and KVM where paravirt tlb flush means the software page table walkers like GUP-fast cannot rely on IRQs disabling like regular x86 can. Not for inclusion - is

[PATCH v4 2/8] mm: Add missing TLB invalidate to RCU page-table freeing

2012-08-21 Thread Nikunj A. Dadhania
From: Peter Zijlstra a.p.zijls...@chello.nl For normal systems we need a TLB invalidate before freeing the page-tables, the generic RCU based page-table freeing code lacked this. This is because this code originally came from ppc where the hardware never walks the linux page-tables and thus this

[PATCH v4 3/8] KVM Guest: Add VCPU running/pre-empted state for guest

2012-08-21 Thread Nikunj A. Dadhania
From: Nikunj A. Dadhania nik...@linux.vnet.ibm.com The patch adds guest code for msr between guest and hypervisor. The msr will export the vcpu running/pre-empted information to the guest from host. This will enable guest to intelligently send ipi to running vcpus and set flag for pre-empted

[PATCH v4 4/8] KVM-HV: Add VCPU running/pre-empted state for guest

2012-08-21 Thread Nikunj A. Dadhania
From: Nikunj A. Dadhania nik...@linux.vnet.ibm.com Hypervisor code to indicate guest running/pre-empteded status through msr. The page is now pinned during MSR write time and use kmap_atomic/kunmap_atomic to access the shared area vcpu_state area. Suggested-by: Marcelo Tosatti

[PATCH v4 5/8] KVM Guest: Add paravirt kvm_flush_tlb_others

2012-08-21 Thread Nikunj A. Dadhania
From: Nikunj A. Dadhania nik...@linux.vnet.ibm.com flush_tlb_others_ipi depends on lot of statics in tlb.c. Replicated the flush_tlb_others_ipi as kvm_flush_tlb_others to further adapt to paravirtualization. Use the vcpu state information inside the kvm_flush_tlb_others to avoid sending ipi to

[PATCH v4 6/8] KVM-HV: Add flush_on_enter before guest enter

2012-08-21 Thread Nikunj A. Dadhania
PV-Flush guest would indicate to flush on enter, flush the TLB before entering and exiting the guest. Signed-off-by: Nikunj A. Dadhania nik...@linux.vnet.ibm.com --- arch/x86/kvm/x86.c | 28 1 files changed, 12 insertions(+), 16 deletions(-) diff --git

[PATCH v4 7/8] Enable HAVE_RCU_TABLE_FREE for kvm when PARAVIRT_TLB_FLUSH is enabled

2012-08-21 Thread Nikunj A. Dadhania
Signed-off-by: Nikunj A. Dadhania nik...@linux.vnet.ibm.com --- arch/x86/Kconfig | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index c70684f..354160d 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -612,6 +612,17

[PATCH v4 8/8] KVM-doc: Add paravirt tlb flush document

2012-08-21 Thread Nikunj A. Dadhania
Signed-off-by: Nikunj A. Dadhania nik...@linux.vnet.ibm.com --- Documentation/virtual/kvm/msr.txt|4 ++ Documentation/virtual/kvm/paravirt-tlb-flush.txt | 53 ++ 2 files changed, 57 insertions(+), 0 deletions(-) create mode 100644

Re: KVM call agenda for Tuesday, August 21

2012-08-21 Thread Juan Quintela
Juan Quintela quint...@redhat.com wrote: Hi Please send in any agenda items you are interested in covering. No agenda, no call. Rush all the fixes for 1.2 in the meanwhile. Later, Juan. -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to

[PATCH 1/6] KVM: PPC: booke: use vcpu reference from thread_struct

2012-08-21 Thread Bharat Bhushan
Like other places, use thread_struct to get vcpu reference. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- arch/powerpc/kernel/asm-offsets.c |2 +- arch/powerpc/kvm/booke_interrupts.S |6 ++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git

[PATCH 5/6] booke: Added DBCR4 SPR number

2012-08-21 Thread Bharat Bhushan
Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- arch/powerpc/include/asm/reg_booke.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/include/asm/reg_booke.h b/arch/powerpc/include/asm/reg_booke.h index e07e6af..b417de3 100644 ---

[PATCH 4/6] KVM: PPC: debug stub interface parameter defined

2012-08-21 Thread Bharat Bhushan
This patch defines the interface parameter for KVM_SET_GUEST_DEBUG ioctl support. Follow up patches will use this for setting up hardware breakpoints, watchpoints and software breakpoints. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- arch/powerpc/include/asm/kvm.h | 33

[PATCH 6/6] KVM: booke/bookehv: Add debug stub support

2012-08-21 Thread Bharat Bhushan
This patch adds the debug stub support on booke/bookehv. Now QEMU debug stub can use hw breakpoint, watchpoint and software breakpoint to debug guest. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- arch/powerpc/include/asm/kvm.h| 29 ++-

[PATCH 0/6] KVM: BOOKE/BOOKEHV : Added debug stub support

2012-08-21 Thread Bharat Bhushan
From: Bharat Bhushan bharat.bhus...@freescale.com This patchset adds the QEMU debug stub support for powerpc (booke/bookehv). [1/6] KVM: PPC: booke: use vcpu reference from thread_struct - This is a cleanup patch to use vcpu reference from thread struct [2/6] KVM: PPC: booke: Allow

[PATCH 3/6] KVM: PPC: booke: Added debug handler

2012-08-21 Thread Bharat Bhushan
Installed debug handler will be used for guest debug support and debug facility emulation features (patches for these features will follow this patch). Signed-off-by: Liu Yu yu@freescale.com [bharat.bhus...@freescale.com: Substantial changes] Signed-off-by: Bharat Bhushan

[PATCH 2/6] KVM: PPC: booke: Allow multiple exception types

2012-08-21 Thread Bharat Bhushan
Current kvmppc_booke_handlers uses the same macro (KVM_HANDLER) and all handlers are considered to be the same size. This will not be the case if we want to use different macros for different handlers. This patch improves the kvmppc_booke_handler so that it can support different macros for

Getting VLANS to the vm ping / UDP working but TCP not

2012-08-21 Thread Andrew Holway
Hi, I am trying out a couple of methods to get VLANs to the VM. In both cases the VM can ping google et all without problem and DNS works fine but it does not want to do any TCP. I thought this might be a frame size problem but even using telnet (which I understand sends tiny packets) fails to

[PATCH 00/13] Big real mode fixes

2012-08-21 Thread Avi Kivity
It turns out that our big real mode implementation was based on a miconception: I believed that loading a segment register in real mode causes the limit to be reset to 0x (thus undoing the effect), while in reality, the limit is preserved across segment changes. This bug was hidden by

[PATCH 01/13] KVM: VMX: Separate saving pre-realmode state from setting segments

2012-08-21 Thread Avi Kivity
Commit b246dd5df139 (KVM: VMX: Fix KVM_SET_SREGS with big real mode segments) moved fix_rmode_seg() to vmx_set_segment(), so that it is applied not just on transitions to real mode, but also on KVM_SET_SREGS (migration). However fix_rmode_seg() not only munges the vmcs segments, it also sets up

[PATCH 02/13] KVM: VMX: Fix incorrect lookup of segment S flag in fix_pmode_dataseg()

2012-08-21 Thread Avi Kivity
fix_pmode_dataseg() looks up S in -base instead of -ar_bytes. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/vmx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index bd6e06e..6865ec5 100644 --- a/arch/x86/kvm/vmx.c

[PATCH 04/13] KVM: VMX: Retain limit and attributes when entering protected mode

2012-08-21 Thread Avi Kivity
Real processors don't change segment limits and attributes while in real mode. Mimic that behaviour. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/vmx.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index

[PATCH 05/13] KVM: VMX: Allow real mode emulation using vm86 with dpl=0

2012-08-21 Thread Avi Kivity
Real mode is always entered from protected mode with dpl=0. Since the dpl doesn't affect execution, and we already override it to 3 in the vmcs (as vmx requires), we can allow execution in that state. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/vmx.c | 2 +- 1 file changed, 1

[PATCH 06/13] KVM: VMX: Allow vm86 virtualization of big real mode

2012-08-21 Thread Avi Kivity
Usually, big real mode uses large (4GB) segments. Currently we don't virtualize this; if any segment has a limit other than 0x, we emulate. But if we set the vmx-visible limit to 0x, we can use vm86 to virtualize real mode; if an access overruns the segment limit, the guest will #GP,

[PATCH 07/13] KVM: x86 emulator: Leave segment limit and attributs alone in real mode

2012-08-21 Thread Avi Kivity
When loading a segment in real mode, only the base and selector must be modified. The limit needs to be left alone, otherwise big real mode users will hit a #GP due to limit checking (currently this is suppressed because we don't check limits in real mode). Signed-off-by: Avi Kivity

[PATCH 08/13] KVM: x86 emulator: Check segment limits in real mode too

2012-08-21 Thread Avi Kivity
Segment limits are verified in real mode, not just protected mode. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/emulate.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 7281ff8..67da0ac 100644 ---

[PATCH 09/13] KVM: x86 emulator: Fix #GP error code during linearization

2012-08-21 Thread Avi Kivity
We want the segment selector, nor segment number. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/emulate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 67da0ac..9001b1c 100644 ---

[PATCH 10/13] KVM: VMX: Return real real-mode segment data even if emulate_invalid_guest_state=1

2012-08-21 Thread Avi Kivity
emulate_invalid_guest_state=1 doesn't mean we don't munge the segments in the vmcs; we do. So we need to return the real ones (maintained by vmx_set_segment). Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/vmx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[PATCH 11/13] KVM: VMX: Preserve segment limit and access rights in real mode

2012-08-21 Thread Avi Kivity
While this is undocumented, real processors do not reload the segment limit and access rights when loading a segment register in real mode. Real programs rely on it so we need to comply with this behaviour. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/vmx.c | 3 +++ 1 file changed,

[PATCH 12/13] KVM: VMX: Save all segment data in real mode

2012-08-21 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/vmx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index c16b375..4649618 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -3217,6 +3217,7 @@ static void vmx_set_segment(struct

[PATCH 13/13] KVM: VMX: Ignore segment G and D bits when considering whether we can virtualize

2012-08-21 Thread Avi Kivity
We will enter the guest with G and D cleared; as real hardware ignores D in real mode, and G is taken care of by the limit test, we allow more code to run in vm86 mode. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

Re: [PATCH v10 08/14] KVM: ARM: Inject IRQs and FIQs from userspace

2012-08-21 Thread Christoffer Dall
On Tue, Aug 21, 2012 at 4:20 AM, Jan Kiszka jan.kis...@siemens.com wrote: On 2012-08-16 17:29, Christoffer Dall wrote: From: Christoffer Dall cd...@cs.columbia.edu Userspace can inject IRQs and FIQs through the KVM_IRQ_LINE VM ioctl. This ioctl is used since the sematics are in fact two lines

[PATCH] virt.kvm: Handle migrate errors using QMP monitor properly

2012-08-21 Thread Lucas Meneghel Rodrigues
When using QMP monitor as the sole monitor on KVM autotest (something that we sadly did not exercise on our test farms), starting qemu with -S and then issuing 'cont' will cause errors, since the error treatment with QMP monitors is more strict [1]. Take advantage of the fact that error treatment

Re: [PATCH] mm: mmu_notifier: fix inconsistent memory between secondary MMU and host

2012-08-21 Thread Andrea Arcangeli
On Tue, Aug 21, 2012 at 05:46:39PM +0800, Xiao Guangrong wrote: There has a bug in set_pte_at_notify which always set the pte to the new page before release the old page in secondary MMU, at this time, the process will access on the new page, but the secondary MMU still access on the old page,

Re: Windows slow boot: contractor wanted

2012-08-21 Thread Richard Davies
Avi Kivity wrote: Richard Davies wrote: We're running host kernel 3.5.1 and qemu-kvm 1.1.1. I hadn't though about it, but I agree this is related to cpu overcommit. The slow boots are intermittent (and infrequent) with cpu overcommit whereas I don't think it occurs without cpu

Re: [Qemu-devel] Windows slow boot: contractor wanted

2012-08-21 Thread Troy Benjegerdes
Do you have any way to determine what CPU groups the different VMs are running on? If you end up in an overcommit situation where half the 'virtual' cpus are on one AMD socket, and the other half are on a different AMD socket, then you'll be thrashing the hypertransport link. At Cray we were

[PATCH] virt.kvm_vm: Autodetect whenever bootindex should be used

2012-08-21 Thread Lucas Meneghel Rodrigues
Also, avoid checking twice and use the result when to add boot=on/off to the command line. Signed-off-by: Gerd Hoffmann kra...@redhat.com Signed-off-by: Lucas Meneghel Rodrigues l...@redhat.com --- client/virt/kvm_vm.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git

[PATCH v9 0/2] kvm: level irqfd support

2012-08-21 Thread Alex Williamson
Here's the much anticipated re-write of support for level irqfds. As Michael suggested, I've rolled the eoi/ack notification fd into KVM_IRQFD as a new mode. For lack of a better name, as there seems to be objections to associating this specifically with an EOI or an ACK, I've name this OADN or

[PATCH v9 1/2] kvm: Use a reserved IRQ source ID for irqfd

2012-08-21 Thread Alex Williamson
KVM_IRQFD currently uses the reserved KVM_USERSPACE_IRQ_SOURCE_ID which is also shared with userspace injection methods like KVM_IRQ_LINE. This can cause a conflict if an irqfd triggers on a GSI asserted through KVM_IRQ_LINE. Move irqfd to it's own reserved IRQ source ID. Add a capability for

[PATCH v9 2/2] kvm: On Ack, De-assert Notify KVM_IRQFD extension

2012-08-21 Thread Alex Williamson
For VFIO based device assignment we'd like a mechanism to allow level triggered interrutps to be directly injected into KVM. KVM_IRQFD already allows this for edge triggered interrupts, but for level, we need to watch for acknowledgement of the interrupt from the guest to provide us a hint when

Re: [PATCH v9 1/2] kvm: Use a reserved IRQ source ID for irqfd

2012-08-21 Thread Michael S. Tsirkin
On Tue, Aug 21, 2012 at 01:29:06PM -0600, Alex Williamson wrote: KVM_IRQFD currently uses the reserved KVM_USERSPACE_IRQ_SOURCE_ID which is also shared with userspace injection methods like KVM_IRQ_LINE. This can cause a conflict if an irqfd triggers on a GSI asserted through KVM_IRQ_LINE.

Re: [PATCH v9 1/2] kvm: Use a reserved IRQ source ID for irqfd

2012-08-21 Thread Alex Williamson
On Tue, 2012-08-21 at 22:58 +0300, Michael S. Tsirkin wrote: On Tue, Aug 21, 2012 at 01:29:06PM -0600, Alex Williamson wrote: KVM_IRQFD currently uses the reserved KVM_USERSPACE_IRQ_SOURCE_ID which is also shared with userspace injection methods like KVM_IRQ_LINE. This can cause a conflict

Re: [PATCH v9 1/2] kvm: Use a reserved IRQ source ID for irqfd

2012-08-21 Thread Michael S. Tsirkin
On Tue, Aug 21, 2012 at 02:06:19PM -0600, Alex Williamson wrote: On Tue, 2012-08-21 at 22:58 +0300, Michael S. Tsirkin wrote: On Tue, Aug 21, 2012 at 01:29:06PM -0600, Alex Williamson wrote: KVM_IRQFD currently uses the reserved KVM_USERSPACE_IRQ_SOURCE_ID which is also shared with

[RFC-v3 0/5] vhost-scsi: Add support for host virtualized target

2012-08-21 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org Hi folks, This is the third RFC for vhost-scsi patches against mainline QEMU v1.1 to support the upstream tcm_vhost host virtualized target driver now available in v3.6-rc kernel code. This series is based upon last week's commit 346fe0c4c0b, and is

[RFC-v3 1/5] monitor: Rename+move net_handle_fd_param - monitor_handle_fd_param

2012-08-21 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch renames+moves the net_handle_fd_param() caller used to obtain a file descriptor from either qemu_parse_fd() (the normal case) or from monitor_get_fd() (migration case) into a generically prefixed monitor_handle_fd_param() to be used by

[RFC-v3 2/5] vhost: Pass device path to vhost_dev_init()

2012-08-21 Thread Nicholas A. Bellinger
From: Stefan Hajnoczi stefa...@linux.vnet.ibm.com The path to /dev/vhost-net is currently hardcoded in vhost_dev_init(). This needs to be changed so that /dev/vhost-scsi can be used. Pass in the device path instead of hardcoding it. Signed-off-by: Stefan Hajnoczi stefa...@linux.vnet.ibm.com Cc:

[RFC-v3 4/5] virtio-scsi: Add start/stop functionality for vhost-scsi

2012-08-21 Thread Nicholas A. Bellinger
From: Stefan Hajnoczi stefa...@linux.vnet.ibm.com This patch starts and stops vhost as the virtio device transitions through its status phases. Vhost can only be started once the guest reports its driver has successfully initialized, which means the virtqueues have been set up by the guest. v3:

[RFC-v3 3/5] vhost-scsi: add -vhost-scsi host device for use with tcm-vhost

2012-08-21 Thread Nicholas A. Bellinger
From: Stefan Hajnoczi stefa...@linux.vnet.ibm.com 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=vhost-scsi0,wwpn=...,tpgt=123 The virtio-scsi emulated device will make use of vhost-scsi to process virtio-scsi

[RFC-v3 5/5] virtio-scsi: Set max_target=0 during vhost-scsi operation

2012-08-21 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This QEMU patch sets VirtIOSCSIConfig-max_target=0 for vhost-scsi operation to restrict virtio-scsi LLD guest scanning to max_id=0 (a single target ID instance) when connected to individual tcm_vhost endpoints. This ensures that virtio-scsi LLD only

Re: [PATCH v9 2/2] kvm: On Ack, De-assert Notify KVM_IRQFD extension

2012-08-21 Thread Alex Williamson
On Tue, 2012-08-21 at 23:37 +0300, Michael S. Tsirkin wrote: On Tue, Aug 21, 2012 at 01:29:14PM -0600, Alex Williamson wrote: For VFIO based device assignment we'd like a mechanism to allow level triggered interrutps to be directly injected into KVM. KVM_IRQFD already allows this for edge

Re: [PATCH v9 1/2] kvm: Use a reserved IRQ source ID for irqfd

2012-08-21 Thread Alex Williamson
On Tue, 2012-08-21 at 23:41 +0300, Michael S. Tsirkin wrote: On Tue, Aug 21, 2012 at 02:06:19PM -0600, Alex Williamson wrote: On Tue, 2012-08-21 at 22:58 +0300, Michael S. Tsirkin wrote: On Tue, Aug 21, 2012 at 01:29:06PM -0600, Alex Williamson wrote: KVM_IRQFD currently uses the

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

2012-08-21 Thread Rusty Russell
On Wed, 15 Aug 2012 09:48:44 +0200, Christian Borntraeger borntrae...@de.ibm.com wrote: Have you written an appendix for the virtio specification for virtio-ccw? I think it would be good to include in this series for the purposes of review. Might be nice, but don't get fancy about it.

Re: [PATCH v9 2/2] kvm: On Ack, De-assert Notify KVM_IRQFD extension

2012-08-21 Thread Michael S. Tsirkin
On Tue, Aug 21, 2012 at 03:11:41PM -0600, Alex Williamson wrote: On Tue, 2012-08-21 at 23:37 +0300, Michael S. Tsirkin wrote: On Tue, Aug 21, 2012 at 01:29:14PM -0600, Alex Williamson wrote: For VFIO based device assignment we'd like a mechanism to allow level triggered interrutps to be

Re: [PATCH v9 0/2] kvm: level irqfd support

2012-08-21 Thread Michael S. Tsirkin
On Tue, Aug 21, 2012 at 01:28:57PM -0600, Alex Williamson wrote: Here's the much anticipated re-write of support for level irqfds. As Michael suggested, I've rolled the eoi/ack notification fd into KVM_IRQFD as a new mode. For lack of a better name, as there seems to be objections to

Re: [PATCH v9 1/2] kvm: Use a reserved IRQ source ID for irqfd

2012-08-21 Thread Michael S. Tsirkin
On Tue, Aug 21, 2012 at 03:14:54PM -0600, Alex Williamson wrote: On Tue, 2012-08-21 at 23:41 +0300, Michael S. Tsirkin wrote: On Tue, Aug 21, 2012 at 02:06:19PM -0600, Alex Williamson wrote: On Tue, 2012-08-21 at 22:58 +0300, Michael S. Tsirkin wrote: On Tue, Aug 21, 2012 at 01:29:06PM

Re: [PATCH v9 0/2] kvm: level irqfd support

2012-08-21 Thread Alex Williamson
On Wed, 2012-08-22 at 03:31 +0300, Michael S. Tsirkin wrote: On Tue, Aug 21, 2012 at 01:28:57PM -0600, Alex Williamson wrote: Here's the much anticipated re-write of support for level irqfds. As Michael suggested, I've rolled the eoi/ack notification fd into KVM_IRQFD as a new mode. For

Re: [PATCH v9 1/2] kvm: Use a reserved IRQ source ID for irqfd

2012-08-21 Thread Alex Williamson
On Wed, 2012-08-22 at 03:41 +0300, Michael S. Tsirkin wrote: On Tue, Aug 21, 2012 at 03:14:54PM -0600, Alex Williamson wrote: On Tue, 2012-08-21 at 23:41 +0300, Michael S. Tsirkin wrote: On Tue, Aug 21, 2012 at 02:06:19PM -0600, Alex Williamson wrote: On Tue, 2012-08-21 at 22:58 +0300,

Re: [PATCH v9 2/2] kvm: On Ack, De-assert Notify KVM_IRQFD extension

2012-08-21 Thread Alex Williamson
On Wed, 2012-08-22 at 03:14 +0300, Michael S. Tsirkin wrote: On Tue, Aug 21, 2012 at 03:11:41PM -0600, Alex Williamson wrote: On Tue, 2012-08-21 at 23:37 +0300, Michael S. Tsirkin wrote: On Tue, Aug 21, 2012 at 01:29:14PM -0600, Alex Williamson wrote: + } + irq_rt =

Re: pci_get_subsys: GFP_KERNEL allocations with IRQs disabled

2012-08-21 Thread Fengguang Wu
Feng, I think it's pci_get_subsys() triggered this assert: /* * Oi! Can't be having __GFP_FS allocations with IRQs disabled. */ if (DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags))) return; It's bisected down to this commit: commit

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

2012-08-21 Thread Nicholas A. Bellinger
On Fri, 2012-08-17 at 17:26 +0800, Asias He wrote: This patch brings virito-scsi support to kvm tool. With the introduce of tcm_vhost (vhost-scsi) tcm_vhost: Initial merge for vhost level target fabric driver we can implement virito-scsi by simply having vhost-scsi to handle the SCSI

Re: [PATCH] mm: mmu_notifier: fix inconsistent memory between secondary MMU and host

2012-08-21 Thread Xiao Guangrong
On 08/21/2012 11:06 PM, Andrea Arcangeli wrote: On Tue, Aug 21, 2012 at 05:46:39PM +0800, Xiao Guangrong wrote: There has a bug in set_pte_at_notify which always set the pte to the new page before release the old page in secondary MMU, at this time, the process will access on the new page, but

Re: [PATCH] mm: mmu_notifier: fix inconsistent memory between secondary MMU and host

2012-08-21 Thread Hugh Dickins
On Wed, 22 Aug 2012, Xiao Guangrong wrote: On 08/21/2012 11:06 PM, Andrea Arcangeli wrote: The KSM usage of it looks safe because it will only establish readonly ptes with it. Hmm, in KSM code, i found this code in replace_page: set_pte_at_notify(mm, addr, ptep, mk_pte(kpage,

Re: [PATCH] mm: mmu_notifier: fix inconsistent memory between secondary MMU and host

2012-08-21 Thread Xiao Guangrong
On 08/22/2012 12:12 PM, Hugh Dickins wrote: On Wed, 22 Aug 2012, Xiao Guangrong wrote: On 08/21/2012 11:06 PM, Andrea Arcangeli wrote: The KSM usage of it looks safe because it will only establish readonly ptes with it. Hmm, in KSM code, i found this code in replace_page:

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

2012-08-21 Thread Asias He
On Wed, Aug 22, 2012 at 11:48 AM, Nicholas A. Bellinger n...@linux-iscsi.org wrote: On Fri, 2012-08-17 at 17:26 +0800, Asias He wrote: This patch brings virito-scsi support to kvm tool. With the introduce of tcm_vhost (vhost-scsi) tcm_vhost: Initial merge for vhost level target fabric

[PATCH 1/6] KVM: PPC: booke: use vcpu reference from thread_struct

2012-08-21 Thread Bharat Bhushan
Like other places, use thread_struct to get vcpu reference. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- arch/powerpc/kernel/asm-offsets.c |2 +- arch/powerpc/kvm/booke_interrupts.S |6 ++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git

[PATCH 5/6] booke: Added DBCR4 SPR number

2012-08-21 Thread Bharat Bhushan
Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- arch/powerpc/include/asm/reg_booke.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/include/asm/reg_booke.h b/arch/powerpc/include/asm/reg_booke.h index e07e6af..b417de3 100644 ---

[PATCH 4/6] KVM: PPC: debug stub interface parameter defined

2012-08-21 Thread Bharat Bhushan
This patch defines the interface parameter for KVM_SET_GUEST_DEBUG ioctl support. Follow up patches will use this for setting up hardware breakpoints, watchpoints and software breakpoints. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- arch/powerpc/include/asm/kvm.h | 33

[PATCH 6/6] KVM: booke/bookehv: Add debug stub support

2012-08-21 Thread Bharat Bhushan
This patch adds the debug stub support on booke/bookehv. Now QEMU debug stub can use hw breakpoint, watchpoint and software breakpoint to debug guest. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- arch/powerpc/include/asm/kvm.h| 29 ++-

[PATCH 0/6] KVM: BOOKE/BOOKEHV : Added debug stub support

2012-08-21 Thread Bharat Bhushan
From: Bharat Bhushan bharat.bhus...@freescale.com This patchset adds the QEMU debug stub support for powerpc (booke/bookehv). [1/6] KVM: PPC: booke: use vcpu reference from thread_struct - This is a cleanup patch to use vcpu reference from thread struct [2/6] KVM: PPC: booke: Allow

[PATCH 3/6] KVM: PPC: booke: Added debug handler

2012-08-21 Thread Bharat Bhushan
Installed debug handler will be used for guest debug support and debug facility emulation features (patches for these features will follow this patch). Signed-off-by: Liu Yu yu@freescale.com [bharat.bhus...@freescale.com: Substantial changes] Signed-off-by: Bharat Bhushan

[PATCH 2/6] KVM: PPC: booke: Allow multiple exception types

2012-08-21 Thread Bharat Bhushan
Current kvmppc_booke_handlers uses the same macro (KVM_HANDLER) and all handlers are considered to be the same size. This will not be the case if we want to use different macros for different handlers. This patch improves the kvmppc_booke_handler so that it can support different macros for