Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Jan Kiszka
On 2013-03-05 08:57, Gleb Natapov wrote: On Tue, Mar 05, 2013 at 12:00:10AM +0100, Jan Kiszka wrote: On 2013-03-04 22:41, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com A VCPU sending INIT or SIPI to some other VCPU races for setting the remote VCPU's mp_state. When we were

Re: [PATCH v13 1/8] save/load cpu runstate

2013-03-05 Thread Paolo Bonzini
Il 05/03/2013 03:33, Hu Tao ha scritto: On Mon, Mar 04, 2013 at 10:30:48AM +0100, Paolo Bonzini wrote: Il 28/02/2013 13:13, Hu Tao ha scritto: This patch enables preservation of cpu runstate during save/load vm. So when a vm is restored from snapshot, the cpu runstate is restored, too. I

Re: [PATCH v13 4/8] add a new runstate: RUN_STATE_GUEST_PANICKED

2013-03-05 Thread Paolo Bonzini
Il 05/03/2013 04:17, Hu Tao ha scritto: Will if (runstate_check(RUN_STATE_INTERNAL_ERROR) || runstate_check(RUN_STATE_SHUTDOWN) || runstate_check(RUN_STATE_GUEST_PANICKED)) { runstate_set(RUN_STATE_PAUSED); } be OK? Or I must be

Re: [Bug 53611] New: nVMX: Add nested EPT

2013-03-05 Thread Jan Kiszka
On 2013-03-05 05:45, Nakajima, Jun wrote: On Tue, Feb 26, 2013 at 11:43 AM, Jan Kiszka jan.kis...@web.de wrote: On 2013-02-26 15:11, Nadav Har'El wrote: On Thu, Feb 14, 2013, Nakajima, Jun wrote about Re: [Bug 53611] New: nVMX: Add nested EPT: We have started looking at the pataches first.

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Gleb Natapov
On Tue, Mar 05, 2013 at 09:24:40AM +0100, Jan Kiszka wrote: On 2013-03-05 08:57, Gleb Natapov wrote: On Tue, Mar 05, 2013 at 12:00:10AM +0100, Jan Kiszka wrote: On 2013-03-04 22:41, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com A VCPU sending INIT or SIPI to some other VCPU

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Jan Kiszka
On 2013-03-05 09:46, Gleb Natapov wrote: On Tue, Mar 05, 2013 at 09:24:40AM +0100, Jan Kiszka wrote: On 2013-03-05 08:57, Gleb Natapov wrote: On Tue, Mar 05, 2013 at 12:00:10AM +0100, Jan Kiszka wrote: On 2013-03-04 22:41, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com A VCPU

[PATCH] s3: wake up on RTC event

2013-03-05 Thread Paolo Bonzini
The S3 test requires user interaction to terminate. Set up the RTC alarm instead, so that the test will end after one second. Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- x86/s3.c | 36 1 file changed, 36 insertions(+) diff --git a/x86/s3.c

[PATCH] tcm_vhost: Add hotplug/hotunplug support

2013-03-05 Thread Asias He
In commit 365a7150094 ([SCSI] virtio-scsi: hotplug support for virtio-scsi), hotplug support is added to virtio-scsi. This patch adds hotplug and hotunplug support to tcm_vhost. You can create or delate a LUN in targetcli to hotplug or hotplug a LUN in guest. Signed-off-by: Asias He

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Gleb Natapov
On Tue, Mar 05, 2013 at 10:12:05AM +0100, Jan Kiszka wrote: On 2013-03-05 09:46, Gleb Natapov wrote: On Tue, Mar 05, 2013 at 09:24:40AM +0100, Jan Kiszka wrote: On 2013-03-05 08:57, Gleb Natapov wrote: On Tue, Mar 05, 2013 at 12:00:10AM +0100, Jan Kiszka wrote: On 2013-03-04 22:41, Jan

Re: [PATCH RFC 0/2] kvm: Better yield_to candidate using preemption notifiers

