From nobody Tue Oct 28 02:10:44 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516116084506363.1220295201018; Tue, 16 Jan 2018 07:21:24 -0800 (PST) Received: from localhost ([::1]:40171 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebT3D-0005VK-HS for importer@patchew.org; Tue, 16 Jan 2018 10:21:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebS4k-0003kx-KO for qemu-devel@nongnu.org; Tue, 16 Jan 2018 09:18:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebS4h-0005YH-A5 for qemu-devel@nongnu.org; Tue, 16 Jan 2018 09:18:54 -0500 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:45382) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ebS4h-0005X7-3c for qemu-devel@nongnu.org; Tue, 16 Jan 2018 09:18:51 -0500 Received: by mail-wm0-x243.google.com with SMTP id i186so8661858wmi.4 for ; Tue, 16 Jan 2018 06:18:51 -0800 (PST) Received: from 640k.lan (dynamic-adsl-78-12-229-84.clienti.tiscali.it. [78.12.229.84]) by smtp.gmail.com with ESMTPSA id u10sm1537758wrg.6.2018.01.16.06.18.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jan 2018 06:18:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=C8+zokiy5iXF1tSoWLEySm0x0c0xHd/vJQau14WkiL0=; b=CCwDqfFCPE0i9nZXO4lQwn/zzULo7hViuiJtB/MP9tZ46v1SAL2PuWZY2MefgF1SVo o9OsB6CDipl8n80XoQViRxwO0mh/CjKZW6QmWFnBcgRChkELUrgyJ9Nee+Pytzw8KsGd l540bZv5Vvy6WMZ9VMk8jxy/+s9sntAsvC7PYHQVnRZhHH7EGW1+X4KVf0ALXYzGs7ei aHV3NSbaBRVkGORdQdMD+0cJ3iKzTNjcF9VCIAaGTWk40yV99kCbZWwxw3uxt8QWdxpN 8UdYVw7Evfp42DY1g7VbpiP+z0XHk1d4X8GDujXuwXt9yz9VrDkpVMlRizX7sU4b5gev HqjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=C8+zokiy5iXF1tSoWLEySm0x0c0xHd/vJQau14WkiL0=; b=tXH0YMFp6/voqcF45L4X3A0B/6zzLZd5dIQZfPiIB9J5OUq3J6I7tx+nXMkSDg/uBx lNlw1jtQafCKn1Bj19BDNQ1QxyE8liNi/nzllDS/bZgE5oBmvYlvqJ8VYI2NMmjxg83q d2coLWfpAq2IES2++uWVjOfTg3cTsj6Tcj8azFiE/npliznCb3iWoFBUb6L5cNHJT8ya KSpKDw5XPLILsgDsLm43ojAqP7scUShccFI05O/PaXgkH/+nkEikdiU3ZkqZqqK9Z72R Y+CwY7xrQ/05iJ8gC84qLwUGiV/P86ruLo46rV6hhAPZorU0oBXyCQZaPemKpuC0t6Zk xq6g== X-Gm-Message-State: AKwxytctyguePTV9XlYpx4PofcgYSdzYSOPDLco0AXpZZ5397PsZo7Us nYhS8CiEf27ooCpy4yBNaplmGjYy X-Google-Smtp-Source: ACJfBou6WPL5VRozqUawuST1QpfijHy1myNyOw3eTM64Q18HD/s+QFYi7OYQe9zB7pz+tP7pa8ysOA== X-Received: by 10.28.69.66 with SMTP id s63mr13035767wma.47.1516112329783; Tue, 16 Jan 2018 06:18:49 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 15:17:31 +0100 Message-Id: <1516112253-14480-50-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1516112253-14480-1-git-send-email-pbonzini@redhat.com> References: <1516112253-14480-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PULL 49/51] cpu: flush TB cache when loading VMState X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maria Klimushenkova , Pavel Dovgalyuk Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Pavel Dovgalyuk Flushing TB cache is required because TBs key in the cache may match different code which existed in the previous state. Signed-off-by: Pavel Dovgalyuk Signed-off-by: Maria Klimushenkova Message-Id: <20180110134846.12940.99993.stgit@pasha-VirtualBox> [Add comment suggested by Peter Maydell. - Paolo] Signed-off-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- exec.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/exec.c b/exec.c index 9f4f450..d28fc0c 100644 --- a/exec.c +++ b/exec.c @@ -623,6 +623,13 @@ static int cpu_common_post_load(void *opaque, int vers= ion_id) cpu->interrupt_request &=3D ~0x01; tlb_flush(cpu); =20 + /* loadvm has just updated the content of RAM, bypassing the + * usual mechanisms that ensure we flush TBs for writes to + * memory we've translated code from. So we must flush all TBs, + * which will now be stale. + */ + tb_flush(cpu); + return 0; } =20 --=20 1.8.3.1