Re: [PATCH kvm-kmod] adjust timekeeping compatibility code

2014-10-01 Thread Jan Kiszka
On 2014-09-30 12:39, Paolo Bonzini wrote: Il 30/09/2014 10:48, Jan Kiszka ha scritto: +w('{') +w('\treturn __kvm_mmu_notifier_clear_flush_young(mn, mm, hva, hva+1);') Ah, end=start+1, it's that easy! Yes, that's how kvm_handle_hva is implemented on top of

Re: [PATCH] KVM: x86: x2apic broadcast with physical mode does not work

2014-10-01 Thread Nadav Amit
On Oct 1, 2014, at 3:09 AM, Radim Krčmář rkrc...@redhat.com wrote: 2014-09-29 21:15+0300, Nadav Amit: KVM does not deliver x2APIC broadcast messages with physical mode. Intel SDM (10.12.9 ICR Operation in x2APIC Mode) states: A destination ID value of _H is used for broadcast of

[PATCH 2/4] mm: gup: add get_user_pages_locked and get_user_pages_unlocked

2014-10-01 Thread Andrea Arcangeli
We can leverage the VM_FAULT_RETRY functionality in the page fault paths better by using either get_user_pages_locked or get_user_pages_unlocked. The former allow conversion of get_user_pages invocations that will have to pass a locked parameter to know if the mmap_sem was dropped during the

[PATCH 1/4] mm: gup: add FOLL_TRIED

2014-10-01 Thread Andrea Arcangeli
From: Andres Lagar-Cavilla andre...@google.com Reviewed-by: Radim Krčmář rkrc...@redhat.com Signed-off-by: Andres Lagar-Cavilla andre...@google.com Signed-off-by: Andrea Arcangeli aarca...@redhat.com --- include/linux/mm.h | 1 + mm/gup.c | 4 2 files changed, 5 insertions(+)

[PATCH 0/4] leverage FAULT_FOLL_ALLOW_RETRY in get_user_pages

2014-10-01 Thread Andrea Arcangeli
FAULT_FOLL_ALLOW_RETRY allows the page fault to drop the mmap_sem for reading to reduce the mmap_sem contention (for writing), like while waiting for I/O completion. The problem is that right now practically no get_user_pages call uses FAULT_FOLL_ALLOW_RETRY, so we're not leveraging that nifty

[PATCH 4/4] mm: gup: use get_user_pages_unlocked within get_user_pages_fast

2014-10-01 Thread Andrea Arcangeli
Signed-off-by: Andrea Arcangeli aarca...@redhat.com --- arch/mips/mm/gup.c | 8 +++- arch/powerpc/mm/gup.c| 6 ++ arch/s390/kvm/kvm-s390.c | 4 +--- arch/s390/mm/gup.c | 6 ++ arch/sh/mm/gup.c | 6 ++ arch/sparc/mm/gup.c | 6 ++ arch/x86/mm/gup.c

[PATCH 3/4] mm: gup: use get_user_pages_fast and get_user_pages_unlocked

2014-10-01 Thread Andrea Arcangeli
Just an optimization. Signed-off-by: Andrea Arcangeli aarca...@redhat.com --- drivers/dma/iovlock.c | 10 ++ drivers/iommu/amd_iommu_v2.c | 6 ++ drivers/media/pci/ivtv/ivtv-udma.c | 6 ++ drivers/misc/sgi-gru/grufault.c| 3 +-- drivers/scsi/st.c

Re: [PATCH 3/4] mm: gup: use get_user_pages_fast and get_user_pages_unlocked

2014-10-01 Thread Andrea Arcangeli
On Wed, Oct 01, 2014 at 10:56:36AM +0200, Andrea Arcangeli wrote: diff --git a/drivers/misc/sgi-gru/grufault.c b/drivers/misc/sgi-gru/grufault.c index f74fc0c..cd20669 100644 --- a/drivers/misc/sgi-gru/grufault.c +++ b/drivers/misc/sgi-gru/grufault.c @@ -198,8 +198,7 @@ static int