2013-03-05 Thread Andrew Jones
On Mon, Mar 04, 2013 at 11:31:46PM +0530, Raghavendra K T wrote: This patch series further filters better vcpu candidate to yield to in PLE handler. The main idea is to record the preempted vcpus using preempt notifiers and iterate only those preempted vcpus in the handler. Note that the

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Paolo Bonzini
Il 05/03/2013 10:37, Gleb Natapov ha scritto: Not at all. I'm keeping the state in a single place, mp_state. I just have to make sure that I do not loose asynchronous events - what INIT and SIPI are. As evident from this code: + if (vcpu-arch.mp_state ==

[PATCH 1/8] s390/kvm,gaccess: fix guest access return code handling

2013-03-05 Thread Christian Borntraeger
From: Heiko Carstens heiko.carst...@de.ibm.com Guest access functions like copy_to/from_guest() call __guestaddr_to_user() which in turn call gmap_fault() in order to translate a guest address to a user space address. In error case __guest_addr_to_user() returns either -EFAULT or -ENOMEM. The

[PATCH 3/8] s390/kvm,tprot: use new gmap_translate() function

2013-03-05 Thread Christian Borntraeger
From: Heiko Carstens heiko.carst...@de.ibm.com When out-of-memory the tprot code incorrectly injected a program check for the guest which reported an addressing exception even if the guest address was valid. Let's use the new gmap_translate() which translates a guest address to a user space

[PATCH 8/8] s390/kvm,gaccess: add address space annotations

2013-03-05 Thread Christian Borntraeger
From: Heiko Carstens heiko.carst...@de.ibm.com Add missing address space annotations to all put_guest()/get_guest() callers. Signed-off-by: Heiko Carstens heiko.carst...@de.ibm.com Acked-by: Christian Borntraeger borntrae...@de.ibm.com Acked-by: Martin Schwidefsky schwidef...@de.ibm.com

[PATCH 4/8] s390/kvm: remove explicit -EFAULT return code checking on guest access

2013-03-05 Thread Christian Borntraeger
From: Heiko Carstens heiko.carst...@de.ibm.com Let's change to the paradigm that every return code from guest memory access functions that is not zero translates to -EFAULT and do not explictly compare. Explictly comparing the return value with -EFAULT has already shown to be a bit fragile. In

[PATCH 5/8] s390/kvm,gaccess: shorten put/get_guest code

2013-03-05 Thread Christian Borntraeger
From: Heiko Carstens heiko.carst...@de.ibm.com The put_guest_u*/get_guest_u* are nothing but wrappers for the regular put_user/get_user uaccess functions. The only difference is that before accessing user space the guest address must be translated to a user space address. Change the order of

[PATCH 2/8] s390/mm,gmap: implement gmap_translate()

2013-03-05 Thread Christian Borntraeger
From: Heiko Carstens heiko.carst...@de.ibm.com Implement gmap_translate() function which translates a guest absolute address to a user space process address without establishing the guest page table entries. This is useful for kvm guest address translations where no memory access is expected to

[PATCH 7/8] s390/kvm: cleanup/fix handle_tpi()

2013-03-05 Thread Christian Borntraeger
From: Heiko Carstens heiko.carst...@de.ibm.com - add missing specification exception check - remove one level of indentation - use defines instead of magic numbers Signed-off-by: Heiko Carstens heiko.carst...@de.ibm.com Reviewed-by: Cornelia Huck cornelia.h...@de.ibm.com Signed-off-by: Martin

Re: [PATCH RFC 0/2] kvm: Better yield_to candidate using preemption notifiers

2013-03-05 Thread Andrew Jones
On Tue, Mar 05, 2013 at 05:54:09PM +0530, Raghavendra K T wrote: On 03/05/2013 03:23 PM, Andrew Jones wrote: On Mon, Mar 04, 2013 at 11:31:46PM +0530, Raghavendra K T wrote: This patch series further filters better vcpu candidate to yield to in PLE handler. The main idea is to record the

