Re: [PATCH] kvm: x86: lapic: remove one redundant judging condition

2014-11-05 Thread Chen, Tiejun
On 2014/11/5 18:22, Paolo Bonzini wrote: On 05/11/2014 10:03, Tiejun Chen wrote: Finally we always return highest_irr so its unnecessary to return -1 after check if highest_irr == -1. Signed-off-by: Tiejun Chen --- arch/x86/kvm/lapic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)

RE: [PATCH] KVM: x86: reset RVI upon system reset

2014-11-05 Thread Zhang, Yang Z
Paolo Bonzini wrote on 2014-11-05: > > > On 05/11/2014 10:02, Chen, Tiejun wrote: >>> I think both are ok. >>> If we zero max_irr in vmx_set_rvi(), we still need this check: >>> if ((is_guest_mode(vcpu) && nested_exit_on_intr(vcpu)) || max_irr >>> == >>> -1) >> >> No, I don't think we need to ad

Re: [PATCH v12 2/6] KVM: Add generic support for dirty page logging

2014-11-05 Thread Mario Smarduch
On 11/05/2014 08:09 AM, Paolo Bonzini wrote: > > > On 01/11/2014 11:12, James Hogan wrote: >> AFAICT all of the arch implementations of kvm_vm_ioctl_get_dirty_log() >> except x86 and ppc hv (i.e. ia60, mips, ppc pv, s390) already make use >> of the existing generic function kvm_get_dirty_log() to

Re: [PATCH v2] KVM: x86: update masterclock values on TSC writes

2014-11-05 Thread Marcelo Tosatti
On Wed, Nov 05, 2014 at 08:49:38PM +0100, Paolo Bonzini wrote: > > > On 05/11/2014 20:47, Paolo Bonzini wrote: > > > > > > On 05/11/2014 19:19, Marcelo Tosatti wrote: > >> + * If the vcpus have matched TSCs and host clocksource is TSC, > >> + * perform request to enable mast

Re: [PATCH 14/21] KVM: x86: Software disabled APIC should still deliver NMIs

2014-11-05 Thread Nadav Amit
> On Nov 5, 2014, at 14:30, Paolo Bonzini wrote: > > > > On 02/11/2014 10:54, Nadav Amit wrote: >> Currently, the APIC logical map does not consider VCPUs whose local-apic is >> software-disabled. However, NMIs, INIT, etc. should still be delivered to >> such >> VCPUs. Therefore, the APIC mo

Re: [PATCH 08/21] KVM: x86: Reset FPU state during reset

2014-11-05 Thread Nadav Amit
> On Nov 5, 2014, at 16:55, Paolo Bonzini wrote: > > > > On 05/11/2014 14:20, Nadav Amit wrote: Actually it shouldn't be after INIT. XCR0 is not mentioned explicitly in Table 9-1 of the SDM (IA-32 Processor States Following Power-up, Reset, or INIT), but since MSR_IA32_XSS is

Re: [PATCH 20/21] KVM: x86: MOVNTI emulation min opsize is not respected

2014-11-05 Thread Nadav Amit
> On Nov 5, 2014, at 14:18, Paolo Bonzini wrote: > > > > On 02/11/2014 10:55, Nadav Amit wrote: >> Commit 3b32004a66e9 ("KVM: x86: movnti minimum op size of 32-bit is not >> kept") >> did not fully fix the minimum operand size of MONTI emulation. Still, MOVNTI >> may be mistakenly performed u

Re: [PATCH 20/21] KVM: x86: MOVNTI emulation min opsize is not respected

2014-11-05 Thread Nadav Amit
> On Nov 5, 2014, at 14:18, Paolo Bonzini wrote: > > > > On 02/11/2014 10:55, Nadav Amit wrote: >> Commit 3b32004a66e9 ("KVM: x86: movnti minimum op size of 32-bit is not >> kept") >> did not fully fix the minimum operand size of MONTI emulation. Still, MOVNTI >> may be mistakenly performed u

