From nobody Sat May 18 13:36:46 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1612459368; cv=none; d=zohomail.com; s=zohoarc; b=fQqayVcxDp0KcSUctgqvMRGth8iWxHwKTFfPsuaFJXVSm0lVnmXiUnVZaP6oHgi1hc+mOnzrr8mH121V3zRBSFbNYbnhcTQ8btgXr4yoqdhept4qHGTN8fgHEW673yhbwkxsZUYU8R60bEj+hRWJgioqzCEbHIGK6SxP+aYEQc4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612459368; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=cz+maYlJatZGPJIR03fAMJOosyalgjnA6GOQcsr8gVw=; b=GiVXQyLGisBRijKIpZbEHs0fsTf2K90OzQUWxuC4kh7zVjM1WDnU9BKF/4Bg2dmq9TNJt83GItA0t4rXaPNJHKwhqQdwuxmWkgp5WrKT7ShxItsO6Y6nm7weoAfOBPSjcqrlGGZA55SNIc1YhTtNz5RoLE5IvpNv6/RJSGG2VxU= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612459368501165.30350230832153; Thu, 4 Feb 2021 09:22:48 -0800 (PST) Received: from localhost ([::1]:57254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7iL9-00019R-Av for importer@patchew.org; Thu, 04 Feb 2021 12:22:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7hii-0004HK-R0 for qemu-devel@nongnu.org; Thu, 04 Feb 2021 11:43:04 -0500 Received: from proxmox-new.maurer-it.com ([212.186.127.180]:59541) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7hig-00063v-Py for qemu-devel@nongnu.org; Thu, 04 Feb 2021 11:43:04 -0500 Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id A2ACE461E2; Thu, 4 Feb 2021 17:35:48 +0100 (CET) From: Stefan Reiter To: Vladimir Sementsov-Ogievskiy , Juan Quintela , "Dr. David Alan Gilbert" Subject: [PATCH] migration: only check page size match if RAM postcopy is enabled Date: Thu, 4 Feb 2021 17:35:22 +0100 Message-Id: <20210204163522.13291-1-s.reiter@proxmox.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.186.127.180; envelope-from=s.reiter@proxmox.com; helo=proxmox-new.maurer-it.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Postcopy may also be advised for dirty-bitmap migration only, in which case the remote page size will not be available and we'll instead read bogus data, blocking migration with a mismatch error if the VM uses hugepages. Fixes: 58110f0acb ("migration: split common postcopy out of ram postcopy") Signed-off-by: Stefan Reiter Reviewed-by: Dr. David Alan Gilbert --- migration/ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/ram.c b/migration/ram.c index 7811cde643..6ace15261c 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -3521,7 +3521,7 @@ static int ram_load_precopy(QEMUFile *f) } } /* For postcopy we need to check hugepage sizes match = */ - if (postcopy_advised && + if (postcopy_advised && migrate_postcopy_ram() && block->page_size !=3D qemu_host_page_size) { uint64_t remote_page_size =3D qemu_get_be64(f); if (remote_page_size !=3D block->page_size) { --=20 2.20.1