Re: [PATCH v2] KVM: nVMX: Fix setting of CR0 and CR4 in guest mode

2013-03-05 Thread Gleb Natapov
On Mon, Mar 04, 2013 at 08:40:29PM +0100, Jan Kiszka wrote: The logic for calculating the value with which we call kvm_set_cr0/4 was broken (will definitely be visible with nested unrestricted guest mode support). Also, we performed the check regarding CR0_ALWAYSON too early when in guest

Re: [PATCH v2] KVM: nVMX: Fix setting of CR0 and CR4 in guest mode

2013-03-05 Thread Gleb Natapov
On Tue, Mar 05, 2013 at 02:57:03PM +0200, Gleb Natapov wrote: On Mon, Mar 04, 2013 at 08:40:29PM +0100, Jan Kiszka wrote: The logic for calculating the value with which we call kvm_set_cr0/4 was broken (will definitely be visible with nested unrestricted guest mode support). Also, we

Re: [PATCH v2] KVM: nVMX: Fix setting of CR0 and CR4 in guest mode

2013-03-05 Thread Jan Kiszka
On 2013-03-05 14:02, Gleb Natapov wrote: On Tue, Mar 05, 2013 at 02:57:03PM +0200, Gleb Natapov wrote: On Mon, Mar 04, 2013 at 08:40:29PM +0100, Jan Kiszka wrote: The logic for calculating the value with which we call kvm_set_cr0/4 was broken (will definitely be visible with nested

Re: [PATCH v5 6/6] KVM: s390: Wire up ioeventfd.

2013-03-05 Thread Michael S. Tsirkin
On Tue, Mar 05, 2013 at 09:13:08AM +0100, Cornelia Huck wrote: On Mon, 4 Mar 2013 21:07:41 -0300 Marcelo Tosatti mtosa...@redhat.com wrote: On Thu, Feb 28, 2013 at 12:33:21PM +0100, Cornelia Huck wrote: Enable ioeventfd support on s390 and hook up diagnose 500 virtio-ccw notifications.

Re: [PATCH] tcm_vhost: Add hotplug/hotunplug support

2013-03-05 Thread Paolo Bonzini
Il 05/03/2013 13:11, Michael S. Tsirkin ha scritto: + + struct vhost_work vs_event_work; /* evt injection work item */ + struct llist_head vs_event_list; /* evt injection queue */ + + bool vs_events_dropped; Documentation pls. Also - how is this handled during migration? Migration

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Jan Kiszka
On 2013-03-05 11:50, Paolo Bonzini wrote: Il 05/03/2013 10:37, Gleb Natapov ha scritto: Not at all. I'm keeping the state in a single place, mp_state. I just have to make sure that I do not loose asynchronous events - what INIT and SIPI are. As evident from this code: + if

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Gleb Natapov
On Tue, Mar 05, 2013 at 11:50:58AM +0100, Paolo Bonzini wrote: Il 05/03/2013 10:37, Gleb Natapov ha scritto: Not at all. I'm keeping the state in a single place, mp_state. I just have to make sure that I do not loose asynchronous events - what INIT and SIPI are. As evident

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Gleb Natapov
On Tue, Mar 05, 2013 at 02:25:51PM +0100, Jan Kiszka wrote: On 2013-03-05 11:50, Paolo Bonzini wrote: Il 05/03/2013 10:37, Gleb Natapov ha scritto: Not at all. I'm keeping the state in a single place, mp_state. I just have to make sure that I do not loose asynchronous events - what INIT

Re: KXVM call agenda for 2013-03-05

2013-03-05 Thread Juan Quintela
Juan Quintela quint...@redhat.com wrote: Hi Please send in any agenda topics you are interested in. Later, Juan. As there are no agenda, call gets cancelled. Later, Juan. -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org

Re: [PATCH v5 6/6] KVM: s390: Wire up ioeventfd.

2013-03-05 Thread Cornelia Huck
On Tue, 5 Mar 2013 15:19:43 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Tue, Mar 05, 2013 at 09:13:08AM +0100, Cornelia Huck wrote: On Mon, 4 Mar 2013 21:07:41 -0300 Marcelo Tosatti mtosa...@redhat.com wrote: On Thu, Feb 28, 2013 at 12:33:21PM +0100, Cornelia Huck wrote:

Re: [PATCH] tcm_vhost: Add hotplug/hotunplug support

2013-03-05 Thread Michael S. Tsirkin
On Tue, Mar 05, 2013 at 02:21:20PM +0100, Paolo Bonzini wrote: Il 05/03/2013 13:11, Michael S. Tsirkin ha scritto: + +struct vhost_work vs_event_work; /* evt injection work item */ +struct llist_head vs_event_list; /* evt injection queue */ + +bool

Re: [PATCH RFC 1/2] kvm: Record the preemption status of vcpus using preempt notifiers

2013-03-05 Thread Chegu Vinod
On 3/4/2013 10:02 AM, Raghavendra K T wrote: From: Raghavendra K T raghavendra...@linux.vnet.ibm.com Note that we mark as preempted only when vcpu's task state was Running during preemption. Thanks Jiannan, Avi for preemption notifier ideas. Thanks Gleb, PeterZ for their precious suggestions.

Re: [PATCH RFC 2/2] kvm: Iterate over only vcpus that are preempted

2013-03-05 Thread Chegu Vinod
On 3/4/2013 10:02 AM, Raghavendra K T wrote: From: Raghavendra K T raghavendra...@linux.vnet.ibm.com This helps in filtering out the eligible candidates further and thus potentially helps in quickly allowing preempted lockholders to run. Note that if a vcpu was spinning during preemption we

Re: in-kernel interrupt controller steering

2013-03-05 Thread Gleb Natapov
On Mon, Mar 04, 2013 at 11:20:47PM +0100, Alexander Graf wrote: Howdy, We just sat down to discuss the proposed XICS and MPIC interfaces and how we can take bits of each and create an interface that works for everyone. In this, it feels like we came to some conclusions. Some of which we

[PATCH kvm-unit-tests] x86: add INIT test

2013-03-05 Thread Paolo Bonzini
Test various ways of sending an INIT interrupt to the bootstrap processor. In all cases, the processor should start executing from 0xfff0 and other devices should be untouched. With the patches I just sent to qemu-devel (also at branch x86-soft-reset of git://github.com/bonzini/qemu.git),

Re: Tracing kvm: kvm_entry and kvm_exit

2013-03-05 Thread David Ahern
On 3/3/13 11:15 PM, Mohamad Gebai wrote: host kernel version? 3.8 compiled from perf-kvm-live-3.8 I made no changes to the kernel side so essentially you are running v3.8 unmodified. guest kernel? 3.8.1 qemu-kvm command line? (leave out the disk and network arguments -- just the rest)

Re: [PATCH 4/4] Add a timer to allow the separation of consigned from steal time.

2013-03-05 Thread Michael Wolf
Sorry for the delay in the response. I did not see your question. On Mon, 2013-02-18 at 20:57 -0300, Marcelo Tosatti wrote: On Tue, Feb 05, 2013 at 03:49:41PM -0600, Michael Wolf wrote: Add a helper routine to scheduler/core.c to allow the kvm module to retrieve the cpu hardlimit settings.

Re: [PATCH 0/4] Alter steal-time reporting in the guest

2013-03-05 Thread Michael Wolf
Sorry for the delay in the response. I did not see the email right away. On Mon, 2013-02-18 at 22:11 -0300, Marcelo Tosatti wrote: On Mon, Feb 18, 2013 at 05:43:47PM +0100, Frederic Weisbecker wrote: 2013/2/5 Michael Wolf m...@linux.vnet.ibm.com: In the case of where you have a system that

Re: [PATCH] tcm_vhost: Add hotplug/hotunplug support

2013-03-05 Thread Nicholas A. Bellinger
On Tue, 2013-03-05 at 16:34 +0200, Michael S. Tsirkin wrote: On Tue, Mar 05, 2013 at 02:21:20PM +0100, Paolo Bonzini wrote: Il 05/03/2013 13:11, Michael S. Tsirkin ha scritto: + + struct vhost_work vs_event_work; /* evt injection work item */ + struct llist_head

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Marcelo Tosatti
On Mon, Mar 04, 2013 at 10:41:43PM +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com A VCPU sending INIT or SIPI to some other VCPU races for setting the remote VCPU's mp_state. When we were unlucky, KVM_MP_STATE_INIT_RECEIVED was overwritten by kvm_emulate_halt and, thus, got

Re: [PATCH v5 0/6] kvm: Make ioeventfd usable on s390.

2013-03-05 Thread Marcelo Tosatti
On Thu, Feb 28, 2013 at 12:33:15PM +0100, Cornelia Huck wrote: v5 of the ioeventfd patch set, this time with a proper return code from __diag_virtio_hypercall(), otherwise unchanged. v4 - v5: - Proper return code in __diag_virtio_hypercall() v3 - v4: - Pass cookies in virtio-ccw notify

Re: virtio PCI on KVM without IO BARs

2013-03-05 Thread H. Peter Anvin
On 02/28/2013 07:24 AM, Michael S. Tsirkin wrote: 3. hypervisor assigned IO address qemu can reserve IO addresses and assign to virtio devices. 2 bytes per device (for notification and ISR access) will be enough. So we can reserve 4K and this gets us 2000 devices.

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Marcelo Tosatti
On Tue, Mar 05, 2013 at 08:16:41PM -0300, Marcelo Tosatti wrote: On Mon, Mar 04, 2013 at 10:41:43PM +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com A VCPU sending INIT or SIPI to some other VCPU races for setting the remote VCPU's mp_state. When we were unlucky,

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Marcelo Tosatti
On Tue, Mar 05, 2013 at 08:16:41PM -0300, Marcelo Tosatti wrote: On Mon, Mar 04, 2013 at 10:41:43PM +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com A VCPU sending INIT or SIPI to some other VCPU races for setting the remote VCPU's mp_state. When we were unlucky,

Re: [PATCH v2] KVM: nVMX: Reset RFLAGS on VM-exit

2013-03-05 Thread Marcelo Tosatti
On Mon, Mar 04, 2013 at 11:00:38AM +0200, Gleb Natapov wrote: On Sun, Mar 03, 2013 at 08:47:11PM +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Ouch, how could this work so well that far? We need to clear RFLAGS to the reset value as specified by the SDM. Particularly,

Re: in-kernel interrupt controller steering

2013-03-05 Thread Benjamin Herrenschmidt
On Mon, 2013-03-04 at 23:20 +0100, Alexander Graf wrote: 7) Interrupt line connections to vcpus are implicit We don't explicitly mark which in-kernel irqchip interrupt line goes to which vcpu. This is done implicitly. If we see a need for it, we create a new irqchip device type that allows

Re: in-kernel interrupt controller steering

2013-03-05 Thread Alexander Graf
On 06.03.2013, at 01:23, Benjamin Herrenschmidt wrote: On Mon, 2013-03-04 at 23:20 +0100, Alexander Graf wrote: 7) Interrupt line connections to vcpus are implicit We don't explicitly mark which in-kernel irqchip interrupt line goes to which vcpu. This is done implicitly. If we see a need