Re: [PATCH v2] KVM: x86: update masterclock values on TSC writes

2014-11-05 Thread Paolo Bonzini
On 05/11/2014 19:19, Marcelo Tosatti wrote: >>> > > +* If the vcpus have matched TSCs and host clocksource is TSC, >>> > > +* perform request to enable masterclock. >>> > > +* >>> > > +* If the masterclock is enabled, perform request to update >>> > > +* ma

Re: [PATCH v2] KVM: x86: update masterclock values on TSC writes

2014-11-05 Thread Paolo Bonzini
On 05/11/2014 20:47, Paolo Bonzini wrote: > > > On 05/11/2014 19:19, Marcelo Tosatti wrote: >> + * If the vcpus have matched TSCs and host clocksource is TSC, >> + * perform request to enable masterclock. >> + * >> + * If the masterclock is enable

[PATCH] kvm: x86: add trace event for pvclock updates

2014-11-05 Thread David Matlack
The new trace event records: * the id of vcpu being updated * the pvclock_vcpu_time_info struct being written to guest memory This is useful for debugging pvclock bugs, such as the bug fixed by "[PATCH] kvm: x86: Fix kvm clock versioning.". Signed-off-by: David Matlack --- arch/x86/kvm/trac

Re: [PATCH 1/1] kvm-s390: Provide guest TOD Clock Get/Set Controls

2014-11-05 Thread Paolo Bonzini
On 05/11/2014 18:56, Christian Borntraeger wrote: >> > >> > Whether you want to follow that approach or do it as VM attribute >> > straight away, I don't mind much :). > given that top programmable field and epoch are available as ONEREG, lets do > the same for TOD. Is the epoch per-cpu? Paol

Re: [PATCH v2] KVM: x86: update masterclock values on TSC writes

