public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* WARNING: at arch/x86/kernel/kvmclock.c:127
@ 2012-06-05 18:20 Frank Arnold
  2012-06-06 15:52 ` Eric B Munson
  0 siblings, 1 reply; 12+ messages in thread
From: Frank Arnold @ 2012-06-05 18:20 UTC (permalink / raw)
  To: emunson; +Cc: avi, mtosatti, tglx, mingo, hpa, Joerg Roedel, kvm

Hi all,

I observed the following warning during testing of 3.5-rc1, involving
some intensive and random CPU online state toggling through sysfs. It
only shows up about 1 out of 500 times. Also, there was no KVM guest
running on the system.

------------[ cut here ]------------
WARNING: at arch/x86/kernel/kvmclock.c:127
kvm_check_and_clear_guest_paused+0x52/0x60()
Hardware name: Dinar
Modules linked in: nfs lockd fscache auth_rpcgss nfs_acl sunrpc ipv6
ext4 jbd2 dm_mod powernow_k8 freq_table mperf kvm_amd kvm crc32c_intel
ghash_clmulni_intel aesni_intel cryptd aes_x86_64 aes_generic microcode
serio_raw pcspkr k10temp amd64_edac_mod edac_core edac_mce_amd i2c_piix4
sg bnx2 ext3 jbd mbcache sr_mod cdrom sd_mod crc_t10dif ata_generic
pata_acpi pata_atiixp ahci libahci usb_storage radeon ttm drm_kms_helper
drm i2c_algo_bit i2c_core [last unloaded: scsi_wait_scan]
Pid: 3593, comm: py_topology Not tainted 3.5.0-rc1+ #1
Call Trace:
 [<ffffffff8104fd7f>] warn_slowpath_common+0x7f/0xc0
 [<ffffffff8104fdda>] warn_slowpath_null+0x1a/0x20
 [<ffffffff8103f252>] kvm_check_and_clear_guest_paused+0x52/0x60
 [<ffffffff810d29f7>] watchdog_timer_fn+0x97/0x1b0
 [<ffffffff81077743>] __run_hrtimer+0x83/0x1d0
 [<ffffffff810d2960>] ? touch_softlockup_watchdog_sync+0x40/0x40
 [<ffffffff81077b26>] hrtimer_interrupt+0x106/0x240
 [<ffffffff81077d98>] migrate_hrtimers+0x138/0x1a0
 [<ffffffff8150eb76>] hrtimer_cpu_notify+0xe4/0xeb
 [<ffffffff8151a655>] notifier_call_chain+0x55/0x80
 [<ffffffff8107961e>] __raw_notifier_call_chain+0xe/0x10
 [<ffffffff81052e50>] __cpu_notify+0x20/0x40
 [<ffffffff81052e85>] cpu_notify_nofail+0x15/0x30
 [<ffffffff814fc6bd>] _cpu_down+0x12d/0x270
 [<ffffffff814fc836>] cpu_down+0x36/0x50
 [<ffffffff814feeb4>] store_online+0x74/0xd0
 [<ffffffff8133e8a0>] dev_attr_store+0x20/0x30
 [<ffffffff811e0d5f>] sysfs_write_file+0xef/0x170
 [<ffffffff81171708>] vfs_write+0xc8/0x190
 [<ffffffff811718d1>] sys_write+0x51/0x90
 [<ffffffff8151eba9>] system_call_fastpath+0x16/0x1b
---[ end trace 574db9e069f4f35e ]---

This is a regression introduced by the following commit:

commit 3b5d56b9317fa7b5407dff1aa7b115bf6cdbd494
Author: Eric B Munson <emunson@mgebm.net>
Date:   Sat Mar 10 14:37:26 2012 -0500

    kvmclock: Add functions to check if the host has stopped the vm
    
    When a host stops or suspends a VM it will set a flag to show this.  The
    watchdog will use these functions to determine if a softlockup is real, or the
    result of a suspended VM.
    
    Signed-off-by: Eric B Munson <emunson@mgebm.net>
    asm-generic changes Acked-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
    Signed-off-by: Avi Kivity <avi@redhat.com>


-- 
Regards,
Frank Arnold 

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: WARNING: at arch/x86/kernel/kvmclock.c:127
  2012-06-05 18:20 Frank Arnold
@ 2012-06-06 15:52 ` Eric B Munson
  2012-06-06 15:53   ` Eric B Munson
  0 siblings, 1 reply; 12+ messages in thread
From: Eric B Munson @ 2012-06-06 15:52 UTC (permalink / raw)
  To: Frank Arnold; +Cc: avi, mtosatti, tglx, mingo, hpa, Joerg Roedel, kvm

On Tue, 5 Jun 2012 20:20:59 +0200, Frank Arnold wrote:
> Hi all,
>
> I observed the following warning during testing of 3.5-rc1, involving
> some intensive and random CPU online state toggling through sysfs. It
> only shows up about 1 out of 500 times. Also, there was no KVM guest
> running on the system.
>

This warning kicks off if the watchdog_timer_fn function is called 
outside of an
atomic context, the warning itself is not re

> ------------[ cut here ]------------
> WARNING: at arch/x86/kernel/kvmclock.c:127
> kvm_check_and_clear_guest_paused+0x52/0x60()
> Hardware name: Dinar
> Modules linked in: nfs lockd fscache auth_rpcgss nfs_acl sunrpc ipv6
> ext4 jbd2 dm_mod powernow_k8 freq_table mperf kvm_amd kvm 
> crc32c_intel
> ghash_clmulni_intel aesni_intel cryptd aes_x86_64 aes_generic 
> microcode
> serio_raw pcspkr k10temp amd64_edac_mod edac_core edac_mce_amd 
> i2c_piix4
> sg bnx2 ext3 jbd mbcache sr_mod cdrom sd_mod crc_t10dif ata_generic
> pata_acpi pata_atiixp ahci libahci usb_storage radeon ttm 
> drm_kms_helper
> drm i2c_algo_bit i2c_core [last unloaded: scsi_wait_scan]
> Pid: 3593, comm: py_topology Not tainted 3.5.0-rc1+ #1
> Call Trace:
>  [<ffffffff8104fd7f>] warn_slowpath_common+0x7f/0xc0
>  [<ffffffff8104fdda>] warn_slowpath_null+0x1a/0x20
>  [<ffffffff8103f252>] kvm_check_and_clear_guest_paused+0x52/0x60
>  [<ffffffff810d29f7>] watchdog_timer_fn+0x97/0x1b0
>  [<ffffffff81077743>] __run_hrtimer+0x83/0x1d0
>  [<ffffffff810d2960>] ? touch_softlockup_watchdog_sync+0x40/0x40
>  [<ffffffff81077b26>] hrtimer_interrupt+0x106/0x240
>  [<ffffffff81077d98>] migrate_hrtimers+0x138/0x1a0
>  [<ffffffff8150eb76>] hrtimer_cpu_notify+0xe4/0xeb
>  [<ffffffff8151a655>] notifier_call_chain+0x55/0x80
>  [<ffffffff8107961e>] __raw_notifier_call_chain+0xe/0x10
>  [<ffffffff81052e50>] __cpu_notify+0x20/0x40
>  [<ffffffff81052e85>] cpu_notify_nofail+0x15/0x30
>  [<ffffffff814fc6bd>] _cpu_down+0x12d/0x270
>  [<ffffffff814fc836>] cpu_down+0x36/0x50
>  [<ffffffff814feeb4>] store_online+0x74/0xd0
>  [<ffffffff8133e8a0>] dev_attr_store+0x20/0x30
>  [<ffffffff811e0d5f>] sysfs_write_file+0xef/0x170
>  [<ffffffff81171708>] vfs_write+0xc8/0x190
>  [<ffffffff811718d1>] sys_write+0x51/0x90
>  [<ffffffff8151eba9>] system_call_fastpath+0x16/0x1b
> ---[ end trace 574db9e069f4f35e ]---
>
> This is a regression introduced by the following commit:
>
> commit 3b5d56b9317fa7b5407dff1aa7b115bf6cdbd494
> Author: Eric B Munson <emunson@mgebm.net>
> Date:   Sat Mar 10 14:37:26 2012 -0500
>
>     kvmclock: Add functions to check if the host has stopped the vm
>
>     When a host stops or suspends a VM it will set a flag to show 
> this.  The
>     watchdog will use these functions to determine if a softlockup is
> real, or the
>     result of a suspended VM.
>
>     Signed-off-by: Eric B Munson <emunson@mgebm.net>
>     asm-generic changes Acked-by: Arnd Bergmann <arnd@arndb.de>
>     Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
>     Signed-off-by: Avi Kivity <avi@redhat.com>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: WARNING: at arch/x86/kernel/kvmclock.c:127
  2012-06-06 15:52 ` Eric B Munson
