Re: KVM call for agend for 2014-09-16

2014-09-16 Thread Juan Quintela
Juan Quintela quint...@redhat.com wrote: Hi Please, send any topic that you are interested in covering. People have complained on the past that I don't cancel the call until the very last minute. So, what do you think that deadline for submitting topics is 23:00UTC on Monday? ok, no

Re: [PATCH kvm-unit-tests] arm: fix crash when caches are off

2014-09-16 Thread Paolo Bonzini
Il 16/09/2014 04:06, Andrew Jones ha scritto: We shouldn't try Load-Exclusive instructions unless we've enabled memory management, as these instructions depend on the data cache unit's coherency monitor. This patch adds a new setup boolean, initialized to false, that is used to guard

Re: Live migration locks up 3.2 guests in do_timer(ticks ~ 500000)

2014-09-16 Thread Paolo Bonzini
Il 15/09/2014 20:14, Matt Mullins ha scritto: On Tue, Sep 09, 2014 at 11:53:49PM -0700, Matt Mullins wrote: On Mon, Sep 08, 2014 at 06:18:46PM +0200, Paolo Bonzini wrote: What version of QEMU? Can you try the 12.04 qemu (which IIRC is 1.0) on top of the newer kernel? I did reproduce this on

Re: [PATCH] Using the tlb flush util function where applicable

2014-09-16 Thread Paolo Bonzini
Il 16/09/2014 00:49, Liang Chen ha scritto: --- (And what about a possible followup patch that replaces kvm_mmu_flush_tlb() with kvm_make_request() again? It would free the namespace a bit and we could call something similarly named from vcpu_enter_guest() to do the job.) That seems

Re: [Qemu-devel] QEMU with KVM does not start Win8 on kernel 3.4.67 and core2duo

2014-09-16 Thread Erik Rull
On September 12, 2014 at 7:29 PM Jan Kiszka jan.kis...@siemens.com wrote: On 2014-09-12 19:15, Jan Kiszka wrote: On 2014-09-12 14:29, Erik Rull wrote: On September 11, 2014 at 3:32 PM Jan Kiszka jan.kis...@siemens.com wrote: On 2014-09-11 15:25, Erik Rull wrote: On August 6, 2014

Re: [PATCH v3 0/4] Make kvm_device_ops registration dynamic

2014-09-16 Thread Paolo Bonzini
Il 02/09/2014 11:27, Will Deacon ha scritto: The mpic, flic and xics are still not ported over, as I don't want to risk breaking those devices Actually FLIC is ported. :) arch/s390/kvm/kvm-s390.c | 3 +- arch/s390/kvm/kvm-s390.h | 1 + include/linux/kvm_host.h | 4 +-

[PATCH v6 5/6] kvm, mem-hotplug: Reload L1's apic access page on migration when L2 is running.

2014-09-16 Thread Tang Chen
This patch only handle L1 and L2 vm share one apic access page situation. When L1 vm is running, if the shared apic access page is migrated, mmu_notifier will request all vcpus to exit to L0, and reload apic access page physical address for all the vcpus' vmcs (which is done by patch 5/6). And

[PATCH v6 6/6] kvm, mem-hotplug: Unpin and remove kvm_arch-apic_access_page.

2014-09-16 Thread Tang Chen
To make apic access page migratable, we do not pin it in memory now. When it is migrated, we should reload its physical address for all vmcses. But when we tried to do this, all vcpu will access kvm_arch-apic_access_page without any locking. This is not safe. Actually, we do not need

[PATCH v6 4/6] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-16 Thread Tang Chen
apic access page is pinned in memory. As a result, it cannot be migrated/hot-removed. Actually, it is not necessary to be pinned. The hpa of apic access page is stored in VMCS APIC_ACCESS_ADDR pointer. When the page is migrated, kvm_mmu_notifier_invalidate_page() will invalidate the

[PATCH v6 3/6] kvm: Make init_rmode_identity_map() return 0 on success.

2014-09-16 Thread Tang Chen
In init_rmode_identity_map(), there two variables indicating the return value, r and ret, and it return 0 on error, 1 on success. The function is only called by vmx_create_vcpu(), and r is redundant. This patch removes the redundant variable r, and make init_rmode_identity_map() return 0 on

