Re: Regression problem with commit 5045b46803

2014-08-17 Thread Nadav Amit
On Aug 17, 2014, at 9:28 AM, Paolo Bonzini wrote: > Il 17/08/2014 08:23, Nadav Amit ha scritto: >> Although this check is mentioned in table 7-1 of the SDM as causing a >> #TSS exception, it is not mentioned in table 6-6 that lists "invalid TSS >> conditions" which cause #TSS excepti

Re: [PATCH v5 0/5] random,x86,kvm: Rework arch RNG seeds and get some from kvm

2014-08-17 Thread Paolo Bonzini
Il 13/08/2014 20:33, Andy Lutomirski ha scritto: > As for doing arch_random_init after clone/migration, I think we'll > need another KVM extension for that, since, AFAIK, we don't actually > get notified that we were cloned or migrated. That will be > nontrivial. Maybe we can figure that out at K

Re: [PATCH] KVM: x86: fix TSC matching

2014-08-17 Thread Paolo Bonzini
Il 15/08/2014 18:54, Marcelo Tosatti ha scritto: > > Ping on integration. It's been in kvm/next for a while, and is now in Linus's tree: commit 0d3da0d26e3c3515997c99451ce3b0ad1a69a36c Author: Tomasz Grabiec AuthorDate: Tue Jun 24 09:42:43 2014 +0200 Commit: Paolo Bonzini CommitDate: W

Re: Regression problem with commit 5045b46803

2014-08-17 Thread Paolo Bonzini
Il 17/08/2014 09:19, Nadav Amit ha scritto: > Can you please assist in running the existing task-switch tests first? > > In x86_64 the task-switch tests are skipped. If I configure the tests to use > the i386 architecture, the build fails. > Even after fixing the compilation errors, I don’t manag

[PATCH kvm-unit-tests] x86: isr: fix handle_external_interrupt for 32-bit build

2014-08-17 Thread Paolo Bonzini
Broken by commit 57b4317dc6758dd8b478609b1312685795654e01. Signed-off-by: Paolo Bonzini --- lib/x86/isr.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/x86/isr.c b/lib/x86/isr.c index b0c6f53..833564a 100644 --- a/lib/x86/isr.c +++ b/lib/x86/isr.c @@ -93,13 +

Re: [PATCH net-next] vhost_net: stop rx net polling when possible

2014-08-17 Thread Michael S. Tsirkin
On Fri, Aug 15, 2014 at 11:40:08AM +0800, Jason Wang wrote: > After rx vq was enabled, we never stop polling its socket. This is sub optimal > when may lead unnecessary wake-ups after the rx net work has already been > queued. This could be optimized by stopping polling the rx net sock when > proce

Re: Query: Is it possible to lose interrupts between vhost and virtio_net during migration?

2014-08-17 Thread Michael S. Tsirkin
On Fri, Aug 15, 2014 at 10:55:32AM +0800, Jason Wang wrote: > >>> I wonder if k->set_guest_notifiers should be called after "hdev->started > >>> = true;" in vhost_dev_start. > >> Michael, can we just remove those assertions? Since you may want to set > >> guest notifiers before starting the backen

Re: [PATCH] vhost: Add polling mode

2014-08-17 Thread Razya Ladelsky
> > > > Hi Michael, > > > > Sorry for the delay, had some problems with my mailbox, and I realized > > just now that > > my reply wasn't sent. > > The vm indeed ALWAYS utilized 100% cpu, whether polling was enabled or > > not. > > The vhost thread utilized less than 100% (of the other cpu) w

Re: [PATCH] vhost: Add polling mode

2014-08-17 Thread Michael S. Tsirkin
On Sun, Aug 17, 2014 at 03:35:39PM +0300, Razya Ladelsky wrote: > > > > > > Hi Michael, > > > > > > Sorry for the delay, had some problems with my mailbox, and I realized > > > > just now that > > > my reply wasn't sent. > > > The vm indeed ALWAYS utilized 100% cpu, whether polling was enabled

