Re: [Qemu-devel] KVM call minutes July 31th

2012-07-31 Thread Igor Mammedov
- Original Message - > From: "Eduardo Habkost" > To: "Juan Quintela" , "Anthony Liguori" > > Cc: qemu-de...@nongnu.org, "KVM devel mailing list" > Sent: Tuesday, July 31, 2012 5:40:14 PM > Subject: Re: [Qemu-devel] KVM call minutes July 31th > > On Tue, Jul 31, 2012 at 04:32:05PM +0200

Need advice how to fix an access to uninitialized per_cpu clock

2012-02-02 Thread Igor Mammedov
While playing with kvm cpu hot-plug, I've probably stumbled on general kernel bug. So I'm lookng for advice on approach to fix it. When kvm guest uses kvmclock, it may hang on cpu hot-plug at BSP: smp_apic_timer_interrupt ... -> do_timer -> update_wall_time a

Re: [PATCHv2] Add async page fault test

2012-05-09 Thread Igor Mammedov
On 05/09/2012 12:33 PM, Gleb Natapov wrote: The test checks that when hypervisor prefaults swapped in page it does not generates spurious #PFs in case page was unmapped while it was swapped out. diff --git a/config-x86-common.mak b/config-x86-common.mak index c8fbda7..6976f78 100644 --- a/config

[PATCH] Introduce x86_cpuinit.early_percpu_clock_init hook

2012-02-07 Thread Igor Mammedov
x86_cpuinit.setup_percpu_clockev in start_secondary, ftrace may cause the same overflow/hang on cpu hot-plug anyway. More complete description of the problem: https://lkml.org/lkml/2012/2/2/101 Credits to Marcelo Tosatti for hook idea. Signed-off-by: Igor Mammedov --- arch/x86/include/asm/x8

Re: x86: kvmclock: abstract save/restore sched_clock_state

2012-02-08 Thread Igor Mammedov
ve/restore sched_clock_state functions and use restore_state to write to KVM_SYSTEM_TIME MSR, forcing an update. Fixes suspend-to-disk with kvmclock. Signed-off-by: Marcelo Tosatti Acked-by: Igor Mammedov -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of

Re: x86: kvmclock: abstract save/restore sched_clock_state

2012-02-09 Thread Igor Mammedov
On 02/09/2012 01:27 PM, Amit Shah wrote: On (Tue) 07 Feb 2012 [19:05:42], Marcelo Tosatti wrote: Upon resume from hibernation, CPU 0's hvclock area contains the old values for system_time and tsc_timestamp. It is necessary for the hypervisor to update these values with uptodate ones before the

Re: x86: kvmclock: abstract save/restore sched_clock_state

2012-02-10 Thread Igor Mammedov
Could you send me your .config and commit id of kernel you are using? - Original Message - > From: "Amit Shah" > To: "Igor Mammedov" > Cc: "Marcelo Tosatti" , kvm@vger.kernel.org, > t...@linutronix.de, mi...@redhat.com, > h...@zytor

Re: x86: kvmclock: abstract save/restore sched_clock_state

2012-02-10 Thread Igor Mammedov
On 02/10/2012 01:33 PM, Marcelo Tosatti wrote: On Fri, Feb 10, 2012 at 10:32:16AM -0200, Marcelo Tosatti wrote: On Fri, Feb 10, 2012 at 03:32:11PM +0530, Amit Shah wrote: On (Thu) 09 Feb 2012 [16:13:29], Igor Mammedov wrote: Stalls are probably caused by uninitialized percpu hv_clock, with

Re: x86: kvmclock: abstract save/restore sched_clock_state