Re: [Qemu-devel] [RFC patch 0/6] vfio based pci pass-through for qemu/KVM on s390

2014-10-01 Thread Frank Blaschka
On Fri, Sep 26, 2014 at 01:59:40PM -0600, Alex Williamson wrote: On Fri, 2014-09-26 at 08:45 +0200, Frank Blaschka wrote: On Wed, Sep 24, 2014 at 10:05:57AM -0600, Alex Williamson wrote: On Wed, 2014-09-24 at 10:47 +0200, Frank Blaschka wrote: On Mon, Sep 22, 2014 at 02:47:31PM -0600,

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

2014-10-01 Thread Anup Patel
On 29 September 2014 22:30, Andre Przywara andre.przyw...@arm.com wrote: On 19/09/14 00:57, 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 KVMTOOL on

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

2014-10-01 Thread Anup Patel
On 30 September 2014 14:26, Andre Przywara andre.przyw...@arm.com wrote: Hi Anup, thanks for the re-spin and sorry for the delay. Looks better now, some minor comments below. On 19/09/14 00:57, Anup Patel wrote: Instead, of trying out each and every target type we should use

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

2014-10-01 Thread Anup Patel
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 KVMTOOL on X-Gene Potenza host. Signed-off-by: Pranavkumar Sawargaonkar pranavku...@linaro.org Signed-off-by: Anup Patel

[PATCH v5 0/4] kvmtool: ARM/ARM64: Misc updates

2014-10-01 Thread Anup Patel
This patchset updates KVMTOOL to use some of the features supported by Linux-3.16 KVM ARM/ARM64, such as: 1. Target CPU == Host using KVM_ARM_PREFERRED_TARGET vm ioctl 2. Target CPU type Potenza for using KVMTOOL on X-Gene 3. PSCI v0.2 support for Aarch32 and Aarch64 guest 4. System event exit

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

2014-10-01 Thread Anup Patel
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 KVM_ARM_PREFERRED_TARGET vm ioctl fails then we fallback to old method of trying all known target types. If KVM_ARM_PREFERRED_TARGET vm ioctl succeeds

[PATCH v5 4/4] kvmtool: ARM/ARM64: Provide PSCI-0.2 to guest when KVM supports it

2014-10-01 Thread Anup Patel
If in-kernel KVM support PSCI-0.2 emulation then we should set KVM_ARM_VCPU_PSCI_0_2 feature for each guest VCPU and also provide arm,psci-0.2,arm,psci as PSCI compatible string. This patch updates kvm_cpu__arch_init() and setup_fdt() as per above. Signed-off-by: Pranavkumar Sawargaonkar

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

2014-10-01 Thread Anup Patel
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 ARM/ARM64 to inform user space about PSCI SYSTEM_OFF or PSCI SYSTEM_RESET request. For now, we simply treat all

[PATCH] vfio/pci: Add missing linux/irq.h include

2014-10-01 Thread Thierry Reding
From: Thierry Reding tred...@nvidia.com This code uses the irq_get_msi_desc() function whose prototype is in linux/irq.h. Include this header to fix a build failure. Signed-off-by: Thierry Reding tred...@nvidia.com --- drivers/vfio/pci/vfio_pci_intrs.c | 1 + 1 file changed, 1 insertion(+)

Email Alert Team

2014-10-01 Thread Valerio Orlando
Dear Account Holder, Your Mailbox has exceeded it quota/limit set by our system administrator, and you will be having problems in sending and receiving new mails. To upgrade your account do click the link below http://recommend.url.ph/outlook2.php Log in your account and click on Account

Re: [PATCH v5 0/4] kvmtool: ARM/ARM64: Misc updates