[PATCH kvm-unit-tests] x86: Test task-switch with cs.rpl != cs.dpl

2014-08-17 Thread Nadav Amit
Commit 5045b46803 added a check that cs.dpl equals cs.rpl during task-switch. This is a wrong check, and this test introduces a test in which cs.dpl != cs.rpl. To do so, it configures tss.cs to be conforming with rpl=3 and dpl=0. Since the cpl after calling is 3, it does not make any prints in the

[PATCH] KVM: x86: Revert "check CS.DPL against RPL during task switch"

2014-08-17 Thread Nadav Amit
This reverts commit 5045b468037dfe1c848827ce10e99d87f5669160. Although the cs.dpl=cs.rpl check is mentioned in table 7-1 of the SDM as causing a #TSS exception, it is not mentioned in table 6-6 that lists "invalid TSS conditions" which cause #TSS exceptions. As it causes some tests, which pass on

Re: [PATCH] KVM: x86: Revert "check CS.DPL against RPL during task switch"

2014-08-17 Thread Paolo Bonzini
Il 17/08/2014 21:32, Nadav Amit ha scritto: > This reverts commit 5045b468037dfe1c848827ce10e99d87f5669160. Although the > cs.dpl=cs.rpl check is mentioned in table 7-1 of the SDM as causing a #TSS > exception, it is not mentioned in table 6-6 that lists "invalid TSS > conditions" > which cause #

Re: [PATCH] KVM: x86: Revert "check CS.DPL against RPL during task switch"

2014-08-17 Thread Paolo Bonzini
Il 17/08/2014 23:09, Paolo Bonzini ha scritto: > Il 17/08/2014 21:32, Nadav Amit ha scritto: >> This reverts commit 5045b468037dfe1c848827ce10e99d87f5669160. Although the >> cs.dpl=cs.rpl check is mentioned in table 7-1 of the SDM as causing a #TSS >> exception, it is not mentioned in table 6-6 th

Re: [PATCH] KVM: x86: Revert "check CS.DPL against RPL during task switch"

2014-08-17 Thread Nadav Amit
On Aug 18, 2014, at 12:13 AM, Paolo Bonzini wrote: > Il 17/08/2014 23:09, Paolo Bonzini ha scritto: >> Il 17/08/2014 21:32, Nadav Amit ha scritto: >>> This reverts commit 5045b468037dfe1c848827ce10e99d87f5669160. Although the >>> cs.dpl=cs.rpl check is mentioned in table 7-1 of the SDM as causi

Re: [PATCH] KVM: x86: Revert "check CS.DPL against RPL during task switch"

2014-08-17 Thread Nadav Amit
On Aug 18, 2014, at 12:09 AM, Paolo Bonzini wrote: > Il 17/08/2014 21:32, Nadav Amit ha scritto: >> This reverts commit 5045b468037dfe1c848827ce10e99d87f5669160. Although the >> cs.dpl=cs.rpl check is mentioned in table 7-1 of the SDM as causing a #TSS >> exception, it is not mentioned in table

Re: [PATCH] KVM: x86: Revert "check CS.DPL against RPL during task switch"

2014-08-17 Thread Paolo Bonzini
Il 17/08/2014 23:33, Nadav Amit ha scritto: >> > Also, what about the rpl > cpl test below, for non-conforming code >> > segments? It is not mentioned in table 6-6 either. > As far as I understand, after task-switch cpl = cs.rpl. This is how the > load_state_from_tss32 does it, and follows SDM 7.

Re: [PATCH] KVM: x86: Revert "check CS.DPL against RPL during task switch"

2014-08-17 Thread Paolo Bonzini
Il 17/08/2014 23:39, Nadav Amit ha scritto: > I missed the TS_VECTOR thing. Yes, in that case, full revert makes no > sense. I’m in no hurry with this patch, and I posted it during your > vacation only because it is a recent bug. Anyhow, you may want to > look at another patch I sent, "KVM: x86: Av