[PATCH v6 0/6] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page.

2014-09-16 Thread Tang Chen
ept identity pagetable and apic access page in kvm are pinned in memory. As a result, they cannot be migrated/hot-removed. But actually they don't need to be pinned in memory. [For ept identity page] Just do not pin it. When it is migrated, guest will be able to find the new page in the next ept

[PATCH v6 2/6] kvm: Remove ept_identity_pagetable from struct kvm_arch.

2014-09-16 Thread Tang Chen
kvm_arch-ept_identity_pagetable holds the ept identity pagetable page. But it is never used to refer to the page at all. In vcpu initialization, it indicates two things: 1. indicates if ept page is allocated 2. indicates if a memory slot for identity page is initialized Actually,

[PATCH v6 1/6] kvm: Use APIC_DEFAULT_PHYS_BASE macro as the apic access page address.

2014-09-16 Thread Tang Chen
We have APIC_DEFAULT_PHYS_BASE defined as 0xfee0, which is also the address of apic access page. So use this macro. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Gleb Natapov g...@kernel.org --- arch/x86/kvm/svm.c | 3 ++- arch/x86/kvm/vmx.c | 6 +++--- 2 files changed, 5

Re: [PATCH v6 4/6] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-16 Thread Paolo Bonzini
Il 16/09/2014 12:42, Tang Chen ha scritto: diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 33712fb..0df82c1 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -210,6 +210,11 @@ void kvm_make_scan_ioapic_request(struct kvm *kvm) make_all_cpus_request(kvm,

Re: [PATCH v6 5/6] kvm, mem-hotplug: Reload L1's apic access page on migration when L2 is running.

2014-09-16 Thread Paolo Bonzini
Il 16/09/2014 12:42, Tang Chen ha scritto: This patch only handle L1 and L2 vm share one apic access page situation. When L1 vm is running, if the shared apic access page is migrated, mmu_notifier will request all vcpus to exit to L0, and reload apic access page physical address for all

[PATCH] kvm: Make init_rmode_tss() return 0 on success.

2014-09-16 Thread Paolo Bonzini
In init_rmode_tss(), there two variables indicating the return value, r and ret, and it return 0 on error, 1 on success. The function is only called by vmx_set_tss_addr(), and r is redundant. This patch removes the redundant variable, by making init_rmode_tss() return 0 on success, -errno on

Re: [PATCH v6 0/6] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page.

2014-09-16 Thread Paolo Bonzini
Il 16/09/2014 12:41, Tang Chen ha scritto: ept identity pagetable and apic access page in kvm are pinned in memory. As a result, they cannot be migrated/hot-removed. But actually they don't need to be pinned in memory. [For ept identity page] Just do not pin it. When it is migrated, guest

Re: [PATCH kvm-unit-tests] arm: fix crash when caches are off

2014-09-16 Thread Andrew Jones
- Original Message - Il 16/09/2014 04:06, Andrew Jones ha scritto: We shouldn't try Load-Exclusive instructions unless we've enabled memory management, as these instructions depend on the data cache unit's coherency monitor. This patch adds a new setup boolean, initialized to

[PATCH 3/3] KVM: x86: Using cpuid structs in KVM

2014-09-16 Thread Nadav Amit
Using cpuid structs in KVM to eliminate cryptic code with many bit operations. The code does not introduce functional changes. Signed-off-by: Nadav Amit na...@cs.technion.ac.il --- arch/x86/kvm/cpuid.c | 36 ++-- 1 file changed, 22 insertions(+), 14 deletions(-)

[PATCH 2/3] x86: Use new cpuid structs in cpuid functions

2014-09-16 Thread Nadav Amit
The current code that decodes cpuid fields is somewhat cryptic, since it uses many bit operations. Using cpuid structs instead for clarifying the code. Introducing no functional change. Signed-off-by: Nadav Amit na...@cs.technion.ac.il --- arch/x86/kernel/cpu/common.c | 56

[PATCH 0/3] x86: structs for cpuid info in x86

2014-09-16 Thread Nadav Amit
The code that deals with x86 cpuid fields is hard to follow since it performs many bit operations and does not refer to cpuid field explicitly. To eliminate the need of openning a spec whenever dealing with cpuid fields, this patch-set introduces structs that reflect the various cpuid functions.

[PATCH 1/3] x86: Adding structs to reflect cpuid fields

2014-09-16 Thread Nadav Amit
Adding structs that reflect various cpuid fields in x86 architecture. Structs were added only for functions that are not pure bitmaps. Signed-off-by: Nadav Amit na...@cs.technion.ac.il --- arch/x86/include/asm/cpuid_def.h | 163 +++ 1 file changed, 163

Re: [PATCH kvm-unit-tests] arm: fix crash when caches are off

2014-09-16 Thread Paolo Bonzini
Il 16/09/2014 14:12, Andrew Jones ha scritto: Should it at least write 1 to the spinlock? I thought about that. So on one hand we might get a somewhat functional synchronization mechanism, which may be enough for some unit test that doesn't enable caches, but still needs it. On the other

Re: [PATCH kvm-unit-tests] arm: fix crash when caches are off

2014-09-16 Thread Andrew Jones
- Original Message - Il 16/09/2014 14:12, Andrew Jones ha scritto: Should it at least write 1 to the spinlock? I thought about that. So on one hand we might get a somewhat functional synchronization mechanism, which may be enough for some unit test that doesn't enable caches,

Re: [PATCH kvm-unit-tests] arm: fix crash when caches are off

2014-09-16 Thread Paolo Bonzini
Il 16/09/2014 14:43, Andrew Jones ha scritto: I don't think we need to worry about this case. AFAIU, enabling the caches for a particular cpu shouldn't require any synchronization. So we should be able to do enable caches spin_lock start other processors spin_unlock Ok,

Re: [PATCH kvm-unit-tests] arm: fix crash when caches are off

2014-09-16 Thread Andrew Jones
- Original Message - - Original Message - Il 16/09/2014 14:12, Andrew Jones ha scritto: Should it at least write 1 to the spinlock? I thought about that. So on one hand we might get a somewhat functional synchronization mechanism, which may be enough for some

Re: [PATCH kvm-unit-tests] arm: fix crash when caches are off

2014-09-16 Thread Andrew Jones
- Original Message - Il 16/09/2014 14:43, Andrew Jones ha scritto: I don't think we need to worry about this case. AFAIU, enabling the caches for a particular cpu shouldn't require any synchronization. So we should be able to do enable caches spin_lock start

Re: [PATCH kvm-unit-tests] arm: fix crash when caches are off

2014-09-16 Thread Andrew Jones
- Original Message - Il 16/09/2014 14:43, Andrew Jones ha scritto: I don't think we need to worry about this case. AFAIU, enabling the caches for a particular cpu shouldn't require any synchronization. So we should be able to do enable caches spin_lock start

Re: [PATCH 0/3] x86: structs for cpuid info in x86

2014-09-16 Thread Ingo Molnar
* Nadav Amit na...@cs.technion.ac.il wrote: The code that deals with x86 cpuid fields is hard to follow since it performs many bit operations and does not refer to cpuid field explicitly. To eliminate the need of openning a spec whenever dealing with cpuid fields, this patch-set introduces

Re: [PATCH] kvm: Faults which trigger IO release the mmap_sem

2014-09-16 Thread Paolo Bonzini
Il 15/09/2014 22:11, Andres Lagar-Cavilla ha scritto: + if (!locked) { + BUG_ON(npages != -EBUSY); VM_BUG_ON perhaps? @@ -1177,9 +1210,15 @@ static int hva_to_pfn_slow(unsigned long addr, bool *async, bool write_fault, npages = get_user_page_nowait(current,

Re: [Qemu-devel] KVM call for agend for 2014-09-16

2014-09-16 Thread Peter Maydell
On 16 September 2014 01:10, Juan Quintela quint...@redhat.com wrote: Juan Quintela quint...@redhat.com wrote: Hi Please, send any topic that you are interested in covering. People have complained on the past that I don't cancel the call until the very last minute. So, what do you think

Re: KVM call for agend for 2014-09-16

2014-09-16 Thread Juan Quintela
Peter Maydell peter.mayd...@linaro.org wrote: On 16 September 2014 01:10, Juan Quintela quint...@redhat.com wrote: Juan Quintela quint...@redhat.com wrote: Hi Please, send any topic that you are interested in covering. People have complained on the past that I don't cancel the call until

[PATCH] kvmtool/arm{,64}: fix ARM initrd functionality

2014-09-16 Thread Andre Przywara
lkvm -i is currently broken on ARM/ARM64. We should not try to convert smaller-than-4GB addresses into 64-bit big endian and then stuff them into u32 variables if we expect to read anything other than 0 out of it. Adjust the type to u64 to write the proper address in BE format into the /chosen

Re: [PATCH kvm-unit-tests] arm: fix crash when caches are off

2014-09-16 Thread Andrew Jones
- Original Message - - Original Message - Il 16/09/2014 14:43, Andrew Jones ha scritto: I don't think we need to worry about this case. AFAIU, enabling the caches for a particular cpu shouldn't require any synchronization. So we should be able to do

Re: [question] virtio-blk performance degradation happened with virito-serial

2014-09-16 Thread Zhang Haoyu
If virtio-blk and virtio-serial share an IRQ, the guest operating system has to check each virtqueue for activity. Maybe there is some inefficiency doing that. AFAIK virtio-serial registers 64 virtqueues (on 31 ports + console) even if everything is unused. That could be the case if MSI is

Re: [PATCH v2 3/3] hw_random: increase schedule timeout in rng_dev_read()

2014-09-16 Thread Michael Büsch
On Tue, 16 Sep 2014 08:27:40 +0800 Amos Kong ak...@redhat.com wrote: Set timeout to 10: non-smp guest with quick backend (1.2M/s) - about 490K/s) That sounds like an awful lot. This is a 60% loss in throughput. I don't think we can live with that. -- Michael signature.asc Description:

Re: [PATCH 2/2] virtio-rng: fix stuck in catting hwrng attributes

2014-09-16 Thread Rusty Russell
Amos Kong ak...@redhat.com writes: On Sun, Sep 14, 2014 at 01:12:58AM +0800, Amos Kong wrote: On Thu, Sep 11, 2014 at 09:08:03PM +0930, Rusty Russell wrote: Amos Kong ak...@redhat.com writes: When I check hwrng attributes in sysfs, cat process always gets stuck if guest has only 1 vcpu

Re: [PATCH] kvm: Faults which trigger IO release the mmap_sem

2014-09-16 Thread Andres Lagar-Cavilla
On Tue, Sep 16, 2014 at 9:52 AM, Andres Lagar-Cavilla andre...@google.com wrote: Apologies to all. Resend as lists rejected my gmail-formatted version. Now on plain text. Won't happen again. On Tue, Sep 16, 2014 at 6:51 AM, Paolo Bonzini pbonz...@redhat.com wrote: Il 15/09/2014 22:11, Andres

Re: [PATCH kvm-unit-tests] arm: fix crash when caches are off

2014-09-16 Thread Andrew Jones
On Tue, Sep 16, 2014 at 10:38:11AM -0400, Andrew Jones wrote: - Original Message - - Original Message - Il 16/09/2014 14:43, Andrew Jones ha scritto: I don't think we need to worry about this case. AFAIU, enabling the caches for a particular cpu shouldn't

Re: [PATCH] kvm: Faults which trigger IO release the mmap_sem

2014-09-16 Thread Paolo Bonzini
Il 16/09/2014 18:52, Andres Lagar-Cavilla ha scritto: Was this: down_read(mm-mmap_sem); npages = get_user_pages(NULL, mm, addr, 1, 1, 0, NULL, NULL); up_read(mm-mmap_sem); the intention rather than get_user_pages_fast? I meant the intention of the original author,

Re: [PATCH] kvm: Faults which trigger IO release the mmap_sem

2014-09-16 Thread Andres Lagar-Cavilla
On Tue, Sep 16, 2014 at 11:29 AM, Paolo Bonzini pbonz...@redhat.com wrote: Il 16/09/2014 18:52, Andres Lagar-Cavilla ha scritto: Was this: down_read(mm-mmap_sem); npages = get_user_pages(NULL, mm, addr, 1, 1, 0, NULL, NULL); up_read(mm-mmap_sem); the intention

Re: [PATCH] kvmtool/arm{,64}: fix ARM initrd functionality

2014-09-16 Thread Marc Zyngier
On 2014-09-16 15:37, Andre Przywara wrote: lkvm -i is currently broken on ARM/ARM64. We should not try to convert smaller-than-4GB addresses into 64-bit big endian and then stuff them into u32 variables if we expect to read anything other than 0 out of it. Adjust the type to u64 to write the

Re: [PATCH 0/3] x86: structs for cpuid info in x86

2014-09-16 Thread Nadav Amit
On 9/16/14 4:22 PM, Ingo Molnar wrote: * Nadav Amit na...@cs.technion.ac.il wrote: The code that deals with x86 cpuid fields is hard to follow since it performs many bit operations and does not refer to cpuid field explicitly. To eliminate the need of openning a spec whenever dealing

Re: [PATCH] kvm: Faults which trigger IO release the mmap_sem

2014-09-16 Thread Radim Krčmář
2014-09-15 13:11-0700, Andres Lagar-Cavilla: +int kvm_get_user_page_retry(struct task_struct *tsk, struct mm_struct *mm, The suffix '_retry' is not best suited for this. On first reading, I imagined we will be retrying something from before, possibly calling it in a loop, but we are actually

Re: [PATCH] kvm: Faults which trigger IO release the mmap_sem

2014-09-16 Thread Andres Lagar-Cavilla
On Tue, Sep 16, 2014 at 1:51 PM, Radim Krčmář rkrc...@redhat.com wrote: 2014-09-15 13:11-0700, Andres Lagar-Cavilla: +int kvm_get_user_page_retry(struct task_struct *tsk, struct mm_struct *mm, The suffix '_retry' is not best suited for this. On first reading, I imagined we will be retrying

Re: [PATCH v4 0/4 resend] Introduce device assignment flag operation helper function

2014-09-16 Thread Bjorn Helgaas
On Tue, Sep 09, 2014 at 10:21:24AM +0800, Ethan Zhao wrote: This patch set introduces three PCI device flag operation helper functions when set pci device PF/VF to assigned or deassigned status also check it. and patch 2,3,4 apply these helper functions to KVM,XEN and PCI. v2: simplify

Re: [PATCH v3 1/4] kvmtool: ARM: Use KVM_ARM_PREFERRED_TARGET vm ioctl to determine target cpu

2014-09-16 Thread Anup Patel
On Thu, Sep 11, 2014 at 9:24 PM, Andre Przywara andre.przyw...@arm.com wrote: Hi Anup, On 08/09/14 09:17, Anup Patel wrote: Instead, of trying out each and every target type we should use KVM_ARM_PREFERRED_TARGET vm ioctl to determine target type for KVM ARM/ARM64. If

Re: [PATCH v3 2/4] kvmtool: ARM64: Add target type potenza for aarch64

2014-09-16 Thread Anup Patel
On Thu, Sep 11, 2014 at 9:37 PM, Andre Przywara andre.przyw...@arm.com wrote: Anup, On 08/09/14 09:17, Anup Patel wrote: The VCPU target type KVM_ARM_TARGET_XGENE_POTENZA is available in latest Linux-3.16-rcX or higher hence register aarch64 target type for it. This patch enables us to run

Re: [PATCH v3 3/4] kvmtool: Handle exit reason KVM_EXIT_SYSTEM_EVENT

2014-09-16 Thread Anup Patel
On Thu, Sep 11, 2014 at 9:56 PM, Andre Przywara andre.przyw...@arm.com wrote: On 08/09/14 09:17, Anup Patel wrote: The KVM_EXIT_SYSTEM_EVENT exit reason was added to define architecture independent system-wide events for a Guest. Currently, it is used by in-kernel PSCI-0.2 emulation of KVM

Re: [PATCH] kvm: Faults which trigger IO release the mmap_sem

2014-09-16 Thread Radim Krčmář
[Emergency posting to fix the tag and couldn't find unmangled Cc list, so some recipients were dropped, sorry. (I guess you are glad though).] 2014-09-16 14:01-0700, Andres Lagar-Cavilla: On Tue, Sep 16, 2014 at 1:51 PM, Radim Krčmář rkrc...@redhat.com wrote: 2014-09-15 13:11-0700, Andres

Re: [PATCH v3 1/4] kvmtool: ARM: Use KVM_ARM_PREFERRED_TARGET vm ioctl to determine target cpu

2014-09-16 Thread Anup Patel
On Wed, Sep 17, 2014 at 3:43 AM, Anup Patel apa...@apm.com wrote: On Thu, Sep 11, 2014 at 9:24 PM, Andre Przywara andre.przyw...@arm.com wrote: Hi Anup, On 08/09/14 09:17, Anup Patel wrote: Instead, of trying out each and every target type we should use KVM_ARM_PREFERRED_TARGET vm ioctl to

Re: [PATCH v3 3/4] kvmtool: Handle exit reason KVM_EXIT_SYSTEM_EVENT

2014-09-16 Thread Anup Patel
On Wed, Sep 17, 2014 at 3:59 AM, Anup Patel apa...@apm.com wrote: On Thu, Sep 11, 2014 at 9:56 PM, Andre Przywara andre.przyw...@arm.com wrote: On 08/09/14 09:17, Anup Patel wrote: The KVM_EXIT_SYSTEM_EVENT exit reason was added to define architecture independent system-wide events for a

Re: [PATCH v3 2/4] kvmtool: ARM64: Add target type potenza for aarch64

2014-09-16 Thread Anup Patel
On Wed, Sep 17, 2014 at 3:54 AM, Anup Patel apa...@apm.com wrote: On Thu, Sep 11, 2014 at 9:37 PM, Andre Przywara andre.przyw...@arm.com wrote: Anup, On 08/09/14 09:17, Anup Patel wrote: The VCPU target type KVM_ARM_TARGET_XGENE_POTENZA is available in latest Linux-3.16-rcX or higher hence

Re: [PATCH] Using the tlb flush util function where applicable

2014-09-16 Thread Wanpeng Li
Hi Radim, On Mon, Sep 15, 2014 at 09:33:52PM +0200, Radim Krčmář wrote: 2014-09-12 17:06-0400, Liang Chen: Using kvm_mmu_flush_tlb as the other places to make sure vcpu stat is incremented Signed-off-by: Liang Chen liangchen.li...@gmail.com --- Good catch. arch/x86/kvm/vmx.c | 2 +- 1

Re: [RFC PATCH 07/17] COLO buffer: implement colo buffer as well as QEMUFileOps based on it

2014-09-16 Thread Hongyang Yang
Hi 在 08/01/2014 10:52 PM, Dr. David Alan Gilbert 写道: * Yang Hongyang (yan...@cn.fujitsu.com) wrote: We need a buffer to store migration data. On save side: all saved data was write into colo buffer first, so that we can know the total size of the migration data. this can also separate the

How KVM hypervisor allocates physical pages to the VM.

2014-09-16 Thread Steven
Dear KVM Developers: I have some questions about how KVM hypervisor requests and allocate physical pages to the VM. I am using kernel version 3.2.14. I run a microbenchmark in the VM, which declares an array with certain size and then assigns some value to all the elements in the array, which

Re: [PATCH] kvm: Faults which trigger IO release the mmap_sem

2014-09-16 Thread Andres Lagar-Cavilla
On Tue, Sep 16, 2014 at 3:34 PM, Radim Krčmář rkrc...@redhat.com wrote: [Emergency posting to fix the tag and couldn't find unmangled Cc list, so some recipients were dropped, sorry. (I guess you are glad though).] 2014-09-16 14:01-0700, Andres Lagar-Cavilla: On Tue, Sep 16, 2014 at 1:51