From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965156AbcKLKaC (ORCPT ); Sat, 12 Nov 2016 05:30:02 -0500 Received: from mx6-phx2.redhat.com ([209.132.183.39]:47873 "EHLO mx6-phx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754713AbcKLKaA (ORCPT ); Sat, 12 Nov 2016 05:30:00 -0500 Date: Sat, 12 Nov 2016 05:29:41 -0500 (EST) From: Paolo Bonzini To: Dmitry Vyukov Cc: rkrcmar@redhat.com, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, KVM list , LKML , Steve Rutherford , syzkaller Message-ID: <1766965157.12320774.1478946581097.JavaMail.zimbra@redhat.com> In-Reply-To: References: Subject: Re: kvm: GPF in __get_kvmclock_ns MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.4.164.1, 10.5.100.50] X-Mailer: Zimbra 8.0.6_GA_5922 (ZimbraWebClient - FF49 (Linux)/8.0.6_GA_5922) Thread-Topic: GPF in __get_kvmclock_ns Thread-Index: UM44Ka8fHHQQYyjpDUnXCcMRSvwM6g== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This one is already known - see "[PATCH] KVM: x86: do not go through vcpu in __get_kvmclock_ns" which I posted yesterday. Paolo ----- Original Message ----- > From: "Dmitry Vyukov" > To: "Paolo Bonzini" , rkrcmar@redhat.com, "Thomas Gleixner" , "Ingo Molnar" > , "H. Peter Anvin" , x86@kernel.org, "KVM list" , "LKML" > , "Steve Rutherford" > Cc: "syzkaller" > Sent: Saturday, November 12, 2016 2:21:59 AM > Subject: Re: kvm: GPF in __get_kvmclock_ns > > On Fri, Nov 11, 2016 at 4:13 PM, Dmitry Vyukov wrote: > > Hello, > > > > The following program triggers GPF in __get_kvmclock_ns if run in a loop: > > https://gist.githubusercontent.com/dvyukov/91e4b366019e8500bac73ead5fbc44b0/raw/18178c254775dc953c4b5cf75442207480d939b4/gistfile1.txt > > > > On commit 015ed9433be2b476ec7e2e6a9a411a56e3b5b035 (Nov 11). > > > > general protection fault: 0000 [#1] SMP KASAN > > Dumping ftrace buffer: > > (ftrace buffer empty) > > Modules linked in: > > CPU: 3 PID: 4898 Comm: syz-executor Not tainted 4.9.0-rc4+ #40 > > Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs > > 01/01/2011 > > task: ffff880066e32dc0 task.stack: ffff880067280000 > > RIP: 0010:[] [] > > __get_kvmclock_ns+0x5e/0x390 arch/x86/kvm/x86.c:1731 > > RSP: 0018:ffff8800672878c0 EFLAGS: 00010003 > > RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffc90000766000 > > RDX: 000000000000064c RSI: 0000000000000000 RDI: 0000000000003265 > > RBP: ffff8800672878f0 R08: ffffed000ce50f3e R09: ffffed000ce50f3e > > R10: ffffed000ce50f3d R11: ffff8800672879ef R12: ffff88006728c000 > > R13: ffff88006728c000 R14: 000000002000d000 R15: ffffffffffffffea > > FS: 00007f0b2288a700(0000) GS:ffff88006e300000(0000) > > knlGS:0000000000000000 > > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > > CR2: 000000002000d000 CR3: 00000000672ba000 CR4: 00000000000026e0 > > Stack: > > 0000000000000046 1ffff1000ce50f24 1ffff1000ce50f24 ffff8800672879c0 > > ffff88006728c000 000000002000d000 ffff880067287b90 ffffffff810aafd8 > > 0000000000000038 ffff880067287948 ffffffff812c10f5 1ffff1000ce50f2d > > Call Trace: > > [] kvm_arch_vm_ioctl+0x1098/0x1c10 > > arch/x86/kvm/x86.c:4096 > > [] kvm_vm_ioctl+0x193/0x1670 > > arch/x86/kvm/../../../virt/kvm/kvm_main.c:3097 > > [< inline >] vfs_ioctl fs/ioctl.c:43 > > [] do_vfs_ioctl+0x18c/0x1040 fs/ioctl.c:679 > > [< inline >] SYSC_ioctl fs/ioctl.c:694 > > [] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:685 > > [] entry_SYSCALL_64_fastpath+0x1f/0xc2 > > Code: 03 80 3c 02 00 0f 85 26 03 00 00 49 8b 9c 24 a0 03 00 00 48 b8 > > 00 00 00 00 00 fc ff df 48 8d bb 65 32 00 00 48 89 fa 48 c1 ea 03 <0f> > > b6 04 02 48 89 fa 83 e2 07 38 d0 7f 08 84 c0 0f 85 99 02 00 > > RIP [] __get_kvmclock_ns+0x5e/0x390 > > arch/x86/kvm/x86.c:1731 > > RSP > > ---[ end trace 86f1ebae02f87a96 ]--- > > Kernel panic - not syncing: Fatal exception > > Dumping ftrace buffer: > > (ftrace buffer empty) > > Kernel Offset: disabled > > reboot: cpu_has_vmx: ecx=80a02021 1 > > > > > > The line is: > > if (vcpu && vcpu->arch.hv_clock.flags & PVCLOCK_TSC_STABLE_BIT) { > > > > > > Thanks > > > +Steve >