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
)); ret = kvm_getput_regs(env, 0); if (ret 0) { -- 1.7.10.4 Reviewed-by: Igor Mammedov imamm...@redhat.com -- Regards, Igor -- 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

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 imamm...@redhat.com 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-core may

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 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 ehabk...@redhat.com Reviewed-By: Igor Mammedov imamm...@redhat.com --- target-i386/cpu.c | 11 --- 1 file changed, 4 insertions

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 ehabk...@redhat.com 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

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 ehabk...@redhat.com 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 ehabk...@redhat.com wrote: When using -cpu host, we don't need to use the kvm_default_features

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 ehabk...@redhat.com 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

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 g...@redhat.com 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 ehabk...@redhat.com wrote: On Sun, Jan 06, 2013 at 04:27:19PM +0200, Gleb Natapov wrote: On Fri

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 d...@cloudswitch.com wrote: Fix duplicate name (kvmclock = kvm_clock2) also. Signed-off-by: Don Slutz d...@cloudswitch.com --- target-i386/cpu.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git

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

2012-07-31 Thread Igor Mammedov
- Original Message - From: Eduardo Habkost ehabk...@redhat.com To: Juan Quintela quint...@redhat.com, Anthony Liguori anth...@codemonkey.ws Cc: qemu-de...@nongnu.org, KVM devel mailing list kvm@vger.kernel.org Sent: Tuesday, July 31, 2012 5:40:14 PM Subject: Re: [Qemu-devel] KVM

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

[PATCH] Introduce x86_cpuinit.early_percpu_clock_init hook

2012-02-07 Thread Igor Mammedov
, 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 mtosa...@redhat.com for hook idea. Signed-off-by: Igor Mammedov imamm...@redhat.com --- arch/x86/include/asm/x86_init.h

Re: x86: kvmclock: abstract save/restore sched_clock_state

2012-02-08 Thread Igor Mammedov
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 Tosattimtosa...@redhat.com Acked-by: Igor Mammedov imamm...@redhat.com -- To unsubscribe from this list: send the line unsubscribe kvm

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 amit.s...@redhat.com To: Igor Mammedov imamm...@redhat.com Cc: Marcelo Tosatti mtosa...@redhat.com, kvm@vger.kernel.org, t...@linutronix.de, mi...@redhat.com, h...@zytor.com, x

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

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

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

2012-02-13 Thread Igor Mammedov
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. Fixes suspend

[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 imamm...@redhat.com --- 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

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_timestamp

[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: Igor Mammedov imamm

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 prevent

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

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

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 delta; +u64

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,

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 Bonzinipbonz...@redhat.com mailto:pbonz...@redhat.com wrote: Il 04/04/2012 03:18, Michael Roth ha scritto:

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

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 ehabk...@redhat.com 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

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 ehabk...@redhat.com wrote: Signed-off-by: Eduardo Habkost ehabk...@redhat.com --- Cc: kvm@vger.kernel.org Cc: Michael S. Tsirkin m...@redhat.com Cc: Gleb Natapov g...@redhat.com Cc: Marcelo Tosatti mtosa...@redhat.com ---

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 ehabk...@redhat.com 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:

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 ehabk...@redhat.com 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

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 ehabk...@redhat.com 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

Re: [Qemu-devel] vCPU hotplug roadmap

2013-01-30 Thread Igor Mammedov
On Wed, 30 Jan 2013 14:02:16 +0100 Andreas Färber afaer...@suse.de 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

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 afaer...@suse.de 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

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 afaer...@suse.de wrote: Am 04.02.2013 12:08, schrieb Igor Mammedov: On Sat, 2 Feb 2013 01:37:07 +0100 Andreas Färber afaer...@suse.de wrote: Move x86_def_t definition to header and embed into X86CPUClass. Register types per built

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 imamm...@redhat.com wrote: On Mon, 04 Feb 2013 13:52:32 +0100 Andreas Färber afaer...@suse.de wrote: Am 04.02.2013 12:08, schrieb Igor Mammedov: On Sat, 2 Feb 2013 01:37:07 +0100 Andreas Färber afaer...@suse.de 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 afaer...@suse.de wrote: Am 08.02.2013 10:03, schrieb Igor Mammedov: On Thu, 7 Feb 2013 13:08:19 -0200 Eduardo Habkost ehabk...@redhat.com wrote: On Tue, Feb 05, 2013 at 05:39:22PM +0100, Igor Mammedov wrote: From: Andreas Färber afaer

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 ehabk...@redhat.com 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 Fri, 08 Feb 2013 12:16:17 +0100

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 ehabk...@redhat.com 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 ehabk...@redhat.com wrote: On Fri, Feb 08, 2013 at 05:54:50PM +0100, Andreas Färber wrote

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 jan.kis...@web.de wrote: From: Jan Kiszka jan.kis...@siemens.com 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

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 ehabk...@redhat.com 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 jan.kis...@web.de wrote: From: Jan Kiszka jan.kis...@siemens.com Several issues fixed

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 jan.kis...@web.de wrote: On 2013-02-27 08:37, Igor Mammedov wrote: On Wed, 27 Feb 2013 00:26:38 -0300 Eduardo Habkost ehabk...@redhat.com wrote: On Tue, Feb 26, 2013 at 10:57:56PM +0100, Igor Mammedov wrote: On Sat, 23 Feb 2013 16:45:00

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

2013-02-27 Thread Igor Mammedov
much 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 jan.kis...@siemens.com Reviewed-By: Igor Mammedov imamm...@redhat.com --- Changes

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

2013-06-10 Thread Igor Mammedov
) || 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 Mammedov imamm...@redhat.com --- arch

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 afaer...@suse.de wrote: Change Monitor::mon_cpu to CPUState as well. In cpu_synchronize_all_states() use qemu_for_each_cpu() now. Reviewed-by: liguang lig.f...@cn.fujitsu.com Signed-off-by: Andreas Färber afaer...@suse.de --- cpus.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 pbonz...@redhat.com 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

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

2013-06-21 Thread Igor Mammedov
of sched_clock() would yield correct value. Signed-off-by: Igor Mammedov imamm...@redhat.com --- arch/x86/kernel/kvmclock.c | 11 +-- arch/x86/kernel/smpboot.c |2 +- arch/x86/mm/pageattr.c |4 ++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel

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

2013-06-21 Thread Igor Mammedov
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 at earliest possible time

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

2013-06-21 Thread Igor Mammedov
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 imamm...@redhat.com --- arch/x86/kernel/kvmclock.c |1 + 1 files changed, 1 insertions(+), 0

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 quint...@redhat.com 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.

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 afaer...@suse.de wrote: From: Igor Mammedov imamm...@redhat.com - since hyperv_* helper functions are used only in target-i386/kvm.c move them there as static helpers Requested-by: Eduardo Habkost ehabk...@redhat.com Signed-off-by: Igor

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 afaer...@suse.de 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

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 pbonz...@redhat.com 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

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 g...@redhat.com 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 pbonz...@redhat.com wrote: The data in leaf 0Dh depends on information from other feature bits

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 afaer...@suse.de 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?)

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 ehabk...@redhat.com 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

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 ehabk...@redhat.com 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-add won't accept arbitrary

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 ebl...@redhat.com 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

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

2014-02-10 Thread Igor Mammedov
conversion to X86CPU subclasses + KVM subclasses written by Andreas Färber afaer...@suse.de, Igor Mammedov imamm...@redhat.com. The host CPU model is special, as the feature flags depend on KVM being initialized. So it has its own class_init and instance_init function, and feature flags

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 pbonz...@redhat.com 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

[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 imamm...@redhat.com --- 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

[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 imamm...@redhat.com --- arch/x86/kvm/emulate.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git

[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 imamm...@redhat.com --- 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

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

2014-03-15 Thread Igor Mammedov
Signed-off-by: Igor Mammedov imamm...@redhat.com --- 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

[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: send

Re: release VCPUs while VM is running,

2014-05-28 Thread Igor Mammedov
On Wed, 28 May 2014 13:59:31 +0200 Anshul Makkar anshul.mak...@profitbricks.com 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

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 anshul.mak...@profitbricks.com 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

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

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

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 mtosa...@redhat.com 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 uses TSC

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 pbonz...@redhat.com wrote: Il 16/07/2014 15:55, Igor Mammedov ha scritto: On Wed, 16 Jul 2014 08:41:00 -0300 Marcelo Tosatti mtosa...@redhat.com wrote: On Wed, Jul 16, 2014 at 12:18:37PM +0200, Paolo Bonzini wrote: Il 16/07/2014 11:52

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 pbonz...@redhat.com 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 neither detection nor correction are 100

[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 Igor

[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 imamm...@redhat.com --- 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

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

2014-07-31 Thread Igor Mammedov
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 imamm...@redhat.com --- arch/x86/include/asm/cpufeature.h | 1 + arch/x86

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

2014-11-06 Thread Igor Mammedov
and other devices that use them. Signed-off-by: Igor Mammedov imamm...@redhat.com --- 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

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 ag...@suse.de 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

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 ag...@suse.de wrote: On 10.11.14 13:31, Igor Mammedov wrote: On Fri, 7 Nov 2014 22:18:45 +0100 Alexander Graf ag...@suse.de wrote: Memory slots have to be page aligned to get entered into KVM. There is existing logic that tries

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

2014-11-13 Thread Igor Mammedov
. Signed-off-by: Igor Mammedov imamm...@redhat.com --- 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

[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 pbonz...@redhat.com 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 like algorithm

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

2014-11-14 Thread Igor Mammedov
-id_to_index[mslots[i].id] = i; } static void update_memslots(struct kvm_memslots *slots, Reviewed-by: Igor Mammedov imamm...@redhat.com -- 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

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 pbonz...@redhat.com 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, where 1 slot

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ář rkrc...@redhat.com 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 pbonz...@redhat.com

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

2014-11-14 Thread Igor Mammedov
) { new.dirty_bitmap = NULL; Reviewed-by: Igor Mammedov imamm...@redhat.com -- 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
)); } - 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 imamm...@redhat.com -- To unsubscribe

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

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

[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 imamm...@redhat.com --- virt/kvm/kvm_main.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt

[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 imamm...@redhat.com --- include/linux

[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 imamm...@redhat.com --- virt/kvm/kvm_main.c | 28 +--- 1 file changed, 13 insertions(+), 15 deletions

[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 imamm...@redhat.com --- virt/kvm/kvm_main.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff

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 pbonz...@redhat.com 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 of Windows

Re: [PATCH] vhost: support upto 509 memory regions

2015-02-17 Thread Igor Mammedov
, Michael S. Tsirkin wrote: Increasing VHOST_MEMORY_MAX_NREGIONS from 65 to 509 to match KVM_USER_MEM_SLOTS fixes issue for vhost-net. Signed-off-by: Igor Mammedov imamm...@redhat.com This scares me a bit: each region is 32byte, we are talking a 16K allocation that userspace can

Re: [PATCH] vhost: support upto 509 memory regions

2015-02-17 Thread Igor Mammedov
for vhost-net. Signed-off-by: Igor Mammedov imamm...@redhat.com This scares me a bit: each region is 32byte, we are talking a 16K allocation that userspace can trigger. What's bad with a 16K allocation? It fails when memory is fragmented. How does kvm handle this issue

[PATCH] vhost: support upto 509 memory regions

2015-02-13 Thread Igor Mammedov
in module vhost-net refuses to accept more than 65 memory regions. Increasing VHOST_MEMORY_MAX_NREGIONS from 65 to 509 to match KVM_USER_MEM_SLOTS fixes issue for vhost-net. Signed-off-by: Igor Mammedov imamm...@redhat.com --- drivers/vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] kvm: avoid page allocation failure in kvm_set_memory_region()

2015-03-20 Thread Igor Mammedov
have to be present in physically contiguous (kmalloc-ed) address space, change allocation to kvm_kvzalloc() so that it will be vmalloc-ed when its size is more then a page. Signed-off-by: Igor Mammedov imamm...@redhat.com --- TODO: - work on follow up patches to allocate space for actual amount

[PATCH v2] kvm: avoid page allocation failure in kvm_set_memory_region()

2015-03-20 Thread Igor Mammedov
have to be present in physically contiguous (kmalloc-ed) address space, change allocation to kvm_kvzalloc() so that it will be vmalloc-ed when its size is more then a page. Signed-off-by: Igor Mammedov imamm...@redhat.com --- v2: - alloc initial memslots with vmalloc - use kvfree in every place

  1   2   3   >