Re: [PATCH] uio/uio_pci_generic: don't return zero on failure path in probe()

2014-12-07 Thread Michael S. Tsirkin
On Sat, Dec 06, 2014 at 12:28:01AM +0300, Alexey Khoroshilov wrote: > If uio_register_device() fails in probe(), it breaks off initialization, > deallocates all resources, but returns zero. > > The patch adds proper error code propagation. > > Found by Linux Driver Verification project (linuxtest

Re: [PATCH RFC] KVM: x86: nested: support for MSR loading/storing

2014-12-07 Thread Jan Kiszka
On 2014-12-08 04:49, Wincy Van wrote: +static bool vmx_msr_switch_area_verify(u32 count, u64 addr, int maxphyaddr) +{ +if (count == 0) +return true; +if ((addr & 0xf) != 0) >> >> Bits 11:0 have to be zero, in fact (page alignment required). > > >

Re: [v2 17/25] KVM: kvm-vfio: User API for VT-d Posted-Interrupts

2014-12-07 Thread Alex Williamson
On Mon, 2014-12-08 at 04:58 +, Wu, Feng wrote: > > > -Original Message- > > From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On > > Behalf Of Eric Auger > > Sent: Thursday, December 04, 2014 10:05 PM > > To: Wu, Feng; t...@linutronix.de; mi...@redhat.com; h...@zytor.c

Re: [v2 18/25] KVM: kvm-vfio: implement the VFIO skeleton for VT-d Posted-Interrupts

2014-12-07 Thread Alex Williamson
On Mon, 2014-12-08 at 04:58 +, Wu, Feng wrote: > > > -Original Message- > > From: Eric Auger [mailto:eric.au...@linaro.org] > > Sent: Thursday, December 04, 2014 11:36 PM > > To: Wu, Feng; t...@linutronix.de; mi...@redhat.com; h...@zytor.com; > > x...@kernel.org; g...@kernel.org; pbonz

RE: [v2 17/25] KVM: kvm-vfio: User API for VT-d Posted-Interrupts

2014-12-07 Thread Wu, Feng
> -Original Message- > From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On > Behalf Of Eric Auger > Sent: Thursday, December 04, 2014 10:05 PM > To: Wu, Feng; t...@linutronix.de; mi...@redhat.com; h...@zytor.com; > x...@kernel.org; g...@kernel.org; pbonz...@redhat.com; >

RE: [v2 18/25] KVM: kvm-vfio: implement the VFIO skeleton for VT-d Posted-Interrupts

2014-12-07 Thread Wu, Feng
> -Original Message- > From: Eric Auger [mailto:eric.au...@linaro.org] > Sent: Thursday, December 04, 2014 11:36 PM > To: Wu, Feng; t...@linutronix.de; mi...@redhat.com; h...@zytor.com; > x...@kernel.org; g...@kernel.org; pbonz...@redhat.com; > dw...@infradead.org; j...@8bytes.org; alex.w

Re: [PATCH RFC] KVM: x86: nested: support for MSR loading/storing

2014-12-07 Thread Wincy Van
Sorry, please ignore the previous mail, It was rejected due to HTML format. 2014-12-07 18:21 GMT+08:00 Jan Kiszka : > > On 2014-12-07 10:46, Bandan Das wrote: > > [Ccing a few others who might be interested] > > > > Hi Eugene, > > > > Did you look at the other patch that was posted for this functi

bridge mode without network rework

2014-12-07 Thread Thomas Lau
Hi All, I just wondering is it possible not to rework our host machine network structure to get KVM guest working on bridge mode? Current implementation is using brctl to control it, which is destructive especially you have a host which is using that network card to connect internet. -- To unsubsc

[PATCH] arch: powerpc: kvm: book3s_paired_singles.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
Remove the function inst_set_field() that is not used anywhere. This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- arch/powerpc/kvm/book3s_paired_singles.c |8 1 file changed, 8 deletions(-) diff --git a/arch/p

[PATCH] arch: powerpc: kvm: book3s_pr.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
Remove the function get_fpr_index() that is not used anywhere. This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- arch/powerpc/kvm/book3s_pr.c |5 - 1 file changed, 5 deletions(-) diff --git a/arch/powerpc/kvm/book3

[PATCH] arch: powerpc: kvm: book3s.c: Remove some unused functions

2014-12-07 Thread Rickard Strandqvist
Removes some functions that are not used anywhere: kvmppc_core_load_guest_debugstate() kvmppc_core_load_host_debugstate() This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- arch/powerpc/kvm/book3s.c |8 arch/pow

[PATCH] arch: powerpc: kvm: book3s_32_mmu.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
Remove the function sr_nx() that is not used anywhere. This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- arch/powerpc/kvm/book3s_32_mmu.c |5 - 1 file changed, 5 deletions(-) diff --git a/arch/powerpc/kvm/book3s_32

Re: [PATCH] KVM: nVMX: Disable unrestricted mode if ept=0

2014-12-07 Thread Jan Kiszka
On 2014-12-06 16:02, Bandan Das wrote: > > If L0 has disabled EPT, don't advertise unrestricted > mode at all since it depends on EPT to run real mode code. > > Signed-off-by: Bandan Das > --- > arch/x86/kvm/vmx.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arc

Re: [PATCH RFC] KVM: x86: nested: support for MSR loading/storing

2014-12-07 Thread Jan Kiszka
On 2014-12-07 10:46, Bandan Das wrote: > [Ccing a few others who might be interested] > > Hi Eugene, > > Did you look at the other patch that was posted for this functionality > by Wincy Van ? > > https://lkml.org/lkml/2014/11/21/749 It's good to see more momentum here, but, yes, we should defi

[PATCH] KVM: x86: Remove prefix flag when GP macro is used

2014-12-07 Thread Nadav Amit
The macro GP already sets the flag Prefix. Remove the redundant flag for 0f_38_f0 and 0f_38_f1 opcodes. Signed-off-by: Nadav Amit --- arch/x86/kvm/emulate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 3817334..b4f4

Re: [PATCH RFC] KVM: x86: nested: support for MSR loading/storing

2014-12-07 Thread Bandan Das
[Ccing a few others who might be interested] Hi Eugene, Did you look at the other patch that was posted for this functionality by Wincy Van ? https://lkml.org/lkml/2014/11/21/749 Eugene Korenevsky writes: > BitVisor hypervisor fails to start a nested guest due to lack of MSR > load/store supp

[PATCH kvm-unit-tests] x86: test_conforming_switch misses es initialization

2014-12-07 Thread Nadav Amit
test_conforming_switch in the taskswitch2 tests, miss es initialization. Fix it. Signed-off-by: Nadav Amit --- x86/taskswitch2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x86/taskswitch2.c b/x86/taskswitch2.c index f55843c..db3e41a 100644 --- a/x86/taskswitch2.c +++ b

[PATCH v2 1/5] KVM: Redesign kvm_io_bus_ API to pass VCPU structure to the callbacks.

2014-12-07 Thread Nikolay Nikolaev
This is needed in e.g. ARM vGIC emulation, where the MMIO handling depends on the VCPU that does the access. Signed-off-by: Nikolay Nikolaev --- arch/ia64/kvm/kvm-ia64.c |4 ++-- arch/powerpc/kvm/mpic.c| 10 ++ arch/powerpc/kvm/powerpc.c |4 ++-- arch/s390/kvm/diag.c

[PATCH v2 5/5] ARM: enable KVM_CAP_IOEVENTFD

2014-12-07 Thread Nikolay Nikolaev
KVM on arm will support the eventfd extension. Signed-off-by: Nikolay Nikolaev --- arch/arm/kvm/arm.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index c3d0fbd..266b618 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -197,6 +197,9

[PATCH v2 3/5] KVM: ARM VGIC add kvm_io_bus_ frontend

2014-12-07 Thread Nikolay Nikolaev
In io_mem_abort remove the call to vgic_handle_mmio. The target is to have a single MMIO handling path - that is through the kvm_io_bus_ API. Register a kvm_io_device in kvm_vgic_init on the whole vGIC MMIO region. Both read and write calls are redirected to vgic_io_dev_access where kvm_exit_mmio

[PATCH v2 0/5] ARM: KVM: Enable the ioeventfd capability of KVM on ARM

2014-12-07 Thread Nikolay Nikolaev
The IOEVENTFD KVM capability is a prerequisite for vhost support. This series enables the ioeventfd KVM capability on ARM. The implementation routes MMIO access in the IO abort handler to the KVM IO bus. If there is already a registered ioeventfd handler for this address, the file descriptor will

[PATCH v2 4/5] ARM/ARM64: enable linking against eventfd

2014-12-07 Thread Nikolay Nikolaev
This enables compilation of the eventfd feature on ARM/ARM64. Signed-off-by: Nikolay Nikolaev --- arch/arm/kvm/Kconfig|1 + arch/arm/kvm/Makefile |2 +- arch/arm64/kvm/Kconfig |1 + arch/arm64/kvm/Makefile |2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git

[PATCH v2 2/5] KVM: ARM: on IO mem abort - route the call to KVM MMIO bus

2014-12-07 Thread Nikolay Nikolaev
On IO memory abort, try to handle the MMIO access thorugh the KVM registered read/write callbacks. This is done by invoking the relevant kvm_io_bus_* API. Signed-off-by: Nikolay Nikolaev --- arch/arm/kvm/mmio.c | 33 + 1 file changed, 33 insertions(+) diff --gi