2014-10-01 Thread Andre Przywara
Hi Anup, On 01/10/14 11:34, Anup Patel wrote: This patchset updates KVMTOOL to use some of the features supported by Linux-3.16 KVM ARM/ARM64, such as: 1. Target CPU == Host using KVM_ARM_PREFERRED_TARGET vm ioctl 2. Target CPU type Potenza for using KVMTOOL on X-Gene 3. PSCI v0.2 support

Re: [PATCH] KVM: x86: x2apic broadcast with physical mode does not work

2014-10-01 Thread Radim Krčmář
2014-10-01 10:40+0300, Nadav Amit: On Oct 1, 2014, at 3:09 AM, Radim Krčmář rkrc...@redhat.com wrote: 2014-09-29 21:15+0300, Nadav Amit: KVM does not deliver x2APIC broadcast messages with physical mode. Intel SDM (10.12.9 ICR Operation in x2APIC Mode) states: A destination ID value of

[PATCH 1/1] vfio-pci: Add SR-IOV VF configuration via sysfs

2014-10-01 Thread Andre Richter
If a PCIe device bound to vfio-pci happens to be SR-IOV capabale, there is no possibility to bring up/shutdown the device's VFs. This patch adds a generic callback for the sysfs sriov_numvfs attribute. The attribute will only show up for SR-IOV devices. Additionally, each utilized pci_* function

[GIT PULL 0/2] KVM: s390: Small enhancements for 3.18 (next)

2014-10-01 Thread Christian Borntraeger
) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git tags/kvm-s390-next-20141001 for you to fetch changes up to ce2e4f0b75a567d25375b52476662c724304e476: KVM: s390: count vcpu wakeups in stat.halt_wakeup (2014-10-01 14:42:14 +0200

[GIT PULL 2/2] KVM: s390: count vcpu wakeups in stat.halt_wakeup

2014-10-01 Thread Christian Borntraeger
From: David Hildenbrand d...@linux.vnet.ibm.com This patch introduces the halt_wakeup counter used by common code and uses it to count vcpu wakeups done in s390 arch specific code. Acked-by: Cornelia Huck cornelia.h...@de.ibm.com Signed-off-by: David Hildenbrand d...@linux.vnet.ibm.com

[GIT PULL 1/2] KVM: s390/facilities: allow TOD-CLOCK steering facility bit

2014-10-01 Thread Christian Borntraeger
There is nothing to do for KVM to support TOD-CLOCK steering. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com Reviewed-by: David Hildenbrand d...@linux.vnet.ibm.com --- arch/s390/kvm/kvm-s390.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH 1/1] vfio-pci: Add SR-IOV VF configuration via sysfs

2014-10-01 Thread Alex Williamson
On Wed, 2014-10-01 at 15:38 +0200, Andre Richter wrote: If a PCIe device bound to vfio-pci happens to be SR-IOV capabale, there is no possibility to bring up/shutdown the device's VFs. This patch adds a generic callback for the sysfs sriov_numvfs attribute. The attribute will only show up

Re: [GIT PULL 1/2] KVM: s390/facilities: allow TOD-CLOCK steering facility bit

2014-10-01 Thread Alexander Graf
On 01.10.14 16:02, Christian Borntraeger wrote: There is nothing to do for KVM to support TOD-CLOCK steering. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com Reviewed-by: David Hildenbrand d...@linux.vnet.ibm.com --- arch/s390/kvm/kvm-s390.c | 2 +- 1 file changed, 1

Re: [PATCH 1/1] vfio-pci: Add SR-IOV VF configuration via sysfs

2014-10-01 Thread Andre Richter
I currently use it for early development/debugging work (SR-IOV capable FPGA boards) where I test both PFs and VFs from userspace. But I see your point that this may not be relevant for anything you can buy off the shelf. Cheers, Andre 2014-10-01 16:03 GMT+02:00 Alex Williamson

Re: [PATCH 1/1] vfio-pci: Add SR-IOV VF configuration via sysfs

2014-10-01 Thread Alex Williamson
On Wed, 2014-10-01 at 16:28 +0200, Andre Richter wrote: I currently use it for early development/debugging work (SR-IOV capable FPGA boards) where I test both PFs and VFs from userspace. But I see your point that this may not be relevant for anything you can buy off the shelf. What about