2014-11-05 Thread Marcelo Tosatti
On Wed, Nov 05, 2014 at 10:36:05AM +0100, Paolo Bonzini wrote: > On 05/11/2014 00:30, Marcelo Tosatti wrote: > > + /* > > +* If the vcpus have matched TSCs and host clocksource is TSC, > > +* perform request to enable masterclock. > > +* > > +* If the masterclock is enabled, perfo

Re: [PATCH 1/1] kvm-s390: Provide guest TOD Clock Get/Set Controls

2014-11-05 Thread Christian Borntraeger
Am 05.11.2014 18:37, schrieb Alexander Graf: > > > On 05.11.14 17:48, Christian Borntraeger wrote: >> Am 05.11.2014 14:11, schrieb Paolo Bonzini: >>> >>> >>> On 05/11/2014 13:28, Christian Borntraeger wrote: Am 05.11.2014 11:07, schrieb Alexander Graf: > > > On 27.10.14 16:44, Ja

Re: [PATCH 1/1] kvm-s390: Provide guest TOD Clock Get/Set Controls

2014-11-05 Thread Alexander Graf
On 05.11.14 17:48, Christian Borntraeger wrote: > Am 05.11.2014 14:11, schrieb Paolo Bonzini: >> >> >> On 05/11/2014 13:28, Christian Borntraeger wrote: >>> Am 05.11.2014 11:07, schrieb Alexander Graf: On 27.10.14 16:44, Jason J. Herne wrote: > From: "Jason J. Herne" > >>>

Re: [PATCH 1/1] kvm-s390: Provide guest TOD Clock Get/Set Controls

2014-11-05 Thread Christian Borntraeger
Am 05.11.2014 14:11, schrieb Paolo Bonzini: > > > On 05/11/2014 13:28, Christian Borntraeger wrote: >> Am 05.11.2014 11:07, schrieb Alexander Graf: >>> >>> >>> On 27.10.14 16:44, Jason J. Herne wrote: From: "Jason J. Herne" Enable KVM_SET_CLOCK and KVM_GET_CLOCK ioctls on s390 for

Re: [PATCH v12 1/6] KVM: Add architecture-defined TLB flush support

2014-11-05 Thread Paolo Bonzini
On 23/10/2014 00:34, Mario Smarduch wrote: > This patch adds support for architecture implemented VM TLB flush, currently > ARMv7 defines HAVE_KVM_ARCH_TLB_FLUSH_ALL. This leaves other architectures > unaffected using the generic version. In subsequent patch ARMv7 defines > HAVE_KVM_ARCH_TLB_FLU

Re: [PATCH v12 2/6] KVM: Add generic support for dirty page logging

2014-11-05 Thread Paolo Bonzini
On 01/11/2014 11:12, James Hogan wrote: > AFAICT all of the arch implementations of kvm_vm_ioctl_get_dirty_log() > except x86 and ppc hv (i.e. ia60, mips, ppc pv, s390) already make use > of the existing generic function kvm_get_dirty_log() to help implement > their kvm_vm_ioctl_get_dirty_log fun

Re: [PATCH 1/1] kvm-s390: Provide guest TOD Clock Get/Set Controls

2014-11-05 Thread Paolo Bonzini
On 05/11/2014 15:32, Alexander Graf wrote: > > Of course 2 has code written, but it should be a small change to use > > ONEREG instead. What do you think? > > How far does the existing nanosecond number get us until we hit the > 64bit limit? 2042. > And by the time we hit it, wouldn't we hit i

Re: [PATCH 08/21] KVM: x86: Reset FPU state during reset

2014-11-05 Thread Paolo Bonzini
On 05/11/2014 14:20, Nadav Amit wrote: >> > Actually it shouldn't be after INIT. XCR0 is not mentioned explicitly >> > in Table 9-1 of the SDM (IA-32 Processor States Following Power-up, >> > Reset, or INIT), but since MSR_IA32_XSS is not specified, I think XCR0 >> > should fall under "All ot

Re: [PATCH 1/1] kvm-s390: Provide guest TOD Clock Get/Set Controls

2014-11-05 Thread Alexander Graf
On 05.11.14 14:11, Paolo Bonzini wrote: > > > On 05/11/2014 13:28, Christian Borntraeger wrote: >> Am 05.11.2014 11:07, schrieb Alexander Graf: >>> >>> >>> On 27.10.14 16:44, Jason J. Herne wrote: From: "Jason J. Herne" Enable KVM_SET_CLOCK and KVM_GET_CLOCK ioctls on s390 for >

[Bug 87591] Host will call trace when loading igbvf.

2014-11-05 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=87591 Paolo Bonzini changed: What|Removed |Added CC||bonz...@gnu.org Component|kvm

Re: [PATCH 08/21] KVM: x86: Reset FPU state during reset

2014-11-05 Thread Nadav Amit
> On Nov 5, 2014, at 14:04, Paolo Bonzini wrote: > > > > On 02/11/2014 10:54, Nadav Amit wrote: >> When resetting the VCPU, the FPU should be reset as well (e.g., XCR0 state). >> Call fx_init during reset as well. > > Actually it shouldn't be after INIT. XCR0 is not mentioned explicitly > i

Re: [PATCH 1/1] kvm-s390: Provide guest TOD Clock Get/Set Controls

2014-11-05 Thread Paolo Bonzini
On 05/11/2014 13:28, Christian Borntraeger wrote: > Am 05.11.2014 11:07, schrieb Alexander Graf: >> >> >> On 27.10.14 16:44, Jason J. Herne wrote: >>> From: "Jason J. Herne" >>> >>> Enable KVM_SET_CLOCK and KVM_GET_CLOCK ioctls on s390 for >>> managing guest Time Of Day clock value. >>> >>>

Re: [PATCH 00/21] Fixes for various KVM bugs

2014-11-05 Thread Paolo Bonzini
On 02/11/2014 10:54, Nadav Amit wrote: > Nadav Amit (21): > KVM: x86: decode_modrm does not regard modrm correctly > KVM: x86: No error-code on real-mode exceptions > KVM: x86: Emulator should set DR6 upon GD like real CPU > KVM: x86: Clear DR6[0:3] on #DB during handle_dr > KVM: x86: B

Re: [PATCH 14/21] KVM: x86: Software disabled APIC should still deliver NMIs

2014-11-05 Thread Paolo Bonzini
On 02/11/2014 10:54, Nadav Amit wrote: > Currently, the APIC logical map does not consider VCPUs whose local-apic is > software-disabled. However, NMIs, INIT, etc. should still be delivered to > such > VCPUs. Therefore, the APIC mode should first be determined, and then the map, > considering a

Re: [PATCH 1/1] kvm-s390: Provide guest TOD Clock Get/Set Controls

2014-11-05 Thread Christian Borntraeger
Am 05.11.2014 11:07, schrieb Alexander Graf: > > > On 27.10.14 16:44, Jason J. Herne wrote: >> From: "Jason J. Herne" >> >> Enable KVM_SET_CLOCK and KVM_GET_CLOCK ioctls on s390 for managing guest Time >> Of Day clock value. >> >> Signed-off-by: Jason J. Herne >> Reviewed-by: David Hildenbrand

Re: [PATCH 20/21] KVM: x86: MOVNTI emulation min opsize is not respected

2014-11-05 Thread Paolo Bonzini
On 02/11/2014 10:55, Nadav Amit wrote: > Commit 3b32004a66e9 ("KVM: x86: movnti minimum op size of 32-bit is not kept") > did not fully fix the minimum operand size of MONTI emulation. Still, MOVNTI > may be mistakenly performed using 16-bit opsize. > > This patch add No16 flag to mark an instru

Re: [PATCH 08/21] KVM: x86: Reset FPU state during reset

2014-11-05 Thread Paolo Bonzini
On 02/11/2014 10:54, Nadav Amit wrote: > When resetting the VCPU, the FPU should be reset as well (e.g., XCR0 state). > Call fx_init during reset as well. Actually it shouldn't be after INIT. XCR0 is not mentioned explicitly in Table 9-1 of the SDM (IA-32 Processor States Following Power-up,

Re: [PATCH 07/21] KVM: x86: Emulator considers imm as memory operand

2014-11-05 Thread Paolo Bonzini
On 02/11/2014 10:54, Nadav Amit wrote: > The emulator mistakenly considers some of the immediate operands as memory > operands, performs memory read and uses the wrong data. By default, every > operand is marked as OP_MEM, so if it is not changed, memory read may be > wrongly emulated and the wron

Re: [PATCH 06/21] KVM: x86: Emulator MOV-sreg uses incorrect size

2014-11-05 Thread Paolo Bonzini
On 02/11/2014 10:54, Nadav Amit wrote: > In x86, you cannot MOV-sreg to memory is either 16-bits or 64-bits. When > destination is registers, and the operand size is 32-bits, the high 16-bits in > modern CPUs is filled with zero. > > In contrast, KVM may write to memory 32-bits on MOV-sreg. Thi

Re: [PATCH 01/21] KVM: x86: decode_modrm does not regard modrm correctly

2014-11-05 Thread Paolo Bonzini
On 02/11/2014 10:54, Nadav Amit wrote: > In one occassion, decode_modrm uses the rm field after it is extended with > REX.B to determine the addressing mode. Doing so causes it not to read the > offset for rip-relative addressing. > > This patch uses the value after masking instead. > > Signed-of

Re: [PATCH] kvm: x86: lapic: remove one redundant judging condition

2014-11-05 Thread Paolo Bonzini
On 05/11/2014 10:03, Tiejun Chen wrote: > Finally we always return highest_irr so its unnecessary to return -1 > after check if highest_irr == -1. > > Signed-off-by: Tiejun Chen > --- > arch/x86/kvm/lapic.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/arch/x86/kvm/

Re: [PATCH v9 13/19] vfio/platform: support for level sensitive interrupts

2014-11-05 Thread Antonios Motakis
On Fri, Oct 31, 2014 at 8:36 PM, Alex Williamson wrote: > On Mon, 2014-10-27 at 19:07 +0100, Antonios Motakis wrote: >> Level sensitive interrupts are exposed as maskable and automasked >> interrupts and are masked and disabled automatically when they fire. >> >> Signed-off-by: Antonios Motakis >

Re: [PATCH v9 12/19] vfio/platform: trigger an interrupt via eventfd

2014-11-05 Thread Antonios Motakis
On Fri, Oct 31, 2014 at 8:36 PM, Alex Williamson wrote: > On Mon, 2014-10-27 at 19:07 +0100, Antonios Motakis wrote: >> This patch allows to set an eventfd for a patform device's interrupt, >> and also to trigger the interrupt eventfd from userspace for testing. >> Level sensitive interrupts are m

Re: [PATCH 1/1] kvm-s390: Provide guest TOD Clock Get/Set Controls

2014-11-05 Thread Alexander Graf
On 27.10.14 16:44, Jason J. Herne wrote: > From: "Jason J. Herne" > > Enable KVM_SET_CLOCK and KVM_GET_CLOCK ioctls on s390 for managing guest Time > Of Day clock value. > > Signed-off-by: Jason J. Herne > Reviewed-by: David Hildenbrand I like it. Reviewed-by: Alexander Graf Alex -- To

Re: [PATCH v9 15/19] vfio: add local lock in virqfd instead of depending on VFIO PCI

2014-11-05 Thread Antonios Motakis
On Fri, Oct 31, 2014 at 8:43 PM, Alex Williamson wrote: > On Mon, 2014-10-27 at 19:08 +0100, Antonios Motakis wrote: >> Virqfd just needs to keep accesses to any struct *virqfd safe, but this >> comes into play only when creating or destroying eventfds, so sharing >> the same spinlock with the VFI

Re: [PATCH v9 10/19] vfio/platform: return IRQ info

2014-11-05 Thread Antonios Motakis
On Fri, Oct 31, 2014 at 8:11 PM, Alex Williamson wrote: > On Mon, 2014-10-27 at 19:07 +0100, Antonios Motakis wrote: >> Return information for the interrupts exposed by the device. >> This patch extends VFIO_DEVICE_GET_INFO with the number of IRQs >> and enables VFIO_DEVICE_GET_IRQ_INFO. >> >> Sig

Re: [PATCH] KVM: x86: reset RVI upon system reset

2014-11-05 Thread Paolo Bonzini
On 05/11/2014 10:02, Chen, Tiejun wrote: >> I think both are ok. >> If we zero max_irr in vmx_set_rvi(), we still need this check: >> if ((is_guest_mode(vcpu) && nested_exit_on_intr(vcpu)) || max_irr == -1) > > No, I don't think we need to add this. You don't, because the code will look like:

Re: [PATCH v9 04/19] vfio: amba: VFIO support for AMBA devices

2014-11-05 Thread Antonios Motakis
On Fri, Oct 31, 2014 at 7:40 PM, Alex Williamson wrote: > On Mon, 2014-10-27 at 19:07 +0100, Antonios Motakis wrote: >> Add support for discovering AMBA devices with VFIO and handle them >> similarly to Linux platform devices. >> >> Signed-off-by: Antonios Motakis >> --- >> drivers/vfio/platform

Re: [PATCH v9 07/19] vfio/platform: return info for device memory mapped IO regions

2014-11-05 Thread Antonios Motakis
On Fri, Oct 31, 2014 at 7:58 PM, Alex Williamson wrote: > On Mon, 2014-10-27 at 19:07 +0100, Antonios Motakis wrote: >> This patch enables the IOCTLs VFIO_DEVICE_GET_REGION_INFO ioctl call, >> which allows the user to learn about the available MMIO resources of >> a device. >> >> Signed-off-by: An

Re: [PATCH v2 1/6] vfio: implement iommu driver capabilities with an enum

2014-11-05 Thread Antonios Motakis
On Fri, Oct 31, 2014 at 9:04 PM, Alex Williamson wrote: > > On Mon, 2014-10-27 at 19:05 +0100, Antonios Motakis wrote: > > Currently a VFIO driver's IOMMU capabilities are encoded as a series of > > numerical defines. Replace this with an enum for future maintainability. > > > > Signed-off-by: Ant

Re: [PATCH] kvm: x86: vmx: avoid returning bool to distinguish success from error

2014-11-05 Thread Paolo Bonzini
On 05/11/2014 02:43, Chen, Tiejun wrote: >> >> +default: >> +WARN_ON(1); >> +continue; > > 'continue' versus 'break'? Yes, it avoids falling through to "vmcs12_write_any(&vmx->vcpu, field, field_value)". > Looks we're missing another place, Right, thanks. Pao

Re: [PATCH v2] KVM: x86: update masterclock values on TSC writes

2014-11-05 Thread Paolo Bonzini
On 05/11/2014 00:30, Marcelo Tosatti wrote: > + /* > + * If the vcpus have matched TSCs and host clocksource is TSC, > + * perform request to enable masterclock. > + * > + * If the masterclock is enabled, perform request to update > + * masterclock values. > + */ >