2012-02-10 Thread Igor Mammedov
I've to revoke my ack and say NAK to this patch. Patch itself is in right direction but clock restore happens too late. With patch I've used to hunt down overflow for cpu hotplug (maybe it will be better for it to be in kernel, which will help to detect overflow problem without spending a lot of

Re: x86: kvmclock: abstract save/restore sched_clock_state (v2)

2012-02-13 Thread Igor Mammedov
ve/restore sched_clock_state functions and use restore_state to write to KVM_SYSTEM_TIME MSR, forcing an update. Also move restore_sched_clock_state before __restore_processor_state, since the later calls CONFIG_LOCK_STAT's lockstat_clock (also for TSC). Thanks to Igor Mammedov for tracking it down.

[PATCH RFC] pvclock: Make pv_clock more robust and fixup it if overflow happens

2012-02-13 Thread Igor Mammedov
if overflow condition is detected. Signed-off-by: Igor Mammedov --- arch/x86/kernel/pvclock.c | 18 +++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c index 42eb330..b486756 100644 --- a/arch/x86/kernel/pvcloc

Re: [PATCH RFC] pvclock: Make pv_clock more robust and fixup it if overflow happens

2012-02-13 Thread Igor Mammedov
On 02/13/2012 06:48 PM, Marcelo Tosatti wrote: On Mon, Feb 13, 2012 at 04:45:59PM +0100, Igor Mammedov wrote: Instead of hunting misterious stalls/hungs all over the kernel when overflow occurs at pvclock.c:pvclock_get_nsec_offset u64 delta = native_read_tsc() - shadow->tsc_timest

[PATCH] BUG in pv_clock when overflow condition is detected

2012-02-13 Thread Igor Mammedov
BUG when overflow occurs at pvclock.c:pvclock_get_nsec_offset u64 delta = native_read_tsc() - shadow->tsc_timestamp; this might happen at an attempt to read an uninitialized yet clock. It won't prevent stalls and hangs but at least it won't do it silently. Signed-off-by:

Re: [PATCH] BUG in pv_clock when overflow condition is detected

2012-02-15 Thread Igor Mammedov
On 02/15/2012 11:49 AM, Avi Kivity wrote: On 02/13/2012 08:20 PM, Igor Mammedov wrote: BUG when overflow occurs at pvclock.c:pvclock_get_nsec_offset u64 delta = native_read_tsc() - shadow->tsc_timestamp; this might happen at an attempt to read an uninitialized yet clock. It won't

Re: [PATCH] BUG in pv_clock when overflow condition is detected

2012-02-15 Thread Igor Mammedov
- Original Message - > From: "Avi Kivity" > To: "Igor Mammedov" > Cc: linux-ker...@vger.kernel.org, kvm@vger.kernel.org, t...@linutronix.de, > mi...@redhat.com, h...@zytor.com, > r...@redhat.com, "amit shah" , mtosa...@redhat.com &g

Re: [PATCH] BUG in pv_clock when overflow condition is detected

2012-02-17 Thread Igor Mammedov
On 02/16/2012 03:03 PM, Avi Kivity wrote: On 02/15/2012 07:18 PM, Igor Mammedov wrote: On 02/15/2012 01:23 PM, Igor Mammedov wrote: static u64 pvclock_get_nsec_offset(struct pvclock_shadow_time *shadow) { -u64 delta = native_read_tsc() - shadow->tsc_timestamp; +u64 de

Re: [PATCH] BUG in pv_clock when overflow condition is detected

2012-02-21 Thread Igor Mammedov
On 02/20/2012 04:28 PM, Konrad Rzeszutek Wilk wrote: On Fri, Feb 17, 2012 at 04:25:04PM +0100, Igor Mammedov wrote: On 02/16/2012 03:03 PM, Avi Kivity wrote: On 02/15/2012 07:18 PM, Igor Mammedov wrote: On 02/15/2012 01:23 PM, Igor Mammedov wrote: static u64 pvclock_get_nsec_offset(struct

Re: [PATCH][SeaBIOS] memory hotplug

2012-03-16 Thread Igor Mammedov
On 03/16/2012 03:09 PM, Vasilis Liaskovitis wrote: Hi, On Thu, Mar 15, 2012 at 02:01:38PM +0200, Gleb Natapov wrote: Commenting a little bit late, but since you've said that you are working on a new version of the patch... better late than never. On Thu, Aug 11, 2011 at 04:39:38PM +0200, Vasil

Re: [Qemu-devel] KVM call minutes April 3

2012-04-04 Thread Igor Mammedov
On 04/04/2012 02:14 PM, Michael Roth wrote: On Wed, Apr 04, 2012 at 01:53:34PM +0300, Dor Laor wrote: On 04/04/2012 01:37 PM, Michael Roth wrote: On Apr 4, 2012 2:42 AM, "Paolo Bonzini"mailto:pbonz...@redhat.com>> wrote: Il 04/04/2012 03:18, Michael Roth ha scritto: Attacking the IDL/schem

Re: [Qemu-devel] [RFC PATCH 6/9] pc: pass paravirt info for hotplug memory slots to BIOS

2012-04-20 Thread Igor Mammedov
On 04/19/2012 04:08 PM, Vasilis Liaskovitis wrote: The numa_fw_cfg paravirt interface is extended to include SRAT information for all hotplug-able memslots. There are 3 words for each hotplug-able memory slot, denoting start address, size and node proximity. nb_numa_nodes is set to 1 by

Re: [Qemu-devel] [RFC PATCH 2/9][SeaBIOS] Implement acpi-dsdt functions for memory hotplug.

2012-04-20 Thread Igor Mammedov
On 04/19/2012 04:08 PM, Vasilis Liaskovitis wrote: Extend the DSDT to include methods for handling memory hot-add and hot-remove notifications and memory device status requests. These functions are called from the memory device SSDT methods. Eject has only been tested with level gpe event, but w

Re: [Qemu-devel] vCPU hotplug roadmap

2013-01-30 Thread Igor Mammedov
On Wed, 30 Jan 2013 14:02:16 +0100 Andreas Färber wrote: > Am 30.01.2013 13:49, schrieb Eduardo Habkost: > > On Wed, Jan 30, 2013 at 11:58:56AM +0100, Andreas Färber wrote: [...] > > http://article.gmane.org/gmane.comp.emulators.qemu/186778 > > ...and I have been working on making it even simpl

Re: [Qemu-devel] [PATCH qom-cpu-next v3 3/4] target-i386: Slim conversion to X86CPU subclasses

2013-02-04 Thread Igor Mammedov
On Sat, 2 Feb 2013 01:37:07 +0100 Andreas Färber wrote: > Move x86_def_t definition to header and embed into X86CPUClass. > Register types per built-in model definition. > > Move version initialization from x86_cpudef_setup() to class_init. > > Inline cpu_x86_register() into the X86CPU initfn.

Re: [Qemu-devel] [PATCH qom-cpu-next v3 3/4] target-i386: Slim conversion to X86CPU subclasses

2013-02-04 Thread Igor Mammedov
On Mon, 04 Feb 2013 13:52:32 +0100 Andreas Färber wrote: > Am 04.02.2013 12:08, schrieb Igor Mammedov: > > On Sat, 2 Feb 2013 01:37:07 +0100 > > Andreas Färber wrote: > > > >> Move x86_def_t definition to header and embed into X86CPUClass. > >> Regis

Re: [Qemu-devel] [PATCH qom-cpu-next v3 3/4] target-i386: Slim conversion to X86CPU subclasses

2013-02-04 Thread Igor Mammedov
On Mon, 4 Feb 2013 17:05:01 +0100 Igor Mammedov wrote: > On Mon, 04 Feb 2013 13:52:32 +0100 > Andreas Färber wrote: > > > Am 04.02.2013 12:08, schrieb Igor Mammedov: > > > On Sat, 2 Feb 2013 01:37:07 +0100 > > > Andreas Färber wrote: > > > [...] &

Re: [Qemu-devel] [PATCH 3/5] target-i386: Slim conversion to X86CPU subclasses

2013-02-08 Thread Igor Mammedov
On Fri, 08 Feb 2013 12:16:17 +0100 Andreas Färber wrote: > Am 08.02.2013 10:03, schrieb Igor Mammedov: > > On Thu, 7 Feb 2013 13:08:19 -0200 > > Eduardo Habkost wrote: > > > >> On Tue, Feb 05, 2013 at 05:39:22PM +0100, Igor Mammedov wrote: > >>> From:

Re: [Qemu-devel] [PATCH 3/5] target-i386: Slim conversion to X86CPU subclasses

2013-02-10 Thread Igor Mammedov
On Fri, 8 Feb 2013 16:13:02 -0200 Eduardo Habkost wrote: > On Fri, Feb 08, 2013 at 05:54:50PM +0100, Andreas Färber wrote: > > Am 08.02.2013 15:52, schrieb Eduardo Habkost: > > > On Fri, Feb 08, 2013 at 01:58:42PM +0100, Igor Mammedov wrote: > > >> On F

Re: [Qemu-devel] [PATCH 3/5] target-i386: Slim conversion to X86CPU subclasses

2013-02-13 Thread Igor Mammedov
On Tue, 12 Feb 2013 12:48:47 -0200 Eduardo Habkost wrote: > On Mon, Feb 11, 2013 at 02:52:49AM +0100, Igor Mammedov wrote: > > On Fri, 8 Feb 2013 16:13:02 -0200 > > Eduardo Habkost wrote: > > > > > On Fri, Feb 08, 2013 at 05:54:50PM +0100, Andreas Färber wrot

Re: [PATCH] target-i386: Improve x86_cpu_list output

2013-02-26 Thread Igor Mammedov
On Sat, 23 Feb 2013 16:45:00 +0100 Jan Kiszka wrote: > From: Jan Kiszka > > Several issues fixed: > - We were missing a bunch of feature lists. Fix this by simply dumping >the meta list feature_word_info. > - kvm_enabled() cannot be true at this point because accelerators are >initial

Re: [PATCH] target-i386: Improve x86_cpu_list output

2013-02-26 Thread Igor Mammedov
On Wed, 27 Feb 2013 00:26:38 -0300 Eduardo Habkost wrote: > On Tue, Feb 26, 2013 at 10:57:56PM +0100, Igor Mammedov wrote: > > On Sat, 23 Feb 2013 16:45:00 +0100 > > Jan Kiszka wrote: > > > > > From: Jan Kiszka > > > > > > Several issues fi

Re: [PATCH] target-i386: Improve x86_cpu_list output

2013-02-27 Thread Igor Mammedov
On Wed, 27 Feb 2013 08:52:50 +0100 Jan Kiszka wrote: > On 2013-02-27 08:37, Igor Mammedov wrote: > > On Wed, 27 Feb 2013 00:26:38 -0300 > > Eduardo Habkost wrote: > > > >> On Tue, Feb 26, 2013 at 10:57:56PM +0100, Igor Mammedov wrote: > >>> On Sat, 2

Re: [Qemu-devel] [PATCH v2] target-i386: Improve x86_cpu_list output

2013-02-27 Thread Igor Mammedov
ch later during init. Also, hiding this makes it very >hard to discover for users. Simply dump unconditionally if CONFIG_KVM >is set. > - Add explanation for "host" CPU type. > > Signed-off-by: Jan Kiszka Reviewed-By: Igor Mammedov > --- > > Changes

[PATCH] x86: kvmclock: zero initialize pvclock shared memory area

2013-06-10 Thread Igor Mammedov
version & 1) || version != src->version); if secondary kvmclock is accessed before it's registered with kvm. Clear garbage in pvclock shared memory area right after it's allocated to avoid this issue. Ref: https://bugzilla.kernel.org/show_bug.cgi?id=59521 Signed-off-by: Igor Ma

Re: [PATCH qom-cpu v2 02/29] kvm: Change cpu_synchronize_state() argument to CPUState

2013-06-18 Thread Igor Mammedov
On Sun, 16 Jun 2013 17:57:22 +0200 Andreas Färber wrote: > Change Monitor::mon_cpu to CPUState as well. > In cpu_synchronize_all_states() use qemu_for_each_cpu() now. > > Reviewed-by: liguang > Signed-off-by: Andreas Färber > --- > cpus.c | 8 > gdbstub.c

Re: [PATCHv1] kvm guest: fix uninitialized kvmclock read by KVM guest

2013-06-20 Thread Igor Mammedov
On Wed, 19 Jun 2013 15:29:31 +0200 Paolo Bonzini wrote: > Il 19/06/2013 15:20, Batalov Eugene ha scritto: > > > > I've missed this detail. It looks like Igor's patch doesn't bring > > secondary cpus kvm_clocksource behavior back to one before the regression, > > Before the regression per_cpu var

[PATCH 2/2] x86: kvmclock: register per-cpu kvmclock at earliest possible time

2013-06-21 Thread Igor Mammedov
ng its registration. So that any following usage of sched_clock() would yield correct value. Signed-off-by: Igor Mammedov --- arch/x86/kernel/kvmclock.c | 11 +-- arch/x86/kernel/smpboot.c |2 +- arch/x86/mm/pageattr.c |4 ++-- 3 files changed, 12 insertions(+), 5

[PATCH 0/2 v2] x86: kvmclock: Prevent uninitialized per-cpu kvmclock usage

2013-06-21 Thread Igor Mammedov
reason why it's clearing is necessary. - added "[2/2] x86: kvmclock: register per-cpu kvmclock at earliest possible time" to register clock earlier. Igor Mammedov (2): x86: kvmclock: zero initialize pvclock shared memory area x86: kvmclock: register per-cpu kvmclock

[PATCH 1/2] x86: kvmclock: zero initialize pvclock shared memory area

2013-06-21 Thread Igor Mammedov
assumption for usage of: hv_clock.migrate_count which could be populated with random garbage now. Clearing garbage in pvclock shared memory area right after it's allocated helps to avoid these issues. Signed-off-by: Igor Mammedov --- arch/x86/kernel/kvmclock.c |1 + 1 files changed, 1 inserti

Re: [Qemu-devel] KVM call agenda for 2013-06-25

2013-06-25 Thread Igor Mammedov
On Tue, 11 Jun 2013 17:52:53 +0200 Juan Quintela wrote: > > Hi > > Now we have moved to one call each other week. > Please, send any topic that you are interested in covering. > > Thanks, Juan. > > PD. If you want to attend and you don't have the call details, > contact me. > Using s

Re: [Qemu-devel] [PATCH qom-cpu v9] target-i386: Move hyperv_* static globals to X86CPU

2013-07-08 Thread Igor Mammedov
On Mon, 8 Jul 2013 03:03:54 +0200 Andreas Färber wrote: > From: Igor Mammedov > > - since hyperv_* helper functions are used only in target-i386/kvm.c > move them there as static helpers > > Requested-by: Eduardo Habkost > Signed-off-by: Igor Mammedov > Signed-off

Re: [Qemu-devel] KVM call agenda for 2013-07-09

2013-07-09 Thread Igor Mammedov
On Mon, 08 Jul 2013 02:42:32 +0200 Andreas Färber wrote: > Am 08.07.2013 01:10, schrieb Juan Quintela: > > Please, send any topic that you are interested in covering. > > Static qdev vs. dynamic QOM properties and -global > (Igor's topic from two weeks ago that we couldn't cover any more) > => n

Re: [KVM] About releasing vcpu when closing vcpu fd

2014-07-02 Thread Igor Mammedov
On Mon, 30 Jun 2014 16:41:07 +0200 Anshul Makkar wrote: > Hi, > > Currently as per the specs for cpu_hot(un)plug, ACPI GPE Block: IO > ports 0xafe0-0xafe3 where each bit corresponds to each CPU. > > Currently, EJ0 method in acpi-dsdt-cpu-hotplu.dsl doesn't do anything. > > Method(CPEJ, 2, No

[PATCH] ensure guest's kvmclock never goes backwards when TSC jumps backward

2014-07-16 Thread Igor Mammedov
nd ensures that clock will never go backwards even with using PVCLOCK_TSC_STABLE_BIT enabled path. Signed-off-by: Igor Mammedov --- RHBZ: 1115795 --- arch/x86/kernel/pvclock.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/pvclock.c b/arch/

Re: [PATCH] ensure guest's kvmclock never goes backwards when TSC jumps backward

2014-07-16 Thread Igor Mammedov
On Wed, 16 Jul 2014 08:41:00 -0300 Marcelo Tosatti wrote: > On Wed, Jul 16, 2014 at 12:18:37PM +0200, Paolo Bonzini wrote: > > Il 16/07/2014 11:52, Igor Mammedov ha scritto: > > >There are buggy hosts in the wild that advertise invariant > > >TSC and as result host u

Re: [PATCH] ensure guest's kvmclock never goes backwards when TSC jumps backward

2014-07-16 Thread Igor Mammedov
On Wed, 16 Jul 2014 16:16:17 +0200 Paolo Bonzini wrote: > Il 16/07/2014 15:55, Igor Mammedov ha scritto: > > On Wed, 16 Jul 2014 08:41:00 -0300 > > Marcelo Tosatti wrote: > > > >> On Wed, Jul 16, 2014 at 12:18:37PM +0200, Paolo Bonzini wrote: > >>> Il

Re: [PATCH] ensure guest's kvmclock never goes backwards when TSC jumps backward

2014-07-16 Thread Igor Mammedov
On Wed, 16 Jul 2014 16:55:37 +0200 Paolo Bonzini wrote: > Il 16/07/2014 16:51, Igor Mammedov ha scritto: > >>>> I'm not sure that a per-CPU value is enough; your patch can make > >>>> the problem much less frequent of course, but I'm not sure >

[PATCH 0/2] Avoid using TSC clocksource on AMD APUs affected by erratum 778

2014-07-31 Thread Igor Mammedov
Fixes pvclock backwards jumps caused by TSC drifting despite host believing that TSC is invariant/synchronized. TSC drift maybe caused by erratum 778 described in "Revision Guide for AMD Family 15h Models 10h-1Fh Processors, Publication # 48931, Issue Date: May 2013, Revision: 3.10&qu

[PATCH 2/2] x86: kvm: do not advertise stable clocksource if CPU has TSC drift BUG

2014-07-31 Thread Igor Mammedov
Signed-off-by: Igor Mammedov --- arch/x86/kvm/cpuid.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index 38a0afe..f519823 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -478,8 +478,9 @@ static inline int

[PATCH 1/2] x86: AMD: mark TSC unstable on APU family 15h models 10h-1fh

2014-07-31 Thread Igor Mammedov
fix issue mark TSC as unstable on affected CPU, so it won't be used as clocksource. Which in turn disables master_clock mechanism in KVM and force pvclock using global clock counter that can't go backwards. Signed-off-by: Igor Mammedov --- arch/x86/include/asm/cpufeature.h | 1 +

[PATCH] kvm: x86: increase user memory slots to 509

2014-11-06 Thread Igor Mammedov
other devices that use them. Signed-off-by: Igor Mammedov --- previously increased to 125 slots for assigned devices by 0f888f5acd --- arch/x86/include/asm/kvm_host.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm

Re: [PATCH] kvm: Fix memory slot page alignment logic

2014-11-10 Thread Igor Mammedov
On Fri, 7 Nov 2014 22:18:45 +0100 Alexander Graf wrote: > Memory slots have to be page aligned to get entered into KVM. There > is existing logic that tries to ensure that we pad memory slots that > are not page aligned to the biggest region that would still fit in the > alignment requirements.

Re: [PATCH] kvm: Fix memory slot page alignment logic

2014-11-10 Thread Igor Mammedov
On Mon, 10 Nov 2014 14:16:58 +0100 Alexander Graf wrote: > > > On 10.11.14 13:31, Igor Mammedov wrote: > > On Fri, 7 Nov 2014 22:18:45 +0100 > > Alexander Graf wrote: > > > >> Memory slots have to be page aligned to get entered into KVM. There > &g

[PATCH] kvm: memslots: replace heap sort with insertion sort

2014-11-13 Thread Igor Mammedov
. Signed-off-by: Igor Mammedov --- virt/kvm/kvm_main.c | 54 + 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 25ffac9..5fcbc45 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm

[PATCH v2] kvm: memslots: replace heap sort with insertion sort

2014-11-13 Thread Igor Mammedov
usage pattern and known position of changed slot. performance change of 128 memslots insersions with gradually increasing size (the worst case): heap sort custom sort max: 249747 2500 cycles with custom sort alg taking ~98% less then original update time. Signed-off-by: Igor

Re: [PATCH v2] kvm: memslots: replace heap sort with insertion sort

2014-11-14 Thread Igor Mammedov
On Fri, 14 Nov 2014 10:57:10 +0100 Paolo Bonzini wrote: > > > On 14/11/2014 00:00, Igor Mammedov wrote: > > memslots is a sorted array, when slot changes in it > > with current heapsort it would take O(n log n) time > > to update array, while using insertion sort

Re: [PATCH 1/3] kvm: memslots: track id_to_index changes during the insertion sort

2014-11-14 Thread Igor Mammedov
d_to_index[mslots[i].id] = i; > + i--; > + } else > + break; > } > } > > - for (i = 0; i < KVM_MEM_SLOTS_NUM; i++) > - slots->id_to_index[slots->

Re: [PATCH] kvm: x86: increase user memory slots to 509

2014-11-14 Thread Igor Mammedov
On Thu, 06 Nov 2014 17:23:58 +0100 Paolo Bonzini wrote: > > > On 06/11/2014 16:52, Igor Mammedov wrote: > > With the 3 private slots, this gives us 512 slots total. > > Motivation for this is in addition to assigned devices > > support more memory hotplug slots, wh

Re: [PATCH 1/3] kvm: memslots: track id_to_index changes during the insertion sort

2014-11-14 Thread Igor Mammedov
On Fri, 14 Nov 2014 14:35:00 +0100 Radim Krčmář wrote: > 2014-11-14 12:12+0100, Paolo Bonzini: > > This completes the optimization from the previous patch, by > > removing the KVM_MEM_SLOTS_NUM-iteration loop from insert_memslot. > > > > Signed-off-by: Paolo Bonzini > > --- > > virt/kvm/kvm_ma

Re: [PATCH 2/3] kvm: commonize allocation of the new memory slots

2014-11-14 Thread Igor Mammedov
FP_KERNEL); > - if (!slots) > - goto out_free; > - } > - > /* actual memory is freed via old in kvm_free_physmem_slot > below */ if (change == KVM_MR_DELETE) { > new.dirty_bitmap = NULL; Reviewed-by: Igor Mammedov -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 3/3] kvm: simplify update_memslots invocation