Re: [RFC PATCH 1/6] kvm: add device control API

2013-03-05 Thread Paul Mackerras
On Wed, Feb 13, 2013 at 11:49:15PM -0600, Scott Wood wrote: Currently, devices that are emulated inside KVM are configured in a hardcoded manner based on an assumption that any given architecture only has one way to do it. If there's any need to access device state, it is done through

Re: [RFC PATCH 1/6] kvm: add device control API

2013-03-05 Thread Scott Wood
On 03/05/2013 06:59:26 PM, Paul Mackerras wrote: On Wed, Feb 13, 2013 at 11:49:15PM -0600, Scott Wood wrote: Currently, devices that are emulated inside KVM are configured in a hardcoded manner based on an assumption that any given architecture only has one way to do it. If there's any need

Re: [PATCH] tcm_vhost: Add hotplug/hotunplug support

2013-03-05 Thread Asias He
On Tue, Mar 05, 2013 at 02:11:25PM +0200, Michael S. Tsirkin wrote: On Tue, Mar 05, 2013 at 05:17:07PM +0800, Asias He wrote: In commit 365a7150094 ([SCSI] virtio-scsi: hotplug support for virtio-scsi), hotplug support is added to virtio-scsi. This patch adds hotplug and hotunplug

Re: [PATCH] tcm_vhost: Add hotplug/hotunplug support

