Re: [patch 01/12] [PATCH] kvm-s390: add parameter for KVM_CREATE_VM

2011-12-12 Thread Avi Kivity
On 12/10/2011 02:35 PM, Carsten Otte wrote: > This patch introduces a new config option for user controlled kernel > virtual machines. It introduces an optional parameter to > KVM_CREATE_VM in order to create a user controlled virtual machine. > The parameter is passed to kvm_arch_init_vm for all a

Re: [patch 00/12] Ucontrol patchset V5

2011-12-12 Thread Avi Kivity
On 12/10/2011 02:35 PM, Carsten Otte wrote: > Hi Avi, Hi Marcelo, > > this iteration of the patchset has two changes: > - Handling of null PTEs is fixed (thanks Heiko) > - Typo in comment is fixed (thanks Joachim) Please add links to the documentation of the SIE thingie. -- error compiling commi

Re: [patch 04/12] [PATCH] kvm-s390-ucontrol: export SIE control block to user

2011-12-12 Thread Avi Kivity
On 12/10/2011 01:25 PM, Carsten Otte wrote: > On 09.12.2011 17:06, Alexander Graf wrote: >> Same as this. It's an s390 specific hack, so it should be identified >> as such. > Naming is fine either way with me. Sasha Levin and Avi seemed to > prefer not to have _S390 in it. > I've reconsidered and

[PATCH 1/2] kvm tools: Clean up 'kvm debug'

2011-12-12 Thread Sasha Levin
Signed-off-by: Sasha Levin --- tools/kvm/builtin-debug.c | 13 +++-- tools/kvm/builtin-run.c |7 --- tools/kvm/include/kvm/builtin-debug.h | 13 + 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/tools/kvm/builtin-debug.c b

[PATCH 2/2] kvm tools: Add ability to assert/deassert IRQs using 'kvm debug'

2011-12-12 Thread Sasha Levin
Add options to assert and deassert IRQs using 'kvm debug'. For example, to assert IRQ4 in guest 'my_instance': vm debug -n my_instance --assert_irq 4 Signed-off-by: Sasha Levin --- tools/kvm/builtin-debug.c | 19 +++ tools/kvm/builtin-run.c |

Re: [patch 01/12] [PATCH] kvm-s390: add parameter for KVM_CREATE_VM

2011-12-12 Thread Carsten Otte
On 12.12.2011 10:13, Avi Kivity wrote: Old kernels don't expose KVM_VM_REGULAR, so if people follow the recommendations, their userspace won't build. Normal guests must be 0. We can pretend we planned this all along by making the argument a flags mask, and claiming bit 0 for UCONTROL. That's a

Re: [patch 00/12] Ucontrol patchset V5

2011-12-12 Thread Carsten Otte
On 12.12.2011 10:15, Avi Kivity wrote: Please add links to the documentation of the SIE thingie. The format of the SIE control block is documented here: http://www.vm.ibm.com/pubs/cpdacb/SIEBK.HTML The native behavior of SSKE, ISKE and RRBE is documented in the Principles of Operation: for Sy

Re: [patch 04/12] [PATCH] kvm-s390-ucontrol: export SIE control block to user

2011-12-12 Thread Carsten Otte
On 12.12.2011 10:17, Avi Kivity wrote: I've reconsidered and now want the s390 back. Sorry about that. git-filter-branch can make the sedding painless. So pain involved, I can operate sed "s/old/new/g" just fine ;-). Will change it for the next version. -- To unsubscribe from this list: send

Re: [patch 00/12] Ucontrol patchset V5

2011-12-12 Thread Avi Kivity
On 12/12/2011 11:44 AM, Carsten Otte wrote: > On 12.12.2011 10:15, Avi Kivity wrote: >> Please add links to the documentation of the SIE thingie. > The format of the SIE control block is documented here: > http://www.vm.ibm.com/pubs/cpdacb/SIEBK.HTML > > The native behavior of SSKE, ISKE and RRBE i

Re: [patch 00/12] Ucontrol patchset V5

2011-12-12 Thread Carsten Otte
On 12.12.2011 10:49, Avi Kivity wrote: Do you have it in a tablet form factor? Never trust a machine you can lift :-). -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo

Re: [RFC PATCH] kvm tools, qcow: Add support for growing refcount blocks

2011-12-12 Thread Kevin Wolf
Am 12.12.2011 03:03, schrieb Lan Tianyu: > This patch enables allocating new refcount blocks and so then kvm tools > could expand qcow2 image much larger. > > Signed-off-by: Lan Tianyu > --- > tools/kvm/disk/qcow.c | 105 +--- > 1 files changed, 89 in

