From nobody Tue Nov 26 11:44:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1708634653; cv=none; d=zohomail.com; s=zohoarc; b=XZgFXJe8FUWc2Cy6wA2EA8zhPFjDk8sKlV5bDyUs7Dwd0/uPa6Dms7htw6ltrlnVKgVsKWJivQI4jcIjltocGIgkp8J0wSEBb7Mr+k41ly3uuzJa9S7635djKwtyj+g8vEU99Vod0/jUPBZa8tKuQBCcGehwf59MtiPjzEpZMGo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708634653; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=z/9ie+RjhRAxWQRFAoaHPcdtrZYsCMJBCi3SaKV1dlk=; b=n30Cd08bCIMmLgeaSAlEz/ROPeRdo2OHFZ62WeEd82kGmsfEYaPvqJXijtWXu+Md+jJOejSbRyjJGcNerSyG6oXDh+nhgtjEAt7tysPnNqfadqZRUqBKIJAyWV48QLFYAJb8fVezyiVTigyKPVePgpyWrhJrzqKQjGvVKRwjJ40= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1708634653839664.2809519781516; Thu, 22 Feb 2024 12:44:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rdFv9-0007HX-Nk; Thu, 22 Feb 2024 15:43:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rdFv5-0007Cb-W0 for qemu-devel@nongnu.org; Thu, 22 Feb 2024 15:43:53 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rdFv3-0002fO-3H for qemu-devel@nongnu.org; Thu, 22 Feb 2024 15:43:50 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1d73066880eso2072135ad.3 for ; Thu, 22 Feb 2024 12:43:48 -0800 (PST) Received: from stoup.. (173-197-098-125.biz.spectrum.com. [173.197.98.125]) by smtp.gmail.com with ESMTPSA id l12-20020a170902d34c00b001d8f81ecebesm10275500plk.192.2024.02.22.12.43.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 12:43:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708634627; x=1709239427; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=z/9ie+RjhRAxWQRFAoaHPcdtrZYsCMJBCi3SaKV1dlk=; b=g9JkkC78kXu590aZzhZDQGh3vXufgZDGk/pLXVSNopNrqAow5tDlZitYpxgnT0+rbb 9nfupNRA/SApjE/uPonO1p1D/38Pi4NjyCLqk3RmZ7W3ekbWnOMC958TWzTjUaT7cdl/ hY4op/O3Rv+jrya4IRLxNDpda9oruJK582TYebSkb2WHN5+wtIFIukQbFKpbu/H+K9Wc +S8lQc0Aek6OfcfWU4mLeixWT2kOOJqTrc6+3IztWj60BDSTCUq/dZ3u+sPSgbetg1PR 3DskF6gxZe7XI8Km4l6z5/826fpFU5Jb9iIi9fuiu4xZrdPeJ4Um9Aa5rkj+2s9Kb6Qa nEIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708634627; x=1709239427; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z/9ie+RjhRAxWQRFAoaHPcdtrZYsCMJBCi3SaKV1dlk=; b=khm1Nyo94WCwBtoXHdm13jrKika9TgQfiHk8qcGGyFUDJDUisk7YImq0ypw+ZEY5UA SH9+u4ex1CPBLQOxepE2OpFOyweyF6rX+6ufTon8B6O+/CdD5v8AinoInR5+neN2q9Zf KjIUR1aytKvgDF8jG2dhNvG9JCXpihH/twSxpq7lNvFGu1ckkw8Hp7veNXVBlZDXPx0G Q+3/CYA56HjtFyC8rt6U2K69WUU/dbbpylD1H7zWAAPTik0SrxRgn8VCJz8dMJ/S1CA3 M21EckiutgiTls3XcfJF/DsAIredUiBKGZdZm6izRRQd1sHmrGpjKruXVqfDxcsWEIxK iYBw== X-Gm-Message-State: AOJu0Ywkl726fbF/idHn8+Q4Kp1faOytkqbkwWz2Wps3caZLfEy2Ch6r yOqPJvst8Yy9AKwmmLfUtx9uXdXZYxFdTNL9uR/Tahl43Nw3riUCT4NJ4lqMqzwRQ2kYVI+qtMg p X-Google-Smtp-Source: AGHT+IGqMMl87NciX6E9cvagZpZTphc4TxdGyPnytQaCAzhuUuBo680g5GPhi/pDhdcbUkqWIO1odw== X-Received: by 2002:a17:902:6e0f:b0:1d9:167b:8e6c with SMTP id u15-20020a1709026e0f00b001d9167b8e6cmr20193636plk.46.1708634627595; Thu, 22 Feb 2024 12:43:47 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , Pierrick Bouvier , Helge Deller Subject: [PULL 14/39] migration: Remove qemu_host_page_size Date: Thu, 22 Feb 2024 10:42:58 -1000 Message-Id: <20240222204323.268539-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222204323.268539-1-richard.henderson@linaro.org> References: <20240222204323.268539-1-richard.henderson@linaro.org> 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=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1708634655459100006 Content-Type: text/plain; charset="utf-8" Replace with the maximum of the real host page size and the target page size. This is an exact replacement. Signed-off-by: Richard Henderson Reviewed-by: Ilya Leoshkevich Reviewed-by: Pierrick Bouvier Acked-by: Helge Deller Message-Id: <20240102015808.132373-12-richard.henderson@linaro.org> --- migration/ram.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 4649a81204..61c1488352 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2935,7 +2935,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque) { RAMState **rsp =3D opaque; RAMBlock *block; - int ret; + int ret, max_hg_page_size; =20 if (compress_threads_save_setup()) { return -1; @@ -2950,6 +2950,12 @@ static int ram_save_setup(QEMUFile *f, void *opaque) } (*rsp)->pss[RAM_CHANNEL_PRECOPY].pss_channel =3D f; =20 + /* + * ??? Mirrors the previous value of qemu_host_page_size, + * but is this really what was intended for the migration? + */ + max_hg_page_size =3D MAX(qemu_real_host_page_size(), TARGET_PAGE_SIZE); + WITH_RCU_READ_LOCK_GUARD() { qemu_put_be64(f, ram_bytes_total_with_ignored() | RAM_SAVE_FLAG_MEM_SIZE); @@ -2958,8 +2964,8 @@ static int ram_save_setup(QEMUFile *f, void *opaque) qemu_put_byte(f, strlen(block->idstr)); qemu_put_buffer(f, (uint8_t *)block->idstr, strlen(block->idst= r)); qemu_put_be64(f, block->used_length); - if (migrate_postcopy_ram() && block->page_size !=3D - qemu_host_page_size) { + if (migrate_postcopy_ram() && + block->page_size !=3D max_hg_page_size) { qemu_put_be64(f, block->page_size); } if (migrate_ignore_shared()) { @@ -3792,6 +3798,7 @@ static int parse_ramblock(QEMUFile *f, RAMBlock *bloc= k, ram_addr_t length) int ret =3D 0; /* ADVISE is earlier, it shows the source has the postcopy capability = on */ bool postcopy_advised =3D migration_incoming_postcopy_advised(); + int max_hg_page_size; =20 assert(block); =20 @@ -3809,9 +3816,16 @@ static int parse_ramblock(QEMUFile *f, RAMBlock *blo= ck, ram_addr_t length) return ret; } } + + /* + * ??? Mirrors the previous value of qemu_host_page_size, + * but is this really what was intended for the migration? + */ + max_hg_page_size =3D MAX(qemu_real_host_page_size(), TARGET_PAGE_SIZE); + /* For postcopy we need to check hugepage sizes match */ if (postcopy_advised && migrate_postcopy_ram() && - block->page_size !=3D qemu_host_page_size) { + block->page_size !=3D max_hg_page_size) { uint64_t remote_page_size =3D qemu_get_be64(f); if (remote_page_size !=3D block->page_size) { error_report("Mismatched RAM page size %s " --=20 2.34.1