2014-11-14 Thread Igor Mammedov
0, sizeof(new.arch)); > } > > - old_memslots = install_new_memslots(kvm, slots, &new); > + update_memslots(slots, &new); > + old_memslots = install_new_memslots(kvm, slots); > > kvm_arch_commit_memory_region(kvm, mem, &old, change); > Reviewed-by: Igor Mammedov -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 5/5] kvm: optimize GFN to memslot lookup with large slots amount

2014-12-01 Thread Igor Mammedov
arch 117 slots : 13000 30 460 117 slots : 2000 35 180 binary search Signed-off-by: Igor Mammedov --- include/linux/kvm_host.h | 34 ++ virt/kvm/kvm_main.c | 8 +++- 2 files changed, 29 insertions(+), 13 deletions(-) diff

[PATCH 4/5] kvm: change memslot sorting rule from size to GFN

2014-12-01 Thread Igor Mammedov
it will allow to use binary search for GFN -> memslot lookups, reducing lookup cost with large slots amount. Signed-off-by: Igor Mammedov --- virt/kvm/kvm_main.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_mai

[PATCH 3/5] kvm: search_memslots: add simple LRU memslot caching

2014-12-01 Thread Igor Mammedov
In typical guest boot workload only 2-3 memslots are used extensively, and at that it's mostly the same memslot lookup operation. Adding LRU cache improves average lookup time from 46 to 28 cycles (~40%) for this workload. Signed-off-by: Igor Mammedov --- include/linux/kvm_host.h

