Re: Why invtsc (CPUID_APM_INVTSC) is unmigratable?

2024-01-29 Thread Marcelo Tosatti
On Fri, Jan 26, 2024 at 04:16:57PM +0800, Xiaoyao Li wrote: > On 1/25/2024 6:05 AM, Marcelo Tosatti wrote: > > On Wed, Jan 24, 2024 at 10:52:46PM +0800, Xiaoyao Li wrote: > > > On 1/23/2024 11:39 PM, Marcelo Tosatti wrote: > > > > On Sat, Jan 20, 2024 at 05:4

Re: Why invtsc (CPUID_APM_INVTSC) is unmigratable?

2024-01-24 Thread Marcelo Tosatti
On Wed, Jan 24, 2024 at 10:52:46PM +0800, Xiaoyao Li wrote: > On 1/23/2024 11:39 PM, Marcelo Tosatti wrote: > > On Sat, Jan 20, 2024 at 05:44:07PM +0800, Xiaoyao Li wrote: > > > On 1/20/2024 12:14 AM, Marcelo Tosatti wrote: > > > > On Fri, Jan 19, 2024 at 02:4

Re: Why invtsc (CPUID_APM_INVTSC) is unmigratable?

2024-01-23 Thread Marcelo Tosatti
On Sat, Jan 20, 2024 at 05:44:07PM +0800, Xiaoyao Li wrote: > On 1/20/2024 12:14 AM, Marcelo Tosatti wrote: > > On Fri, Jan 19, 2024 at 02:46:22PM +0800, Xiaoyao Li wrote: > > > I'm wondering why CPUID_APM_INVTSC is set as unmigratable_flags. Could > > > anyone

Re: Why invtsc (CPUID_APM_INVTSC) is unmigratable?

2024-01-19 Thread Marcelo Tosatti
On Fri, Jan 19, 2024 at 02:46:22PM +0800, Xiaoyao Li wrote: > I'm wondering why CPUID_APM_INVTSC is set as unmigratable_flags. Could > anyone explain it? commit 68bfd0ad4a1dcc4c328d5db85dc746b49c1ec07e Author: Marcelo Tosatti Date: Wed May 14 16:30:09 2014 -0300 target-

Re: [PATCH] Add support for RAPL MSRs in KVM/Qemu

2023-06-28 Thread Marcelo Tosatti
On Fri, Jun 16, 2023 at 04:08:30PM +0200, Anthony Harivel wrote: > Starting with the "Sandy Bridge" generation, Intel CPUs provide a RAPL > interface (Running Average Power Limit) for advertising the accumulated > energy consumption of various power domains (e.g. CPU packages, DRAM, > etc.). > > T

[PATCH v2] kvm: reuse per-vcpu stats fd to avoid vcpu interruption

2023-06-17 Thread Marcelo Tosatti
x27;s main thread. Signed-off-by: Marcelo Tosatti --- v2: use convention for Error parameter order (Markus Armbruster) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 7679f397ae..9aa898db14 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -450,6 +450,8 @

[PATCH] kvm: reuse per-vcpu stats fd to avoid vcpu interruption

2023-06-13 Thread Marcelo Tosatti
KVM_GET_STATS_FD uses run_on_cpu to query per vcpu statistics, which interrupts the vcpu (and is unnecessary). To fix this, open the per vcpu stats fd on vcpu initialization, and read from that fd from QEMU's main thread. Signed-off-by: Marcelo Tosatti --- diff --git a/accel/kvm/kvm-all.c b/accel/kv

Re: [RFC PATCH] Add support for RAPL MSRs in KVM/Qemu