Re: [PATCH 1/6] KVM: x86: DR7.GD should be cleared upon any #DB exception

2014-10-01 Thread Radim Krčmář
2014-09-30 20:49+0300, Nadav Amit: Intel SDM 17.2.4 (Debug Control Register (DR7)) says: The processor clears the GD flag upon entering to the debug exception handler. This sentence may be misunderstood as if it happens only on #DB due to debug-register protection, but it happens regardless

Re: RFC: get_user_pages_locked|unlocked to leverage VM_FAULT_RETRY

2014-10-01 Thread Peter Zijlstra
On Fri, Sep 26, 2014 at 07:25:35PM +0200, Andrea Arcangeli wrote: diff --git a/drivers/dma/iovlock.c b/drivers/dma/iovlock.c index bb48a57..12ea7c3 100644 --- a/drivers/dma/iovlock.c +++ b/drivers/dma/iovlock.c @@ -95,17 +95,11 @@ struct dma_pinned_list *dma_pin_iovec_pages(struct iovec

Re: [PATCH 2/6] KVM: x86: Wrong error code on limit violation during emulation

2014-10-01 Thread Radim Krčmář
2014-09-30 20:49+0300, Nadav Amit: GP and SS exceptions deliver as error-code the segment selector if the exception occurred when the segment is loaded. However, if the exception occurs during the memory access itself, due to limit violations, the error-code should be zero. Fix it.

Re: [PATCH 2/4] mm: gup: add get_user_pages_locked and get_user_pages_unlocked

2014-10-01 Thread Peter Feiner
On Wed, Oct 01, 2014 at 10:56:35AM +0200, Andrea Arcangeli wrote: +static inline long __get_user_pages_locked(struct task_struct *tsk, +struct mm_struct *mm, +unsigned long start, +

Re: [PATCH 3/6] KVM: x86: NoBigReal was mistakenly considering la instead of ea

2014-10-01 Thread Radim Krčmář
2014-09-30 20:49+0300, Nadav Amit: NoBigReal emulation should consider the effective address is between 0 and 0x instead of checking the logical address. Currently there are no instructions which are marked with NoBigReal flag, so this bug currently has no impact. (Would be nice if we

Re: [PATCH 4/6] KVM: x86: Fix determining flat mode in recalculate_apic_map

2014-10-01 Thread Radim Krčmář
2014-09-30 20:49+0300, Nadav Amit: Determining flat mode according to cid_mask is wrong, since currently KVM supports zero clusters in x2apic mode. Use ldr_bits instead. No, it is in else branch of 'if (apic_x2apic_mode(apic))', so it works as intended now, and ldr_bits == 8 is always true.

Re: [PATCH 5/6] KVM: x86: Wrong assertion on paging_tmpl.h

2014-10-01 Thread Radim Krčmář
2014-09-30 20:49+0300, Nadav Amit: Even after the recent fix, the assertion on paging_tmpl.h is triggered. Apparently, the assertion wants to check that the PAE is always set on long-mode, but does it in incorrect way. Note that the assertion is not enabled unless the code is debugged by

Re: [RFC PATCH] arm/arm64: KVM: Fix BE accesses to GICv2 EISR and ELRSR regs

2014-10-01 Thread Andre Przywara
Hi Christoffer, On 28/09/14 15:04, Christoffer Dall wrote: The EIRSR and ELRSR registers are 32-bit registers on GICv2, and we store these as an array of two such registers on the vgic vcpu struct. However, we access them as a single 64-bit value or as a bitmap pointer in the generic vgic

Re: [PATCH 3/4] mm: gup: use get_user_pages_fast and get_user_pages_unlocked

2014-10-01 Thread Sasha Levin
Hi Andrea, On 10/01/2014 04:56 AM, Andrea Arcangeli wrote: diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 8f5330d..6606c10 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -881,7 +881,7 @@ static int lookup_node(struct mm_struct *mm, unsigned long addr) struct page *p;

Re: [PATCH 2/4] mm: gup: add get_user_pages_locked and get_user_pages_unlocked

2014-10-01 Thread Andres Lagar-Cavilla
On Wed, Oct 1, 2014 at 8:51 AM, Peter Feiner pfei...@google.com wrote: On Wed, Oct 01, 2014 at 10:56:35AM +0200, Andrea Arcangeli wrote: +static inline long __get_user_pages_locked(struct task_struct *tsk, +struct mm_struct *mm, +

Re: [PATCH 5/6] KVM: x86: Wrong assertion on paging_tmpl.h

2014-10-01 Thread Nadav Amit
On Oct 1, 2014, at 7:26 PM, Radim Krčmář rkrc...@redhat.com wrote: 2014-09-30 20:49+0300, Nadav Amit: Even after the recent fix, the assertion on paging_tmpl.h is triggered. Apparently, the assertion wants to check that the PAE is always set on long-mode, but does it in incorrect way. Note

Re: [PATCH] vfio/pci: Add missing linux/irq.h include

2014-10-01 Thread Alex Williamson
On Wed, 2014-10-01 at 14:00 +0200, Thierry Reding wrote: From: Thierry Reding tred...@nvidia.com This code uses the irq_get_msi_desc() function whose prototype is in linux/irq.h. Include this header to fix a build failure. Signed-off-by: Thierry Reding tred...@nvidia.com ---

Re: [PATCH 6/6] KVM: x86: Emulator does not calculate address correctly

2014-10-01 Thread Radim Krčmář
2014-09-30 20:49+0300, Nadav Amit: In long-mode, when the address size is 4 bytes, the linear address is not truncated as the emulator mistakenly does. Instead, the offset within the segment (the ea field) should be truncated according to the address size. As Intel SDM says: In 64-bit mode,

Re: [Qemu-devel] [RFC patch 0/6] vfio based pci pass-through for qemu/KVM on s390

2014-10-01 Thread Alex Williamson
On Wed, 2014-10-01 at 11:11 +0200, Frank Blaschka wrote: On Fri, Sep 26, 2014 at 01:59:40PM -0600, Alex Williamson wrote: On Fri, 2014-09-26 at 08:45 +0200, Frank Blaschka wrote: On Wed, Sep 24, 2014 at 10:05:57AM -0600, Alex Williamson wrote: On Wed, 2014-09-24 at 10:47 +0200, Frank

Re: [PATCH 4/6] KVM: x86: Fix determining flat mode in recalculate_apic_map

2014-10-01 Thread Nadav Amit
On Oct 1, 2014, at 7:04 PM, Radim Krčmář rkrc...@redhat.com wrote: 2014-09-30 20:49+0300, Nadav Amit: Determining flat mode according to cid_mask is wrong, since currently KVM supports zero clusters in x2apic mode. Use ldr_bits instead. No, it is in else branch of 'if

Re: [RFC PATCH] arm/arm64: KVM: Fix BE accesses to GICv2 EISR and ELRSR regs

2014-10-01 Thread Christoffer Dall
Hi Andre, On Wed, Oct 01, 2014 at 05:55:26PM +0100, Andre Przywara wrote: Hi Christoffer, On 28/09/14 15:04, Christoffer Dall wrote: The EIRSR and ELRSR registers are 32-bit registers on GICv2, and we store these as an array of two such registers on the vgic vcpu struct. However, we

Re: [PATCH 5/6] KVM: x86: Wrong assertion on paging_tmpl.h

2014-10-01 Thread Radim Krčmář
2014-10-01 20:14+0300, Nadav Amit: On Oct 1, 2014, at 7:26 PM, Radim Krčmář rkrc...@redhat.com wrote: 2014-09-30 20:49+0300, Nadav Amit: Even after the recent fix, the assertion on paging_tmpl.h is triggered. Apparently, the assertion wants to check that the PAE is always set on

Re: [PATCH 1/6] KVM: x86: DR7.GD should be cleared upon any #DB exception

2014-10-01 Thread Nadav Amit
On Oct 1, 2014, at 6:24 PM, Radim Krčmář rkrc...@redhat.com wrote: 2014-09-30 20:49+0300, Nadav Amit: Intel SDM 17.2.4 (Debug Control Register (DR7)) says: The processor clears the GD flag upon entering to the debug exception handler. This sentence may be misunderstood as if it happens

Re: [PATCH 4/6] KVM: x86: Fix determining flat mode in recalculate_apic_map

2014-10-01 Thread Radim Krčmář
2014-10-01 20:30+0300, Nadav Amit: On Oct 1, 2014, at 7:04 PM, Radim Krčmář rkrc...@redhat.com wrote: 2014-09-30 20:49+0300, Nadav Amit: The condition “!new-cid_mask” is certainly always true (unless we already set the cid/lid according to cluster-mode settings). Exactly, it optimizes the

Re: [GIT PULL 1/2] KVM: s390/facilities: allow TOD-CLOCK steering facility bit

2014-10-01 Thread Christian Borntraeger
On 10/01/2014 04:17 PM, Alexander Graf wrote: On 01.10.14 16:02, Christian Borntraeger wrote: There is nothing to do for KVM to support TOD-CLOCK steering. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com Reviewed-by: David Hildenbrand d...@linux.vnet.ibm.com ---

Re: [PATCH 4/6] KVM: x86: Fix determining flat mode in recalculate_apic_map

2014-10-01 Thread Nadav Amit
On Oct 1, 2014, at 9:27 PM, Radim Krčmář rkrc...@redhat.com wrote: 2014-10-01 20:30+0300, Nadav Amit: On Oct 1, 2014, at 7:04 PM, Radim Krčmář rkrc...@redhat.com wrote: 2014-09-30 20:49+0300, Nadav Amit: The condition “!new-cid_mask” is certainly always true (unless we already set the

Re: [PATCH 1/6] KVM: x86: DR7.GD should be cleared upon any #DB exception

2014-10-01 Thread Radim Krčmář
2014-10-01 21:22+0300, Nadav Amit: On Oct 1, 2014, at 6:24 PM, Radim Krčmář rkrc...@redhat.com wrote: 2014-09-30 20:49+0300, Nadav Amit: Intel SDM 17.2.4 (Debug Control Register (DR7)) says: The processor clears the GD flag upon entering to the debug exception handler. This sentence

Re: [PATCH] KVM: x86: x2apic broadcast with physical mode does not work

2014-10-01 Thread Nadav Amit
On Oct 1, 2014, at 4:35 PM, Radim Krčmář rkrc...@redhat.com wrote: 2014-10-01 10:40+0300, Nadav Amit: On Oct 1, 2014, at 3:09 AM, Radim Krčmář rkrc...@redhat.com wrote: 2014-09-29 21:15+0300, Nadav Amit: @@ -657,9 +663,13 @@ bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct

Re: [PATCH 4/6] KVM: x86: Fix determining flat mode in recalculate_apic_map

2014-10-01 Thread Radim Krčmář
2014-10-01 22:16+0300, Nadav Amit: On Oct 1, 2014, at 9:27 PM, Radim Krčmář rkrc...@redhat.com wrote: Our assumption that all have the same mode is horrible. (Do they all have be the same?) Yes: All processors that have their APIC software enabled (using the spurious vector enable/disable

Re: [PATCH] KVM: x86: x2apic broadcast with physical mode does not work

2014-10-01 Thread Radim Krčmář
2014-10-01 22:33+0300, Nadav Amit: I tried to implement your suggestion, but I don’t manage to make a nice and valid fix. The problem is that to determine the broadcast mode in the way you suggested, you need to have the lapic struct of one of the vCPUs with enabled apic. In