2013-03-05 Thread Asias He
On Tue, Mar 05, 2013 at 05:31:00PM +0800, Wanlong Gao wrote: On 03/05/2013 05:17 PM, Asias He wrote: In commit 365a7150094 ([SCSI] virtio-scsi: hotplug support for virtio-scsi), hotplug support is added to virtio-scsi. This patch adds hotplug and hotunplug support to tcm_vhost. You

Re: [PATCH] tcm_vhost: Add hotplug/hotunplug support

2013-03-05 Thread Asias He
On Tue, Mar 05, 2013 at 04:34:17PM +0200, Michael S. Tsirkin wrote: On Tue, Mar 05, 2013 at 02:21:20PM +0100, Paolo Bonzini wrote: Il 05/03/2013 13:11, Michael S. Tsirkin ha scritto: + + struct vhost_work vs_event_work; /* evt injection work item */ + struct llist_head

Re: [PATCH] s3: wake up on RTC event

2013-03-05 Thread Marcelo Tosatti
On Tue, Mar 05, 2013 at 10:16:18AM +0100, Paolo Bonzini wrote: The S3 test requires user interaction to terminate. Set up the RTC alarm instead, so that the test will end after one second. Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- x86/s3.c | 36

Re: [PATCH v2] KVM: nVMX: Fix content of MSR_IA32_VMX_ENTRY/EXIT_CTLS