Re: [patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-12 Thread Martin Schwidefsky
On Sat, 10 Dec 2011 13:35:39 +0100 Carsten Otte wrote: > --- a/arch/s390/mm/pgtable.c > +++ b/arch/s390/mm/pgtable.c > @@ -393,6 +393,33 @@ out_unmap: > } > EXPORT_SYMBOL_GPL(gmap_map_segment); > > +static pmd_t *__pmdp_for_addr(struct mm_struct *mm, unsigned long addr) > +{ > + struct vm_

Re: [RFC PATCH] kvm tools, qcow: Add support for growing refcount blocks

2011-12-12 Thread Pekka Enberg
On Mon, 12 Dec 2011, Kevin Wolf wrote: @@ -667,14 +722,11 @@ static struct qcow_refcount_block *qcow_read_refcount_block(struct qcow *q, u64 rft_idx = clust_idx >> (header->cluster_bits - QCOW_REFCOUNT_BLOCK_SHIFT); if (rft_idx >= rft->rf_size) - return NULL; +

Re: [Android-virt] [PATCH v5 05/13] ARM: KVM: Inject IRQs and FIQs from userspace

2011-12-12 Thread Marc Zyngier
On 11/12/11 20:07, Christoffer Dall wrote: > On Dec 11, 2011, at 2:48 PM, Peter Maydell wrote: > >> On 11 December 2011 19:30, Christoffer Dall >> wrote: >>> On Sun, Dec 11, 2011 at 11:03 AM, Peter Maydell >>> wrote: Removing the mask would be wrong since the irq field here is encodin

Re: [RFC PATCH] kvm tools, qcow: Add support for growing refcount blocks

2011-12-12 Thread Kevin Wolf
Am 12.12.2011 11:58, schrieb Pekka Enberg: > On Mon, 12 Dec 2011, Kevin Wolf wrote: >>> @@ -667,14 +722,11 @@ static struct qcow_refcount_block >>> *qcow_read_refcount_block(struct qcow *q, u64 >>> >>> rft_idx = clust_idx >> (header->cluster_bits - >>> QCOW_REFCOUNT_BLOCK_SHIFT); >>> if (

Re: [RFC PATCH] kvm tools, qcow: Add support for growing refcount blocks

2011-12-12 Thread Kevin Wolf
Am 12.12.2011 12:15, schrieb Kevin Wolf: > Am 12.12.2011 11:58, schrieb Pekka Enberg: >> On Mon, 12 Dec 2011, Kevin Wolf wrote: @@ -667,14 +722,11 @@ static struct qcow_refcount_block *qcow_read_refcount_block(struct qcow *q, u64 rft_idx = clust_idx >> (header->cluster_bits

[AMD iommu] pci Failed to assign device "hostdev0" : Device or resource busy

2011-12-12 Thread Andreas Hartmann
Hello! I've got a few questions to a problem, which already was analyzed here sometime ago: http://markmail.org/message/dspovwvzp3wtdrf6#query:+page:1+mid:i2oph4xwfmiknt3y+state:results My situation is a bit different. I do have two PCI cards (a Linksys wlan card and an intel e100 card). Each of

Re: [PATCH 0/10] nEPT: Nested EPT support for Nested VMX

2011-12-12 Thread Nadav Har'El
On Sun, Nov 13, 2011, Avi Kivity wrote about "Re: [PATCH 0/10] nEPT: Nested EPT support for Nested VMX": > > I also believed that the fault injection part was also correct: I > > thought that the code already knows when to handle the fault in L2 (when > > the address is missing in cr3), in L1 (whe

Re: [Android-virt] [PATCH v5 05/13] ARM: KVM: Inject IRQs and FIQs from userspace

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 6:06 AM, Marc Zyngier wrote: > On 11/12/11 20:07, Christoffer Dall wrote: >> On Dec 11, 2011, at 2:48 PM, Peter Maydell wrote: >> >>> On 11 December 2011 19:30, Christoffer Dall >>> wrote: On Sun, Dec 11, 2011 at 11:03 AM, Peter Maydell wrote: > Removing th

Re: [PATCH v3] kvm: make vcpu life cycle separated from kvm instance

2011-12-12 Thread Gleb Natapov
On Mon, Dec 12, 2011 at 10:41:23AM +0800, Liu Ping Fan wrote: > From: Liu Ping Fan > > Currently, vcpu can be destructed only when kvm instance destroyed. > Change this to vcpu's destruction taken when its refcnt is zero, > and then vcpu MUST and CAN be destroyed before kvm's destroy. > Please d

Re: [PATCH 0/10] nEPT: Nested EPT support for Nested VMX

2011-12-12 Thread Avi Kivity
On 12/12/2011 01:37 PM, Nadav Har'El wrote: > On Sun, Nov 13, 2011, Avi Kivity wrote about "Re: [PATCH 0/10] nEPT: Nested > EPT support for Nested VMX": > > > I also believed that the fault injection part was also correct: I > > > thought that the code already knows when to handle the fault in L2

Re: [PATCH v5 05/13] ARM: KVM: Inject IRQs and FIQs from userspace

2011-12-12 Thread Avi Kivity
On 12/11/2011 12:24 PM, Christoffer Dall wrote: > 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 lines. > > KVM needs to know which VCPU it must

[PATCH] KVM, CPU hotplug: Avoid wraparound in pvclock_get_nsec_offset

2011-12-12 Thread Vasilis Liaskovitis
Hotplugging a vCPU with kvmclock enabled can cause a guest stall/hang. When the stall happens, pvclock_clocksource_read() is called for the new vCPU and pvclock_get_nsec_offset calculates native_read_tsc() - shadow->tsc_timestamp. shadow->tsc_timestamp contains a value larger than native_read_tsc()

Re: [PATCH v5 07/13] ARM: KVM: Emulation framework and CP15 emulation

2011-12-12 Thread Avi Kivity
On 12/11/2011 12:25 PM, Christoffer Dall wrote: > From: Christoffer Dall > > Adds a new important function in the main KVM/ARM code called > handle_exit() which is called from kvm_arch_vcpu_ioctl_run() on returns > from guest execution. This function examines the Hyp-Syndrome-Register > (HSR), whi

Re: [PATCH v5 09/13] ARM: KVM: Handle I/O aborts

2011-12-12 Thread Avi Kivity
On 12/11/2011 12:25 PM, Christoffer Dall wrote: > From: Christoffer Dall > > When the guest accesses I/O memory this will create data abort > exceptions and they are handled by decoding the HSR information > (physical address, read/write, length, register) and forwarding reads > and writes to QEMU

Re: [PATCH] KVM, CPU hotplug: Avoid wraparound in pvclock_get_nsec_offset

2011-12-12 Thread Jan Kiszka
On 2011-12-12 14:37, Vasilis Liaskovitis wrote: > Hotplugging a vCPU with kvmclock enabled can cause a guest stall/hang. When > the stall happens, pvclock_clocksource_read() is called for the new vCPU and > pvclock_get_nsec_offset calculates native_read_tsc() - shadow->tsc_timestamp. > shadow->tsc_

Re: [PATCH v5 10/13] ARM: KVM: Guest wait-for-interrupts (WFI) support

2011-12-12 Thread Avi Kivity
On 12/11/2011 12:25 PM, Christoffer Dall wrote: > From: Christoffer Dall > > When the guest executes a WFI instruction the operation is trapped to > KVM, which emulates the instruction in software. There is no correlation > between a guest executing a WFI instruction and actually puttin the putti

Re: [PATCH v5 11/13] ARM: KVM: Support SMP hosts

2011-12-12 Thread Avi Kivity
On 12/11/2011 12:25 PM, Christoffer Dall wrote: > In order to support KVM on a SMP host, it is necessary to initialize the > hypervisor on all CPUs, mostly by making sure each CPU gets its own > hypervisor stack and runs the HYP init code. > > We also take care of some missing locking of modificati

Re: [PATCH v5 12/13] ARM: KVM: Fix guest view of MPIDR

2011-12-12 Thread Avi Kivity
On 12/11/2011 12:25 PM, Christoffer Dall wrote: > From: Marc Zyngier > > A guest may need to know which CPU it has booted on (and Linux does). > Now that we can run KVM on a SMP host, QEMU may be running on any s/QEMU/userspace/ > CPU. In that case, directly reading MPIDR will give an inconsiste

Re: [Android-virt] [PATCH v5 05/13] ARM: KVM: Inject IRQs and FIQs from userspace

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 8:28 AM, Avi Kivity wrote: > On 12/11/2011 12:24 PM, Christoffer Dall wrote: >> 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

Re: [PATCH v5 04/13] ARM: KVM: Memory virtualization setup

2011-12-12 Thread Avi Kivity
On 12/11/2011 12:24 PM, Christoffer Dall wrote: > This commit introduces the framework for guest memory management > through the use of 2nd stage translation. Each VM has a pointer > to a level-1 tabled (the pgd field in struct kvm_arch) which is > used for the 2nd stage translations. Entries are a

[PATCH] kvm tools: mmap guest kernel instead of reading it into memory

2011-12-12 Thread Sasha Levin
This patch mmaps guest kernel into it's own memory slot instead of reading it into the memory. The advantages are: - Smaller memory footprint (same effect as KSM if running multiple guests) - Faster loading of larger kernels. Suggested-by: "Sweeney, Andrew John" Signed-off-by: Sasha Levin ---

Re: [Android-virt] [PATCH v5 05/13] ARM: KVM: Inject IRQs and FIQs from userspace

2011-12-12 Thread Avi Kivity
On 12/12/2011 04:38 PM, Christoffer Dall wrote: > > > > Why don't they match? The assignment of lines to actual pins differs, > > but essentially it's the same thing (otherwise we'd use a different ioctl). > > > > because there is no notion of gsi and irq_source_id on ARM. gsi = number of irq l

Re: [PATCH] kvm tools: mmap guest kernel instead of reading it into memory

2011-12-12 Thread Pekka Enberg
On Mon, Dec 12, 2011 at 4:47 PM, Sasha Levin wrote: > This patch mmaps guest kernel into it's own memory slot instead of reading > it into the memory. > > The advantages are: >  - Smaller memory footprint (same effect as KSM if running multiple guests) KSM isn't free so it's smaller footprint wit

Re: [Android-virt] [PATCH v5 09/13] ARM: KVM: Handle I/O aborts

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 8:54 AM, Avi Kivity wrote: > On 12/11/2011 12:25 PM, Christoffer Dall wrote: >> From: Christoffer Dall >> >> When the guest accesses I/O memory this will create data abort >> exceptions and they are handled by decoding the HSR information >> (physical address, read/write,

Re: [PATCH] KVM, CPU hotplug: Avoid wraparound in pvclock_get_nsec_offset

2011-12-12 Thread Vasilis Liaskovitis
On Mon, Dec 12, 2011 at 02:53:29PM +0100, Jan Kiszka wrote: > > Can't comment on the semantics, but your patch is whitespace damaged and > doesn't follow kernel coding style. But I assume it's not for > application yet, right? right. It fixes the hang for me, but I am not sure it's the best solut

Re: [PATCH v5 08/13] ARM: KVM: Handle guest faults in KVM

2011-12-12 Thread Avi Kivity
On 12/11/2011 12:25 PM, Christoffer Dall wrote: > From: Christoffer Dall > > Handles the guest faults in KVM by mapping in corresponding user pages > in the 2nd stage page tables. > > Introduces new ARM-specific kernel memory types, PAGE_KVM_GUEST and > pgprot_guest variables used to map 2nd stage

Re: [Android-virt] [PATCH v5 04/13] ARM: KVM: Memory virtualization setup

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 9:40 AM, Avi Kivity wrote: > On 12/11/2011 12:24 PM, Christoffer Dall wrote: >> This commit introduces the framework for guest memory management >> through the use of 2nd stage translation. Each VM has a pointer >> to a level-1 tabled (the pgd field in struct kvm_arch) whic

Re: [Android-virt] [PATCH v5 05/13] ARM: KVM: Inject IRQs and FIQs from userspace

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 9:50 AM, Avi Kivity wrote: > On 12/12/2011 04:38 PM, Christoffer Dall wrote: >> > >> > Why don't they match?  The assignment of lines to actual pins differs, >> > but essentially it's the same thing (otherwise we'd use a different ioctl). >> > >> >> because there is no noti

Re: [Android-virt] [PATCH v5 04/13] ARM: KVM: Memory virtualization setup

2011-12-12 Thread Avi Kivity
On 12/12/2011 05:09 PM, Christoffer Dall wrote: > On Mon, Dec 12, 2011 at 9:40 AM, Avi Kivity wrote: > > On 12/11/2011 12:24 PM, Christoffer Dall wrote: > >> This commit introduces the framework for guest memory management > >> through the use of 2nd stage translation. Each VM has a pointer > >> t

Re: [Android-virt] [PATCH v5 05/13] ARM: KVM: Inject IRQs and FIQs from userspace

2011-12-12 Thread Avi Kivity
On 12/12/2011 05:11 PM, Christoffer Dall wrote: > >> If I should re-use the existing one, should I simply move it outside > >> of __KVM_HAVE_IOAPIC? > > > > Protect it with __KVM_HAVE_IRQ_LINE so we don't leak unused tracepoints > > for other archs. > > > > ok. I used to be scared of touching your

Re: [Android-virt] [PATCH v5 04/13] ARM: KVM: Memory virtualization setup

2011-12-12 Thread Peter Maydell
On 12 December 2011 15:15, Avi Kivity wrote: > We need to differentiate in how Linux-as-a-guest acts and how the cpu is > supposed to work.  A guest operating system can theoretically assign the > ASID x to process A running on vcpu 0, and the same ASID x to process B > running on vcpu 1 That wou

Re: [PATCH] kvm tools: mmap guest kernel instead of reading it into memory

2011-12-12 Thread Sasha Levin
On Mon, 2011-12-12 at 16:54 +0200, Pekka Enberg wrote: > On Mon, Dec 12, 2011 at 4:47 PM, Sasha Levin wrote: > > This patch mmaps guest kernel into it's own memory slot instead of reading > > it into the memory. > > > > The advantages are: > > - Smaller memory footprint (same effect as KSM if run

Re: [Android-virt] [PATCH v5 04/13] ARM: KVM: Memory virtualization setup

2011-12-12 Thread Avi Kivity
On 12/12/2011 05:25 PM, Peter Maydell wrote: > On 12 December 2011 15:15, Avi Kivity wrote: > > We need to differentiate in how Linux-as-a-guest acts and how the cpu is > > supposed to work. A guest operating system can theoretically assign the > > ASID x to process A running on vcpu 0, and the s

Re: [PATCH] kvm tools: mmap guest kernel instead of reading it into memory

2011-12-12 Thread Pekka Enberg
On Mon, Dec 12, 2011 at 4:47 PM, Sasha Levin wrote: > +       /* mmap the actual kernel */ > +       kvm->bz_fd = dup(fd_kernel); > +       kvm->bz_len = st.st_size; > +       setup_end = ALIGN(setup_size - PAGE_SIZE, PAGE_SIZE); /* Need it > aligned to PAGE_SIZE */ > +       kvm->bz_start = mmap

Re: [PATCH] kvm tools: mmap guest kernel instead of reading it into memory

2011-12-12 Thread Sasha Levin
On Mon, 2011-12-12 at 17:59 +0200, Pekka Enberg wrote: > On Mon, Dec 12, 2011 at 4:47 PM, Sasha Levin wrote: > > + /* mmap the actual kernel */ > > + kvm->bz_fd = dup(fd_kernel); > > + kvm->bz_len = st.st_size; > > + setup_end = ALIGN(setup_size - PAGE_SIZE, PAGE_SIZE); /*

Re: [PATCH v5 07/13] ARM: KVM: Emulation framework and CP15 emulation

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 8:44 AM, Avi Kivity wrote: > On 12/11/2011 12:25 PM, Christoffer Dall wrote: >> From: Christoffer Dall >> >> Adds a new important function in the main KVM/ARM code called >> handle_exit() which is called from kvm_arch_vcpu_ioctl_run() on returns >> from guest execution. Th

Re: [PATCH v5 10/13] ARM: KVM: Guest wait-for-interrupts (WFI) support

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 9:12 AM, Avi Kivity wrote: > On 12/11/2011 12:25 PM, Christoffer Dall wrote: >> From: Christoffer Dall >> >> When the guest executes a WFI instruction the operation is trapped to >> KVM, which emulates the instruction in software. There is no correlation >> between a guest

Re: [Android-virt] [PATCH v5 05/13] ARM: KVM: Inject IRQs and FIQs from userspace

2011-12-12 Thread Peter Maydell
On 11 December 2011 23:01, Jan Kiszka wrote: > Enabling in-kernel irqchips usually means "switching worlds". So the > semantics of these particular IRQ inject interface details may change > without breaking anything. > > However, things might look different if there will be a need to inject > also

Re: [PATCH v4 00/15] uq/master: Introduce basic irqchip support

2011-12-12 Thread Marcelo Tosatti
On Thu, Dec 08, 2011 at 12:52:19PM +0100, Jan Kiszka wrote: > Changes in v4: > - rebased of current uq/master > - fixed stupid bugs that broke bisectability and user space irqchip mode > - integrated NMI-over-LINT1 injection logic > > CC: Lai Jiangshan > > Jan Kiszka (15): > msi: Generalize ms

Re: [PATCH v4 00/15] uq/master: Introduce basic irqchip support

2011-12-12 Thread Jan Kiszka
On 2011-12-12 17:37, Marcelo Tosatti wrote: > On Thu, Dec 08, 2011 at 12:52:19PM +0100, Jan Kiszka wrote: >> Changes in v4: >> - rebased of current uq/master >> - fixed stupid bugs that broke bisectability and user space irqchip mode >> - integrated NMI-over-LINT1 injection logic >> >> CC: Lai Jian

Re: [PATCH] kvm tools: mmap guest kernel instead of reading it into memory

2011-12-12 Thread Ingo Molnar
* Sasha Levin wrote: > + kvm->bz_start = mmap(NULL, kvm->bz_len, PROT_READ | PROT_WRITE, > + MAP_PRIVATE, kvm->bz_fd, setup_end); > > + /* NOP everything before the kernel start */ > + memset(kvm->bz_start, 0x90, setup_size - setup_end); You should real

Re: [PATCH] kvm tools: mmap guest kernel instead of reading it into memory

2011-12-12 Thread Andrew Walrond
On Mon, Dec 12, 2011 at 07:47:35PM +0200, Sasha Levin wrote: > > Another usecase which I've only first heard about couple of days ago is > loading extremely large bzImages. Those images are 300MB+ in size and > come with built in filesystem. Apparently it's some sort of a livecd > variant. > Hav

Re: [PATCH 4/4] KVM: PPC: align vcpu_kick with x86

2011-12-12 Thread Scott Wood
On 12/09/2011 05:15 PM, Alexander Graf wrote: > > On 09.12.2011, at 20:15, Scott Wood wrote: > >> On 12/09/2011 01:10 PM, Alexander Graf wrote: >>> >>> On 09.12.2011, at 19:19, Scott Wood wrote: >>> On 12/09/2011 09:26 AM, Alexander Graf wrote: > Our vcpu kick implementation differs a b

Re: [PATCH v4 00/15] uq/master: Introduce basic irqchip support

2011-12-12 Thread Avi Kivity
On 12/12/2011 06:51 PM, Jan Kiszka wrote: > > > > Any thoughts on the qemu-kvm merge plan? Sounds painful. > > Pain will be where the existing qemu-kvm extensions collide with these > refactored upstream devices (backend/frontend split specifically). > That's where we have to merge very carefully.

Re: [PATCH v5 11/13] ARM: KVM: Support SMP hosts

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 9:30 AM, Avi Kivity wrote: > On 12/11/2011 12:25 PM, Christoffer Dall wrote: >> In order to support KVM on a SMP host, it is necessary to initialize the >> hypervisor on all CPUs, mostly by making sure each CPU gets its own >> hypervisor stack and runs the HYP init code. >>

Re: [PATCH v5 12/13] ARM: KVM: Fix guest view of MPIDR

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 9:32 AM, Avi Kivity wrote: > On 12/11/2011 12:25 PM, Christoffer Dall wrote: >> From: Marc Zyngier >> >> A guest may need to know which CPU it has booted on (and Linux does). >> Now that we can run KVM on a SMP host, QEMU may be running on any > > s/QEMU/userspace/ > >> CP

Re: [Android-virt] [PATCH v5 04/13] ARM: KVM: Memory virtualization setup

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 10:49 AM, Avi Kivity wrote: > On 12/12/2011 05:25 PM, Peter Maydell wrote: >> On 12 December 2011 15:15, Avi Kivity wrote: >> > We need to differentiate in how Linux-as-a-guest acts and how the cpu is >> > supposed to work.  A guest operating system can theoretically assig

Re: [Android-virt] [PATCH v5 05/13] ARM: KVM: Inject IRQs and FIQs from userspace

2011-12-12 Thread Avi Kivity
On 12/12/2011 06:31 PM, Peter Maydell wrote: > On 11 December 2011 23:01, Jan Kiszka wrote: > > Enabling in-kernel irqchips usually means "switching worlds". So the > > semantics of these particular IRQ inject interface details may change > > without breaking anything. > > > > However, things migh

Re: [PATCH v4 00/15] uq/master: Introduce basic irqchip support

2011-12-12 Thread Jan Kiszka
On 2011-12-12 18:37, Avi Kivity wrote: > On 12/12/2011 06:51 PM, Jan Kiszka wrote: >>> >>> Any thoughts on the qemu-kvm merge plan? Sounds painful. >> >> Pain will be where the existing qemu-kvm extensions collide with these >> refactored upstream devices (backend/frontend split specifically). >> T

Re: [PATCH v5 10/13] ARM: KVM: Guest wait-for-interrupts (WFI) support

2011-12-12 Thread Avi Kivity
On 12/12/2011 06:20 PM, Christoffer Dall wrote: > >> > >> +/** > >> + * kvm_handle_wfi - handle a wait-for-interrupts instruction executed by > >> a guest > >> + * @vcpu:the vcpu pointer > >> + * @run: the kvm_run structure pointer > >> + * > >> + * Simply sets the wait_for_interrupts flag

Re: [PATCH v5 12/13] ARM: KVM: Fix guest view of MPIDR

2011-12-12 Thread Marc Zyngier
On 12/12/11 17:39, Christoffer Dall wrote: > On Mon, Dec 12, 2011 at 9:32 AM, Avi Kivity wrote: >> On 12/11/2011 12:25 PM, Christoffer Dall wrote: >>> From: Marc Zyngier >>> >>> A guest may need to know which CPU it has booted on (and Linux does). >>> Now that we can run KVM on a SMP host, QEMU m

Re: [PATCH v5 11/13] ARM: KVM: Support SMP hosts

2011-12-12 Thread Avi Kivity
On 12/12/2011 07:37 PM, Christoffer Dall wrote: > > > > This looks overly complicated with two levels of locks. x86 gets by > > with no locks, and a much more complicated interrupt architecture. > > > > My recommendation is: > > wait_for_interrupts is managed solely by the vcpu thread > > KVM_IR

Re: [PATCH v4 00/15] uq/master: Introduce basic irqchip support

2011-12-12 Thread Avi Kivity
On 12/12/2011 07:42 PM, Jan Kiszka wrote: > > It's a little late for this, but refactoring qemu-kvm in-tree and then > > splitting it into patches would have been easier. Let's try it this way > > for the next batch. > > I thought about this, but it definitely takes a clean, qemu-kvm free > base a

Re: [PATCH] kvm tools: mmap guest kernel instead of reading it into memory

2011-12-12 Thread Avi Kivity
On 12/12/2011 08:14 PM, Sasha Levin wrote: > On Mon, 2011-12-12 at 17:59 +0200, Pekka Enberg wrote: > > On Mon, Dec 12, 2011 at 4:47 PM, Sasha Levin > > wrote: > > > + /* mmap the actual kernel */ > > > + kvm->bz_fd = dup(fd_kernel); > > > + kvm->bz_len = st.st_size; > > > +

Re: [PATCH] kvm tools: mmap guest kernel instead of reading it into memory

2011-12-12 Thread Avi Kivity
On 12/12/2011 04:47 PM, Sasha Levin wrote: > This patch mmaps guest kernel into it's own memory slot instead of reading > it into the memory. > > - } else { > - /* First RAM range from zero to the PCI gap: */ > > + /* Mapped kernel */ > + phys_start = BZ_KE

Re: [PATCH] kvm tools: mmap guest kernel instead of reading it into memory

2011-12-12 Thread Avi Kivity
On 12/12/2011 04:47 PM, Sasha Levin wrote: > This patch mmaps guest kernel into it's own memory slot instead of reading > it into the memory. > > The advantages are: > - Smaller memory footprint (same effect as KSM if running multiple guests) > - Faster loading of larger kernels. > How many COW

Re: [AMD iommu] pci Failed to assign device "hostdev0" : Device or resource busy

2011-12-12 Thread Don Dutile
On 12/12/2011 06:15 AM, Andreas Hartmann wrote: Hello! I've got a few questions to a problem, which already was analyzed here sometime ago: http://markmail.org/message/dspovwvzp3wtdrf6#query:+page:1+mid:i2oph4xwfmiknt3y+state:results My situation is a bit different. I do have two PCI cards (a L

Re: [Android-virt] [PATCH v5 10/13] ARM: KVM: Guest wait-for-interrupts (WFI) support

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 12:44 PM, Avi Kivity wrote: > On 12/12/2011 06:20 PM, Christoffer Dall wrote: >> >> >> >> +/** >> >> + * kvm_handle_wfi - handle a wait-for-interrupts instruction executed by >> >> a guest >> >> + * @vcpu:    the vcpu pointer >> >> + * @run:     the kvm_run structure point

Re: [Android-virt] [PATCH v5 11/13] ARM: KVM: Support SMP hosts

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 12:56 PM, Avi Kivity wrote: > On 12/12/2011 07:37 PM, Christoffer Dall wrote: >> > >> > This looks overly complicated with two levels of locks.  x86 gets by >> > with no locks, and a much more complicated interrupt architecture. >> > >> > My recommendation is: >> >  wait_fo

Re: [PATCH v5 12/13] ARM: KVM: Fix guest view of MPIDR

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 12:44 PM, Marc Zyngier wrote: > On 12/12/11 17:39, Christoffer Dall wrote: >> On Mon, Dec 12, 2011 at 9:32 AM, Avi Kivity wrote: >>> On 12/11/2011 12:25 PM, Christoffer Dall wrote: From: Marc Zyngier A guest may need to know which CPU it has booted on (and

Re: [PATCH v5 08/13] ARM: KVM: Handle guest faults in KVM

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 10:05 AM, Avi Kivity wrote: > On 12/11/2011 12:25 PM, Christoffer Dall wrote: >> From: Christoffer Dall >> >> Handles the guest faults in KVM by mapping in corresponding user pages >> in the 2nd stage page tables. >> >> Introduces new ARM-specific kernel memory types, PAGE

Re: [PATCH 2/2] kvm tools: Add ability to assert/deassert IRQs using 'kvm debug'

2011-12-12 Thread Pekka Enberg
On Mon, 2011-12-12 at 11:19 +0200, Sasha Levin wrote: > Add options to assert and deassert IRQs using 'kvm debug'. For example, to > assert IRQ4 in guest 'my_instance': > > vm debug -n my_instance --assert_irq 4 > > Signed-off-by: Sasha Levin Why is this useful? How does it protect agains

[PATCH] KVM: PPC: e500: include linux/export.h

2011-12-12 Thread Scott Wood
This is required for THIS_MODULE. We recently stopped acquiring it via some other header. Signed-off-by: Scott Wood --- arch/powerpc/kvm/e500.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kvm/e500.c b/arch/powerpc/kvm/e500.c index 0910104..709d82f 10064

[PATCH v3 01/14] KVM: PPC: Make wakeups work again for Book3S HV guests

2011-12-12 Thread Paul Mackerras
When commit f43fdc15fa ("KVM: PPC: booke: Improve timer register emulation") factored out some code in arch/powerpc/kvm/powerpc.c into a new helper function, kvm_vcpu_kick(), an error crept in which causes Book3s HV guest vcpus to stall. This fixes it. On POWER7 machines, guest vcpus are grouped t

[PATCH v3 02/14] KVM: PPC: Move kvm_vcpu_ioctl_[gs]et_one_reg down to platform-specific code

2011-12-12 Thread Paul Mackerras
This moves the get/set_one_reg implementation down from powerpc.c into booke.c, book3s_pr.c and book3s_hv.c. This avoids #ifdefs in C code, but more importantly, it fixes a bug on Book3s HV where we were accessing beyond the end of the kvm_vcpu struct (via the to_book3s() macro) and corrupting mem

[PATCH v3 08/14] KVM: PPC: Allow use of small pages to back Book3S HV guests

2011-12-12 Thread Paul Mackerras
This relaxes the requirement that the guest memory be provided as 16MB huge pages, allowing it to be provided as normal memory, i.e. in pages of PAGE_SIZE bytes (4k or 64k). To allow this, we index the kvm->arch.slot_phys[] arrays with a small page index, even if huge pages are being used, and use

[PATCH v3 04/14] KVM: PPC: Keep page physical addresses in per-slot arrays

2011-12-12 Thread Paul Mackerras
This allocates an array for each memory slot that is added to store the physical addresses of the pages in the slot. This array is vmalloc'd and accessed in kvmppc_h_enter using real_vmalloc_addr(). This allows us to remove the ram_pginfo field from the kvm_arch struct, and removes the 64GB guest

[PATCH v3 14/14] KVM: PPC: Allow for read-only pages backing a Book3S HV guest

2011-12-12 Thread Paul Mackerras
With this, if a guest does an H_ENTER with a read/write HPTE on a page which is currently read-only, we make the actual HPTE inserted be a read-only version of the HPTE. We now intercept protection faults as well as HPTE not found faults, and for a protection fault we work out whether it should be

[PATCH v3 06/14] KVM: PPC: Make the H_ENTER hcall more reliable

2011-12-12 Thread Paul Mackerras
At present, our implementation of H_ENTER only makes one try at locking each slot that it looks at, and doesn't even retry the ldarx/stdcx. atomic update sequence that it uses to attempt to lock the slot. Thus it can return the H_PTEG_FULL error unnecessarily, particularly when the H_EXACT flag is

[PATCH v3 11/14] KVM: PPC: Implement MMIO emulation support for Book3S HV guests

2011-12-12 Thread Paul Mackerras
This provides the low-level support for MMIO emulation in Book3S HV guests. When the guest tries to map a page which is not covered by any memslot, that page is taken to be an MMIO emulation page. Instead of inserting a valid HPTE, we insert an HPTE that has the valid bit clear but another hyperv

[PATCH v3 07/14] KVM: PPC: Only get pages when actually needed, not in prepare_memory_region()

2011-12-12 Thread Paul Mackerras
This removes the code from kvmppc_core_prepare_memory_region() that looked up the VMA for the region being added and called hva_to_page to get the pfns for the memory. We have no guarantee that there will be anything mapped there at the time of the KVM_SET_USER_MEMORY_REGION ioctl call; userspace

[PATCH v3 05/14] KVM: PPC: Add an interface for pinning guest pages in Book3s HV guests

2011-12-12 Thread Paul Mackerras
This adds two new functions, kvmppc_pin_guest_page() and kvmppc_unpin_guest_page(), and uses them to pin the guest pages where the guest has registered areas of memory for the hypervisor to update, (i.e. the per-cpu virtual processor areas, SLB shadow buffers and dispatch trace logs) and then unpin

[PATCH v3 09/14] KVM: PPC: Allow I/O mappings in memory slots

2011-12-12 Thread Paul Mackerras
This provides for the case where userspace maps an I/O device into the address range of a memory slot using a VM_PFNMAP mapping. In that case, we work out the pfn from vma->vm_pgoff, and record the cache enable bits from vma->vm_page_prot in two low-order bits in the slot_phys array entries. Then

[PATCH v3 12/14] KVM: Add barriers to allow mmu_notifier_retry to be used locklessly

2011-12-12 Thread Paul Mackerras
This adds an smp_wmb in kvm_mmu_notifier_invalidate_range_end() and an smp_rmb in mmu_notifier_retry() so that mmu_notifier_retry() will give the correct answer when called without kvm->mmu_lock being held. PowerPC Book3S HV KVM wants to use a bitlock per guest page rather than a single global spin

[PATCH v3 03/14] KVM: PPC: Keep a record of HV guest view of hashed page table entries

2011-12-12 Thread Paul Mackerras
This adds an array that parallels the guest hashed page table (HPT), that is, it has one entry per HPTE, used to store the guest's view of the second doubleword of the corresponding HPTE. The first doubleword in the HPTE is the same as the guest's idea of it, so we don't need to store a copy, but

[PATCH v3 00/14] KVM: PPC: Update Book3S HV memory handling

2011-12-12 Thread Paul Mackerras
This series of patches updates the Book3S-HV KVM code that manages the guest hashed page table (HPT) to enable several things: * MMIO emulation and MMIO pass-through * Use of small pages (4kB or 64kB, depending on config) to back the guest memory * Pageable guest memory - i.e. backing pages ca

[PATCH v3 10/14] KVM: PPC: Maintain a doubly-linked list of guest HPTEs for each gfn

2011-12-12 Thread Paul Mackerras
This expands the reverse mapping array to contain two links for each HPTE which are used to link together HPTEs that correspond to the same guest logical page. Each circular list of HPTEs is pointed to by the rmap array entry for the guest logical page, pointed to by the relevant memslot. Links a

[PATCH v3 13/14] KVM: PPC: Implement MMU notifiers for Book3S HV guests

2011-12-12 Thread Paul Mackerras
This adds the infrastructure to enable us to page out pages underneath a Book3S HV guest, on processors that support virtualized partition memory, that is, POWER7. Instead of pinning all the guest's pages, we now look in the host userspace Linux page tables to find the mapping for a given guest pa

KVM call agenda for Tuesday 13

2011-12-12 Thread Juan Quintela
Hi Please send in any agenda items you are interested in covering. Thanks, Juan. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [Qemu-devel] KVM call agenda for Tuesday 13

2011-12-12 Thread Anthony Liguori
On 12/12/2011 05:16 PM, Juan Quintela wrote: Hi Please send in any agenda items you are interested in covering. - QOM merge plan I'd also like to do a code walk through of QOM at the first call of the new year. Regards, Anthony Liguori Thanks, Juan. -- To unsubscribe from this list:

Re: [RFC] virtio: use mandatory barriers for remote processor vdevs

2011-12-12 Thread Amos Kong
On 12/12/2011 01:12 PM, Rusty Russell wrote: > On Mon, 12 Dec 2011 11:06:53 +0800, Amos Kong wrote: >> On 12/12/11 06:27, Benjamin Herrenschmidt wrote: >>> On Sun, 2011-12-11 at 14:25 +0200, Michael S. Tsirkin wrote: >>> Forwarding some results by Amos, who run multiple netperf streams in >>>

Re: [AMD iommu] pci Failed to assign device "hostdev0" : Device or resource busy

2011-12-12 Thread Andreas Hartmann
Am Mon, 12 Dec 2011 13:36:36 -0500 schrieb Don Dutile : > On 12/12/2011 06:15 AM, Andreas Hartmann wrote: > > Hello! > > > > I've got a few questions to a problem, which already was analyzed here > > sometime ago: > > http://markmail.org/message/dspovwvzp3wtdrf6#query:+page:1+mid:i2oph4xwfmiknt3y+

What does "LP" stands for?

2011-12-12 Thread Zhen-Hua Li
Hi all, I saw a line from some document: "KVM  supports 4096 LPs ",What does "LP" stands for? Thanks -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[Qemu-devel] [PATCH v3 0/3] ivshmem: add a new PIO BAR4(Doorbell) besides MMIO BAR0 to reduce notification time

2011-12-12 Thread zanghongyong
From: Hongyong Zang This patch series, adds a PIO BAR4 for guest notifying qemu. And the new notification way of PIO BAR4 reduces 30% time in comparison with the original MMIO BAR0 way. Meantime, this patch adds a memory API named kvm_set_ioeventfd_pio_long which is about ioeventfd for PIO long.

[Qemu-devel] [PATCH v3 2/3] ivshmem: add a new PIO BAR4(Doorbell) to reduce notification time

2011-12-12 Thread zanghongyong
From: Hongyong Zang This patch adds a PIO BAR4 for guest notifying qemu to reduce notification time. And the new notification way of PIO BAR4 reduces 30% time in comparison with the original MMIO BAR0 way. Also, this patch introduces a new feature named IVSHMEM_PIO_NOTIFY to make PIO BAR4 disapp

[Qemu-devel] [PATCH v3 3/3] ivshmem: update the spec

2011-12-12 Thread zanghongyong
From: Hongyong Zang Signed-off-by: Hongyong Zang --- docs/specs/ivshmem_device_spec.txt |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/specs/ivshmem_device_spec.txt b/docs/specs/ivshmem_device_spec.txt index 23dd2ba..d36c737 100644 --- a/docs/specs/ivshme

[Qemu-devel] [PATCH v3 1/3] memory: add a memory API about ioeventfd for PIO long

2011-12-12 Thread zanghongyong
From: Hongyong Zang The new memory API, named kvm_set_ioeventfd_pio_long, is about ioeventfd for PIO long. Signed-off-by: Hongyong Zang --- kvm-all.c | 23 +++ kvm-stub.c |5 + kvm.h |1 + memory.c | 20 4 files changed, 45 inse

Re: [RFC PATCH] kvm tools, qcow: Add support for growing refcount blocks

2011-12-12 Thread lan,Tianyu
Thanks for your review. On 一, 2011-12-12 at 17:55 +0800, Kevin Wolf wrote: > Am 12.12.2011 03:03, schrieb Lan Tianyu: > > This patch enables allocating new refcount blocks and so then kvm tools > > could expand qcow2 image much larger. > > > > Signed-off-by: Lan Tianyu > > --- > > tools/kvm/disk

Re: [RFC PATCH] kvm tools, qcow: Add support for growing refcount blocks

2011-12-12 Thread lan,Tianyu
On 一, 2011-12-12 at 18:58 +0800, Pekka Enberg wrote: > On Mon, 12 Dec 2011, Kevin Wolf wrote: > >> @@ -667,14 +722,11 @@ static struct qcow_refcount_block > >> *qcow_read_refcount_block(struct qcow *q, u64 > >> > >>rft_idx = clust_idx >> (header->cluster_bits - > >> QCOW_REFCOUNT_BLOCK_SHIFT)

  1   2   >