[PATCH] kvm: x86: lapic: remove one redundant judging condition

2014-11-05 Thread Tiejun Chen
Finally we always return highest_irr so its unnecessary to return -1 after check if highest_irr == -1. Signed-off-by: Tiejun Chen --- arch/x86/kvm/lapic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 5f574b4..e6a7eb6 1006

KVM Test report, kernel c6338ce4... qemu d5b4dc3b...

2014-11-05 Thread Hu, Robert
Hi, This is KVM upstream test result against kvm.git next branch and qemu.git master branch. kvm.git next branch: c6338ce494456ed9c92ef10f63c0a8408bfeac6d based on kernel 3.18.0-rc3 qemu.git master branch: d5b4dc3b50175f0c34f3cf4b053e123fb37f5aed We found one new bug and no fi

Re: [PATCH] KVM: x86: reset RVI upon system reset

2014-11-05 Thread Chen, Tiejun
On 2014/11/5 16:50, Wang, Wei W wrote: On 05/11/2014 4:07, Tiejun Chen wrote: A bug was reported as follows: when running Windows 7 32-bit guests on qemu-kvm, sometimes the guests run into blue screen during reboot. The problem was that a guest's RVI was not cleared when it rebooted. This patch

RE: [PATCH] KVM: x86: reset RVI upon system reset

2014-11-05 Thread Wang, Wei W
On 05/11/2014 4:07, Tiejun Chen wrote: > >>> A bug was reported as follows: when running Windows 7 32-bit guests > >>> on qemu-kvm, sometimes the guests run into blue screen during > >>> reboot. The problem was that a guest's RVI was not cleared when it > >>> rebooted. This > >> patch has fixed the

Re: The status about vhost-net on kvm-arm?

2014-11-05 Thread Shannon Zhao
Hi Nikolay, >From this mail I know you guys have done some work about ioeventfd support on kvm-arm before. Do you have plan to rework your patch based on the new branch? If not, I think we should send a patch to make eventfd support on kvm-arm and make vhost-net work. Based on the new kvm-arm bran

Re: [PATCH] KVM: x86: reset RVI upon system reset

2014-11-05 Thread Chen, Tiejun
On 2014/11/5 15:39, Wang, Wei W wrote: On 05/11/2014 2:14, Tiejun Chen wrote: A bug was reported as follows: when running Windows 7 32-bit guests on qemu-kvm, sometimes the guests run into blue screen during reboot. The problem was that a guest's RVI was not cleared when it rebooted. This patch