[PATCH 5/9] kvm/irqchip: kvm_arch_irq_routing_update renaming split

2015-10-16 Thread Denis V. Lunev
From: Andrey Smetanin Actually kvm_arch_irq_routing_update() should be kvm_arch_post_irq_routing_update() as it's called at the end of irq routing update. This renaming frees kvm_arch_irq_routing_update function name. kvm_arch_irq_routing_update() weak function which will be used to update mappi

[PATCH 6/9] drivers/hv: share Hyper-V SynIC constants with userspace

2015-10-16 Thread Denis V. Lunev
From: Andrey Smetanin Moved Hyper-V synic contants from guest Hyper-V drivers private header into x86 arch uapi Hyper-V header. Added Hyper-V synic msr's flags into x86 arch uapi Hyper-V header. Signed-off-by: Andrey Smetanin Reviewed-by: Roman Kagan Signed-off-by: Denis V. Lunev CC: Vitaly

[PATCH v2 0/9] Hyper-V synthetic interrupt controller

2015-10-16 Thread Denis V. Lunev
This patchset implements the KVM part of the synthetic interrupt controller (SynIC) which is a building block of the Hyper-V paravirtualized device bus (vmbus). SynIC is a lapic extension, which is controlled via MSRs and maintains for each vCPU - 16 synthetic interrupt "lines" (SINT's); each can

[PATCH 4/9] kvm/irqchip: allow only multiple irqchip routes per GSI

2015-10-16 Thread Denis V. Lunev
From: Andrey Smetanin Any other irq routing types (MSI, S390_ADAPTER, upcoming Hyper-V SynIC) map one-to-one to GSI. Signed-off-by: Andrey Smetanin Reviewed-by: Roman Kagan Signed-off-by: Denis V. Lunev CC: Vitaly Kuznetsov CC: "K. Y. Srinivasan" CC: Gleb Natapov CC: Paolo Bonzini --- vi

[PATCH 7/9] kvm/x86: split ioapic-handled and EOI exit bitmaps

2015-10-16 Thread Denis V. Lunev
From: Andrey Smetanin The function to determine if the vector is handled by ioapic used to rely on the fact that only ioapic-handled vectors were set up to cause vmexits when virtual apic was in use. We're going to break this assumption when introducing Hyper-V synthetic interrupts: they may nee

[PATCH 2/9] kvm/eventfd: factor out kvm_notify_acked_gsi()

2015-10-16 Thread Denis V. Lunev
From: Andrey Smetanin Factor out kvm_notify_acked_gsi() helper to iterate over EOI listeners and notify those matching the given gsi. It will be reused in the upcoming Hyper-V SynIC implementation. Signed-off-by: Andrey Smetanin Reviewed-by: Roman Kagan Signed-off-by: Denis V. Lunev CC: Vita

[PATCH 1/9] kvm/eventfd: avoid loop inside irqfd_update()

2015-10-16 Thread Denis V. Lunev
From: Andrey Smetanin The loop(for) inside irqfd_update() is unnecessary because any other value for irq_entry.type will just trigger schedule_work(&irqfd->inject). Signed-off-by: Andrey Smetanin Reviewed-by: Roman Kagan Signed-off-by: Denis V. Lunev CC: Vitaly Kuznetsov CC: "K. Y. Srinivasa

[PATCH 3/9] kvm/eventfd: add arch-specific set_irq

2015-10-16 Thread Denis V. Lunev
From: Andrey Smetanin Allow for arch-specific interrupt types to be set. For that, add kvm_arch_set_irq() which takes interrupt type-specific action if it recognizes the interrupt type given, and -EWOULDBLOCK otherwise. The default implementation always returns -EWOULDBLOCK. Signed-off-by: And

[PATCH 9/9] kvm/x86: Hyper-V kvm exit

2015-10-16 Thread Denis V. Lunev
From: Andrey Smetanin A new vcpu exit is introduced to notify the userspace of the changes in Hyper-V SynIC configuration triggered by guest writing to the corresponding MSRs. Signed-off-by: Andrey Smetanin Reviewed-by: Roman Kagan Signed-off-by: Denis V. Lunev CC: Vitaly Kuznetsov CC: "K. Y

[PATCH 8/9] kvm/x86: Hyper-V synthetic interrupt controller

2015-10-16 Thread Denis V. Lunev
From: Andrey Smetanin SynIC (synthetic interrupt controller) is a lapic extension, which is controlled via MSRs and maintains for each vCPU - 16 synthetic interrupt "lines" (SINT's); each can be configured to trigger a specific interrupt vector optionally with auto-EOI semantics - a messa

Re: [RESEND PATCH] kvm: Allow the Hyper-V vendor ID to be specified

2015-10-16 Thread Paolo Bonzini
On 16/10/2015 00:16, Alex Williamson wrote: > According to Microsoft documentation, the signature in the standard > hypervisor CPUID leaf at 0x4000 identifies the Vendor ID and is > for reporting and diagnostic purposes only. We can therefore allow > the user to change it to whatever they wa

[PATCH 0/5 v2] KVM: x86: MMU: Eliminate extra memory slot searches in page fault handlers

2015-10-16 Thread Takuya Yoshikawa
v2: Based on Paolo's suggestion, kept the common code as much as possible by introducing memslot_valid_for_gpte(). Note: instead of joining all checks by boolean operators, splitted the no_dirty_log case off to be a separate if-check because it is checking clearly different thing t

[PATCH 1/5] KVM: x86: MMU: Make force_pt_level bool

2015-10-16 Thread Takuya Yoshikawa
This will be passed to a function later. Signed-off-by: Takuya Yoshikawa --- arch/x86/kvm/mmu.c | 8 arch/x86/kvm/paging_tmpl.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index b8482c0..2262728 100644 --- a/ar

Re: [PATCH 9/9] kvm/x86: Hyper-V kvm exit

2015-10-16 Thread Paolo Bonzini
On 16/10/2015 09:07, Denis V. Lunev wrote: > > + /* KVM_EXIT_HYPERV */ > +struct kvm_hyperv_exit hyperv; > +Indicates that the VCPU exits into userspace to process some tasks > +related with Hyper-V emulation. Currently used to synchronize modified > +Hyper-V SynIC s

[PATCH 2/5] KVM: x86: MMU: Simplify force_pt_level calculation code in FNAME(page_fault)()

2015-10-16 Thread Takuya Yoshikawa
As a bonus, an extra memory slot search can be eliminated when is_self_change_mapping is true. Signed-off-by: Takuya Yoshikawa --- arch/x86/kvm/paging_tmpl.h | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.

[PATCH 3/5] KVM: x86: MMU: Merge mapping_level_dirty_bitmap() into mapping_level()

2015-10-16 Thread Takuya Yoshikawa
This is necessary to eliminate an extra memory slot search later. Signed-off-by: Takuya Yoshikawa --- arch/x86/kvm/mmu.c | 29 ++--- arch/x86/kvm/paging_tmpl.h | 6 +++--- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/

[PATCH 5/5] KVM: x86: MMU: Eliminate an extra memory slot search in mapping_level()

2015-10-16 Thread Takuya Yoshikawa
Calling kvm_vcpu_gfn_to_memslot() twice in mapping_level() should be avoided since getting a slot by binary search may not be negligible, especially for virtual machines with many memory slots. Signed-off-by: Takuya Yoshikawa --- arch/x86/kvm/mmu.c | 17 +++-- 1 file changed, 11 inse

[PATCH 4/5] KVM: x86: MMU: Remove mapping_level_dirty_bitmap()

2015-10-16 Thread Takuya Yoshikawa
Now that it has only one caller, and its name is not so helpful for readers, remove it. Instead, the new memslot_valid_for_gpte() function makes it possible to share the common code. Signed-off-by: Takuya Yoshikawa --- arch/x86/kvm/mmu.c | 24 1 file changed, 16 inserti

Re: [PATCH 0/5 v2] KVM: x86: MMU: Eliminate extra memory slot searches in page fault handlers

2015-10-16 Thread Paolo Bonzini
On 16/10/2015 10:03, Takuya Yoshikawa wrote: > v2: Based on Paolo's suggestion, kept the common code as much as possible by > introducing memslot_valid_for_gpte(). > > Note: instead of joining all checks by boolean operators, splitted the > no_dirty_log case off to be a separate if-c

Re: [PATCH] KVM: x86: move steal time initialization to vcpu entry time

2015-10-16 Thread Paolo Bonzini
On 15/10/2015 19:10, David Matlack wrote: > > As reported at https://bugs.launchpad.net/qemu/+bug/1494350, > > it is possible to have vcpu->arch.st.last_steal initialized > > from a thread other than vcpu thread, say the iothread, via > > KVM_SET_MSRS. > > > > Which can cause an overflow later (w

Re: [PATCH 9/9] kvm/x86: Hyper-V kvm exit

2015-10-16 Thread Roman Kagan
On Fri, Oct 16, 2015 at 09:51:58AM +0200, Paolo Bonzini wrote: > The documentation should include the definition of the struct and the > definition of the subtypes (currently KVM_EXIT_HYPERV_SYNIC only). > > Documentation for KVM_CAP_HYPERV_SINIC and KVM_IRQ_ROUTING_HV_SINT is > missing, too. > >

Re: just an observation about USB

2015-10-16 Thread Stefan Hajnoczi
On Wed, Oct 14, 2015 at 04:30:22PM -0400, Eric S. Johansson wrote: > On 10/14/2015 04:04 PM, Paolo Bonzini wrote: > >On 14/10/2015 21:39, Eric S. Johansson wrote: > >>Latency is a bit longer than I like. USB and network connections break > >>every time I come out of suspend part at least I don't ha

Please Verify Your Email Address

2015-10-16 Thread
Hello, This message contains urgent information regarding your access to E-mail network systems. The password for your network account has been tempered with and must be checked. Your network account password controls access to various systems and services such as email. To avoid any interru

Re: [PATCH] VFIO: platform: AMD xgbe reset module

2015-10-16 Thread Eric Auger
Dear all, On 10/15/2015 06:53 PM, Alex Williamson wrote: > On Thu, 2015-10-15 at 16:46 +0200, Eric Auger wrote: >> Hi Arnd, >> On 10/15/2015 03:59 PM, Arnd Bergmann wrote: >>> On Thursday 15 October 2015 14:12:28 Christoffer Dall wrote: > > enum vfio_platform_op { > VFIO_PLATFORM_

Re: [PATCH v3 0/5] KVM: nVMX: nested VPID emulation

2015-10-16 Thread Wanpeng Li
Ping, :-) On 10/14/15 12:12 AM, Wanpeng Li wrote: v2 -> v3: * separate nested_vmx_vpid_caps and move checks to patch 3/5, only rejoin them when reading the MSR. v1 -> v2: * set bit 32 of the VMX_EPT_VPID_CAP MSR * check against the supported types in the implementation of the INVVP

Re: [PATCH v3 0/5] KVM: nVMX: nested VPID emulation

2015-10-16 Thread Paolo Bonzini
On 16/10/2015 15:13, Wanpeng Li wrote: > Ping, :-) > On 10/14/15 12:12 AM, Wanpeng Li wrote: >> v2 -> v3: >> * separate nested_vmx_vpid_caps and move checks to patch 3/5, >> only rejoin them when reading the MSR. >> >> v1 -> v2: >> * set bit 32 of the VMX_EPT_VPID_CAP MSR >> * check aga

Re: [PATCH] VFIO: platform: AMD xgbe reset module

2015-10-16 Thread Arnd Bergmann
On Friday 16 October 2015 15:06:45 Eric Auger wrote: > I've since forgotten his answer, but the fact that > > __symbol_get() is only defined for modules makes it moot, we either need > > to make symbol_get() work or define __symbol_get() for non-module > > builds. > I currently don't see any solu

Re: [PATCH] VFIO: platform: AMD xgbe reset module

2015-10-16 Thread Eric Auger
Hi Arnd, On 10/16/2015 03:26 PM, Arnd Bergmann wrote: > On Friday 16 October 2015 15:06:45 Eric Auger wrote: > >> I've since forgotten his answer, but the fact that >>> __symbol_get() is only defined for modules makes it moot, we either need >>> to make symbol_get() work or define __symbol_get()

Re: [RFC PATCH] vfio/type1: Do not support IOMMUs that allow bypass

2015-10-16 Thread Eric Auger
Hi Alex, On 10/15/2015 10:52 PM, Alex Williamson wrote: > We can only provide isolation if DMA is forced through the IOMMU > aperture. Don't allow type1 to be used if this is not the case. > > Signed-off-by: Alex Williamson > --- > > Eric, I see a number of IOMMU drivers enable this, do the one

Re: [RESEND PATCH] kvm: Allow the Hyper-V vendor ID to be specified

2015-10-16 Thread Alex Williamson
On Fri, 2015-10-16 at 09:30 +0200, Paolo Bonzini wrote: > > On 16/10/2015 00:16, Alex Williamson wrote: > > According to Microsoft documentation, the signature in the standard > > hypervisor CPUID leaf at 0x4000 identifies the Vendor ID and is > > for reporting and diagnostic purposes only. W

Re: [PATCH v3 10/20] KVM: ARM64: Add reset and access handlers for PMCCNTR register

2015-10-16 Thread Wei Huang
On 09/24/2015 05:31 PM, Shannon Zhao wrote: > Since the reset value of PMCCNTR is UNKNOWN, use reset_unknown for its > reset handler. Add a new case to emulate reading to PMCCNTR register. > > Signed-off-by: Shannon Zhao > --- > arch/arm64/kvm/sys_regs.c | 17 +++-- > 1 file change

Re: [Qemu-devel] [RESEND PATCH] kvm: Allow the Hyper-V vendor ID to be specified

2015-10-16 Thread Igor Mammedov
On Fri, 16 Oct 2015 08:26:14 -0600 Alex Williamson wrote: > On Fri, 2015-10-16 at 09:30 +0200, Paolo Bonzini wrote: > > > > On 16/10/2015 00:16, Alex Williamson wrote: > > > According to Microsoft documentation, the signature in the standard > > > hypervisor CPUID leaf at 0x4000 identifies t

Re: [PATCH v3 15/20] KVM: ARM64: Add reset and access handlers for PMSWINC register

2015-10-16 Thread Wei Huang
On 09/24/2015 05:31 PM, Shannon Zhao wrote: > Add access handler which emulates writing and reading PMSWINC > register and add support for creating software increment event. > > Signed-off-by: Shannon Zhao > --- > arch/arm64/kvm/sys_regs.c | 18 +- > include/kvm/arm_pmu.h |

Re: [PATCH v3 18/20] KVM: ARM64: Reset PMU state when resetting vcpu

2015-10-16 Thread Wei Huang
On 09/24/2015 05:31 PM, Shannon Zhao wrote: > Signed-off-by: Shannon Zhao Missing commit message here. > --- > arch/arm64/kvm/reset.c | 3 +++ > include/kvm/arm_pmu.h | 2 ++ > virt/kvm/arm/pmu.c | 18 ++ > 3 files changed, 23 insertions(+) > > diff --git a/arch/arm64/

[PATCH v2] kvm: Allow the Hyper-V vendor ID to be specified

2015-10-16 Thread Alex Williamson
According to Microsoft documentation, the signature in the standard hypervisor CPUID leaf at 0x4000 identifies the Vendor ID and is for reporting and diagnostic purposes only. We can therefore allow the user to change it to whatever they want, within the 12 character limit. Add a new hyperv-v

Re: just an observation about USB

2015-10-16 Thread Eric S. Johansson
On 10/16/2015 07:55 AM, Stefan Hajnoczi wrote: QEMU can emulate PCI soundcards, including the Intel HD Audio codec cards (-device intel-hda or -soundhw hda might do the trick). Low latency and power consumption are usually at odds with each other. That's because real-time audio requires small

Re: [RFC PATCH] vfio/type1: Do not support IOMMUs that allow bypass

2015-10-16 Thread Alex Williamson
On Fri, 2015-10-16 at 16:03 +0200, Eric Auger wrote: > Hi Alex, > On 10/15/2015 10:52 PM, Alex Williamson wrote: > > We can only provide isolation if DMA is forced through the IOMMU > > aperture. Don't allow type1 to be used if this is not the case. > > > > Signed-off-by: Alex Williamson > > ---

Re: [PATCH v3 00/20] KVM: ARM64: Add guest PMU support

2015-10-16 Thread Christopher Covington
On 10/16/2015 12:55 AM, Wei Huang wrote: > > > On 09/24/2015 05:31 PM, Shannon Zhao wrote: >> This patchset adds guest PMU support for KVM on ARM64. It takes >> trap-and-emulate approach. When guest wants to monitor one event, it >> will be trapped by KVM and KVM will call perf_event API to creat

Re: Network hangs when communicating with host

2015-10-16 Thread Sasha Levin
On 10/15/2015 04:20 PM, Dmitry Vyukov wrote: > Hello, > > I am trying to run a program in lkvm sandbox so that it communicates > with a program on host. I run lkvm as: > > ./lkvm sandbox --disk sandbox-test --mem=2048 --cpus=4 --kernel > /arch/x86/boot/bzImage --network mode=user -- /my_prog > >

Re: [edk2] KVM: MTRR: fix memory type handling if MTRR is completely disabled

2015-10-16 Thread Laszlo Ersek
On 10/16/15 05:05, Xiao Guangrong wrote: > > > On 10/16/2015 12:18 AM, Laszlo Ersek wrote: >> CC'ing Jordan and Chen Fan. >> >> On 10/15/15 09:10, Xiao Guangrong wrote: >>> >>> >>> On 10/15/2015 02:58 PM, Janusz wrote: W dniu 15.10.2015 o 08:41, Xiao Guangrong pisze: > > > On 10/

[PATCH v3 1/2] qapi: Create DEFINE_PROP_STRING_LEN

2015-10-16 Thread Alex Williamson
A slight addition to set_string(), which optionally tests that the string length is within the bounds specified. Signed-off-by: Alex Williamson --- hw/core/qdev-properties.c|7 +++ include/hw/qdev-core.h |1 + include/hw/qdev-properties.h | 16 ++-- 3 files ch

[PATCH v3 2/2] kvm: Allow the Hyper-V vendor ID to be specified

2015-10-16 Thread Alex Williamson
According to Microsoft documentation, the signature in the standard hypervisor CPUID leaf at 0x4000 identifies the Vendor ID and is for reporting and diagnostic purposes only. We can therefore allow the user to change it to whatever they want, within the 12 character limit. Add a new hyperv-v

[PATCH v3 0/2] Enable specifying a non-default Hyper-V vendor ID

2015-10-16 Thread Alex Williamson
v3: Incorporate suggestion from Igor to move the string length test out to the property parsing. A string that's too long will now get an error like: $ qemu-system-x86_64 -cpu qemu64,hv_vendor_id=123456789abcd qemu-system-x86_64: Property 'host-x86_64-cpu.hv-vendor-id' doesn't tak

Re: [Qemu-devel] [PATCH v3 0/2] Enable specifying a non-default Hyper-V vendor ID

2015-10-16 Thread Amos Jianjun Kong
On Sat, Oct 17, 2015 at 2:53 AM, Alex Williamson wrote: > v3: Incorporate suggestion from Igor to move the string length test > out to the property parsing. A string that's too long will now > get an error like: > > $ qemu-system-x86_64 -cpu qemu64,hv_vendor_id=123456789abcd > qem

[RFC PATCH 1/2] block: introduce file_bd_inode()

2015-10-16 Thread Dan Williams
Similar to the file_inode() helper, provide a helper to lookup the inode for a raw block device itself. Cc: Al Viro Signed-off-by: Dan Williams --- fs/block_dev.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 073

[RFC PATCH 2/2] block: enable dax for raw block devices

2015-10-16 Thread Dan Williams
If an application wants exclusive access to all of the persistent memory provided by an NVDIMM namespace it can use this raw-block-dax facility to forgo establishing a filesystem. This capability is targeted primarily to hypervisors wanting to provision persistent memory for guests. Cc: Jeff Moye

[PATCH] KVM/arm: kernel low level debug suport for ARM32 virtual platforms

2015-10-16 Thread Mario Smarduch
When booting a VM using QEMU or Kvmtool there are no clear ways to enable low level debugging for these virtual platforms. some menu port choices are not supported by the virtual platforms at all. And there is no help on the location of physical and virtual addresses for the ports. This may lead