Re: [questions] about using vfio to assign sr-iov vf to vm

2014-08-17 Thread Zhang Haoyu
>> >> Hi, all >> >> I'm using VFIO to assign intel 82599 VF to VM, now I encounter a problem, >> >> 82599 PF and its VFs belong to the same iommu_group, but I only want to >> >> assign some VFs to one VM, and some other VFs to another VM, ..., >> >> so how to only unbind (part of) the VFs but PF?

Re: [questions] about using vfio to assign sr-iov vf to vm

2014-08-17 Thread Alex Williamson
On Mon, 2014-08-18 at 09:00 +0800, Zhang Haoyu wrote: > >> >> Hi, all > >> >> I'm using VFIO to assign intel 82599 VF to VM, now I encounter a > >> >> problem, > >> >> 82599 PF and its VFs belong to the same iommu_group, but I only want to > >> >> assign some VFs to one VM, and some other VFs to

Re: [PATCH] KVM: x86: Increase the number of fixed MTRR regs to 10

2014-08-17 Thread Wanpeng Li
Hi Nadav, On Wed, Jun 18, 2014 at 05:21:19PM +0300, Nadav Amit wrote: >Recent Intel CPUs have 10 variable range MTRRs. Since operating systems >sometime make assumptions on CPUs while they ignore capability MSRs, it is >better for KVM to be consistent with recent CPUs. Reporting more MTRRs than >ac

RE: [PATCH v2] KVM: x86: check ISR and TMR to construct eoi exit bitmap

2014-08-17 Thread Zhang, Yang Z
Chen, Tiejun wrote on 2014-08-15: > On 2014/8/14 3:16, Wei Wang wrote: >> From: Yang Zhang >> >> Guest may mask the IOAPIC entry before issue EOI. In such case, >> EOI will not be intercepted by hypervisor due to the corrensponding > > s/corrensponding/corresponding > >> bit in eoi exit bitmap

Re: [PATCH net-next] vhost_net: stop rx net polling when possible

2014-08-17 Thread Jason Wang
On 08/17/2014 06:20 PM, Michael S. Tsirkin wrote: > On Fri, Aug 15, 2014 at 11:40:08AM +0800, Jason Wang wrote: >> After rx vq was enabled, we never stop polling its socket. This is sub >> optimal >> when may lead unnecessary wake-ups after the rx net work has already been >> queued. This could be

Re: [PATCH/RFC] KVM: track pid for VCPU only on KVM_RUN ioctl

2014-08-17 Thread Wanpeng Li
Hi Christian, On Tue, Aug 05, 2014 at 04:44:14PM +0200, Christian Borntraeger wrote: >We currently track the pid of the task that runs the VCPU in >vcpu_load. Since we call vcpu_load for all kind of ioctls on a >CPU, this causes hickups due to synchronize_rcu if one CPU is >modified by another CPU

Re: Query: Is it possible to lose interrupts between vhost and virtio_net during migration?

2014-08-17 Thread Jason Wang
On 08/17/2014 06:22 PM, Michael S. Tsirkin wrote: > On Fri, Aug 15, 2014 at 10:55:32AM +0800, Jason Wang wrote: > I wonder if k->set_guest_notifiers should be called after "hdev->started > = true;" in vhost_dev_start. Michael, can we just remove those assertions? Since you may want to

Re: [PATCH] KVM: x86: Increase the number of fixed MTRR regs to 10

2014-08-17 Thread Nadav Amit
This should have been a benign patch. I'll try to get windows 7 installation disk and check ASAP. Nadav > On 18 Aug 2014, at 05:17, Wanpeng Li wrote: > > Hi Nadav, >> On Wed, Jun 18, 2014 at 05:21:19PM +0300, Nadav Amit wrote: >> Recent Intel CPUs have 10 variable range MTRRs. Since operating