From patchwork Fri Jan 12 11:31:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 859837 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YP6sUeF/"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zJ1y51Z9Wz9t3G for ; Fri, 12 Jan 2018 23:19:09 +1100 (AEDT) Received: from localhost ([::1]:36597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZyId-00080f-8J for incoming@patchwork.ozlabs.org; Fri, 12 Jan 2018 07:19:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42150) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZxZO-00084N-SC for qemu-devel@nongnu.org; Fri, 12 Jan 2018 06:32:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZxZL-00064B-48 for qemu-devel@nongnu.org; Fri, 12 Jan 2018 06:32:22 -0500 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:38111) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eZxZK-00063u-UP for qemu-devel@nongnu.org; Fri, 12 Jan 2018 06:32:19 -0500 Received: by mail-wr0-x241.google.com with SMTP id x1so859036wrb.5 for ; Fri, 12 Jan 2018 03:32:18 -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=YP6sUeF/erD9dgY9RoQ/hISmu/W+/NdibjyCCq8OLGGy8uY2Cn46KPPRZleTAJH15a D9xsSkx45DNdVp334b/aoycpzs4QEy4OBRFrU7puz6sd6EOvxb8qoFuw4NYx3KggMi4k ptIro4hczPoS+mvGhTN7ikn5zToaNYDpGZJuEpr7skqY3aIkdS8o5L71k5R6ayMImEfH zCrZrCzV51+hjoBIa2Qu73Kq2XKOvU5uOPYo4I8tZa1SPRIa4bAjIa8M9pt8AIr/gRp0 GpyE/6XCEydPC3oLcwuCvg7os2pINgcYroZq4btyObtawWJXVC8VvdDa9mFAMPeHVTaz crBw== 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=hjAJgsCZEhe8vI24ZdhwVB5mWyLzWWHC/07/mn8WfOR32mvCHFC5S2OCGeYTQjtyXr jgMCIto/8TVoMAG50GoM1Km2LR2iN7oIEePSELxlkduBcRseO/uKqW5SDXcSkud1zbJi Zy9oNQIiG+7VvUnF3z9UiIsiXpBL0qtT+LhdHBOZ10YXmFhG+TmhHDpu+H01fBMp1yAf OZptZPxmEdkRzriWcSWacI2rWh0irErYs2V/bj/tLPtDnVIi2ptg1KJKZdd/yvXBASBI zn4S6DWMioaE+LGxTgAbv4PsvE9DgfdKrtwLUB6HZqrhJf7tnbMePPz5XTXZ2dZNSTtD SXkA== X-Gm-Message-State: AKwxytf21zMvqKR31UqGAiGSr1OwY2GgHa5OkxqWHSoBbz8hpsCw7/1/ BYdnNw9xXf8Lsl2TnhxQzc3rou2M X-Google-Smtp-Source: ACJfBouFvY0hh+61a9ehTC140VgmrnQiezwVJfShYEyd2m/kMCpa5vKXIu+ksrIlYbvrgcVdwfVJPA== X-Received: by 10.223.176.103 with SMTP id g36mr7715451wra.129.1515756737658; Fri, 12 Jan 2018 03:32:17 -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 l8sm2732271wmg.46.2018.01.12.03.32.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Jan 2018 03:32:16 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 12 Jan 2018 12:31:14 +0100 Message-Id: <1515756676-3860-51-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1515756676-3860-1-git-send-email-pbonzini@redhat.com> References: <1515756676-3860-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:c0c::241 Subject: [Qemu-devel] [PULL 50/52] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 version_id) cpu->interrupt_request &= ~0x01; tlb_flush(cpu); + /* 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; }