@ 2012-06-06 15:53   ` Eric B Munson
  0 siblings, 0 replies; 12+ messages in thread
From: Eric B Munson @ 2012-06-06 15:53 UTC (permalink / raw)
  To: Eric B Munson
  Cc: Frank Arnold, avi, mtosatti, tglx, mingo, hpa, Joerg Roedel, kvm

On Wed, 06 Jun 2012 11:52:23 -0400, Eric B Munson wrote:
> On Tue, 5 Jun 2012 20:20:59 +0200, Frank Arnold wrote:
>> Hi all,
>>
>> I observed the following warning during testing of 3.5-rc1, 
>> involving
>> some intensive and random CPU online state toggling through sysfs. 
>> It
>> only shows up about 1 out of 500 times. Also, there was no KVM guest
>> running on the system.
>>
>
> This warning kicks off if the watchdog_timer_fn function is called
> outside of an
> atomic context, the warning itself is not re

Grr, keyboard shortcut...

The warning itself is not required for the check_and_clear function and 
can be removed as far as I am concerned.

Eric
>
>> ------------[ cut here ]------------
>> WARNING: at arch/x86/kernel/kvmclock.c:127
>> kvm_check_and_clear_guest_paused+0x52/0x60()
>> Hardware name: Dinar
>> Modules linked in: nfs lockd fscache auth_rpcgss nfs_acl sunrpc ipv6
>> ext4 jbd2 dm_mod powernow_k8 freq_table mperf kvm_amd kvm 
>> crc32c_intel
>> ghash_clmulni_intel aesni_intel cryptd aes_x86_64 aes_generic 
>> microcode
>> serio_raw pcspkr k10temp amd64_edac_mod edac_core edac_mce_amd 
>> i2c_piix4
>> sg bnx2 ext3 jbd mbcache sr_mod cdrom sd_mod crc_t10dif ata_generic
>> pata_acpi pata_atiixp ahci libahci usb_storage radeon ttm 
>> drm_kms_helper
>> drm i2c_algo_bit i2c_core [last unloaded: scsi_wait_scan]
>> Pid: 3593, comm: py_topology Not tainted 3.5.0-rc1+ #1
>> Call Trace:
>>  [<ffffffff8104fd7f>] warn_slowpath_common+0x7f/0xc0
>>  [<ffffffff8104fdda>] warn_slowpath_null+0x1a/0x20
>>  [<ffffffff8103f252>] kvm_check_and_clear_guest_paused+0x52/0x60
>>  [<ffffffff810d29f7>] watchdog_timer_fn+0x97/0x1b0
>>  [<ffffffff81077743>] __run_hrtimer+0x83/0x1d0
>>  [<ffffffff810d2960>] ? touch_softlockup_watchdog_sync+0x40/0x40
>>  [<ffffffff81077b26>] hrtimer_interrupt+0x106/0x240
>>  [<ffffffff81077d98>] migrate_hrtimers+0x138/0x1a0
>>  [<ffffffff8150eb76>] hrtimer_cpu_notify+0xe4/0xeb
>>  [<ffffffff8151a655>] notifier_call_chain+0x55/0x80
>>  [<ffffffff8107961e>] __raw_notifier_call_chain+0xe/0x10
>>  [<ffffffff81052e50>] __cpu_notify+0x20/0x40
>>  [<ffffffff81052e85>] cpu_notify_nofail+0x15/0x30
>>  [<ffffffff814fc6bd>] _cpu_down+0x12d/0x270
>>  [<ffffffff814fc836>] cpu_down+0x36/0x50
>>  [<ffffffff814feeb4>] store_online+0x74/0xd0
>>  [<ffffffff8133e8a0>] dev_attr_store+0x20/0x30
>>  [<ffffffff811e0d5f>] sysfs_write_file+0xef/0x170
>>  [<ffffffff81171708>] vfs_write+0xc8/0x190
>>  [<ffffffff811718d1>] sys_write+0x51/0x90
>>  [<ffffffff8151eba9>] system_call_fastpath+0x16/0x1b
>> ---[ end trace 574db9e069f4f35e ]---
>>
>> This is a regression introduced by the following commit:
>>
>> commit 3b5d56b9317fa7b5407dff1aa7b115bf6cdbd494
>> Author: Eric B Munson <emunson@mgebm.net>
>> Date:   Sat Mar 10 14:37:26 2012 -0500
>>
>>     kvmclock: Add functions to check if the host has stopped the vm
>>
>>     When a host stops or suspends a VM it will set a flag to show 
>> this.  The
>>     watchdog will use these functions to determine if a softlockup 
>> is
>> real, or the
>>     result of a suspended VM.
>>
>>     Signed-off-by: Eric B Munson <emunson@mgebm.net>
>>     asm-generic changes Acked-by: Arnd Bergmann <arnd@arndb.de>
>>     Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
>>     Signed-off-by: Avi Kivity <avi@redhat.com>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: WARNING: at arch/x86/kernel/kvmclock.c:127
@ 2012-06-10 15:47 Sedat Dilek
  2012-06-10 16:08 ` Sedat Dilek
  2012-06-11 21:47 ` Eric B Munson
  0 siblings, 2 replies; 12+ messages in thread
From: Sedat Dilek @ 2012-06-10 15:47 UTC (permalink / raw)
  To: Eric B Munson
  Cc: kvm, LKML, Avi Kivity, Marcelo Tosatti, Glauber Costa,
	Thomas Gleixner, Ingo Molnar, x86

Hi,

I see the same warning especially when resuming from a suspend (see
timestamps >=30-35sec) between Linux v3.5-rc1..v3.5-rc2.

$ sudo grep kvmclock.c /var/log/kern.log
Jun  4 21:11:32 fambox kernel: [  784.037237] WARNING: at
arch/x86/kernel/kvmclock.c:127
kvm_check_and_clear_guest_paused+0x52/0x60()
Jun  5 20:35:57 fambox kernel: [ 1928.458060] WARNING: at
arch/x86/kernel/kvmclock.c:127
kvm_check_and_clear_guest_paused+0x52/0x60()
Jun  8 09:35:52 fambox kernel: [ 3290.134637] WARNING: at
arch/x86/kernel/kvmclock.c:127
kvm_check_and_clear_guest_paused+0x52/0x60()
Jun  8 09:35:52 fambox kernel: [ 3290.238592] WARNING: at
arch/x86/kernel/kvmclock.c:127
kvm_check_and_clear_guest_paused+0x52/0x60()
Jun  8 12:11:20 fambox kernel: [ 5777.023571] WARNING: at
arch/x86/kernel/kvmclock.c:127
kvm_check_and_clear_guest_paused+0x52/0x60()
Jun  9 13:32:50 fambox kernel: [ 2778.842695] WARNING: at
arch/x86/kernel/kvmclock.c:127
kvm_check_and_clear_guest_paused+0x52/0x60()

>From [1]:

"...The warning itself is not required for the check_and_clear
function and can be removed as far as I am concerned."

>From [2] commit 3b5d56b9317fa7b5407dff1aa7b115bf6cdbd494 ("kvmclock:
Add functions to check if the host has stopped the vm")
...
+bool kvm_check_and_clear_guest_paused(void)
+{
+       bool ret = false;
+       struct pvclock_vcpu_time_info *src;
+
+       /*
+        * per_cpu() is safe here because this function is only called from
+        * timer functions where preemption is already disabled.
+        */
+       WARN_ON(!in_atomic());
+       src = &__get_cpu_var(hv_clock);
+       if ((src->flags & PVCLOCK_GUEST_STOPPED) != 0) {
+               __this_cpu_and(hv_clock.flags, ~PVCLOCK_GUEST_STOPPED);
+               ret = true;
+       }
+
+       return ret;
+}
+EXPORT_SYMBOL_GPL(kvm_check_and_clear_guest_paused);
+
...
( The export macro was dropped in a followup commit. )

So you mean "WARN_ON(!in_atomic());" can be deleted?

Regards,
- Sedat -

[1] http://www.spinics.net/lists/kvm/msg73732.html
[2] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blobdiff;f=arch/x86/kernel/kvmclock.c;h=4ba090ca689db5322fb242b98b53158de5447dc9;hp=f8492da65bfcb03e2775638ad5ce9502099d62c8;hb=3b5d56b9317fa7b5407dff1aa7b115bf6cdbd494;hpb=eae3ee7d8a7c59cf63441dedf28674889f5fc477

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: WARNING: at arch/x86/kernel/kvmclock.c:127
  2012-06-10 15:47 WARNING: at arch/x86/kernel/kvmclock.c:127 Sedat Dilek
@ 2012-06-10 16:08 ` Sedat Dilek
  2012-06-11 21:47 ` Eric B Munson
  1 sibling, 0 replies; 12+ messages in thread
From: Sedat Dilek @ 2012-06-10 16:08 UTC (permalink / raw)
  To: Eric B Munson
  Cc: kvm, LKML, Avi Kivity, Marcelo Tosatti, Thomas Gleixner,
	Ingo Molnar, x86, Rafael J. Wysocki

[-- Attachment #1: Type: text/plain, Size: 2983 bytes --]

On Sun, Jun 10, 2012 at 5:47 PM, Sedat Dilek <sedat.dilek@googlemail.com> wrote:
> Hi,
>
> I see the same warning especially when resuming from a suspend (see
> timestamps >=30-35sec) between Linux v3.5-rc1..v3.5-rc2.
>
> $ sudo grep kvmclock.c /var/log/kern.log
> Jun  4 21:11:32 fambox kernel: [  784.037237] WARNING: at
> arch/x86/kernel/kvmclock.c:127
> kvm_check_and_clear_guest_paused+0x52/0x60()
> Jun  5 20:35:57 fambox kernel: [ 1928.458060] WARNING: at
> arch/x86/kernel/kvmclock.c:127
> kvm_check_and_clear_guest_paused+0x52/0x60()
> Jun  8 09:35:52 fambox kernel: [ 3290.134637] WARNING: at
> arch/x86/kernel/kvmclock.c:127
> kvm_check_and_clear_guest_paused+0x52/0x60()
> Jun  8 09:35:52 fambox kernel: [ 3290.238592] WARNING: at
> arch/x86/kernel/kvmclock.c:127
> kvm_check_and_clear_guest_paused+0x52/0x60()
> Jun  8 12:11:20 fambox kernel: [ 5777.023571] WARNING: at
> arch/x86/kernel/kvmclock.c:127
> kvm_check_and_clear_guest_paused+0x52/0x60()
> Jun  9 13:32:50 fambox kernel: [ 2778.842695] WARNING: at
> arch/x86/kernel/kvmclock.c:127
> kvm_check_and_clear_guest_paused+0x52/0x60()
>
> From [1]:
>
> "...The warning itself is not required for the check_and_clear
> function and can be removed as far as I am concerned."
>
> From [2] commit 3b5d56b9317fa7b5407dff1aa7b115bf6cdbd494 ("kvmclock:
> Add functions to check if the host has stopped the vm")
> ...
> +bool kvm_check_and_clear_guest_paused(void)
> +{
> +       bool ret = false;
> +       struct pvclock_vcpu_time_info *src;
> +
> +       /*
> +        * per_cpu() is safe here because this function is only called from
> +        * timer functions where preemption is already disabled.
> +        */
> +       WARN_ON(!in_atomic());
> +       src = &__get_cpu_var(hv_clock);
> +       if ((src->flags & PVCLOCK_GUEST_STOPPED) != 0) {
> +               __this_cpu_and(hv_clock.flags, ~PVCLOCK_GUEST_STOPPED);
> +               ret = true;
> +       }
> +
> +       return ret;
> +}
> +EXPORT_SYMBOL_GPL(kvm_check_and_clear_guest_paused);
> +
> ...
> ( The export macro was dropped in a followup commit. )
>
> So you mean "WARN_ON(!in_atomic());" can be deleted?
>
> Regards,
> - Sedat -
>
> [1] http://www.spinics.net/lists/kvm/msg73732.html
> [2] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blobdiff;f=arch/x86/kernel/kvmclock.c;h=4ba090ca689db5322fb242b98b53158de5447dc9;hp=f8492da65bfcb03e2775638ad5ce9502099d62c8;hb=3b5d56b9317fa7b5407dff1aa7b115bf6cdbd494;hpb=eae3ee7d8a7c59cf63441dedf28674889f5fc477

[ Removed Glauber Costa - Email-address @ RH does not exist anymore ]
[ Added CC to Rafael  J. Wysocki (S/R) ]

I added for the sake of correctness the last call-trace I have seen
with Linux v3.5-rc2.
And... I had loaded kvm and kvm_intel kernel-modules, but no KVM
instance actively running or active while doing suspend/resume (S/R).

- Sedat -

[-- Attachment #2: CALL-TRACE_kvmclock_kern-log.txt --]
[-- Type: text/plain, Size: 9731 bytes --]

Jun  9 13:32:50 fambox kernel: [ 2777.787365] Freezing user space processes ... (elapsed 0.01 seconds) done.
Jun  9 13:32:50 fambox kernel: [ 2777.803351] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
Jun  9 13:32:50 fambox kernel: [ 2777.803354] PM: Entering mem sleep
Jun  9 13:32:50 fambox kernel: [ 2777.803420] Suspending console(s) (use no_console_suspend to debug)
Jun  9 13:32:50 fambox kernel: [ 2777.803806] sd 1:0:0:0: [sdb] Synchronizing SCSI cache
Jun  9 13:32:50 fambox kernel: [ 2777.803850] sd 0:0:0:0: [sda] Synchronizing SCSI cache
Jun  9 13:32:50 fambox kernel: [ 2777.804168] sd 0:0:0:0: [sda] Stopping disk
Jun  9 13:32:50 fambox kernel: [ 2777.806550] sd 1:0:0:0: [sdb] Stopping disk
Jun  9 13:32:50 fambox kernel: [ 2778.422876] PM: suspend of devices complete after 619.779 msecs
Jun  9 13:32:50 fambox kernel: [ 2778.422878] PM: suspend devices took 0.620 seconds
Jun  9 13:32:50 fambox kernel: [ 2778.423006] PM: late suspend of devices complete after 0.126 msecs
Jun  9 13:32:50 fambox kernel: [ 2778.438920] r8169 0000:02:00.0: wake-up capability enabled by ACPI
Jun  9 13:32:50 fambox kernel: [ 2778.502850] PM: noirq suspend of devices complete after 79.895 msecs
Jun  9 13:32:50 fambox kernel: [ 2778.503082] ACPI: Preparing to enter system sleep state S3
Jun  9 13:32:50 fambox kernel: [ 2778.526894] PM: Saving platform NVS memory
Jun  9 13:32:50 fambox kernel: [ 2778.531564] Disabling non-boot CPUs ...
Jun  9 13:32:50 fambox kernel: [ 2778.634664] CPU 1 is now offline
Jun  9 13:32:50 fambox kernel: [ 2778.738600] CPU 2 is now offline
Jun  9 13:32:50 fambox kernel: [ 2778.739230] Broke affinity for irq 9
Jun  9 13:32:50 fambox kernel: [ 2778.739247] Broke affinity for irq 16
Jun  9 13:32:50 fambox kernel: [ 2778.842535] CPU 3 is now offline
Jun  9 13:32:50 fambox kernel: [ 2778.842688] ------------[ cut here ]------------
Jun  9 13:32:50 fambox kernel: [ 2778.842695] WARNING: at arch/x86/kernel/kvmclock.c:127 kvm_check_and_clear_guest_paused+0x52/0x60()
Jun  9 13:32:50 fambox kernel: [ 2778.842696] Hardware name: <HIDDEN>
Jun  9 13:32:50 fambox kernel: [ 2778.842723] Modules linked in: sch_fq_codel sch_htb snd_hda_codec_hdmi snd_hda_codec_realtek rfcomm parport_pc bnep ppdev joydev snd_hda_intel arc4 snd_hda_codec coretemp snd_hwdep kvm_intel snd_pcm snd_page_alloc kvm i915 snd_seq_midi iwlwifi snd_seq_midi_event snd_rawmidi snd_seq ghash_clmulni_intel snd_seq_device drm_kms_helper aesni_intel snd_timer uvcvideo drm aes_x86_64 mac80211 cryptd videobuf2_vmalloc snd videobuf2_memops psmouse i2c_algo_bit btusb videobuf2_core samsung_laptop soundcore microcode cfg80211 videodev lp bluetooth serio_raw mei hid_generic mac_hid lpc_ich video parport usbhid hid r8169
Jun  9 13:32:50 fambox kernel: [ 2778.842725] Pid: 5475, comm: pm-suspend Not tainted 3.5.0-rc2-1-iniza-generic #1
Jun  9 13:32:50 fambox kernel: [ 2778.842727] Call Trace:
Jun  9 13:32:50 fambox kernel: [ 2778.842731]  [<ffffffff810527bf>] warn_slowpath_common+0x7f/0xc0
Jun  9 13:32:50 fambox kernel: [ 2778.842734]  [<ffffffff8105281a>] warn_slowpath_null+0x1a/0x20
Jun  9 13:32:50 fambox kernel: [ 2778.842736]  [<ffffffff8103fc82>] kvm_check_and_clear_guest_paused+0x52/0x60
Jun  9 13:32:50 fambox kernel: [ 2778.842739]  [<ffffffff810dda6d>] watchdog_timer_fn+0x8d/0x180
Jun  9 13:32:50 fambox kernel: [ 2778.842742]  [<ffffffff8107a506>] __run_hrtimer+0x76/0x1f0
Jun  9 13:32:50 fambox kernel: [ 2778.842744]  [<ffffffff810dd9e0>] ? __touch_watchdog+0x30/0x30
Jun  9 13:32:50 fambox kernel: [ 2778.842746]  [<ffffffff8101b349>] ? read_tsc+0x9/0x20
Jun  9 13:32:50 fambox kernel: [ 2778.842748]  [<ffffffff8107adc3>] hrtimer_interrupt+0xe3/0x200
Jun  9 13:32:50 fambox kernel: [ 2778.842750]  [<ffffffff8107af0b>] __hrtimer_peek_ahead_timers.part.26+0x2b/0x30
Jun  9 13:32:50 fambox kernel: [ 2778.842754]  [<ffffffff816527c2>] hrtimer_cpu_notify+0x1c3/0x1eb
Jun  9 13:32:50 fambox kernel: [ 2778.842757]  [<ffffffff81668f5d>] notifier_call_chain+0x4d/0x70
Jun  9 13:32:50 fambox kernel: [ 2778.842758]  [<ffffffff8107c54e>] __raw_notifier_call_chain+0xe/0x10
Jun  9 13:32:50 fambox kernel: [ 2778.842761]  [<ffffffff81055620>] __cpu_notify+0x20/0x40
Jun  9 13:32:50 fambox kernel: [ 2778.842762]  [<ffffffff81055775>] cpu_notify_nofail+0x15/0x20
Jun  9 13:32:50 fambox kernel: [ 2778.842765]  [<ffffffff816365ad>] _cpu_down+0x10d/0x270
Jun  9 13:32:50 fambox kernel: [ 2778.842767]  [<ffffffff81055927>] disable_nonboot_cpus+0xa7/0x150
Jun  9 13:32:50 fambox kernel: [ 2778.842770]  [<ffffffff8109952c>] suspend_devices_and_enter+0x22c/0x310
Jun  9 13:32:50 fambox kernel: [ 2778.842771]  [<ffffffff8109979f>] pm_suspend+0x18f/0x1f0
Jun  9 13:32:50 fambox kernel: [ 2778.842773]  [<ffffffff810987ae>] state_store+0x8e/0xf0
Jun  9 13:32:50 fambox kernel: [ 2778.842775]  [<ffffffff81319aff>] kobj_attr_store+0xf/0x30
Jun  9 13:32:50 fambox kernel: [ 2778.842778]  [<ffffffff811eddcf>] sysfs_write_file+0xef/0x170
Jun  9 13:32:50 fambox kernel: [ 2778.842781]  [<ffffffff8117ed93>] vfs_write+0xb3/0x180
Jun  9 13:32:50 fambox kernel: [ 2778.842782]  [<ffffffff8117f0ba>] sys_write+0x4a/0x90
Jun  9 13:32:50 fambox kernel: [ 2778.842785]  [<ffffffff8166d229>] system_call_fastpath+0x16/0x1b
Jun  9 13:32:50 fambox kernel: [ 2778.842786] ---[ end trace c32bb8d548ae6e7f ]---
Jun  9 13:32:50 fambox kernel: [ 2778.843016] Extended CMOS year: 2000
Jun  9 13:32:50 fambox kernel: [ 2778.844289] ACPI: Low-level resume complete
Jun  9 13:32:50 fambox kernel: [ 2778.844335] PM: Restoring platform NVS memory
Jun  9 13:32:50 fambox kernel: [ 2778.845559] Extended CMOS year: 2000
Jun  9 13:32:50 fambox kernel: [ 2778.845604] Enabling non-boot CPUs ...
Jun  9 13:32:50 fambox kernel: [ 2778.845694] Booting Node 0 Processor 1 APIC 0x1
Jun  9 13:32:50 fambox kernel: [ 2778.856634] Disabled fast string operations
Jun  9 13:32:50 fambox kernel: [ 2778.859002] NMI watchdog: enabled, takes one hw-pmu counter.
Jun  9 13:32:50 fambox kernel: [ 2778.859289] CPU1 is up
Jun  9 13:32:50 fambox kernel: [ 2778.859424] Booting Node 0 Processor 2 APIC 0x2
Jun  9 13:32:50 fambox kernel: [ 2778.870461] Disabled fast string operations
Jun  9 13:32:50 fambox kernel: [ 2778.872826] NMI watchdog: enabled, takes one hw-pmu counter.
Jun  9 13:32:50 fambox kernel: [ 2778.873148] CPU2 is up
Jun  9 13:32:50 fambox kernel: [ 2778.873243] Booting Node 0 Processor 3 APIC 0x3
Jun  9 13:32:50 fambox kernel: [ 2778.884278] Disabled fast string operations
Jun  9 13:32:50 fambox kernel: [ 2778.886641] NMI watchdog: enabled, takes one hw-pmu counter.
Jun  9 13:32:50 fambox kernel: [ 2778.886944] CPU3 is up
Jun  9 13:32:50 fambox kernel: [ 2778.891780] ACPI: Waking up from system sleep state S3
Jun  9 13:32:50 fambox kernel: [ 2778.943274] PM: noirq resume of devices complete after 2.200 msecs
Jun  9 13:32:50 fambox kernel: [ 2778.943379] PM: early resume of devices complete after 0.065 msecs
Jun  9 13:32:50 fambox kernel: [ 2778.943451] i915 0000:00:02.0: setting latency timer to 64
Jun  9 13:32:50 fambox kernel: [ 2778.943461] ehci_hcd 0000:00:1a.0: setting latency timer to 64
Jun  9 13:32:50 fambox kernel: [ 2778.943497] ehci_hcd 0000:00:1d.0: setting latency timer to 64
Jun  9 13:32:50 fambox kernel: [ 2778.943509] ahci 0000:00:1f.2: setting latency timer to 64
Jun  9 13:32:50 fambox kernel: [ 2778.943585] r8169 0000:02:00.0: wake-up capability disabled by ACPI
Jun  9 13:32:50 fambox kernel: [ 2778.943638] iwlwifi 0000:01:00.0: RF_KILL bit toggled to enable radio.
Jun  9 13:32:50 fambox kernel: [ 2778.943651] snd_hda_intel 0000:00:1b.0: irq 50 for MSI/MSI-X
Jun  9 13:32:50 fambox kernel: [ 2778.943682] usb usb3: root hub lost power or was reset
Jun  9 13:32:50 fambox kernel: [ 2778.943684] usb usb4: root hub lost power or was reset
Jun  9 13:32:50 fambox kernel: [ 2778.948575] xhci_hcd 0000:03:00.0: irq 41 for MSI/MSI-X
Jun  9 13:32:50 fambox kernel: [ 2778.948581] xhci_hcd 0000:03:00.0: irq 42 for MSI/MSI-X
Jun  9 13:32:50 fambox kernel: [ 2778.948586] xhci_hcd 0000:03:00.0: irq 43 for MSI/MSI-X
Jun  9 13:32:50 fambox kernel: [ 2778.948592] xhci_hcd 0000:03:00.0: irq 44 for MSI/MSI-X
Jun  9 13:32:50 fambox kernel: [ 2778.948597] xhci_hcd 0000:03:00.0: irq 45 for MSI/MSI-X
Jun  9 13:32:50 fambox kernel: [ 2779.001863] [drm] Enabling RC6 states: RC6 on, RC6p off, RC6pp off
Jun  9 13:32:50 fambox kernel: [ 2779.276755] ata4: SATA link down (SStatus 0 SControl 300)
Jun  9 13:32:50 fambox kernel: [ 2779.284757] ata5: SATA link down (SStatus 0 SControl 300)
Jun  9 13:32:50 fambox kernel: [ 2779.292760] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
Jun  9 13:32:50 fambox kernel: [ 2779.297042] ata2.00: configured for UDMA/133
Jun  9 13:32:50 fambox kernel: [ 2779.312786] sd 1:0:0:0: [sdb] Starting disk
Jun  9 13:32:50 fambox kernel: [ 2779.380807] usb 2-1.4: reset low-speed USB device number 3 using ehci_hcd
Jun  9 13:32:50 fambox kernel: [ 2779.732579] usb 1-1.4: reset high-speed USB device number 3 using ehci_hcd
Jun  9 13:32:50 fambox kernel: [ 2781.483191] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
Jun  9 13:32:50 fambox kernel: [ 2781.485651] ata1.00: configured for UDMA/133
Jun  9 13:32:50 fambox kernel: [ 2781.499271] sd 0:0:0:0: [sda] Starting disk
Jun  9 13:32:50 fambox kernel: [ 2781.501362] Extended CMOS year: 2000
Jun  9 13:32:50 fambox kernel: [ 2781.528530] PM: resume of devices complete after 2586.977 msecs
Jun  9 13:32:50 fambox kernel: [ 2781.528604] PM: resume devices took 2.588 seconds
Jun  9 13:32:50 fambox kernel: [ 2781.528646] PM: Finishing wakeup.
Jun  9 13:32:50 fambox kernel: [ 2781.531291] Restarting tasks ... done.
Jun  9 13:32:50 fambox kernel: [ 2781.537436] video LNXVIDEO:00: Restoring backlight state

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: WARNING: at arch/x86/kernel/kvmclock.c:127
  2012-06-10 15:47 WARNING: at arch/x86/kernel/kvmclock.c:127 Sedat Dilek
  2012-06-10 16:08 ` Sedat Dilek