2013-03-05 Thread Marcelo Tosatti
On Mon, Mar 04, 2013 at 05:15:48PM +0100, Jan Kiszka wrote: Properly set those bits to 1 that the spec demands in case bit 55 of VMX_BASIC is 0 - like in our case. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- Changes in v2: - use symbolic constants arch/x86/include/asm/vmx.h

Re: [PATCH 4/4] Add a timer to allow the separation of consigned from steal time.

2013-03-05 Thread Marcelo Tosatti
On Tue, Mar 05, 2013 at 02:17:57PM -0600, Michael Wolf wrote: Sorry for the delay in the response. I did not see your question. On Mon, 2013-02-18 at 20:57 -0300, Marcelo Tosatti wrote: On Tue, Feb 05, 2013 at 03:49:41PM -0600, Michael Wolf wrote: Add a helper routine to scheduler/core.c

Re: [PATCH 0/4] Alter steal-time reporting in the guest

2013-03-05 Thread Marcelo Tosatti
On Tue, Mar 05, 2013 at 02:22:08PM -0600, Michael Wolf wrote: Sorry for the delay in the response. I did not see the email right away. On Mon, 2013-02-18 at 22:11 -0300, Marcelo Tosatti wrote: On Mon, Feb 18, 2013 at 05:43:47PM +0100, Frederic Weisbecker wrote: 2013/2/5 Michael Wolf

Re: [RFC PATCH 1/6] kvm: add device control API

2013-03-05 Thread Benjamin Herrenschmidt
On Wed, 2013-02-13 at 23:49 -0600, Scott Wood wrote: Currently, devices that are emulated inside KVM are configured in a hardcoded manner based on an assumption that any given architecture only has one way to do it. If there's any need to access device state, it is done through inflexible

Re: [RFC PATCH 1/6] kvm: add device control API

