Received: from eggs.gnu.org ([2001:4830:134:3::10]:56334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze3uY-0003vb-QF for qemu-devel@nongnu.org; Mon, 21 Sep 2015 12:25:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ze3uV-0007T9-MJ for qemu-devel@nongnu.org; Mon, 21 Sep 2015 12:25:50 -0400 Received: from indium.canonical.com ([91.189.90.7]:37491) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze3uV-0007Sc-6h for qemu-devel@nongnu.org; Mon, 21 Sep 2015 12:25:47 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.76 #1 (Debian)) id 1Ze3uU-0005au-Hc for ; Mon, 21 Sep 2015 16:25:46 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 82C2C2E80C7 for ; Mon, 21 Sep 2015 16:25:46 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Mon, 21 Sep 2015 16:20:37 -0000 From: Pavel Boldin Sender: bounces@canonical.com References: <20150918235853.1773.80469.malonedeb@gac.canonical.com> Message-Id: <20150921162037.9102.32694.malone@gac.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1497479] Re: memory corruption with migrate/savevm in TCG mode Reply-To: Bug 1497479 <1497479@bugs.launchpad.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi, This one is for QEMU master, 1493049 is for Ubuntu packages. -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1497479 Title: memory corruption with migrate/savevm in TCG mode Status in QEMU: New Bug description: [ISSUE] QEMU releases 2.3.1 and lower are forgetting to flush TLBs before enabling the global dirty pages log and entering the final stage of saving the VM. [DESCRIPTION] The situation is the following: 1. TLB misses is the only way for page dirtying in the TCG mode. 2. If TLB is always hit by a running VM code during the execution of the = `ram_save_iterate' by migration thread then these pages are missing in the = dirty log. The TLB is always hit for instance when the VM is mostly idling = and the Kernel only handles APIC timer interrupts. 3. These pages are then missed during `ram_save_complete' stage. 4. This makes memory content in a saved VM state differ from the actual V= M memory. 5. If the affected memory pages contain some Kernel data structures these= can be corrupted by this memory inconsistency, causing Kernel to Oops afte= r loading the saved state. [SOLUTION] A proposed solution is to flush TLB when `log_global_start' is called. Here is the patch: https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/14= 93049/+attachment/4459905/+files/tcg-commit-on-log-global-start.patch [LINKS] Ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1493049 To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1497479/+subscriptions