[PATCH 1/5] kvm: update_memslots: drop not needed check for the same number of pages

2014-12-01 Thread Igor Mammedov
if number of pages haven't changed sorting algorithm will do nothing, so there is no need to do extra check to avoid entering sorting logic. Signed-off-by: Igor Mammedov --- virt/kvm/kvm_main.c | 28 +--- 1 file changed, 13 insertions(+), 15 deletions(-) diff --

[PATCH 0/5] kvm: memslots lookup optimization

2014-12-01 Thread Igor Mammedov
Series speed-ups GFN to memslot lookup time by: * introducing LRU cache, which improves looukup time for same slot workload (typically boot time of Windows and Linux guest) * switching to binary search for GFN to memslot lookup, improving lookup time with large amount of memory slots Igor

[PATCH 2/5] kvm: update_memslots: drop not needed check for the same slot

2014-12-01 Thread Igor Mammedov
UP/DOWN shift loops will shift array in needed direction and stop at place where new slot should be placed regardless of old slot size. Signed-off-by: Igor Mammedov --- virt/kvm/kvm_main.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/virt/kvm

Re: [PATCH 0/5] kvm: memslots lookup optimization

2014-12-02 Thread Igor Mammedov
On Mon, 01 Dec 2014 18:38:34 +0100 Paolo Bonzini wrote: > > > On 01/12/2014 18:29, Igor Mammedov wrote: > > Series speed-ups GFN to memslot lookup time by: > > * introducing LRU cache, which improves looukup time for > >same slot workload (typically boot time

Re: [Qemu-devel] [PATCH v3 uq/master 2/2] x86: cpuid: reconstruct leaf 0Dh data

2013-10-03 Thread Igor Mammedov
On Wed, 2 Oct 2013 17:54:57 +0200 Paolo Bonzini wrote: > The data in leaf 0Dh depends on information from other feature bits. > Instead of passing it blindly from the host, compute it based on > whether these feature bits are enabled. > > Signed-off-by: Paolo Bonzini > --- > target-i386/cpu.c

Re: [Qemu-devel] [PATCH v3 uq/master 2/2] x86: cpuid: reconstruct leaf 0Dh data

2013-10-03 Thread Igor Mammedov
On Thu, 3 Oct 2013 13:01:54 +0300 Gleb Natapov wrote: > On Thu, Oct 03, 2013 at 11:59:24AM +0200, Igor Mammedov wrote: > > On Wed, 2 Oct 2013 17:54:57 +0200 > > Paolo Bonzini wrote: > > > > > The data in leaf 0Dh depends on information from other feature bit

Re: [uq/master PATCH 0/7] x86 CPU subclasses, take 7

2014-01-31 Thread Igor Mammedov
On Fri, 31 Jan 2014 12:30:17 +0100 Andreas Färber wrote: > > Further, I was under the impression that this series depends on Igor's > feature property series, which I haven't found time to rework and > haven't noticed anyone else do either. So if there's no prereqs (why > uq/master?) I'll happil

Re: [Qemu-devel] [uq/master PATCH 0/7] x86 CPU subclasses, take 7

2014-01-31 Thread Igor Mammedov
On Thu, 30 Jan 2014 17:48:52 -0200 Eduardo Habkost wrote: > Is there any hope to get this into QEMU 2.0, or it is now too late? I got > almost no feedback on take 6 (submitted November 27). > > This is the main blocker to allow libvirt finally implement an equivalent to > the > "enforce" flag,

Re: [Qemu-devel] [uq/master PATCH 0/7] x86 CPU subclasses, take 7

2014-01-31 Thread Igor Mammedov
On Fri, 31 Jan 2014 13:17:53 -0200 Eduardo Habkost wrote: > On Fri, Jan 31, 2014 at 03:50:23PM +0100, Paolo Bonzini wrote: > > Il 31/01/2014 15:48, Igor Mammedov ha scritto: > > >that's abusing of object-add interface and due to recent changes, > > >object

Re: [Qemu-devel] [libvirt] [uq/master PATCH 0/7] x86 CPU subclasses, take 7

2014-01-31 Thread Igor Mammedov
On Fri, 31 Jan 2014 11:56:18 -0700 Eric Blake wrote: > On 01/31/2014 11:51 AM, Eduardo Habkost wrote: > > >> Allowing -device may be okay, since in the (very?) long term -device > >> can be replaced by -object. But -object is definitive. > > > > OK, one additional reason to try device_add firs

Re: [Qemu-devel] [uq/master PATCH 7/7 v8] target-i386: CPU model subclasses

2014-02-10 Thread Igor Mammedov
er-class property defaults. > > > > Written based on the ideas from the patch "[RFC v5] target-i386: Slim > > conversion to X86CPU subclasses + KVM subclasses" written by Andreas > > Färber , Igor Mammedov . > > > > The "host" CPU model is specia

Re: [PATCH v4 02/17] target-i386: Add missing kvm bits.

2012-09-21 Thread Igor Mammedov
On Thu, 20 Sep 2012 16:03:17 -0400 Don Slutz wrote: > Fix duplicate name (kvmclock => kvm_clock2) also. > > Signed-off-by: Don Slutz > --- > target-i386/cpu.c | 12 > 1 files changed, 8 insertions(+), 4 deletions(-) > > diff --git a/target-i386/cpu.c b/target-i386/cpu.c > index

Re: KVM call agenda for 2012-10-16

2012-10-15 Thread Igor Mammedov
"CPU as DEVICE" http://lists.gnu.org/archive/html/qemu-devel/2012-10/msg00719.html latest known tree for testing: https://github.com/ehabkost/qemu-hacks/commits/work/cpu-devicestate-qdev-core may be we could agree on proposed RFC. -- To unsubscribe from this list: send the line

Re: [Qemu-devel] [PATCH qom-cpu v2 4/7] cpus: Pass CPUState to qemu_cpu_is_self()

2012-10-15 Thread Igor Mammedov
6/kvm.c > @@ -1552,9 +1552,10 @@ static int kvm_get_debugregs(CPUX86State *env) > > int kvm_arch_put_registers(CPUX86State *env, int level) > { > +CPUState *cpu = ENV_GET_CPU(env); > int ret; > > -assert(cpu_is_stopped(env) || qemu_cpu_is_self(env)); > +

Re: [Qemu-devel] KVM call agenda for 2012-10-16

2012-10-16 Thread Igor Mammedov
On Mon, 15 Oct 2012 18:27:51 +0200 Igor Mammedov wrote: > "CPU as DEVICE" > http://lists.gnu.org/archive/html/qemu-devel/2012-10/msg00719.html > latest known tree for testing: > > https://github.com/ehabkost/qemu-hacks/commits/work/cpu-devicestate-qdev-c

Re: [Qemu-devel] file_ram_alloc: unify mem-path, mem-prealloc error handling

2014-02-28 Thread Igor Mammedov
On Thu, 27 Feb 2014 19:30:26 +0100 Paolo Bonzini wrote: > Il 04/02/2014 19:41, Marcelo Tosatti ha scritto: > > > > -mem-prealloc asks to preallocate memory residing on -mem-path path. > > > > Currently QEMU exits in case: > > > > - Memory file has been created but allocation via explicit write >

[PATCH 2/2] KVM: x86 emulator: emulate MOVAPD

2014-03-15 Thread Igor Mammedov
Add emulation for 0x66 prefixed instruction of 0f 28 opcode that has been added earlier. Signed-off-by: Igor Mammedov --- arch/x86/kvm/emulate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index a26d075..205b17e 100644

[PATCH 1/2] KVM: x86 emulator: emulate MOVAPS

2014-03-15 Thread Igor Mammedov
%xmm4,0x40(%esi) which points to MOVAPS instruction currently no emulated by KVM. Fix it by adding appropriate entries to opcode table in KVM's emulator. Signed-off-by: Igor Mammedov --- arch/x86/kvm/emulate.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/x8

[PATCH 0/2] KVM: x86 emulator: emulate MOVAPS and MOVAPD SSE instructions

2014-03-15 Thread Igor Mammedov
MS HCK test fails on 32-bit Windows 8.1 due to missing MOVAPS instruction emulation, this series adds it and while at it, it adds emulation of MOVAPD which is trivial to implement on top of MOVAPS. Igor Mammedov (2): KVM: x86 emulator: emulate MOVAPS KVM: x86 emulator: emulate MOVAPD arch

[PATCH kvm-unit-tests 2/2] emulator: movapd

2014-03-15 Thread Igor Mammedov
Signed-off-by: Igor Mammedov --- x86/emulator.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/x86/emulator.c b/x86/emulator.c index 1296a99..388db99 100644 --- a/x86/emulator.c +++ b/x86/emulator.c @@ -652,6 +652,13 @@ static void test_sse(sse_union *mem) mem->u[0] = 5; mem

[PATCH kvm-unit-tests 1/2] emulator: movaps

2014-03-15 Thread Igor Mammedov
Signed-off-by: Igor Mammedov --- x86/emulator.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/x86/emulator.c b/x86/emulator.c index 2e25dd8..1296a99 100644 --- a/x86/emulator.c +++ b/x86/emulator.c @@ -645,6 +645,13 @@ static void test_sse(sse_union *mem) mem->u[0] = 5; mem

[PATCH kvm-unit-tests 0/2] test MOVAPS and MOVAPD SSE instructions

2014-03-15 Thread Igor Mammedov
This series adds checks for MOVAPS and MOVAPD SSE instructions. It's used by MS HCK test on 32-bit Windows 8.1 Igor Mammedov (2): emulator: movaps emulator: movapd x86/emulator.c | 14 ++ 1 file changed, 14 insertions(+) -- 1.8.5.3 -- To unsubscribe from this list: sen

Re: release VCPUs while VM is running,

2014-05-28 Thread Igor Mammedov
On Wed, 28 May 2014 13:59:31 +0200 Anshul Makkar wrote: > Hi, > > Is there any work in progress on releasing VCPUs while the VM is still > in progress (Hot unplugging) ? As far as I know nobody works on it yet. > > The following patches were not accepted. > > Thanks > Anshul Makkar > www.just

Re: [Qemu-devel] [PATCH 1/2] target-i386: kvm: -cpu host: use GET_SUPPORTED_CPUID for SVM features

2013-01-02 Thread Igor Mammedov
pfthreshold,enforce > > refuse to start if the SVM "pfthreshold" feature is not supported by the > host (after we fix kvm_check_features_against_host() to check SVM flags > as well). > > Signed-off-by: Eduardo Habkost Reviewed-By: Igor Mammedov > --- > target-i38

Re: [Qemu-devel] [PATCH 2/2] target-i386: kvm: enable all supported KVM features for -cpu host

2013-01-02 Thread Igor Mammedov
On Fri, 28 Dec 2012 16:37:34 -0200 Eduardo Habkost wrote: > When using -cpu host, we don't need to use the kvm_default_features > variable, as the user is explicitly asking QEMU to enable all feature > supported by the host. > > This changes the kvm_cpu_fill_host() code to use GET_SUPPORTED_CPUI

Re: [Qemu-devel] [PATCH 2/2] target-i386: kvm: enable all supported KVM features for -cpu host

2013-01-02 Thread Igor Mammedov
On Wed, 2 Jan 2013 13:29:10 -0200 Eduardo Habkost wrote: > On Wed, Jan 02, 2013 at 03:52:45PM +0100, Igor Mammedov wrote: > > On Fri, 28 Dec 2012 16:37:34 -0200 > > Eduardo Habkost wrote: > > > > > When using -cpu host, we don't need to use the kvm_default_f

Re: [Qemu-devel] [PATCH qom-cpu 10/11] target-i386: Call kvm_check_features_against_host() only if CONFIG_KVM is set

2013-01-07 Thread Igor Mammedov
On Mon, 7 Jan 2013 10:00:09 -0200 Eduardo Habkost wrote: > On Sun, Jan 06, 2013 at 04:27:19PM +0200, Gleb Natapov wrote: > > On Fri, Jan 04, 2013 at 08:01:11PM -0200, Eduardo Habkost wrote: > > > This will be necessary once kvm_check_features_against_host() starts > > > using KVM-specific definit

Re: [Qemu-devel] [PATCH qom-cpu 10/11] target-i386: Call kvm_check_features_against_host() only if CONFIG_KVM is set

2013-01-07 Thread Igor Mammedov
On Mon, 7 Jan 2013 15:30:26 +0200 Gleb Natapov wrote: > On Mon, Jan 07, 2013 at 02:15:14PM +0100, Igor Mammedov wrote: > > On Mon, 7 Jan 2013 10:00:09 -0200 > > Eduardo Habkost wrote: > > > > > On Sun, Jan 06, 2013 at 04:27:19PM +0200, Gleb Natapov wrote: > &g

Re: [PATCH qom-cpu 2/7] target-i386: Don't set any KVM flag by default if KVM is disabled

2013-01-09 Thread Igor Mammedov
On Mon, 7 Jan 2013 16:20:43 -0200 Eduardo Habkost wrote: > This is a cleanup that tries to solve two small issues: > > - We don't need a separate kvm_pv_eoi_features variable just to keep a >constant calculated at compile-time, and this style would require >adding a separate variable (

Re: [Qemu-devel] [RFC 01/12] kvm: add KVM_FEATURE_CLOCKSOURCE_STABLE_BIT fake #define

2013-01-10 Thread Igor Mammedov
On Wed, 9 Jan 2013 16:53:41 -0200 Eduardo Habkost wrote: > Signed-off-by: Eduardo Habkost > --- > Cc: kvm@vger.kernel.org > Cc: Michael S. Tsirkin > Cc: Gleb Natapov > Cc: Marcelo Tosatti > --- > include/sysemu/kvm.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/sysemu/k

Re: [RFC 07/12] target-i386/cpu: Introduce apic_id_for_cpu() function

2013-01-10 Thread Igor Mammedov
On Wed, 9 Jan 2013 16:53:47 -0200 Eduardo Habkost wrote: > This function will be used by both the CPU initialization code and the > fw_cfg table initialization code. > > Later this function will be updated to generate APIC IDs according to > the CPU topology. > > Signed-off-by: Eduardo Habkost

Re: [RFC 12/12] pc: Generate APIC IDs according to CPU topology

2013-01-10 Thread Igor Mammedov
On Wed, 9 Jan 2013 16:53:52 -0200 Eduardo Habkost wrote: > This keeps compatibility on machine-types pc-1.2 and older, and prints a > warning in case the requested configuration won't get the correct > topology. > > I couldn't think of a better way to warn about broken topology when in > compat

Re: [RFC 02/12] target-i386: Don't set any KVM flag by default if KVM is disabled

2013-01-10 Thread Igor Mammedov
On Wed, 9 Jan 2013 16:53:42 -0200 Eduardo Habkost wrote: > This is a cleanup that tries to solve two small issues: > > - We don't need a separate kvm_pv_eoi_features variable just to keep a >constant calculated at compile-time, and this style would require >adding a separate variable (

Re: [Qemu-devel] [PATCH v7 06/35] acpi: add aml_method_serialized

2015-11-03 Thread Igor Mammedov
On Mon, 2 Nov 2015 17:13:08 +0800 Xiao Guangrong wrote: > It avoid explicit Mutex and will be used by NVDIMM ACPI > > Signed-off-by: Xiao Guangrong > --- > hw/acpi/aml-build.c | 26 -- > include/hw/acpi/aml-build.h | 1 + > 2 files changed, 25 insertions(+), 2

Re: [PATCH v7 09/35] exec: allow file_ram_alloc to work on file

2015-11-03 Thread Igor Mammedov
On Mon, 2 Nov 2015 17:13:11 +0800 Xiao Guangrong wrote: > Currently, file_ram_alloc() only works on directory - it creates a file > under @path and do mmap on it > > This patch tries to allow it to work on file directly, if @path is a > directory it works as before, otherwise it treats @path as

Re: [PATCH v7 27/35] nvdimm acpi: build ACPI nvdimm devices

2015-11-03 Thread Igor Mammedov
On Mon, 2 Nov 2015 17:13:29 +0800 Xiao Guangrong wrote: > NVDIMM devices is defined in ACPI 6.0 9.20 NVDIMM Devices > > There is a root device under \_SB and specified NVDIMM devices are under the > root device. Each NVDIMM device has _ADR which returns its handle used to > associate MEMDEV str

Re: [PATCH v7 27/35] nvdimm acpi: build ACPI nvdimm devices

2015-11-04 Thread Igor Mammedov
On Tue, 3 Nov 2015 22:22:40 +0800 Xiao Guangrong wrote: > > > On 11/03/2015 09:13 PM, Igor Mammedov wrote: > > On Mon, 2 Nov 2015 17:13:29 +0800 > > Xiao Guangrong wrote: > > > >> NVDIMM devices is defined in ACPI 6.0 9.20 NVDIMM Devices > >&g

  1   2   3   >