2013-03-05 Thread Scott Wood
On 03/05/2013 08:48:33 PM, Benjamin Herrenschmidt wrote: On Wed, 2013-02-13 at 23:49 -0600, Scott Wood wrote: Currently, devices that are emulated inside KVM are configured in a hardcoded manner based on an assumption that any given architecture only has one way to do it. If there's any need

Re: [RFC PATCH 1/6] kvm: add device control API

2013-03-05 Thread Benjamin Herrenschmidt
On Tue, 2013-03-05 at 21:36 -0600, Scott Wood wrote: Which file is this in? A few hits: $ grep anon arch/powerpc/kvm/* arch/powerpc/kvm/book3s_64_mmu_hv.c:#include linux/anon_inodes.h arch/powerpc/kvm/book3s_64_mmu_hv.c:ret = anon_inode_getfd(kvm-htab, kvm_htab_fops, ctx, rwflag);

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Paolo Bonzini
On Tue, Mar 05, 2013 at 08:16:41PM -0300, Marcelo Tosatti wrote: On Mon, Mar 04, 2013 at 10:41:43PM +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com A VCPU sending INIT or SIPI to some other VCPU races for setting the remote VCPU's mp_state. When we were

[PATCH 0/5] tcm_vhost hotplug/hotunplug support and locking fix

2013-03-05 Thread Asias He
Asias He (5): tcm_vhost: Add missed lock in vhost_scsi_clear_endpoint() tcm_vhost: Introduce tcm_vhost_check_feature() tcm_vhost: Introduce tcm_vhost_check_endpoint() tcm_vhost: Fix vs-vs_endpoint checking in vhost_scsi_handle_vq() tcm_vhost: Add hotplug/hotunplug support

[PATCH 1/5] tcm_vhost: Add missed lock in vhost_scsi_clear_endpoint()

2013-03-05 Thread Asias He
tv_tpg-tv_tpg_vhost_count should be protected by tv_tpg-tv_tpg_mutex. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/tcm_vhost.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index 9951297..b3e50d7 100644 ---

[PATCH 2/5] tcm_vhost: Introduce tcm_vhost_check_feature()

2013-03-05 Thread Asias He
This helper is useful to check if a feature is supported. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/tcm_vhost.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index b3e50d7..fdbf986 100644 ---

[PATCH 4/5] tcm_vhost: Fix vs-vs_endpoint checking in vhost_scsi_handle_vq()

2013-03-05 Thread Asias He
vs-vs_endpoint is protected by the vs-dev.mutex. Use tcm_vhost_check_endpoint() to do check. The helper does the needed locking for us. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/tcm_vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 3/5] tcm_vhost: Introduce tcm_vhost_check_endpoint()

2013-03-05 Thread Asias He
This helper is useful to check if vs-vs_endpoint is setup by vhost_scsi_set_endpoint(). Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/tcm_vhost.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index

[PATCH 5/5] tcm_vhost: Add hotplug/hotunplug support

2013-03-05 Thread Asias He
In commit 365a7150094 ([SCSI] virtio-scsi: hotplug support for virtio-scsi), hotplug support is added to virtio-scsi. This patch adds hotplug and hotunplug support to tcm_vhost. You can create or delete a LUN in targetcli to hotplug or hotunplug a LUN in guest. Signed-off-by: Asias He

[PATCH 0/3] KVM: MMU: Simple cleanups and macro fixes

2013-03-05 Thread Takuya Yoshikawa
Note: the first two patches are from my other work. Takuya Yoshikawa (3): KVM: MMU: Fix and clean up for_each_gfn_* macros KVM: MMU: Use list_for_each_entry_safe in kvm_mmu_commit_zap_page() KVM: MMU: Introduce a helper function for FIFO zapping arch/x86/kvm/mmu.c | 78

[PATCH 1/3] KVM: MMU: Fix and clean up for_each_gfn_* macros

2013-03-05 Thread Takuya Yoshikawa
The expression (sp)-gfn should not be expanded using @gfn. Although no user of these macros passes a string other than gfn now, this should be fixed before anyone sees strange errors. Note: ignored the following checkpatch errors: ERROR: Macros with complex values should be enclosed in

[PATCH 2/3] KVM: MMU: Use list_for_each_entry_safe in kvm_mmu_commit_zap_page()

2013-03-05 Thread Takuya Yoshikawa
We are traversing the linked list, invalid_list, deleting each entry by kvm_mmu_free_page(). _safe version is there for such a case. Signed-off-by: Takuya Yoshikawa yoshikawa_takuya...@lab.ntt.co.jp --- arch/x86/kvm/mmu.c |7 +++ 1 files changed, 3 insertions(+), 4 deletions(-) diff

[PATCH 3/3] KVM: MMU: Introduce a helper function for FIFO zapping

2013-03-05 Thread Takuya Yoshikawa
Make the code for zapping the oldest mmu page, placed at the tail of the active list, a separate function. Signed-off-by: Takuya Yoshikawa yoshikawa_takuya...@lab.ntt.co.jp --- arch/x86/kvm/mmu.c | 55 +-- 1 files changed, 23 insertions(+), 32

Re: virtio PCI on KVM without IO BARs

2013-03-05 Thread H. Peter Anvin
On 03/05/2013 04:05 PM, H. Peter Anvin wrote: On 02/28/2013 07:24 AM, Michael S. Tsirkin wrote: 3. hypervisor assigned IO address qemu can reserve IO addresses and assign to virtio devices. 2 bytes per device (for notification and ISR access) will be enough. So we can reserve

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Jan Kiszka
On 2013-03-06 07:12, Paolo Bonzini wrote: On Tue, Mar 05, 2013 at 08:16:41PM -0300, Marcelo Tosatti wrote: On Mon, Mar 04, 2013 at 10:41:43PM +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com A VCPU sending INIT or SIPI to some other VCPU races for setting the remote VCPU's

Re: in-kernel interrupt controller steering

2013-03-05 Thread Benjamin Herrenschmidt
On Mon, 2013-03-04 at 23:20 +0100, Alexander Graf wrote: 7) Interrupt line connections to vcpus are implicit We don't explicitly mark which in-kernel irqchip interrupt line goes to which vcpu. This is done implicitly. If we see a need for it, we create a new irqchip device type that allows

Re: [RFC PATCH 1/6] kvm: add device control API

2013-03-05 Thread Paul Mackerras
On Wed, Feb 13, 2013 at 11:49:15PM -0600, Scott Wood wrote: Currently, devices that are emulated inside KVM are configured in a hardcoded manner based on an assumption that any given architecture only has one way to do it. If there's any need to access device state, it is done through

Re: [RFC PATCH 1/6] kvm: add device control API

2013-03-05 Thread Scott Wood
On 03/05/2013 06:59:26 PM, Paul Mackerras wrote: On Wed, Feb 13, 2013 at 11:49:15PM -0600, Scott Wood wrote: Currently, devices that are emulated inside KVM are configured in a hardcoded manner based on an assumption that any given architecture only has one way to do it. If there's any need

Re: [RFC PATCH 1/6] kvm: add device control API

2013-03-05 Thread Scott Wood
On 03/05/2013 08:48:33 PM, Benjamin Herrenschmidt wrote: On Wed, 2013-02-13 at 23:49 -0600, Scott Wood wrote: Currently, devices that are emulated inside KVM are configured in a hardcoded manner based on an assumption that any given architecture only has one way to do it. If there's any need

Re: [RFC PATCH 1/6] kvm: add device control API

2013-03-05 Thread Benjamin Herrenschmidt
On Tue, 2013-03-05 at 21:36 -0600, Scott Wood wrote: Which file is this in? A few hits: $ grep anon arch/powerpc/kvm/* arch/powerpc/kvm/book3s_64_mmu_hv.c:#include linux/anon_inodes.h arch/powerpc/kvm/book3s_64_mmu_hv.c:ret = anon_inode_getfd(kvm-htab, kvm_htab_fops, ctx, rwflag);