2023-05-26 Thread Marcelo Tosatti
On Wed, May 24, 2023 at 04:53:49PM +0200, Anthony Harivel wrote: > set=UTF-8 > Status: RO > Content-Length: 24102 > Lines: 667 > > Marcelo Tosatti, May 19, 2023 at 20:28: > > Hi Marcelo, > > > > > > +/* Assuming those values are the same a

Re: [RFC PATCH] Add support for RAPL MSRs in KVM/Qemu

2023-05-19 Thread Marcelo Tosatti
Hi Anthony, On Thu, May 18, 2023 at 04:26:51PM +0200, Anthony Harivel wrote: > Marcelo Tosatti, May 17, 2023 at 17:43: > > Hi Marcelo, > > > On Wed, May 17, 2023 at 03:07:30PM +0200, Anthony Harivel wrote: > > diff --git a/target/i386/cpu.h b/target/i386/cpu.h

Re: [RFC PATCH] Add support for RAPL MSRs in KVM/Qemu

2023-05-17 Thread Marcelo Tosatti
On Wed, May 17, 2023 at 03:07:30PM +0200, Anthony Harivel wrote: > Starting with the "Sandy Bridge" generation, Intel CPUs provide a RAPL > interface (Running Average Power Limit) for advertising the accumulated > energy consumption of various power domains (e.g. CPU packages, DRAM, > etc.). > > T

[PATCH 2/2] hw/i386/kvm/clock.c: read kvmclock from guest memory if !correct_tsc_shift

2023-01-19 Thread Marcelo Tosatti
FT bit indicates that the value retrieved by KVM_GET_CLOCK on the source is safe to be used. Signed-off-by: Marcelo Tosatti Index: qemu/hw/i386/kvm/clock.c === --- qemu.orig/hw/i386/kvm/clock.c +++ qemu/hw/i386/kvm/clock.c @@ -50,6

[PATCH 1/2] linux-headers: sync KVM_CLOCK_CORRECT_TSC_SHIFT flag

2023-01-19 Thread Marcelo Tosatti
Sync new KVM_CLOCK_CORRECT_TSC_SHIFT from upstream Linux headers. Signed-off-by: Marcelo Tosatti Index: qemu/linux-headers/linux/kvm.h === --- qemu.orig/linux-headers/linux/kvm.h +++ qemu/linux-headers/linux/kvm.h @@ -1300,6

[PATCH 0/2] read kvmclock from guest memory if !correct_tsc_shift

2023-01-19 Thread Marcelo Tosatti
Before kernel commit 78db6a5037965429c04d708281f35a6e5562d31b, kvm_guest_time_update() would use vcpu->virtual_tsc_khz to calculate tsc_shift value in the vcpus pvclock structure written to guest memory. For those kernels, if vcpu->virtual_tsc_khz != tsc_khz (which can be the case when guest state

Re: [PATCH] i386: Fix KVM_CAP_ADJUST_CLOCK capability check

2022-09-20 Thread Marcelo Tosatti
On Tue, Sep 20, 2022 at 04:40:24PM +0200, Vitaly Kuznetsov wrote: > KVM commit c68dc1b577ea ("KVM: x86: Report host tsc and realtime values in > KVM_GET_CLOCK") broke migration of certain workloads, e.g. Win11 + WSL2 > guest reboots immediately after migration. KVM, however, is not to > blame this

Re: [PATCH] target/i386: properly reset TSC on reset

2022-05-09 Thread Marcelo Tosatti
On Thu, Mar 24, 2022 at 06:31:36PM +0100, Paolo Bonzini wrote: > Some versions of Windows hang on reboot if their TSC value is greater > than 2^54. The calibration of the Hyper-V reference time overflows > and fails; as a result the processors' clock sources are out of sync. > > The issue is that

Re: constant_tsc support for SVM guest

2021-04-26 Thread Marcelo Tosatti
On Sun, Apr 25, 2021 at 12:19:11AM -0500, Wei Huang wrote: > > > On 4/23/21 4:27 PM, Eduardo Habkost wrote: > > On Fri, Apr 23, 2021 at 12:32:00AM -0500, Wei Huang wrote: > > > There was a customer request for const_tsc support on AMD guests. Right > > > now > > > this feature is turned off by d

Re: constant_tsc support for SVM guest

2021-04-26 Thread Marcelo Tosatti
Hi Wei, Eduardo, On Fri, Apr 23, 2021 at 05:27:44PM -0400, Eduardo Habkost wrote: > On Fri, Apr 23, 2021 at 12:32:00AM -0500, Wei Huang wrote: > > There was a customer request for const_tsc support on AMD guests. Right now > > this feature is turned off by default for QEMU x86 CPU types (in > >

Re: [RFC PATCH] i386: Add ratelimit for bus locks acquired in guest

2021-03-19 Thread Marcelo Tosatti
On Fri, Mar 19, 2021 at 10:59:20AM +0800, Chenyi Qiang wrote: > Hi Marcelo, > > Thank you for your comment. > > On 3/19/2021 1:32 AM, Marcelo Tosatti wrote: > > On Wed, Mar 17, 2021 at 04:47:09PM +0800, Chenyi Qiang wrote: > > > Virtual Machines can exploit bus lo

Re: [PATCH 3/3] i386: Make sure kvm_arch_set_tsc_khz() succeeds on migration when 'hv-reenlightenment' was exposed

2021-03-18 Thread Marcelo Tosatti
On Thu, Mar 18, 2021 at 05:38:00PM +0100, Vitaly Kuznetsov wrote: > Paolo Bonzini writes: > > > On 18/03/21 17:02, Vitaly Kuznetsov wrote: > >> KVM doesn't fully support Hyper-V reenlightenment notifications on > >> migration. In particular, it doesn't support emulating TSC frequency > >> of the

Re: [RFC PATCH] i386: Add ratelimit for bus locks acquired in guest

2021-03-18 Thread Marcelo Tosatti
On Wed, Mar 17, 2021 at 04:47:09PM +0800, Chenyi Qiang wrote: > Virtual Machines can exploit bus locks to degrade the performance of > system. To address this kind of performance DOS attack, bus lock VM exit > is introduced in KVM and it will report the bus locks detected in guest, > which can help

Re: [PATCH-for-5.0 1/2] hw/acpi/piix4: Add 'system-hotplug-support' property

2020-08-04 Thread Marcelo Tosatti
On Mon, Aug 03, 2020 at 07:10:11PM +0200, Philippe Mathieu-Daudé wrote: > Hi Igor, Paolo. > > On 3/23/20 12:04 PM, Marcelo Tosatti wrote: > > On Mon, Mar 23, 2020 at 09:05:06AM +0100, Paolo Bonzini wrote: > >> On 22/03/20 17:27, Philippe Mathieu-Daudé wrote: >

[PATCH v2] kvm: i386: allow TSC to differ by NTP correction bounds without TSC scaling

2020-06-16 Thread Marcelo Tosatti
remains the same: in case of a different frequency between host and VM, KVM_SET_TSC_KHZ will fail and QEMU will exit. Signed-off-by: Marcelo Tosatti --- v2: ensure behaviour is unchanged for older kernels and improve changelogs (Paolo) diff --git a/target/i386/kvm.c b/target/i386/kvm.c index

[PATCH] kvm: i386: allow TSC to differ by NTP correction bounds without TSC scaling

2020-06-15 Thread Marcelo Tosatti
a conservative 250ppm error between host TSC and VM TSC frequencies, rather than requiring an exact match. NTP daemon in the guest can correct this difference. Also change migration to accept this bound. Signed-off-by: Marcelo Tosatti diff --git a/target/i386/kvm.c b/target/i386/kvm.c index

Re: [PATCH-for-5.0 1/2] hw/acpi/piix4: Add 'system-hotplug-support' property

2020-03-23 Thread Marcelo Tosatti
On Mon, Mar 23, 2020 at 09:05:06AM +0100, Paolo Bonzini wrote: > On 22/03/20 17:27, Philippe Mathieu-Daudé wrote: > >>> > >> That 'ugly' is typically used within QEMU to deal with such things > >> probably due to its low complexity. > > > > OK. Can you point me to the documentation for this featur

Re: [PATCH v2] mc146818rtc: fix timer interrupt reinjection

2019-11-18 Thread Marcelo Tosatti
On Sun, Nov 17, 2019 at 11:12:43AM +0100, Paolo Bonzini wrote: > On 17/11/19 05:31, Alex Williamson wrote: > > The 'merge' option gives me a similar error. The 'delay' option is > > the only other choice where I can actually start the VM, but this > > results in the commandline: > > > > -rtc base

Re: [PATCH v2] mc146818rtc: fix timer interrupt reinjection

2019-11-16 Thread Marcelo Tosatti
On Sat, Nov 16, 2019 at 01:58:55PM -0700, Alex Williamson wrote: > On Thu, 10 Oct 2019 09:30:08 -0300 > Marcelo Tosatti wrote: > > > commit 369b41359af46bded5799c9ef8be2b641d92e043 broke timer interrupt > > reinjection when there is no period change by the guest.

Re: [PATCH] mc146818rtc: fix timer interrupt reinjection

2019-10-10 Thread Marcelo Tosatti
On Wed, Oct 09, 2019 at 11:13:16PM +0200, Paolo Bonzini wrote: > On 09/10/19 20:40, Marcelo Tosatti wrote: > > s->period = period; > > lost_clock += old_irq_coalesced * old_period; > > -s->irq_coalesced = lost_clock / s->period; &

[PATCH v2] mc146818rtc: fix timer interrupt reinjection

2019-10-10 Thread Marcelo Tosatti
NTP. Easily reproducible by playing a fullscreen video with cirrus and VNC. Fix by not updating s->irq_coalesced when old_period is 0. V2: reorganize code (Paolo Bonzini) Signed-off-by: Marcelo Tosatti diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c index 6cb378751b..0e7cf97

[PATCH] mc146818rtc: fix timer interrupt reinjection

2019-10-09 Thread Marcelo Tosatti
NTP. Easily reproducible by playing a fullscreen video with cirrus and VNC. Fix by not updating s->irq_coalesced when old_period is 0. Signed-off-by: Marcelo Tosatti diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c index 6cb378751b..aabffa8c67 100644 --- a/hw/timer/mc146818rt

Re: [Qemu-devel] [PATCH] migration: Do not re-read the clock on pre_save in case of paused guest

2019-09-02 Thread Marcelo Tosatti
Looks good. Reviewed-by: Marcelo Tosatti On Thu, Aug 29, 2019 at 06:18:42PM -0300, Eduardo Habkost wrote: > CCing Marcelo, who wrote kvm_update_clock() and > kvmclock_pre_save(). > > On Thu, Aug 29, 2019 at 06:07:11PM -0300, Maxiwell S. Garcia wrote: > > The clock move mak

Re: [Qemu-devel] [PATCH-for-4.2 v2] Only enable the halt poll control MSR if it is supported by the host

2019-08-28 Thread Marcelo Tosatti
On Wed, Aug 28, 2019 at 12:22:59PM -0500, Mark Kanda wrote: > Gentle ping - I would like to confirm this patch is acceptable. > > Thanks/regards, > -Mark ACK > > On 7/17/2019 9:38 AM, Mark Kanda wrote: > >The halt poll control MSR should only be enabled on hosts which > >support it. > > > >Fixe

Re: [Qemu-devel] [PATCH v2] scsi: lsi: exit infinite loop while executing script (CVE-2019-12068)

2019-08-08 Thread Marcelo Tosatti
et the > DSTAT.IID bit. > > Illegal Instruction Detected > > This status bit is set any time an illegal or reserved > instruction opcode is detected, whether the LSI53C895A > is operating in single step mode or automatically > executing SCSI SCRIPTS. Sounds the corre

[Qemu-devel] [patch QEMU] kvm: i386: halt poll control MSR support

2019-06-03 Thread Marcelo Tosatti
(CC'ing qemu devel) Add support for halt poll control MSR: save/restore, migration and new feature name. The purpose of this MSR is to allow the guest to disable host halt poll. Signed-off-by: Marcelo Tosatti diff --git a/include/standard-headers/asm-x86/kvm_para.h b/include/standard-he

Re: [Qemu-devel] [PATCH v2 0/2] kvm: x86 CPU power management

2018-06-15 Thread Marcelo Tosatti
On Thu, Jun 14, 2018 at 02:37:28AM +0300, Michael S. Tsirkin wrote: > On Wed, Jun 13, 2018 at 07:34:53PM -0300, Marcelo Tosatti wrote: > > On Tue, Jun 12, 2018 at 09:47:11PM +0300, Michael S. Tsirkin wrote: > > > This adds ability to expose host CPU power management capabiliti

Re: [Qemu-devel] [PATCH v2 0/2] kvm: x86 CPU power management

2018-06-13 Thread Marcelo Tosatti
On Tue, Jun 12, 2018 at 09:47:11PM +0300, Michael S. Tsirkin wrote: > This adds ability to expose host CPU power management capabilities to > guests. For intel guests, this is sufficient for guest to enable > low power CPU power management. For AMD guests it isn't sufficient, > deeper C-states are

Re: [Qemu-devel] [PATCH v3 1/2] i386/kvm: add support for Hyper-V reenlightenment MSRs

2018-03-22 Thread Marcelo Tosatti
On Tue, Mar 20, 2018 at 06:34:59PM +0100, Vitaly Kuznetsov wrote: > KVM recently gained support for Hyper-V Reenlightenment MSRs which are > required to make KVM-on-Hyper-V enable TSC page clocksource to its guests > when INVTSC is not passed to it (and it is not passed by default in Qemu > as it e

[Qemu-devel] [PATCH v2] qemu: improve hugepage allocation failure message

2018-01-15 Thread Marcelo Tosatti
Improve hugepage allocation failure message, indicating what is happening to the user. Signed-off-by: Marcelo Tosatti --- v2: move to allocate_system_memory_nonnuma (Paolo) s/whats/what is/ (Eric) diff --git a/numa.c b/numa.c index 7b9c33a..1f1aff1 100644 --- a/numa.c +++ b/numa.c

[Qemu-devel] [PATCH] qemu: improve hugepage allocation failure message

2018-01-09 Thread Marcelo Tosatti
Improve hugepage allocation failure message, indicating whats happening to the user. Signed-off-by: Marcelo Tosatti diff --git a/exec.c b/exec.c index 4722e521d4..439abedb98 100644 --- a/exec.c +++ b/exec.c @@ -1643,7 +1643,8 @@ static void *file_ram_alloc(RAMBlock *block

[Qemu-devel] [patch 0/2] support RT_PRIO_HC hypercall

2017-09-21 Thread Marcelo Tosatti
Add the following CPU options: allow-rt-prio-hc: allow guest to execute hypercall to change vcpu thread priority. rt-prio: SCHED_FIFO priority to be used when that hypercall is invoked. Signed-off-by: Marcelo Tosatti

[Qemu-devel] [patch 2/2] qemu: kvm: support RT_PRIO_HC hypercall

2017-09-21 Thread Marcelo Tosatti
Add the following CPU options: allow-rt-prio-hc: allow guest to execute hypercall to change vcpu thread priority. rt-prio: SCHED_FIFO priority to be used when that hypercall is invoked. See kernel patchset for details about this hypercall. Signed-off-by: Marcelo Tosatti --- target/i386

[Qemu-devel] [patch 1/2] qemu: sync linux-headers with KVM

2017-09-21 Thread Marcelo Tosatti
Signed-off-by: Marcelo Tosatti Index: qemu-fifoprio/linux-headers/linux/kvm.h === --- qemu-fifoprio.orig/linux-headers/linux/kvm.h +++ qemu-fifoprio/linux-headers/linux/kvm.h @@ -929,6 +929,7 @@ struct kvm_ppc_resize_hpt { #define

Re: [Qemu-devel] [PATCH v2 0/4] i386/kvm: advertise Hyper-V frequency MSRs

2017-08-08 Thread Marcelo Tosatti
kvm: advertise Hyper-V frequency MSRs > > target/i386/kvm.c | 138 > -- > 1 file changed, 71 insertions(+), 67 deletions(-) > > -- > 2.9.3 Signed-off-by: Marcelo Tosatti

Re: [Qemu-devel] [svt-core] [PATCH] kvmclock: update system_time_msr address forcibly

2017-05-24 Thread Marcelo Tosatti
On Wed, May 24, 2017 at 06:54:09PM +0300, Roman Kagan wrote: > On Wed, May 24, 2017 at 05:07:24PM +0300, Denis Plotnikov wrote: > > Do an update of system_time_msr address every time before reading > > the value of tsc_timestamp from guest's kvmclock page. > > > > It should be done in a forcible m

Re: [Qemu-devel] [PATCH 1/2] acpi_piix4: fix migration of gpe fields

2017-03-20 Thread Marcelo Tosatti
p://git.qemu-project.org/?p=qemu.git;a=commitdiff;h=b0b873a07872f7ab7f66f259c73fb9dd42aa66a9>: > > Am 15.11.2012 um 01:11 schrieb Marcelo Tosatti: > > Migrate 16 bytes for en/sts fields (which is the correct size), > > increase version to 3, and document how to support incomi

Re: [Qemu-devel] [QEMU PATCH v2] kvmclock: advance clock by time window between vm_stop and pre_save

2017-02-07 Thread Marcelo Tosatti
On Tue, Feb 07, 2017 at 06:02:13PM +0800, Wanpeng Li wrote: > 2016-11-08 3:41 GMT+08:00 Marcelo Tosatti : > > On Mon, Nov 07, 2016 at 03:46:11PM +, Dr. David Alan Gilbert wrote: > >> * Marcelo Tosatti (mtosa...@redhat.com) wrote: > >> > This patch, relative

[Qemu-devel] [patch 1/2] kvm: sync linux headers

2017-02-02 Thread Marcelo Tosatti
Sync linux headers. Signed-off-by: Marcelo Tosatti --- linux-headers/asm-x86/kvm.h |5 + linux-headers/asm-x86/kvm_para.h | 13 - linux-headers/linux/kvm.h|8 ++-- linux-headers/linux/kvm_para.h |7 +++ 4 files changed, 30 insertions(+), 3

[Qemu-devel] [patch 2/2] kvm: introduce cpu flag to enable cpu frequency changes via hypercall

2017-02-02 Thread Marcelo Tosatti
Guests with DPDK, whose vcpus run isolated on physical CPUs, want to control the frequency of such physical CPUs. Introduce a allow-freq-hc CPU flag to enable such hypercalls. Signed-off-by: Marcelo Tosatti --- target/i386/cpu.c |1 + target/i386/cpu.h |6 ++ target/i386

[Qemu-devel] [patch 0/2] qemu support for kvm cpu freq hypercalls

2017-02-02 Thread Marcelo Tosatti
Add a new cpu flag to allow vCPUs to perform frequency change hypercalls from userspace. See the kernel patchseries for more details.

Re: [Qemu-devel] kvmclock in wrong compat macro?

2017-01-20 Thread Marcelo Tosatti
On Wed, Jan 18, 2017 at 04:03:08PM +, Dr. David Alan Gilbert wrote: > Hi Marcelo, >In commit 6053a86 'kvmclock: reduce kvmclock differences on migration' > you add a 'x-mach-use-reliable-get-clock' and a compatibility entry > that turns it off; if I'm reading it right though it got merged >

[Qemu-devel] [qemu PATCH] pc.h: move x-mach-use-reliable-get-clock compat entry to PC_COMPAT_2_8

2017-01-20 Thread Marcelo Tosatti
it should have gone into PC_COMPAT_2_8. Fix it by moving the entry to PC_COMPAT_2_8. Signed-off-by: Marcelo Tosatti diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index b22e699..738bfd6 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -375,14 +375,15 @@ int e820_get_num_

Re: [Qemu-devel] [PATCH v3 0/2] Allow migration with invtsc if TSC frequency is explicitly set

2017-01-18 Thread Marcelo Tosatti
hen TSC frequency is not > specified explicitly. It will be a bit more complex because it > requires either letting the destination abort the migration, or > sending TSC frequency/scaling information from destination to > source. > > --- > Cc: Marcelo Tosatti > Cc: &

Re: [Qemu-devel] TSC frequency configuration & invtsc migration (was Re: [PATCH 4/4] kvm: Allow migration with invtsc)

2017-01-18 Thread Marcelo Tosatti
On Tue, Jan 10, 2017 at 05:36:48PM +0100, Paolo Bonzini wrote: > > > On 05/01/2017 11:48, Marcelo Tosatti wrote: > >> Host A has TSC scaling, host B doesn't have TSC scaling. We want > >> to be able to start the VM on host A, and migrate to B. In this > >&g

Re: [Qemu-devel] TSC frequency configuration & invtsc migration (was Re: [PATCH 4/4] kvm: Allow migration with invtsc)

2017-01-06 Thread Marcelo Tosatti
On Thu, Jan 05, 2017 at 10:19:50AM -0200, Eduardo Habkost wrote: > On Thu, Jan 05, 2017 at 08:48:32AM -0200, Marcelo Tosatti wrote: > > On Wed, Jan 04, 2017 at 11:36:31PM -0200, Eduardo Habkost wrote: > > > On Wed, Jan 04, 2017 at 08:26:27PM -0200, Marcelo Tosatti wrote: >

Re: [Qemu-devel] TSC frequency configuration & invtsc migration (was Re: [PATCH 4/4] kvm: Allow migration with invtsc)

2017-01-05 Thread Marcelo Tosatti
On Thu, Jan 05, 2017 at 08:48:32AM -0200, Marcelo Tosatti wrote: > > Note that even if we follow your suggestion and implement an > > alternative version of patch 4/4 to cover your use case, I will > > strongly recommend libvirt developers to support configuring TSC > > f

Re: [Qemu-devel] TSC frequency configuration & invtsc migration (was Re: [PATCH 4/4] kvm: Allow migration with invtsc)

2017-01-05 Thread Marcelo Tosatti
On Wed, Jan 04, 2017 at 11:36:31PM -0200, Eduardo Habkost wrote: > On Wed, Jan 04, 2017 at 08:26:27PM -0200, Marcelo Tosatti wrote: > > On Wed, Jan 04, 2017 at 05:59:17PM -0200, Eduardo Habkost wrote: > > > On Wed, Jan 04, 2017 at 11:39:16AM -0200, Eduardo Habkost wrote: >

Re: [Qemu-devel] TSC frequency configuration & invtsc migration (was Re: [PATCH 4/4] kvm: Allow migration with invtsc)

2017-01-04 Thread Marcelo Tosatti
On Wed, Jan 04, 2017 at 05:59:17PM -0200, Eduardo Habkost wrote: > On Wed, Jan 04, 2017 at 11:39:16AM -0200, Eduardo Habkost wrote: > > On Wed, Jan 04, 2017 at 09:56:56AM -0200, Marcelo Tosatti wrote: > > > On Tue, Dec 27, 2016 at 05:21:20PM -0200, Eduardo Habkost wrote:

Re: [Qemu-devel] [PATCH 2/4] kvm: Allow invtsc migration if tsc-khz is set explicitly

2017-01-04 Thread Marcelo Tosatti
On Wed, Jan 04, 2017 at 11:40:17AM -0200, Eduardo Habkost wrote: > On Wed, Jan 04, 2017 at 09:44:06AM -0200, Marcelo Tosatti wrote: > > On Tue, Dec 27, 2016 at 05:21:18PM -0200, Eduardo Habkost wrote: > > > We can safely allow a VM to be migrated with invtsc enabled if &g

Re: [Qemu-devel] [PATCH 4/4] kvm: Allow migration with invtsc

2017-01-04 Thread Marcelo Tosatti
On Tue, Dec 27, 2016 at 05:21:20PM -0200, Eduardo Habkost wrote: > Instead of blocking migration on the source when invtsc is > enabled, rely on the migration destination to ensure there's no > TSC frequency mismatch. > > We can't allow migration unconditionally because we don't know if > the dest

Re: [Qemu-devel] [PATCH 2/4] kvm: Allow invtsc migration if tsc-khz is set explicitly

2017-01-04 Thread Marcelo Tosatti
On Wed, Jan 04, 2017 at 09:44:06AM -0200, Marcelo Tosatti wrote: > On Tue, Dec 27, 2016 at 05:21:18PM -0200, Eduardo Habkost wrote: > > We can safely allow a VM to be migrated with invtsc enabled if > > tsc-khz is set explicitly, because QEMU already refuses to start > > if

Re: [Qemu-devel] [PATCH 2/4] kvm: Allow invtsc migration if tsc-khz is set explicitly

2017-01-04 Thread Marcelo Tosatti
On Tue, Dec 27, 2016 at 05:21:18PM -0200, Eduardo Habkost wrote: > We can safely allow a VM to be migrated with invtsc enabled if > tsc-khz is set explicitly, because QEMU already refuses to start > if it can't set the TSC frequency to the configured value. On the source host, yes, but on the dest

Re: [Qemu-devel] [PATCH 1/4] kvm: Simplify invtsc check

2016-12-29 Thread Marcelo Tosatti
+invtsc_mig_blocker == NULL) { > /* for migration */ > error_setg(&invtsc_mig_blocker, > "State blocked by non-migratable CPU device" > -- > 2.7.4 Reviewed-by: Marcelo Tosatti

Re: [Qemu-devel] [qemu patch V4 2/2] kvmclock: reduce kvmclock difference on migration

2016-12-19 Thread Marcelo Tosatti
On Fri, Dec 16, 2016 at 11:41:36AM -0200, Eduardo Habkost wrote: > On Fri, Dec 16, 2016 at 11:03:33AM +0100, Paolo Bonzini wrote: > > I'd like to make a few cleanups and add more documentation: > > > > Looks good to me. > > Reviewed-by: Eduardo Habkost +1

Re: [Qemu-devel] [qemu patch V4 2/2] kvmclock: reduce kvmclock difference on migration

2016-12-12 Thread Marcelo Tosatti
On Mon, Dec 12, 2016 at 04:01:05PM -0200, Eduardo Habkost wrote: > On Sat, Dec 10, 2016 at 03:21:50PM -0200, Marcelo Tosatti wrote: > [...] > > static void kvmclock_realize(DeviceState *dev, Error **errp) > > { > > KVMClockState *s = KVM_CLOCK

Re: [Qemu-devel] [qemu patch V4 2/2] kvmclock: reduce kvmclock difference on migration

2016-12-12 Thread Marcelo Tosatti
/* > > * If the VM is stopped, declare the clock state valid to > > * avoid re-reading it on next vmsave (which would return > > * a different value). Will be reset when the VM is continued. > > */ > > But the comment is bogus: vm_

[Qemu-devel] [qemu patch V4 2/2] kvmclock: reduce kvmclock difference on migration

2016-12-10 Thread Marcelo Tosatti
. */ But the comment is bogus: vm_state_change is never called twice in a row with running=0 or running=1. Signed-off-by: Marcelo Tosatti --- hw/i386/kvm/clock.c| 107 ++--- include/hw/i386/pc.h |5 ++ target-i386/kvm.c |7 +++ target-i386

[Qemu-devel] [qemu patch V4 1/2] kvm: sync linux headers

2016-12-10 Thread Marcelo Tosatti
Import KVM_CLOCK_TSC_STABLE. Signed-off-by: Marcelo Tosatti diff --git a/include/standard-headers/linux/input.h b/include/standard-headers/linux/input.h index 7361a16..b472b85 100644 --- a/include/standard-headers/linux/input.h +++ b/include/standard-headers/linux/input.h @@ -245,6 +245,7

[Qemu-devel] [qemu patch V4 0/2] improve kvmclock difference on migration

2016-12-10 Thread Marcelo Tosatti
See individual patches for details. This patchset depends on kernels "[PATCH] kvm: kvmclock: let KVM_GET_CLOCK return whether the master clock is in use" from Paolo.

Re: [Qemu-devel] [qemu patch V3 2/2] kvmclock: reduce kvmclock difference on migration

2016-12-05 Thread Marcelo Tosatti
On Mon, Dec 05, 2016 at 01:17:42PM -0200, Eduardo Habkost wrote: > On Fri, Dec 02, 2016 at 08:30:35PM -0200, Marcelo Tosatti wrote: > > On Fri, Dec 02, 2016 at 11:56:09AM -0200, Eduardo Habkost wrote: > > > On Thu, Dec 01, 2016 at 12:39:03PM -0200, Marcelo Tosatti wrote: >

Re: [Qemu-devel] [qemu patch V3 2/2] kvmclock: reduce kvmclock difference on migration

2016-12-02 Thread Marcelo Tosatti
On Fri, Dec 02, 2016 at 11:56:09AM -0200, Eduardo Habkost wrote: > On Thu, Dec 01, 2016 at 12:39:03PM -0200, Marcelo Tosatti wrote: > > On Wed, Nov 30, 2016 at 11:09:28AM -0200, Eduardo Habkost wrote: > > > On Tue, Nov 29, 2016 at 09:54:29PM -0200, Marcelo Tosatti wrote: >

Re: [Qemu-devel] [qemu patch V3 2/2] kvmclock: reduce kvmclock difference on migration

2016-12-02 Thread Marcelo Tosatti
On Wed, Nov 30, 2016 at 11:09:28AM -0200, Eduardo Habkost wrote: > On Tue, Nov 29, 2016 at 09:54:29PM -0200, Marcelo Tosatti wrote: > > On Tue, Nov 29, 2016 at 10:34:05AM -0200, Eduardo Habkost wrote: > > > On Tue, Nov 29, 2016 at 08:56:00AM -0200, Marcelo Tosatti wrote: >

Re: [Qemu-devel] [qemu patch V3 2/2] kvmclock: reduce kvmclock difference on migration

2016-11-29 Thread Marcelo Tosatti
On Tue, Nov 29, 2016 at 10:34:05AM -0200, Eduardo Habkost wrote: > On Tue, Nov 29, 2016 at 08:56:00AM -0200, Marcelo Tosatti wrote: > > On Mon, Nov 28, 2016 at 03:12:01PM -0200, Eduardo Habkost wrote: > > > On Mon, Nov 28, 2016 at 02:45:24PM -0200, Marcelo Tosatti wrote: >

Re: [Qemu-devel] [qemu patch V3 2/2] kvmclock: reduce kvmclock difference on migration

2016-11-29 Thread Marcelo Tosatti
On Mon, Nov 28, 2016 at 03:12:01PM -0200, Eduardo Habkost wrote: > On Mon, Nov 28, 2016 at 02:45:24PM -0200, Marcelo Tosatti wrote: > > On Mon, Nov 28, 2016 at 12:13:22PM -0200, Eduardo Habkost wrote: > > > Sorry for not noticing the following issues on the previous > &g

Re: [Qemu-devel] [qemu patch V3 2/2] kvmclock: reduce kvmclock difference on migration

2016-11-28 Thread Marcelo Tosatti
On Mon, Nov 28, 2016 at 12:13:22PM -0200, Eduardo Habkost wrote: > Sorry for not noticing the following issues on the previous > reviews. I was only paying attention to the vmstate and machine > code: > > On Mon, Nov 21, 2016 at 08:50:04AM -0200, Marcelo Tosatti wrote

Re: [Qemu-devel] [qemu patch 2/2] kvmclock: reduce kvmclock difference on migration

2016-11-28 Thread Marcelo Tosatti
On Mon, Nov 28, 2016 at 02:47:18PM +0100, Paolo Bonzini wrote: > > > On 17/11/2016 13:16, Marcelo Tosatti wrote: > > What QEMU wants is to use KVM_GET_CLOCK at pre_save independently > > of whether masterclock is enabled or not... it just depends > > on KVM_GET_

Re: [Qemu-devel] [qemu patch V3 0/2] improve kvmclock difference on migration

2016-11-28 Thread Marcelo Tosatti
On Mon, Nov 21, 2016 at 08:50:02AM -0200, Marcelo Tosatti wrote: > See individual patches for details. This patchset depends on kernels > "[PATCH] kvm: kvmclock: let KVM_GET_CLOCK return whether the master > clock is in use" from Paolo. Ping?

[Qemu-devel] [qemu patch V3 1/2] kvm: sync linux headers

2016-11-21 Thread Marcelo Tosatti
Import KVM_CLOCK_TSC_STABLE. Signed-off-by: Marcelo Tosatti diff --git a/include/standard-headers/linux/input.h b/include/standard-headers/linux/input.h index 7361a16..b472b85 100644 --- a/include/standard-headers/linux/input.h +++ b/include/standard-headers/linux/input.h @@ -245,6 +245,7

[Qemu-devel] [qemu patch V3 2/2] kvmclock: reduce kvmclock difference on migration

2016-11-21 Thread Marcelo Tosatti
(when max_downtime == 5s). Signed-off-by: Marcelo Tosatti --- hw/i386/kvm/clock.c| 107 ++--- include/hw/i386/pc.h |5 ++ target-i386/kvm.c |7 +++ target-i386/kvm_i386.h |1 4 files changed, 106 insertions(+), 14 deletions(-) v2

[Qemu-devel] [qemu patch V3 0/2] improve kvmclock difference on migration

2016-11-21 Thread Marcelo Tosatti
See individual patches for details. This patchset depends on kernels "[PATCH] kvm: kvmclock: let KVM_GET_CLOCK return whether the master clock is in use" from Paolo.

Re: [Qemu-devel] [qemu patch V2 2/2] kvmclock: reduce kvmclock difference on migration

2016-11-17 Thread Marcelo Tosatti
On Thu, Nov 17, 2016 at 04:16:09PM -0200, Eduardo Habkost wrote: > On Thu, Nov 17, 2016 at 03:15:35PM -0200, Marcelo Tosatti wrote: > > On Thu, Nov 17, 2016 at 12:11:26PM -0200, Eduardo Habkost wrote: > > > On Thu, Nov 17, 2016 at 11:24:13AM -0200, Marcelo Tosatti wrote:

Re: [Qemu-devel] [qemu patch V2 2/2] kvmclock: reduce kvmclock difference on migration

2016-11-17 Thread Marcelo Tosatti
On Thu, Nov 17, 2016 at 03:15:03PM +0100, Paolo Bonzini wrote: > > > On 17/11/2016 15:11, Eduardo Habkost wrote: > > On Thu, Nov 17, 2016 at 11:24:13AM -0200, Marcelo Tosatti wrote: > >> Check for KVM_CAP_ADJUST_CLOCK capability KVM_CLOCK_TSC_STABLE, which > >

Re: [Qemu-devel] [qemu patch V2 2/2] kvmclock: reduce kvmclock difference on migration

2016-11-17 Thread Marcelo Tosatti
On Thu, Nov 17, 2016 at 12:11:26PM -0200, Eduardo Habkost wrote: > On Thu, Nov 17, 2016 at 11:24:13AM -0200, Marcelo Tosatti wrote: > > Check for KVM_CAP_ADJUST_CLOCK capability KVM_CLOCK_TSC_STABLE, which > > indicates that KVM_GET_CLOCK returns a value as seen by the guest at

[Qemu-devel] [qemu patch V2 2/2] kvmclock: reduce kvmclock difference on migration

2016-11-17 Thread Marcelo Tosatti
(when max_downtime == 5s). Signed-off-by: Marcelo Tosatti --- hw/i386/kvm/clock.c| 108 ++--- include/hw/i386/pc.h |5 ++ target-i386/kvm.c |7 +++ target-i386/kvm_i386.h |1 4 files changed, 107 insertions(+), 14 deletions(-) v2

[Qemu-devel] [qemu patch V2 1/2] kvm: sync linux headers

2016-11-17 Thread Marcelo Tosatti
Import KVM_CLOCK_TSC_STABLE. Signed-off-by: Marcelo Tosatti diff --git a/include/standard-headers/linux/input.h b/include/standard-headers/linux/input.h index 7361a16..b472b85 100644 --- a/include/standard-headers/linux/input.h +++ b/include/standard-headers/linux/input.h @@ -245,6 +245,7

[Qemu-devel] [qemu patch V2 0/2] improve kvmclock difference on migration

2016-11-17 Thread Marcelo Tosatti
See individual patches for details. This patchset depends on the not yet applied "[PATCH] kvm: kvmclock: let KVM_GET_CLOCK return whether the master clock is in use" from Paolo.

Re: [Qemu-devel] [qemu patch 2/2] kvmclock: reduce kvmclock difference on migration

2016-11-17 Thread Marcelo Tosatti
On Mon, Nov 14, 2016 at 04:15:18PM -0200, Marcelo Tosatti wrote: > On Mon, Nov 14, 2016 at 06:20:29PM +0100, Paolo Bonzini wrote: > > > > > > On 14/11/2016 18:13, Marcelo Tosatti wrote: > > > On Mon, Nov 14, 2016 at 05:43:33PM +0100, Paolo Bonzini wrote: > >

Re: [Qemu-devel] [qemu patch 2/2] kvmclock: reduce kvmclock difference on migration

2016-11-14 Thread Marcelo Tosatti
On Mon, Nov 14, 2016 at 06:20:29PM +0100, Paolo Bonzini wrote: > > > On 14/11/2016 18:13, Marcelo Tosatti wrote: > > On Mon, Nov 14, 2016 at 05:43:33PM +0100, Paolo Bonzini wrote: > >> > >> > >> On 14/11/2016 16:40, Marcelo Tosatti wrote: > >&g

Re: [Qemu-devel] [qemu patch 2/2] kvmclock: reduce kvmclock difference on migration

2016-11-14 Thread Marcelo Tosatti
On Mon, Nov 14, 2016 at 05:43:33PM +0100, Paolo Bonzini wrote: > > > On 14/11/2016 16:40, Marcelo Tosatti wrote: > > static bool kvmclock_src_use_reliable_get_clock(void *opaque) > > { > > KVMClockState *s = opaque; > > > > /* > >

Re: [Qemu-devel] [qemu patch 2/2] kvmclock: reduce kvmclock difference on migration

2016-11-14 Thread Marcelo Tosatti
On Mon, Nov 14, 2016 at 03:09:46PM +0100, Juan Quintela wrote: > Marcelo Tosatti wrote: > > Check for KVM_CAP_ADJUST_CLOCK capability KVM_CLOCK_TSC_STABLE, which > > indicates that KVM_GET_CLOCK returns a value as seen by the guest at > > that moment. > > > > For

Re: [Qemu-devel] [qemu patch 2/2] kvmclock: reduce kvmclock difference on migration

2016-11-14 Thread Marcelo Tosatti
On Mon, Nov 14, 2016 at 04:00:38PM +0100, Paolo Bonzini wrote: > > > On 14/11/2016 15:50, Marcelo Tosatti wrote: > > Well, i didnt want to mix the meaning of the variables: > > > > +/* whether machine supports reliable KVM_GET_CLOCK */ > > +

Re: [Qemu-devel] [qemu patch 2/2] kvmclock: reduce kvmclock difference on migration

2016-11-14 Thread Marcelo Tosatti
On Mon, Nov 14, 2016 at 03:22:02PM +0100, Paolo Bonzini wrote: > > > On 14/11/2016 15:00, Marcelo Tosatti wrote: > > On Mon, Nov 14, 2016 at 02:54:38PM +0100, Paolo Bonzini wrote: > >> > >> > >> On 14/11/2016 13:36, Marcelo Tosatti wrote: &g

Re: [Qemu-devel] [qemu patch 2/2] kvmclock: reduce kvmclock difference on migration

2016-11-14 Thread Marcelo Tosatti
On Mon, Nov 14, 2016 at 02:54:38PM +0100, Paolo Bonzini wrote: > > > On 14/11/2016 13:36, Marcelo Tosatti wrote: > > +/* local (running VM) restore */ > > +if (s->clock_valid) { > > +/* > > + * if host doe

[Qemu-devel] [qemu patch 2/2] kvmclock: reduce kvmclock difference on migration

2016-11-14 Thread Marcelo Tosatti
(when max_downtime == 5s). Signed-off-by: Marcelo Tosatti --- hw/i386/kvm/clock.c| 88 +++-- include/hw/i386/pc.h |5 ++ target-i386/kvm.c |7 +++ target-i386/kvm_i386.h |1 4 files changed, 98 insertions(+), 3 deletions(-) Index

[Qemu-devel] [qemu patch 1/2] kvm: sync linux headers

2016-11-14 Thread Marcelo Tosatti
Import KVM_CLOCK_TSC_STABLE. Signed-off-by: Marcelo Tosatti diff --git a/include/standard-headers/linux/input.h b/include/standard-headers/linux/input.h index 7361a16..b472b85 100644 --- a/include/standard-headers/linux/input.h +++ b/include/standard-headers/linux/input.h @@ -245,6 +245,7

[Qemu-devel] [qemu patch 0/2] improve kvmclock difference on migration

2016-11-14 Thread Marcelo Tosatti
See patches for details.

Re: [Qemu-devel] [QEMU PATCH v2] kvmclock: advance clock by time window between vm_stop and pre_save

2016-11-14 Thread Marcelo Tosatti
On Thu, Nov 10, 2016 at 06:57:21PM +0100, Paolo Bonzini wrote: > > > On 10/11/2016 12:48, Marcelo Tosatti wrote: > > Destination has to run the following logic: > > > > If (source has KVM_CAP_ADVANCE_CLOCK) > > use KVM_GET_CLOCK value > > Else >

Re: [Qemu-devel] [QEMU PATCH v2] kvmclock: advance clock by time window between vm_stop and pre_save

2016-11-10 Thread Marcelo Tosatti
GOn Wed, Nov 09, 2016 at 05:23:50PM +0100, Paolo Bonzini wrote: > > > On 08/11/2016 11:22, Dr. David Alan Gilbert wrote: > > * Marcelo Tosatti (mtosa...@redhat.com) wrote: > >> On Mon, Nov 07, 2016 at 08:03:50PM +, Dr. David Alan Gilbert wrote: > >>> *

Re: [Qemu-devel] [QEMU PATCH v2] kvmclock: advance clock by time window between vm_stop and pre_save

2016-11-09 Thread Marcelo Tosatti
On Tue, Nov 08, 2016 at 11:32:30AM -0200, Marcelo Tosatti wrote: > On Tue, Nov 08, 2016 at 10:22:56AM +, Dr. David Alan Gilbert wrote: > > * Marcelo Tosatti (mtosa...@redhat.com) wrote: > > > On Mon, Nov 07, 2016 at 08:03:50PM +, Dr. David Alan Gilbert wrote: > &g

Re: [Qemu-devel] [QEMU PATCH v2] kvmclock: advance clock by time window between vm_stop and pre_save

2016-11-08 Thread Marcelo Tosatti
On Tue, Nov 08, 2016 at 10:22:56AM +, Dr. David Alan Gilbert wrote: > * Marcelo Tosatti (mtosa...@redhat.com) wrote: > > On Mon, Nov 07, 2016 at 08:03:50PM +, Dr. David Alan Gilbert wrote: > > > * Marcelo Tosatti (mtosa...@redhat.com) wrote: > > > > On Mon, No

Re: [Qemu-devel] [QEMU PATCH v2] kvmclock: advance clock by time window between vm_stop and pre_save

2016-11-07 Thread Marcelo Tosatti
On Mon, Nov 07, 2016 at 08:03:50PM +, Dr. David Alan Gilbert wrote: > * Marcelo Tosatti (mtosa...@redhat.com) wrote: > > On Mon, Nov 07, 2016 at 03:46:11PM +, Dr. David Alan Gilbert wrote: > > > * Marcelo Tosatti (mtosa...@redhat.com) wrote: > > > > Th

Re: [Qemu-devel] [QEMU PATCH] kvmclock: advance clock by time window between vm_stop and pre_save

2016-11-07 Thread Marcelo Tosatti
On Mon, Nov 07, 2016 at 05:31:49PM +0300, Roman Kagan wrote: > On Fri, Nov 04, 2016 at 06:16:06PM +0100, Radim Krčmář wrote: > > 2016-11-04 16:57+0100, Paolo Bonzini: > > > On 04/11/2016 16:48, Radim Krčmář wrote: > > >> 2016-11-04 16:33+0100, Paolo Bonzini: > > >>> On 04/11/2016 16:25, Radim Krčmá

  1   2   3   4   5   6   7   8   9   10   >