@ 2012-06-11 21:47 ` Eric B Munson
  2012-06-11 22:07   ` Marcelo Tosatti
  1 sibling, 1 reply; 12+ messages in thread
From: Eric B Munson @ 2012-06-11 21:47 UTC (permalink / raw)
  To: sedat.dilek
  Cc: kvm, LKML, Avi Kivity, Marcelo Tosatti, Glauber Costa,
	Thomas Gleixner, Ingo Molnar, x86

On Sun, 10 Jun 2012 17:47:24 +0200, Sedat Dilek wrote:
> Hi,
>
> I see the same warning especially when resuming from a suspend (see
> timestamps >=30-35sec) between Linux v3.5-rc1..v3.5-rc2.
>
> $ sudo grep kvmclock.c /var/log/kern.log
> Jun  4 21:11:32 fambox kernel: [  784.037237] WARNING: at
> arch/x86/kernel/kvmclock.c:127
> kvm_check_and_clear_guest_paused+0x52/0x60()
> Jun  5 20:35:57 fambox kernel: [ 1928.458060] WARNING: at
> arch/x86/kernel/kvmclock.c:127
> kvm_check_and_clear_guest_paused+0x52/0x60()
> Jun  8 09:35:52 fambox kernel: [ 3290.134637] WARNING: at
> arch/x86/kernel/kvmclock.c:127
> kvm_check_and_clear_guest_paused+0x52/0x60()
> Jun  8 09:35:52 fambox kernel: [ 3290.238592] WARNING: at
> arch/x86/kernel/kvmclock.c:127
> kvm_check_and_clear_guest_paused+0x52/0x60()
> Jun  8 12:11:20 fambox kernel: [ 5777.023571] WARNING: at
> arch/x86/kernel/kvmclock.c:127
> kvm_check_and_clear_guest_paused+0x52/0x60()
> Jun  9 13:32:50 fambox kernel: [ 2778.842695] WARNING: at
> arch/x86/kernel/kvmclock.c:127
> kvm_check_and_clear_guest_paused+0x52/0x60()
>
> From [1]:
>
> "...The warning itself is not required for the check_and_clear
> function and can be removed as far as I am concerned."
>
> From [2] commit 3b5d56b9317fa7b5407dff1aa7b115bf6cdbd494 ("kvmclock:
> Add functions to check if the host has stopped the vm")
> ...
> +bool kvm_check_and_clear_guest_paused(void)
> +{
> +       bool ret = false;
> +       struct pvclock_vcpu_time_info *src;
> +
> +       /*
> +        * per_cpu() is safe here because this function is only 
> called from
> +        * timer functions where preemption is already disabled.
> +        */
> +       WARN_ON(!in_atomic());
> +       src = &__get_cpu_var(hv_clock);
> +       if ((src->flags & PVCLOCK_GUEST_STOPPED) != 0) {
> +               __this_cpu_and(hv_clock.flags, 
> ~PVCLOCK_GUEST_STOPPED);
> +               ret = true;
> +       }
> +
> +       return ret;
> +}
> +EXPORT_SYMBOL_GPL(kvm_check_and_clear_guest_paused);
> +
> ...
> ( The export macro was dropped in a followup commit. )
>
> So you mean "WARN_ON(!in_atomic());" can be deleted?

When I wrote the patch originally, I was under the (incorrect) 
assumption that the watch dog was only ever reset in an atomic context.  
Given that this is not the case, the warning can be removed.  Though 
before that happens, I have a question: if this is called outside of an 
atomic context, is the use of __get_cpu_Var() and __this_cpu_and() 
invalid?

Thanks,
Eric

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: WARNING: at arch/x86/kernel/kvmclock.c:127
  2012-06-11 21:47 ` Eric B Munson
@ 2012-06-11 22:07   ` Marcelo Tosatti
  2012-06-11 22:10     ` Eric B Munson
  0 siblings, 1 reply; 12+ messages in thread
From: Marcelo Tosatti @ 2012-06-11 22:07 UTC (permalink / raw)
  To: Eric B Munson
  Cc: sedat.dilek, kvm, LKML, Avi Kivity, Glauber Costa,
	Thomas Gleixner, Ingo Molnar, x86

On Mon, Jun 11, 2012 at 05:47:00PM -0400, Eric B Munson wrote:
> On Sun, 10 Jun 2012 17:47:24 +0200, Sedat Dilek wrote:
> >Hi,
> >
> >I see the same warning especially when resuming from a suspend (see
> >timestamps >=30-35sec) between Linux v3.5-rc1..v3.5-rc2.
> >
> >$ sudo grep kvmclock.c /var/log/kern.log
> >Jun  4 21:11:32 fambox kernel: [  784.037237] WARNING: at
> >arch/x86/kernel/kvmclock.c:127
> >kvm_check_and_clear_guest_paused+0x52/0x60()
> >Jun  5 20:35:57 fambox kernel: [ 1928.458060] WARNING: at
> >arch/x86/kernel/kvmclock.c:127
> >kvm_check_and_clear_guest_paused+0x52/0x60()
> >Jun  8 09:35:52 fambox kernel: [ 3290.134637] WARNING: at
> >arch/x86/kernel/kvmclock.c:127
> >kvm_check_and_clear_guest_paused+0x52/0x60()
> >Jun  8 09:35:52 fambox kernel: [ 3290.238592] WARNING: at
> >arch/x86/kernel/kvmclock.c:127
> >kvm_check_and_clear_guest_paused+0x52/0x60()
> >Jun  8 12:11:20 fambox kernel: [ 5777.023571] WARNING: at
> >arch/x86/kernel/kvmclock.c:127
> >kvm_check_and_clear_guest_paused+0x52/0x60()
> >Jun  9 13:32:50 fambox kernel: [ 2778.842695] WARNING: at
> >arch/x86/kernel/kvmclock.c:127
> >kvm_check_and_clear_guest_paused+0x52/0x60()
> >
> >From [1]:
> >
> >"...The warning itself is not required for the check_and_clear
> >function and can be removed as far as I am concerned."
> >
> >From [2] commit 3b5d56b9317fa7b5407dff1aa7b115bf6cdbd494 ("kvmclock:
> >Add functions to check if the host has stopped the vm")
> >...
> >+bool kvm_check_and_clear_guest_paused(void)
> >+{
> >+       bool ret = false;
> >+       struct pvclock_vcpu_time_info *src;
> >+
> >+       /*
> >+        * per_cpu() is safe here because this function is only
> >called from
> >+        * timer functions where preemption is already disabled.
> >+        */
> >+       WARN_ON(!in_atomic());
> >+       src = &__get_cpu_var(hv_clock);
> >+       if ((src->flags & PVCLOCK_GUEST_STOPPED) != 0) {
> >+               __this_cpu_and(hv_clock.flags,
> >~PVCLOCK_GUEST_STOPPED);
> >+               ret = true;
> >+       }
> >+
> >+       return ret;
> >+}
> >+EXPORT_SYMBOL_GPL(kvm_check_and_clear_guest_paused);
> >+
> >...
> >( The export macro was dropped in a followup commit. )
> >
> >So you mean "WARN_ON(!in_atomic());" can be deleted?

Yes.

> When I wrote the patch originally, I was under the (incorrect)
> assumption that the watch dog was only ever reset in an atomic
> context.  Given that this is not the case, the warning can be
> removed.  Though before that happens, I have a question: if this is
> called outside of an atomic context, is the use of __get_cpu_Var()
> and __this_cpu_and() invalid?

It remains valid because its called with interrupts 
disabled (see migrate_hrtimers).

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: WARNING: at arch/x86/kernel/kvmclock.c:127
  2012-06-11 22:07   ` Marcelo Tosatti
@ 2012-06-11 22:10     ` Eric B Munson
  2012-06-12  2:13       ` Marcelo Tosatti
  0 siblings, 1 reply; 12+ messages in thread
From: Eric B Munson @ 2012-06-11 22:10 UTC (permalink / raw)
  To: Marcelo Tosatti
  Cc: sedat.dilek, kvm, LKML, Avi Kivity, Thomas Gleixner, Ingo Molnar,
	x86

On Mon, 11 Jun 2012 19:07:19 -0300, Marcelo Tosatti wrote:
> On Mon, Jun 11, 2012 at 05:47:00PM -0400, Eric B Munson wrote:
>> On Sun, 10 Jun 2012 17:47:24 +0200, Sedat Dilek wrote:
>> >Hi,
>> >
>> >I see the same warning especially when resuming from a suspend (see
>> >timestamps >=30-35sec) between Linux v3.5-rc1..v3.5-rc2.
>> >
>> >$ sudo grep kvmclock.c /var/log/kern.log
>> >Jun  4 21:11:32 fambox kernel: [  784.037237] WARNING: at
>> >arch/x86/kernel/kvmclock.c:127
>> >kvm_check_and_clear_guest_paused+0x52/0x60()
>> >Jun  5 20:35:57 fambox kernel: [ 1928.458060] WARNING: at
>> >arch/x86/kernel/kvmclock.c:127
>> >kvm_check_and_clear_guest_paused+0x52/0x60()
>> >Jun  8 09:35:52 fambox kernel: [ 3290.134637] WARNING: at
>> >arch/x86/kernel/kvmclock.c:127
>> >kvm_check_and_clear_guest_paused+0x52/0x60()
>> >Jun  8 09:35:52 fambox kernel: [ 3290.238592] WARNING: at
>> >arch/x86/kernel/kvmclock.c:127
>> >kvm_check_and_clear_guest_paused+0x52/0x60()
>> >Jun  8 12:11:20 fambox kernel: [ 5777.023571] WARNING: at
>> >arch/x86/kernel/kvmclock.c:127
>> >kvm_check_and_clear_guest_paused+0x52/0x60()
>> >Jun  9 13:32:50 fambox kernel: [ 2778.842695] WARNING: at
>> >arch/x86/kernel/kvmclock.c:127
>> >kvm_check_and_clear_guest_paused+0x52/0x60()
>> >
>> >From [1]:
>> >
>> >"...The warning itself is not required for the check_and_clear
>> >function and can be removed as far as I am concerned."
>> >
>> >From [2] commit 3b5d56b9317fa7b5407dff1aa7b115bf6cdbd494 
>> ("kvmclock:
>> >Add functions to check if the host has stopped the vm")
>> >...
>> >+bool kvm_check_and_clear_guest_paused(void)
>> >+{
>> >+       bool ret = false;
>> >+       struct pvclock_vcpu_time_info *src;
>> >+
>> >+       /*
>> >+        * per_cpu() is safe here because this function is only
>> >called from
>> >+        * timer functions where preemption is already disabled.
>> >+        */
>> >+       WARN_ON(!in_atomic());
>> >+       src = &__get_cpu_var(hv_clock);
>> >+       if ((src->flags & PVCLOCK_GUEST_STOPPED) != 0) {
>> >+               __this_cpu_and(hv_clock.flags,
>> >~PVCLOCK_GUEST_STOPPED);
>> >+               ret = true;
>> >+       }
>> >+
>> >+       return ret;
>> >+}
>> >+EXPORT_SYMBOL_GPL(kvm_check_and_clear_guest_paused);
>> >+
>> >...
>> >( The export macro was dropped in a followup commit. )
>> >
>> >So you mean "WARN_ON(!in_atomic());" can be deleted?
>
> Yes.
>
>> When I wrote the patch originally, I was under the (incorrect)
>> assumption that the watch dog was only ever reset in an atomic
>> context.  Given that this is not the case, the warning can be
>> removed.  Though before that happens, I have a question: if this is
>> called outside of an atomic context, is the use of __get_cpu_Var()
>> and __this_cpu_and() invalid?
>
> It remains valid because its called with interrupts
> disabled (see migrate_hrtimers).

Thank you, that was my assumption but I wanted to confirm.  I do not 
have access to my working kernel tree and won't for 2 days.  I can't get 
to the patch until late Wednesday so if someone else wants to work that 
up I'd appreciate it.

Thanks,
Eric

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: WARNING: at arch/x86/kernel/kvmclock.c:127
  2012-06-11 22:10     ` Eric B Munson
@ 2012-06-12  2:13       ` Marcelo Tosatti
  2012-06-12  8:48         ` Sedat Dilek
  2012-06-15  9:35         ` Sedat Dilek
  0 siblings, 2 replies; 12+ messages in thread
From: Marcelo Tosatti @ 2012-06-12  2:13 UTC (permalink / raw)
  To: Eric B Munson
  Cc: sedat.dilek, kvm, LKML, Avi Kivity, Thomas Gleixner, Ingo Molnar,
	x86

On Mon, Jun 11, 2012 at 06:10:34PM -0400, Eric B Munson wrote:
> On Mon, 11 Jun 2012 19:07:19 -0300, Marcelo Tosatti wrote:
> >On Mon, Jun 11, 2012 at 05:47:00PM -0400, Eric B Munson wrote:
> >>On Sun, 10 Jun 2012 17:47:24 +0200, Sedat Dilek wrote:
> >>>Hi,
> >>>
> >>>I see the same warning especially when resuming from a suspend (see
> >>>timestamps >=30-35sec) between Linux v3.5-rc1..v3.5-rc2.
> >>>
> >>>$ sudo grep kvmclock.c /var/log/kern.log
> >>>Jun  4 21:11:32 fambox kernel: [  784.037237] WARNING: at
> >>>arch/x86/kernel/kvmclock.c:127
> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
> >>>Jun  5 20:35:57 fambox kernel: [ 1928.458060] WARNING: at
> >>>arch/x86/kernel/kvmclock.c:127
> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
> >>>Jun  8 09:35:52 fambox kernel: [ 3290.134637] WARNING: at
> >>>arch/x86/kernel/kvmclock.c:127
> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
> >>>Jun  8 09:35:52 fambox kernel: [ 3290.238592] WARNING: at
> >>>arch/x86/kernel/kvmclock.c:127
> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
> >>>Jun  8 12:11:20 fambox kernel: [ 5777.023571] WARNING: at
> >>>arch/x86/kernel/kvmclock.c:127
> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
> >>>Jun  9 13:32:50 fambox kernel: [ 2778.842695] WARNING: at
> >>>arch/x86/kernel/kvmclock.c:127
> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
> >>>
> >>>From [1]:
> >>>
> >>>"...The warning itself is not required for the check_and_clear
> >>>function and can be removed as far as I am concerned."
> >>>
> >>>From [2] commit 3b5d56b9317fa7b5407dff1aa7b115bf6cdbd494
> >>("kvmclock:
> >>>Add functions to check if the host has stopped the vm")
> >>>...
> >>>+bool kvm_check_and_clear_guest_paused(void)
> >>>+{
> >>>+       bool ret = false;
> >>>+       struct pvclock_vcpu_time_info *src;
> >>>+
> >>>+       /*
> >>>+        * per_cpu() is safe here because this function is only
> >>>called from
> >>>+        * timer functions where preemption is already disabled.
> >>>+        */
> >>>+       WARN_ON(!in_atomic());
> >>>+       src = &__get_cpu_var(hv_clock);
> >>>+       if ((src->flags & PVCLOCK_GUEST_STOPPED) != 0) {
> >>>+               __this_cpu_and(hv_clock.flags,
> >>>~PVCLOCK_GUEST_STOPPED);
> >>>+               ret = true;
> >>>+       }
> >>>+
> >>>+       return ret;
> >>>+}
> >>>+EXPORT_SYMBOL_GPL(kvm_check_and_clear_guest_paused);
> >>>+
> >>>...
> >>>( The export macro was dropped in a followup commit. )
> >>>
> >>>So you mean "WARN_ON(!in_atomic());" can be deleted?
> >
> >Yes.
> >
> >>When I wrote the patch originally, I was under the (incorrect)
> >>assumption that the watch dog was only ever reset in an atomic
> >>context.  Given that this is not the case, the warning can be
> >>removed.  Though before that happens, I have a question: if this is
> >>called outside of an atomic context, is the use of __get_cpu_Var()
> >>and __this_cpu_and() invalid?
> >
> >It remains valid because its called with interrupts
> >disabled (see migrate_hrtimers).
> 
> Thank you, that was my assumption but I wanted to confirm.  I do not
> have access to my working kernel tree and won't for 2 days.  I can't
> get to the patch until late Wednesday so if someone else wants to
> work that up I'd appreciate it.
> 
> Thanks,
> Eric

Removed the warning in kvm.git master.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: WARNING: at arch/x86/kernel/kvmclock.c:127
  2012-06-12  2:13       ` Marcelo Tosatti
@ 2012-06-12  8:48         ` Sedat Dilek
  2012-06-15  9:35         ` Sedat Dilek
  1 sibling, 0 replies; 12+ messages in thread
From: Sedat Dilek @ 2012-06-12  8:48 UTC (permalink / raw)
  To: Marcelo Tosatti
  Cc: Eric B Munson, kvm, LKML, Avi Kivity, Thomas Gleixner,
	Ingo Molnar, x86

On Tue, Jun 12, 2012 at 4:13 AM, Marcelo Tosatti <mtosatti@redhat.com> wrote:
> On Mon, Jun 11, 2012 at 06:10:34PM -0400, Eric B Munson wrote:
>> On Mon, 11 Jun 2012 19:07:19 -0300, Marcelo Tosatti wrote:
>> >On Mon, Jun 11, 2012 at 05:47:00PM -0400, Eric B Munson wrote:
>> >>On Sun, 10 Jun 2012 17:47:24 +0200, Sedat Dilek wrote:
>> >>>Hi,
>> >>>
>> >>>I see the same warning especially when resuming from a suspend (see
>> >>>timestamps >=30-35sec) between Linux v3.5-rc1..v3.5-rc2.
>> >>>
>> >>>$ sudo grep kvmclock.c /var/log/kern.log
>> >>>Jun  4 21:11:32 fambox kernel: [  784.037237] WARNING: at
>> >>>arch/x86/kernel/kvmclock.c:127
>> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
>> >>>Jun  5 20:35:57 fambox kernel: [ 1928.458060] WARNING: at
>> >>>arch/x86/kernel/kvmclock.c:127
>> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
>> >>>Jun  8 09:35:52 fambox kernel: [ 3290.134637] WARNING: at
>> >>>arch/x86/kernel/kvmclock.c:127
>> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
>> >>>Jun  8 09:35:52 fambox kernel: [ 3290.238592] WARNING: at
>> >>>arch/x86/kernel/kvmclock.c:127
>> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
>> >>>Jun  8 12:11:20 fambox kernel: [ 5777.023571] WARNING: at
>> >>>arch/x86/kernel/kvmclock.c:127
>> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
>> >>>Jun  9 13:32:50 fambox kernel: [ 2778.842695] WARNING: at
>> >>>arch/x86/kernel/kvmclock.c:127
>> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
>> >>>
>> >>>From [1]:
>> >>>
>> >>>"...The warning itself is not required for the check_and_clear
>> >>>function and can be removed as far as I am concerned."
>> >>>
>> >>>From [2] commit 3b5d56b9317fa7b5407dff1aa7b115bf6cdbd494
>> >>("kvmclock:
>> >>>Add functions to check if the host has stopped the vm")
>> >>>...
>> >>>+bool kvm_check_and_clear_guest_paused(void)
>> >>>+{
>> >>>+       bool ret = false;
>> >>>+       struct pvclock_vcpu_time_info *src;
>> >>>+
>> >>>+       /*
>> >>>+        * per_cpu() is safe here because this function is only
>> >>>called from
>> >>>+        * timer functions where preemption is already disabled.
>> >>>+        */
>> >>>+       WARN_ON(!in_atomic());
>> >>>+       src = &__get_cpu_var(hv_clock);
>> >>>+       if ((src->flags & PVCLOCK_GUEST_STOPPED) != 0) {
>> >>>+               __this_cpu_and(hv_clock.flags,
>> >>>~PVCLOCK_GUEST_STOPPED);
>> >>>+               ret = true;
>> >>>+       }
>> >>>+
>> >>>+       return ret;
>> >>>+}
>> >>>+EXPORT_SYMBOL_GPL(kvm_check_and_clear_guest_paused);
>> >>>+
>> >>>...
>> >>>( The export macro was dropped in a followup commit. )
>> >>>
>> >>>So you mean "WARN_ON(!in_atomic());" can be deleted?
>> >
>> >Yes.
>> >
>> >>When I wrote the patch originally, I was under the (incorrect)
>> >>assumption that the watch dog was only ever reset in an atomic
>> >>context.  Given that this is not the case, the warning can be
>> >>removed.  Though before that happens, I have a question: if this is
>> >>called outside of an atomic context, is the use of __get_cpu_Var()
>> >>and __this_cpu_and() invalid?
>> >
>> >It remains valid because its called with interrupts
>> >disabled (see migrate_hrtimers).
>>
>> Thank you, that was my assumption but I wanted to confirm.  I do not
>> have access to my working kernel tree and won't for 2 days.  I can't
>> get to the patch until late Wednesday so if someone else wants to
>> work that up I'd appreciate it.
>>
>> Thanks,
>> Eric
>
> Removed the warning in kvm.git master.
>

I am reading your email approx. 6hrs after you have sent it and I do
NOT see the patch in [1].
Can you please send me the patch as an attachment, Thanks!

- Sedat -

[1] http://git.kernel.org/?p=virt/kvm/kvm.git;a=shortlog;h=refs/heads/master

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: WARNING: at arch/x86/kernel/kvmclock.c:127
  2012-06-12  2:13       ` Marcelo Tosatti
  2012-06-12  8:48         ` Sedat Dilek
@ 2012-06-15  9:35         ` Sedat Dilek
  2012-06-15 11:08           ` Marcelo Tosatti
  1 sibling, 1 reply; 12+ messages in thread
From: Sedat Dilek @ 2012-06-15  9:35 UTC (permalink / raw)
  To: Marcelo Tosatti
  Cc: Eric B Munson, kvm, LKML, Avi Kivity, Thomas Gleixner,
	Ingo Molnar, x86

On Tue, Jun 12, 2012 at 4:13 AM, Marcelo Tosatti <mtosatti@redhat.com> wrote:
> On Mon, Jun 11, 2012 at 06:10:34PM -0400, Eric B Munson wrote:
>> On Mon, 11 Jun 2012 19:07:19 -0300, Marcelo Tosatti wrote:
>> >On Mon, Jun 11, 2012 at 05:47:00PM -0400, Eric B Munson wrote:
>> >>On Sun, 10 Jun 2012 17:47:24 +0200, Sedat Dilek wrote:
>> >>>Hi,
>> >>>
>> >>>I see the same warning especially when resuming from a suspend (see
>> >>>timestamps >=30-35sec) between Linux v3.5-rc1..v3.5-rc2.
>> >>>
>> >>>$ sudo grep kvmclock.c /var/log/kern.log
>> >>>Jun  4 21:11:32 fambox kernel: [  784.037237] WARNING: at
>> >>>arch/x86/kernel/kvmclock.c:127
>> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
>> >>>Jun  5 20:35:57 fambox kernel: [ 1928.458060] WARNING: at
>> >>>arch/x86/kernel/kvmclock.c:127
>> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
>> >>>Jun  8 09:35:52 fambox kernel: [ 3290.134637] WARNING: at
>> >>>arch/x86/kernel/kvmclock.c:127
>> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
>> >>>Jun  8 09:35:52 fambox kernel: [ 3290.238592] WARNING: at
>> >>>arch/x86/kernel/kvmclock.c:127
>> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
>> >>>Jun  8 12:11:20 fambox kernel: [ 5777.023571] WARNING: at
>> >>>arch/x86/kernel/kvmclock.c:127
>> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
>> >>>Jun  9 13:32:50 fambox kernel: [ 2778.842695] WARNING: at
>> >>>arch/x86/kernel/kvmclock.c:127
>> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
>> >>>
>> >>>From [1]:
>> >>>
>> >>>"...The warning itself is not required for the check_and_clear
>> >>>function and can be removed as far as I am concerned."
>> >>>
>> >>>From [2] commit 3b5d56b9317fa7b5407dff1aa7b115bf6cdbd494
>> >>("kvmclock:
>> >>>Add functions to check if the host has stopped the vm")
>> >>>...
>> >>>+bool kvm_check_and_clear_guest_paused(void)
>> >>>+{
>> >>>+       bool ret = false;
>> >>>+       struct pvclock_vcpu_time_info *src;
>> >>>+
>> >>>+       /*
>> >>>+        * per_cpu() is safe here because this function is only
>> >>>called from
>> >>>+        * timer functions where preemption is already disabled.
>> >>>+        */
>> >>>+       WARN_ON(!in_atomic());
>> >>>+       src = &__get_cpu_var(hv_clock);
>> >>>+       if ((src->flags & PVCLOCK_GUEST_STOPPED) != 0) {
>> >>>+               __this_cpu_and(hv_clock.flags,
>> >>>~PVCLOCK_GUEST_STOPPED);
>> >>>+               ret = true;
>> >>>+       }
>> >>>+
>> >>>+       return ret;
>> >>>+}
>> >>>+EXPORT_SYMBOL_GPL(kvm_check_and_clear_guest_paused);
>> >>>+
>> >>>...
>> >>>( The export macro was dropped in a followup commit. )
>> >>>
>> >>>So you mean "WARN_ON(!in_atomic());" can be deleted?
>> >
>> >Yes.
>> >
>> >>When I wrote the patch originally, I was under the (incorrect)
>> >>assumption that the watch dog was only ever reset in an atomic
>> >>context.  Given that this is not the case, the warning can be
>> >>removed.  Though before that happens, I have a question: if this is
>> >>called outside of an atomic context, is the use of __get_cpu_Var()
>> >>and __this_cpu_and() invalid?
>> >
>> >It remains valid because its called with interrupts
>> >disabled (see migrate_hrtimers).
>>
>> Thank you, that was my assumption but I wanted to confirm.  I do not
>> have access to my working kernel tree and won't for 2 days.  I can't
>> get to the patch until late Wednesday so if someone else wants to
>> work that up I'd appreciate it.
>>
>> Thanks,
>> Eric
>
> Removed the warning in kvm.git master.
>

Unfortunately, I was busy this week with familiar affairs.
I have seen too late that Marcelo sent me the patch via PM.

Marcelo, could you please give credits to people next time, Thanks.

I am missing sth. like this in the commit now in Linus upstream GIT...

Reported-by: Frank Arnold <frank.arnold@...> (hidden - me reads KVM ML offline)
Reported-by: Sedat Dilek <sedat.dilek@gmail.com> (lazy guy - could
have reported earlier)
Acked-by or Reviewed-by: Eric B Munson <emunson@mgebm.net>

- Sedat -

[1] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=e32025a56403df4386cd61a741c0a36afe79ae8a

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: WARNING: at arch/x86/kernel/kvmclock.c:127
  2012-06-15  9:35         ` Sedat Dilek
@ 2012-06-15 11:08           ` Marcelo Tosatti
  0 siblings, 0 replies; 12+ messages in thread
From: Marcelo Tosatti @ 2012-06-15 11:08 UTC (permalink / raw)
  To: sedat.dilek
  Cc: Eric B Munson, kvm, LKML, Avi Kivity, Thomas Gleixner,
	Ingo Molnar, x86

On Fri, Jun 15, 2012 at 11:35:58AM +0200, Sedat Dilek wrote:
> On Tue, Jun 12, 2012 at 4:13 AM, Marcelo Tosatti <mtosatti@redhat.com> wrote:
> > On Mon, Jun 11, 2012 at 06:10:34PM -0400, Eric B Munson wrote:
> >> On Mon, 11 Jun 2012 19:07:19 -0300, Marcelo Tosatti wrote:
> >> >On Mon, Jun 11, 2012 at 05:47:00PM -0400, Eric B Munson wrote:
> >> >>On Sun, 10 Jun 2012 17:47:24 +0200, Sedat Dilek wrote:
> >> >>>Hi,
> >> >>>
> >> >>>I see the same warning especially when resuming from a suspend (see
> >> >>>timestamps >=30-35sec) between Linux v3.5-rc1..v3.5-rc2.
> >> >>>
> >> >>>$ sudo grep kvmclock.c /var/log/kern.log
> >> >>>Jun  4 21:11:32 fambox kernel: [  784.037237] WARNING: at
> >> >>>arch/x86/kernel/kvmclock.c:127
> >> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
> >> >>>Jun  5 20:35:57 fambox kernel: [ 1928.458060] WARNING: at
> >> >>>arch/x86/kernel/kvmclock.c:127
> >> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
> >> >>>Jun  8 09:35:52 fambox kernel: [ 3290.134637] WARNING: at
> >> >>>arch/x86/kernel/kvmclock.c:127
> >> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
> >> >>>Jun  8 09:35:52 fambox kernel: [ 3290.238592] WARNING: at
> >> >>>arch/x86/kernel/kvmclock.c:127
> >> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
> >> >>>Jun  8 12:11:20 fambox kernel: [ 5777.023571] WARNING: at
> >> >>>arch/x86/kernel/kvmclock.c:127
> >> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
> >> >>>Jun  9 13:32:50 fambox kernel: [ 2778.842695] WARNING: at
> >> >>>arch/x86/kernel/kvmclock.c:127
> >> >>>kvm_check_and_clear_guest_paused+0x52/0x60()
> >> >>>
> >> >>>From [1]:
> >> >>>
> >> >>>"...The warning itself is not required for the check_and_clear
> >> >>>function and can be removed as far as I am concerned."
> >> >>>
> >> >>>From [2] commit 3b5d56b9317fa7b5407dff1aa7b115bf6cdbd494
> >> >>("kvmclock:
> >> >>>Add functions to check if the host has stopped the vm")
> >> >>>...
> >> >>>+bool kvm_check_and_clear_guest_paused(void)
> >> >>>+{
> >> >>>+       bool ret = false;
> >> >>>+       struct pvclock_vcpu_time_info *src;
> >> >>>+
> >> >>>+       /*
> >> >>>+        * per_cpu() is safe here because this function is only
> >> >>>called from
> >> >>>+        * timer functions where preemption is already disabled.
> >> >>>+        */
> >> >>>+       WARN_ON(!in_atomic());
> >> >>>+       src = &__get_cpu_var(hv_clock);
> >> >>>+       if ((src->flags & PVCLOCK_GUEST_STOPPED) != 0) {
> >> >>>+               __this_cpu_and(hv_clock.flags,
> >> >>>~PVCLOCK_GUEST_STOPPED);
> >> >>>+               ret = true;
> >> >>>+       }
> >> >>>+
> >> >>>+       return ret;
> >> >>>+}
> >> >>>+EXPORT_SYMBOL_GPL(kvm_check_and_clear_guest_paused);
> >> >>>+
> >> >>>...
> >> >>>( The export macro was dropped in a followup commit. )
> >> >>>
> >> >>>So you mean "WARN_ON(!in_atomic());" can be deleted?
> >> >
> >> >Yes.
> >> >
> >> >>When I wrote the patch originally, I was under the (incorrect)
> >> >>assumption that the watch dog was only ever reset in an atomic
> >> >>context.  Given that this is not the case, the warning can be
> >> >>removed.  Though before that happens, I have a question: if this is
> >> >>called outside of an atomic context, is the use of __get_cpu_Var()
> >> >>and __this_cpu_and() invalid?
> >> >
> >> >It remains valid because its called with interrupts
> >> >disabled (see migrate_hrtimers).
> >>
> >> Thank you, that was my assumption but I wanted to confirm.  I do not
> >> have access to my working kernel tree and won't for 2 days.  I can't
> >> get to the patch until late Wednesday so if someone else wants to
> >> work that up I'd appreciate it.
> >>
> >> Thanks,
> >> Eric
> >
> > Removed the warning in kvm.git master.
> >
> 
> Unfortunately, I was busy this week with familiar affairs.
> I have seen too late that Marcelo sent me the patch via PM.
> 
> Marcelo, could you please give credits to people next time, Thanks.
> 
> I am missing sth. like this in the commit now in Linus upstream GIT...
> 
> Reported-by: Frank Arnold <frank.arnold@...> (hidden - me reads KVM ML offline)
> Reported-by: Sedat Dilek <sedat.dilek@gmail.com> (lazy guy - could
> have reported earlier)
> Acked-by or Reviewed-by: Eric B Munson <emunson@mgebm.net>
> 
> - Sedat -
> 
> [1] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=e32025a56403df4386cd61a741c0a36afe79ae8a

Sedat,

You are right, sorry for not giving appropriate credit.

Unfortunately we cannot change the commit message now.

Thanks anyway for reporting.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-06-15 11:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-10 15:47 WARNING: at arch/x86/kernel/kvmclock.c:127 Sedat Dilek
2012-06-10 16:08 ` Sedat Dilek
2012-06-11 21:47 ` Eric B Munson
2012-06-11 22:07   ` Marcelo Tosatti
2012-06-11 22:10     ` Eric B Munson
2012-06-12  2:13       ` Marcelo Tosatti
2012-06-12  8:48         ` Sedat Dilek
2012-06-15  9:35         ` Sedat Dilek
2012-06-15 11:08           ` Marcelo Tosatti
  -- strict thread matches above, loose matches on Subject: below --
2012-06-05 18:20 Frank Arnold
2012-06-06 15:52 ` Eric B Munson
2012-06-06 15:53   ` Eric B Munson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox