From nobody Sat Nov 23 22:43:15 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1728477805; cv=none; d=zohomail.com; s=zohoarc; b=ZTAEPkhmO5gfuZVt7QkAw0rF4IA4QadlHRDl9kMeJlcn2oqzURK7676UQ+xqOPYHgSdi9kZWh4xtnqqXI6fI/m6EWVsvnSSKdy7PLeveI41K+L4vthHsnuAphnfqXBfQbWJsoezCVVsub2wkty7RvYpg5GJH2erHi09UfwXDMNA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728477805; 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=XQt31NpoPy1kBmextgAReCNHDW1SSJ1uheANHNAwqA8=; b=Xlzcvz4dc1hwvek62VK93aRAu9scRLIahTGqXDKWqwdbsJbLSpbBbuoTpPMYay1alETo/llZHhXKKrLLBLCk397mcG22K3JR/fPW2TgTjZ1L0lpTL3Ti9PjsC+xi6eZjOUhGleA8qP/mrQhL4m9acxPQ1zAWfObCSG8vxRpLo9w= 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 1728477805388616.7822746999744; Wed, 9 Oct 2024 05:43:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syW1k-0004iW-7R; Wed, 09 Oct 2024 08:42:52 -0400 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 1syW1h-0004ho-SK for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:42:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syW1g-0005Qv-2f for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:42:49 -0400 Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-297-EDqaR26GMfuZOmhGzLohXA-1; Wed, 09 Oct 2024 08:42:44 -0400 Received: by mail-io1-f72.google.com with SMTP id ca18e2360f4ac-82cd83f0b2eso712611939f.2 for ; Wed, 09 Oct 2024 05:42:44 -0700 (PDT) Received: from x1n.redhat.com (pool-99-254-114-190.cpe.net.cable.rogers.com. [99.254.114.190]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-83503aacb18sm220272039f.30.2024.10.09.05.42.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 05:42:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728477767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XQt31NpoPy1kBmextgAReCNHDW1SSJ1uheANHNAwqA8=; b=a5Mgr6hna2dB/llbKsX+6O8qlrCwwmLrF/NyPWhXSk9dPO8H8JUo0nr4Ax+uQJdaNaqHut QQuirSKXdVOjmcLdUjGPdC2spEPEjzZQhF/WMhtMYWzNhRHEAai31xOLBZ2gr5RNgZIATS /VVrClXtdIc1rFzxE0azubqHkgoWKMw= X-MC-Unique: EDqaR26GMfuZOmhGzLohXA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728477763; x=1729082563; 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=XQt31NpoPy1kBmextgAReCNHDW1SSJ1uheANHNAwqA8=; b=w2KXdjJ4npJYn6bpBxNEvLLM6GRJPBMvRau/ygXi3/2oZenL9/Z/yxtJcqF5YSllmi n+SwVs8Ya2YQ3sLOb61MMyeP8sftyuBSj1zqHcbUUb4QcO3d/yAqqyuBavErNKXpfCqD 3dRXKerX5XRWxmD2wtZ/vasuPSNIAodD7xyVK/wLGfUCH4i8OsJk/mYsbEQLDgOedy3c n3wVPuf/d0UbIoGIPY3qDeOR3q9f/jKDlZwbioZXPLazMDpkY9CwllGCS3bvdDTAO/Yt un2o11S5zQHdNO1X3crM/Zx5o7BzPrIDbNZef3CNJJVZHYeNgFUABfiTh6QoS3Lf44dA 3zww== X-Gm-Message-State: AOJu0YzVv9bLr8PiCwVmZzX1LkSUJqYKcusuRtrAIHIoF4p6qsg6K3g6 uMD41YtdTCW+dc48G6PEzHaY0RSDqqBwM3HM82/zQwuTBHFuUYgT2fIsCDBXvcfpalKV9wQ+cEj +aUOn1opRpyVrCFiAMAJGSUXMi1iMJSUEPye/vgoGJaxqRFXsrCzdqQMEosPkpe5VqHKSOj5GM/ pM+2WUfn7g/IRVme5u2D6fmYr5VPJ4eDATug== X-Received: by 2002:a05:6602:634c:b0:835:444b:6195 with SMTP id ca18e2360f4ac-835444b6394mr116201839f.14.1728477763149; Wed, 09 Oct 2024 05:42:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFMSa2FsTMWN2FK2YGvoOW+MMGKxTusV922goBugNpfYw+prMZ0kJvuRsgvymmt7QWIiva++Q== X-Received: by 2002:a05:6602:634c:b0:835:444b:6195 with SMTP id ca18e2360f4ac-835444b6394mr116199039f.14.1728477762748; Wed, 09 Oct 2024 05:42:42 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Peter Maydell , Fabiano Rosas , peterx@redhat.com, Ani Sinha , Paolo Bonzini Subject: [PULL 01/12] memory: notify hypervisor of all eventfds during listener (de)registration Date: Wed, 9 Oct 2024 08:42:27 -0400 Message-ID: <20241009124238.371084-2-peterx@redhat.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241009124238.371084-1-peterx@redhat.com> References: <20241009124238.371084-1-peterx@redhat.com> 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=170.10.129.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.151, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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.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 @redhat.com) X-ZM-MESSAGEID: 1728477807430116600 Content-Type: text/plain; charset="utf-8" From: Ani Sinha When a new listener for an address space is registered, the hypervisor must= be informed of all existing eventfds for that address space by calling eventfd_add() for that listener. Similarly, when a listener is de-registered from an address space, the hypervisor must be informed of all existing even= tfds for that address space with a call to eventfd_del(). Same is also true for coalesced io. Send coalesced io add/del listener notifications if any flatrage for the address space registered with the listener intersects with any coalesced io range. Suggested-by: Paolo Bonzini Signed-off-by: Ani Sinha Link: https://lore.kernel.org/r/20240918064853.30678-1-anisinha@redhat.com Signed-off-by: Peter Xu --- system/memory.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/system/memory.c b/system/memory.c index f6f6fee6d8..85f6834cb3 100644 --- a/system/memory.c +++ b/system/memory.c @@ -941,6 +941,38 @@ static void flat_range_coalesced_io_add(FlatRange *fr,= AddressSpace *as) } } =20 +static void +flat_range_coalesced_io_notify_listener_add_del(FlatRange *fr, + MemoryRegionSection *mrs, + MemoryListener *listener, + AddressSpace *as, bool add) +{ + CoalescedMemoryRange *cmr; + MemoryRegion *mr =3D fr->mr; + AddrRange tmp; + + QTAILQ_FOREACH(cmr, &mr->coalesced, link) { + tmp =3D addrrange_shift(cmr->addr, + int128_sub(fr->addr.start, + int128_make64(fr->offset_in_regio= n))); + + if (!addrrange_intersects(tmp, fr->addr)) { + return; + } + tmp =3D addrrange_intersection(tmp, fr->addr); + + if (add && listener->coalesced_io_add) { + listener->coalesced_io_add(listener, mrs, + int128_get64(tmp.start), + int128_get64(tmp.size)); + } else if (!add && listener->coalesced_io_del) { + listener->coalesced_io_del(listener, mrs, + int128_get64(tmp.start), + int128_get64(tmp.size)); + } + } +} + static void address_space_update_topology_pass(AddressSpace *as, const FlatView *old_view, const FlatView *new_view, @@ -3015,8 +3047,10 @@ void memory_global_dirty_log_stop(unsigned int flags) static void listener_add_address_space(MemoryListener *listener, AddressSpace *as) { + unsigned i; FlatView *view; FlatRange *fr; + MemoryRegionIoeventfd *fd; =20 if (listener->begin) { listener->begin(listener); @@ -3041,10 +3075,34 @@ static void listener_add_address_space(MemoryListen= er *listener, if (listener->region_add) { listener->region_add(listener, §ion); } + + /* send coalesced io add notifications */ + flat_range_coalesced_io_notify_listener_add_del(fr, §ion, + listener, as, true= ); + if (fr->dirty_log_mask && listener->log_start) { listener->log_start(listener, §ion, 0, fr->dirty_log_mask); } } + + /* + * register all eventfds for this address space for the newly register= ed + * listener. + */ + for (i =3D 0; i < as->ioeventfd_nb; i++) { + fd =3D &as->ioeventfds[i]; + MemoryRegionSection section =3D (MemoryRegionSection) { + .fv =3D view, + .offset_within_address_space =3D int128_get64(fd->addr.start), + .size =3D fd->addr.size, + }; + + if (listener->eventfd_add) { + listener->eventfd_add(listener, §ion, + fd->match_data, fd->data, fd->e); + } + } + if (listener->commit) { listener->commit(listener); } @@ -3054,8 +3112,10 @@ static void listener_add_address_space(MemoryListene= r *listener, static void listener_del_address_space(MemoryListener *listener, AddressSpace *as) { + unsigned i; FlatView *view; FlatRange *fr; + MemoryRegionIoeventfd *fd; =20 if (listener->begin) { listener->begin(listener); @@ -3067,10 +3127,33 @@ static void listener_del_address_space(MemoryListen= er *listener, if (fr->dirty_log_mask && listener->log_stop) { listener->log_stop(listener, §ion, fr->dirty_log_mask, 0); } + + /* send coalesced io del notifications */ + flat_range_coalesced_io_notify_listener_add_del(fr, §ion, + listener, as, fals= e); if (listener->region_del) { listener->region_del(listener, §ion); } } + + /* + * de-register all eventfds for this address space for the current + * listener. + */ + for (i =3D 0; i < as->ioeventfd_nb; i++) { + fd =3D &as->ioeventfds[i]; + MemoryRegionSection section =3D (MemoryRegionSection) { + .fv =3D view, + .offset_within_address_space =3D int128_get64(fd->addr.start), + .size =3D fd->addr.size, + }; + + if (listener->eventfd_del) { + listener->eventfd_del(listener, §ion, + fd->match_data, fd->data, fd->e); + } + } + if (listener->commit) { listener->commit(listener); } --=20 2.45.0 From nobody Sat Nov 23 22:43:15 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1728477785; cv=none; d=zohomail.com; s=zohoarc; b=PrYAvVXDlcuUxUUkCocr5TIYHmVySBwhvlWnYuE6KaUC6f4GO4j4YyGIZN4uzGGRjn3O3zpdbKtLhsJzPB4SRMNoW1u3mKKwuN3Vo2Cb2MIdiWr1++8jX2iCF0Ne+1NlOOO1YD0UI/E/E7asgLZDOzx36lURiijpUILXUIwk+yc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728477785; 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=3dP5VLpH/CdfMrO+j/wA9qzkuALnn3Rt2eGfiqdxtHY=; b=Dg6NgWQa4m8BgQCvjy0ZcFA4XNqVROj+y5mki1ikvx0jjF9k22YiRwd2SC94mkssSepEmEw2KQwZ9hhtD4gP1MwtGKI3DkryMd/hwU8iv2COVBb1ZnvMThHe6VzFxQovMV4SqGOhZDMnSEfJ7BivSlKEdXZjenpJI4kLl+EtWZY= 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 1728477785944986.2731622795824; Wed, 9 Oct 2024 05:43:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syW1i-0004i4-VD; Wed, 09 Oct 2024 08:42:50 -0400 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 1syW1h-0004hg-Ea for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:42:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syW1f-0005Qs-MC for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:42:49 -0400 Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-662-8UTeEMiRN6-_Nh8eELdQCA-1; Wed, 09 Oct 2024 08:42:46 -0400 Received: by mail-io1-f70.google.com with SMTP id ca18e2360f4ac-835428b766dso46664839f.2 for ; Wed, 09 Oct 2024 05:42:46 -0700 (PDT) Received: from x1n.redhat.com (pool-99-254-114-190.cpe.net.cable.rogers.com. [99.254.114.190]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-83503aacb18sm220272039f.30.2024.10.09.05.42.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 05:42:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728477767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3dP5VLpH/CdfMrO+j/wA9qzkuALnn3Rt2eGfiqdxtHY=; b=TMrBt3PJ/7PC5kWdjrw0CZyxhutrCp/6l2LfA7m3modMfjtzKKo4klR9EJorGqNf42DZFB bAHfURCIIgzx/CP3yvIWCS7VkStevktVJD2ATPbCXjR3KW7virSIex+b0mLywMBmLavpIT /vRRcjGcTbtkdssfNWX3mkneV+IqbXw= X-MC-Unique: 8UTeEMiRN6-_Nh8eELdQCA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728477765; x=1729082565; 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=3dP5VLpH/CdfMrO+j/wA9qzkuALnn3Rt2eGfiqdxtHY=; b=DY2h+yPqzTNdClKzYq7qJ7qzs8u/1/nYN0jbYD8F0wuVhle0ihZR5gaFsM5IIMc5q6 vuc9cLctpSstlv8dolHZKStqW/cp5oVtv8cFuhSwEKjGdsg9TTWJdRuGtlsy/ifw7Y3p eKoTkWuXvf/SszdRhSPlpfoTC4wkw3sVF03g7ck1K5smCyGyW/jHsJx1S9lcXaxuJAuq 4kkj52HjNtwgf0FQ5x6rbxCjazsw66Y2OXeZh1D17TmmKPeu2/XvFcRZwfEAARV/2Wre 8oa1gVXdY/gvEDz813q3EUBJOwYQA0ri/t075xmQrzTRz7BSR8NFas0dF4G3gNxQ2eQl 4iFg== X-Gm-Message-State: AOJu0YwCfai2OvqO5HemqTaX92yXhtXSNLrlNtwrm0je1/wihp1OLhOj p5hVl/8C5i5BHHk8fcXzhVT5nXuNfT7s4UzPjjuEx3dPsR7xUEY4vXFaSSUIu41rifFcStjv+L8 Tni64znXN2kiyJuFBAR0M9AneDapOAsTJpg6ewRw5HBDzQ0x8H6tNvyDb9a0AD7ZAX6X1v1U/hg zkXSBMvJEIaggI1EuF7ta3sogZ/NxawCYsgA== X-Received: by 2002:a05:6602:6b07:b0:832:40d0:902a with SMTP id ca18e2360f4ac-8353d4a294bmr302685939f.6.1728477765096; Wed, 09 Oct 2024 05:42:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGwjy2fxISajlh32nV/U7MGRfMgnrbid48+PkBRgkRJpAT5yUqjLydvqLrZl7XaxQUUj/xdpg== X-Received: by 2002:a05:6602:6b07:b0:832:40d0:902a with SMTP id ca18e2360f4ac-8353d4a294bmr302683139f.6.1728477764634; Wed, 09 Oct 2024 05:42:44 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Peter Maydell , Fabiano Rosas , peterx@redhat.com Subject: [PULL 02/12] migration/multifd: Ensure packet->ramblock is null-terminated Date: Wed, 9 Oct 2024 08:42:28 -0400 Message-ID: <20241009124238.371084-3-peterx@redhat.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241009124238.371084-1-peterx@redhat.com> References: <20241009124238.371084-1-peterx@redhat.com> 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=170.10.133.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.151, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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.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 @redhat.com) X-ZM-MESSAGEID: 1728477787248116600 Content-Type: text/plain; charset="utf-8" From: Fabiano Rosas Coverity points out that the current usage of strncpy to write the ramblock name allows the field to not have an ending '\0' in case idstr is already not null-terminated (e.g. if it's larger than 256 bytes). This is currently harmless because the packet->ramblock field is never touched again on the source side. The destination side reads only up to the field's size from the stream and forces the last byte to be 0. We're still open to a programming error in the future in case this field is ever passed into a function that expects a null-terminated string. Change from strncpy to QEMU's pstrcpy, which puts a '\0' at the end of the string and doesn't fill the extra space with zeros. (there's no spillage between iterations of fill_packet because after commit 87bb9e953e ("migration/multifd: Isolate ram pages packet data") the packet is always zeroed before filling) Resolves: Coverity CID 1560071 Reported-by: Peter Maydell Signed-off-by: Fabiano Rosas Link: https://lore.kernel.org/r/20240919150611.17074-1-farosas@suse.de Signed-off-by: Peter Xu --- migration/multifd-nocomp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/migration/multifd-nocomp.c b/migration/multifd-nocomp.c index 07c63f4a72..55191152f9 100644 --- a/migration/multifd-nocomp.c +++ b/migration/multifd-nocomp.c @@ -17,6 +17,7 @@ #include "multifd.h" #include "options.h" #include "qapi/error.h" +#include "qemu/cutils.h" #include "qemu/error-report.h" #include "trace.h" =20 @@ -201,7 +202,8 @@ void multifd_ram_fill_packet(MultiFDSendParams *p) packet->zero_pages =3D cpu_to_be32(zero_num); =20 if (pages->block) { - strncpy(packet->ramblock, pages->block->idstr, 256); + pstrcpy(packet->ramblock, sizeof(packet->ramblock), + pages->block->idstr); } =20 for (int i =3D 0; i < pages->num; i++) { --=20 2.45.0 From nobody Sat Nov 23 22:43:15 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1728477885; cv=none; d=zohomail.com; s=zohoarc; b=Z0MhL4XDPxtyRCF+mPvA6JKZCskxSwpmkSImlNljB3tctmLAj8FMAwNlzegXqqlc5MCQw+/cnKoOmwwPDaz8mbeUKP1Vd8J8cNNZQQTdBbBidLgK2FQEvDbQO03/Xh1VTcvbiDgyt6ybQtpiqnkkgYTnNQf+JqjnJo1yVm7sIzk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728477885; 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=jSrTZ5PyIp+y/7h2oJbsCMlzTXaX6rgV2rodQaLvIWo=; b=JY4F0PZwmrmKVjtM60aZg0mdGU6EfHY5HYI/hy8mLTojnvoesLOBZkOEdbS3CNceFxfgV/jSVNciaEA1chETcPdhjeYrhKgG0uteXpupQ+/n2NrXuoqBoFiDdOaXstS5H0Lc5nA3l0UUWaEpRgIrakeFX6UGEDlgbReysso1mG0= 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 1728477885946454.29008549596574; Wed, 9 Oct 2024 05:44:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syW1m-0004iv-Kg; Wed, 09 Oct 2024 08:42:54 -0400 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 1syW1k-0004iV-6A for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:42:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syW1i-0005Rc-Lf for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:42:51 -0400 Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-41-woXH5DhPOkK0YNbAKJSl_Q-1; Wed, 09 Oct 2024 08:42:48 -0400 Received: by mail-io1-f69.google.com with SMTP id ca18e2360f4ac-8353d85fc5bso90994139f.1 for ; Wed, 09 Oct 2024 05:42:47 -0700 (PDT) Received: from x1n.redhat.com (pool-99-254-114-190.cpe.net.cable.rogers.com. [99.254.114.190]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-83503aacb18sm220272039f.30.2024.10.09.05.42.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 05:42:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728477770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jSrTZ5PyIp+y/7h2oJbsCMlzTXaX6rgV2rodQaLvIWo=; b=LfP0FNGKwqIdzeu09z2AS4p0ZoYtJOQ3hC6n3RZmtr9loCO6FnuDOayRD2x68ha5d17331 7nhq/rkBRH0Prf9OQLexAWTq8LrQAxUlg+qdjI545/pFbh2JRRuefcRlDFIe4SLYfxe87g piFFC76Z3fyK4Ct7ExIYYC7tzvdfHjc= X-MC-Unique: woXH5DhPOkK0YNbAKJSl_Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728477767; x=1729082567; 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=jSrTZ5PyIp+y/7h2oJbsCMlzTXaX6rgV2rodQaLvIWo=; b=Km4IrLx5Znxp7FwYH+g6934TujLYmcQ5e8J/LhZg7HeHGhixdfRb65Wbc0ZnMOt5kX 5WbJT3XHQvGdFU7Dp2mNqG1HBfAXpgQnLmUxiPr1+dtG2wntrDFsldhqD6TL2mO2cHLZ yhO60O9O1XhiFpOHafNIIBODvSirdFNeJGxD9MTLnKIpEJRDMP/33j8OnumIRsHmrJRu SRHeEEc6MX2ChAFYeA2QL/L6G9xHnPV0M0X7+Fv7XWpr3bYSvD2m8nU9sAfDCW/Sj3UK YjY40NWDd3gME5nm/X7Avk69M/CQaDTkvxilLdZtj0qOlWXDRA9meGVdrvmDMMp33IC1 Z+aw== X-Gm-Message-State: AOJu0Yzgf0uSFJ5YxqRLOgNyPdteCdxu5eDgB7ftHHoRBO7wt4TrEPqH l4IQkVwP0O4DZgOe78nb6ri61EyJaVfrVoRGCw+9WzxR9YAngWB5/2Z5P1BXOBYanVGapPhhA51 MjRlZm+s5601uDZ3L8Q9v0UNFHynZeYNgnfySKiwQclWb4cnvVDpkMIWsUzN6L9uGWHZnRYyl5a y6+AAruL3GaIxXtOPTA/c+BXxQEcOthsyKtA== X-Received: by 2002:a05:6602:1595:b0:82c:bdec:1c0e with SMTP id ca18e2360f4ac-8353d378d0cmr246749739f.2.1728477766793; Wed, 09 Oct 2024 05:42:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEpypbmveO/15wJzQiiV5f8btY+IXUL1ItykcAGCz313DXu/lwvl5Vl1GBnfVOI9x47LbpLaQ== X-Received: by 2002:a05:6602:1595:b0:82c:bdec:1c0e with SMTP id ca18e2360f4ac-8353d378d0cmr246747039f.2.1728477766274; Wed, 09 Oct 2024 05:42:46 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Peter Maydell , Fabiano Rosas , peterx@redhat.com, "Dr. David Alan Gilbert" Subject: [PULL 03/12] migration: Remove migrate_cap_set Date: Wed, 9 Oct 2024 08:42:29 -0400 Message-ID: <20241009124238.371084-4-peterx@redhat.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241009124238.371084-1-peterx@redhat.com> References: <20241009124238.371084-1-peterx@redhat.com> 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=170.10.129.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.151, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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.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 @redhat.com) X-ZM-MESSAGEID: 1728477887520116600 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" migrate_cap_set has been unused since 18d154f575 ("migration: Remove 'blk/-b' option from migrate commands") Remove it. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Fabiano Rosas Link: https://lore.kernel.org/r/20240919134626.166183-2-dave@treblig.org Signed-off-by: Peter Xu --- migration/options.h | 1 - migration/options.c | 20 -------------------- 2 files changed, 21 deletions(-) diff --git a/migration/options.h b/migration/options.h index a0bd6edc06..36e7b3723f 100644 --- a/migration/options.h +++ b/migration/options.h @@ -58,7 +58,6 @@ bool migrate_tls(void); /* capabilities helpers */ =20 bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp); -bool migrate_cap_set(int cap, bool value, Error **errp); =20 /* parameters */ =20 diff --git a/migration/options.c b/migration/options.c index 147cd2b8fd..9460c5dee9 100644 --- a/migration/options.c +++ b/migration/options.c @@ -605,26 +605,6 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps= , Error **errp) return true; } =20 -bool migrate_cap_set(int cap, bool value, Error **errp) -{ - MigrationState *s =3D migrate_get_current(); - bool new_caps[MIGRATION_CAPABILITY__MAX]; - - if (migration_is_running()) { - error_setg(errp, "There's a migration process in progress"); - return false; - } - - memcpy(new_caps, s->capabilities, sizeof(new_caps)); - new_caps[cap] =3D value; - - if (!migrate_caps_check(s->capabilities, new_caps, errp)) { - return false; - } - s->capabilities[cap] =3D value; - return true; -} - MigrationCapabilityStatusList *qmp_query_migrate_capabilities(Error **errp) { MigrationCapabilityStatusList *head =3D NULL, **tail =3D &head; --=20 2.45.0 From nobody Sat Nov 23 22:43:15 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1728477877; cv=none; d=zohomail.com; s=zohoarc; b=Rzr+B47XlwRpuzfVyyZz3YbxJAfR/NYHvgXxS9ukq5tN2DhYJ1Kbow878NFiCuXZpJvxzjSY5xGZHNVV2bf2bQixWyeFdwlisrQx1lpHppSDwnPtMzZORmT7L6Mrae+J+Evp7/1xjLSuvUjPLcRYO8aAXxLp3VCQWoTIN/brSA8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728477877; 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=iNbystHyQfpG9zdYMm/IbZBExIkcr+7+jlbR55DWaDg=; b=b7Ce6PdHW0qtJu2s/6ZGi474UDJNx6mAP77nP3206fxPnHeqqwhrwfPgRtmHT940skjXbyxPBZPnQVxi8OTQmRMTscnJnuqumtUbF795gQ5NrXKnZkE3Umuyn3royfDlqPAVOg6iYAOciOWQxM7SU/jmiF0b610mvdbCiLST8L4= 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 1728477877594925.1802264952104; Wed, 9 Oct 2024 05:44:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syW1m-0004iu-HN; Wed, 09 Oct 2024 08:42:54 -0400 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 1syW1l-0004ik-MV for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:42:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syW1k-0005Ru-5n for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:42:53 -0400 Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-563-Vwbz1t1qPsOfcjSys4hjCQ-1; Wed, 09 Oct 2024 08:42:50 -0400 Received: by mail-io1-f71.google.com with SMTP id ca18e2360f4ac-835439ecbd3so37324639f.1 for ; Wed, 09 Oct 2024 05:42:49 -0700 (PDT) Received: from x1n.redhat.com (pool-99-254-114-190.cpe.net.cable.rogers.com. [99.254.114.190]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-83503aacb18sm220272039f.30.2024.10.09.05.42.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 05:42:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728477771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iNbystHyQfpG9zdYMm/IbZBExIkcr+7+jlbR55DWaDg=; b=bgGa3+edro5C/7V3cxoACOZl4tNlptbfnELZhySUEAvCOSNRRovQmW/we0fHlMoB1Xxg/o ENM8x5Ab5u38UfwvkhuXc73v/4L3Tu/joc9yupT6zvnK4gkrnr0DzDQz5RI49CriP1lShu 6h7klgnOa7KsAHg568J0+QuNI9BaoZQ= X-MC-Unique: Vwbz1t1qPsOfcjSys4hjCQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728477768; x=1729082568; 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=iNbystHyQfpG9zdYMm/IbZBExIkcr+7+jlbR55DWaDg=; b=vvUFQHrvZzM3Wbq0NCWuv0VivtbqhQnyfj/JQTo0zM9RUI17jrfuB1k7lIi76RitGm 7MEkXAjpMiyi4ZjMD9BekkI9JOasf1/mcJJiWI/Ah/1QkU+XZ6BeNXAlcKWwv0Is7wVU 8RAsJ/5lPzKOx8JZDzo89x9IaMQc9qNdYzeD8j+cKqIG9kt7yBGBu7GHANTmTJGFdyxQ Aus8qDPyHrpZy1flYBPWn7uCpuNmMEmXJstAmH9jvbRUf0FDRtFkKb2KIGKzIljvQhHZ Tsf697qp8ujHvaos3Ib27gXcCjwnJILFiqftleQ4sGBiKeCVpV/o0pG5UBqZHvqt7vhH JC9w== X-Gm-Message-State: AOJu0YzKnxCNQd0OP23+QsssiTNcethazWGRdAuitmQmZlzvOIFK2Wb+ BKsTgv4wS4axfhqWyxtxGbXIQOipzvT8UfKucVG5QS38QdR2nty1YgGogtkFiZEti1+llTyybs2 DhwVDL2x2wXgEsM3yiVA4ozOBQ91ugXzxSUUpwhvigslHotuD1G8qm3SnBmSRs6EcbuNFayj8Aa JezRD2LgzZclUU3BGFFsLIVI3akLIdfQuTOQ== X-Received: by 2002:a05:6602:148d:b0:81f:75bf:6570 with SMTP id ca18e2360f4ac-8353d4a3b07mr228901939f.5.1728477768375; Wed, 09 Oct 2024 05:42:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IENlNaV1R1A1VuGrBVbAxUhZF4hpbLmYToSTtwgeVsAdY+lrDV+0KUmwe0au+/CrpyEeXnQ8g== X-Received: by 2002:a05:6602:148d:b0:81f:75bf:6570 with SMTP id ca18e2360f4ac-8353d4a3b07mr228897639f.5.1728477767895; Wed, 09 Oct 2024 05:42:47 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Peter Maydell , Fabiano Rosas , peterx@redhat.com, "Dr. David Alan Gilbert" Subject: [PULL 04/12] migration: Remove unused migrate_zero_blocks Date: Wed, 9 Oct 2024 08:42:30 -0400 Message-ID: <20241009124238.371084-5-peterx@redhat.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241009124238.371084-1-peterx@redhat.com> References: <20241009124238.371084-1-peterx@redhat.com> 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=170.10.129.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.151, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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.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 @redhat.com) X-ZM-MESSAGEID: 1728477879502116600 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" migrate_zero_blocks is unused since eef0bae3a7 ("migration: Remove block migration") Remove it. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/20240919134626.166183-3-dave@treblig.org Signed-off-by: Peter Xu --- migration/options.h | 1 - migration/options.c | 7 ------- 2 files changed, 8 deletions(-) diff --git a/migration/options.h b/migration/options.h index 36e7b3723f..79084eed0d 100644 --- a/migration/options.h +++ b/migration/options.h @@ -40,7 +40,6 @@ bool migrate_release_ram(void); bool migrate_return_path(void); bool migrate_validate_uuid(void); bool migrate_xbzrle(void); -bool migrate_zero_blocks(void); bool migrate_zero_copy_send(void); =20 /* diff --git a/migration/options.c b/migration/options.c index 9460c5dee9..6f549984cb 100644 --- a/migration/options.c +++ b/migration/options.c @@ -339,13 +339,6 @@ bool migrate_xbzrle(void) return s->capabilities[MIGRATION_CAPABILITY_XBZRLE]; } =20 -bool migrate_zero_blocks(void) -{ - MigrationState *s =3D migrate_get_current(); - - return s->capabilities[MIGRATION_CAPABILITY_ZERO_BLOCKS]; -} - bool migrate_zero_copy_send(void) { MigrationState *s =3D migrate_get_current(); --=20 2.45.0 From nobody Sat Nov 23 22:43:16 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1728477914; cv=none; d=zohomail.com; s=zohoarc; b=O4p+46YL0e1/Qm+ZRCoIafN3FY96b14ZQPhKnqJa3MRtWm3XxO+XjRjbMdalc30ZdrjYhnRHkWacgvk8NCyuFmjewM1mqjNvKX72OHwPF5ZT0hW5gPkQHGhFrrUrire8JE9//umClxNRWfI4fmtBcakLIezow2WF7dlwCsVsij4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728477914; 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=jk0pKj9VCu3al6N68FkKLk/v4exRbcGJT+XXNWXH8Sw=; b=NEFyHTcHJXdBS3Kl4bRjvECAH0noTp1MzVD3zoSVrervV8KdY0M1JZ7zgKulkO5uuw0m0ww2SwdhR7R8Rl2U+8U1Lm4a9gAcfD0qECoCu3K5inE6RMzff1UCDClko7basoVfpn/zD3HEGD2LlyYAUzLf+ZpXDfrKf8gxfGDa9zw= 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 1728477914488695.7464707009564; Wed, 9 Oct 2024 05:45:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syW1o-0004jM-NH; Wed, 09 Oct 2024 08:42:56 -0400 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 1syW1n-0004jB-Lw for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:42:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syW1l-0005SI-Uf for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:42:55 -0400 Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-683-9w0rMEd-OMic_2vnroH6cA-1; Wed, 09 Oct 2024 08:42:52 -0400 Received: by mail-io1-f72.google.com with SMTP id ca18e2360f4ac-82cdb749559so1175908439f.2 for ; Wed, 09 Oct 2024 05:42:51 -0700 (PDT) Received: from x1n.redhat.com (pool-99-254-114-190.cpe.net.cable.rogers.com. [99.254.114.190]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-83503aacb18sm220272039f.30.2024.10.09.05.42.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 05:42:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728477773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jk0pKj9VCu3al6N68FkKLk/v4exRbcGJT+XXNWXH8Sw=; b=C5xjV+l83RMiEfqfjLBIFIUlY/SRRyIga6QI5pOgYfGV29+pUPKRg6C/V2gcEKk0nYTMmt PwLNoKSl8YyOyjtxwxPRwZO+jI+h2DDvZZoEzql6o+lAAQwQDwosBuW4yisvj9FwqxsdN9 s70bVk77Rc2ejtmOExe40emHVzeazco= X-MC-Unique: 9w0rMEd-OMic_2vnroH6cA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728477770; x=1729082570; 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=jk0pKj9VCu3al6N68FkKLk/v4exRbcGJT+XXNWXH8Sw=; b=VzBgTCSMmpQwHpjBrIB8MNFapAfacIBU63/F8Gzvi4PR+cD4xO3IaxGAxQL207HKW+ S0PWwvPuwycMvoT2DC/KZscgL4oGRPEIJQIX7gPkcf3vylapJzYGst/9VQ9Rh0WcNeiU 8baBAc11zEBq2j5vD+0qRiBjt4YrXuuqH7LvLgKREE8bsuUwkuiqDIZ1TnRhjvle+K49 Pu82fgFWTqVs0pT2iZLEwq3OrCsknv3iQ8UhQuAe4D5xFH68nJ7MAqUMHbDscfvrZG+p CotSG3IxPZKi8r8AVaKwQ0b3upBQbn/wAnS5mE3BxBqPCcUL4wLAd2FTz/fAb9jsm5uF dIJQ== X-Gm-Message-State: AOJu0YwmcfAZM98/zBSToX2IOqWeLmd7fa4pdBsEK0MoS9ba5HHaS8Z9 yoYjypGkAD5N3oLJfqVThT07pcuIL0rdD3wr3BNBhyYVmQwvcYoV7ZOuG1QIcyMNnKoz05+tW6S H840j1OhoMmsU18fIQouXgAjWDNlldvAW408zgP60kMG32CKiUY/+tlO4FJ5Q3Be2xNC6xqtYm8 WmQAOYNBihR2VZK2RGbKaak/5o68+5yBZtiA== X-Received: by 2002:a05:6602:6c04:b0:835:42ce:933d with SMTP id ca18e2360f4ac-83542ce9439mr127156239f.1.1728477770594; Wed, 09 Oct 2024 05:42:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGPihQ1fnKB662fomcWUObYdo/c2JzIDukLZHlNaqfEiNJJ63s+y5HaNwDhBeNP+6VanGR2mQ== X-Received: by 2002:a05:6602:6c04:b0:835:42ce:933d with SMTP id ca18e2360f4ac-83542ce9439mr127152639f.1.1728477770098; Wed, 09 Oct 2024 05:42:50 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Peter Maydell , Fabiano Rosas , peterx@redhat.com Subject: [PULL 05/12] migration: Deprecate zero-blocks capability Date: Wed, 9 Oct 2024 08:42:31 -0400 Message-ID: <20241009124238.371084-6-peterx@redhat.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241009124238.371084-1-peterx@redhat.com> References: <20241009124238.371084-1-peterx@redhat.com> 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=170.10.129.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.151, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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.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 @redhat.com) X-ZM-MESSAGEID: 1728477919809116600 Content-Type: text/plain; charset="utf-8" From: Fabiano Rosas The zero-blocks capability was meant to be used along with the block migration, which has been removed already in commit eef0bae3a7 ("migration: Remove block migration"). Setting zero-blocks is currently a noop, but the outright removal of the capability would cause and error in case some users are still setting it. Put the capability through the deprecation process. Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/20240919134626.166183-4-dave@treblig.org Signed-off-by: Peter Xu --- docs/about/deprecated.rst | 6 ++++++ qapi/migration.json | 5 ++++- migration/options.c | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index c02bbb66f7..33ce4f9536 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -467,3 +467,9 @@ usage of providing a file descriptor to a plain file ha= s been deprecated in favor of explicitly using the ``file:`` URI with the file descriptor being passed as an ``fdset``. Refer to the ``add-fd`` command documentation for details on the ``fdset`` usage. + +``zero-blocks`` capability (since 9.2) +'''''''''''''''''''''''''''''''''''''' + +The ``zero-blocks`` capability was part of the block migration which +doesn't exist anymore since it was removed in QEMU v9.1. diff --git a/qapi/migration.json b/qapi/migration.json index b66cccf107..3af6aa1740 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -479,11 +479,14 @@ # Features: # # @unstable: Members @x-colo and @x-ignore-shared are experimental. +# @deprecated: Member @zero-blocks is deprecated as being part of +# block migration which was already removed. # # Since: 1.2 ## { 'enum': 'MigrationCapability', - 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks', + 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', + { 'name': 'zero-blocks', 'features': [ 'deprecated' ] }, 'events', 'postcopy-ram', { 'name': 'x-colo', 'features': [ 'unstable' ] }, 'release-ram', diff --git a/migration/options.c b/migration/options.c index 6f549984cb..ad8d6989a8 100644 --- a/migration/options.c +++ b/migration/options.c @@ -450,6 +450,10 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps= , Error **errp) ERRP_GUARD(); MigrationIncomingState *mis =3D migration_incoming_get_current(); =20 + if (new_caps[MIGRATION_CAPABILITY_ZERO_BLOCKS]) { + warn_report("zero-blocks capability is deprecated"); + } + #ifndef CONFIG_REPLICATION if (new_caps[MIGRATION_CAPABILITY_X_COLO]) { error_setg(errp, "QEMU compiled without replication module" --=20 2.45.0 From nobody Sat Nov 23 22:43:16 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1728477786; cv=none; d=zohomail.com; s=zohoarc; b=T1isfRA+UjBeIbdisPl/7Oosjt6LDbA21AcfWnZ6ZU6PcM/0rbTsFLK3eZsn1kbfe6d2jgdNwfpvnyVNbUiX5KU4Mq3eg0VDGLbCCX3JMNWjGQm7vbFAC9xpyUvysqKZedlVEJVN3CR67KCEHwRo2Ssde0OCco5RJNpQF1vlLbc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728477786; 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=y/0kDNEZEHcHY+mJQf631i4X5DtZp/zqgZgP9eV3P4g=; b=jddSEACzRJ3Q7YB3sEfG8kimZwpaFfBoJKF3KkUDqTCY4qMNui2PQ+y28nF48he8wN/iOMpNpo3BGpM42MdTCDDdByVKKI+bzLX2jxLUkuEnGm07fsWAP6JmDGQLXwag6DQ51vplEU07+XBIaDT1wQr3wjnur9SdvDCL7jm3PJ0= 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 172847778697929.847397625202348; Wed, 9 Oct 2024 05:43:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syW1p-0004jV-VM; Wed, 09 Oct 2024 08:42:57 -0400 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 1syW1p-0004jN-4A for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:42:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syW1n-0005Sd-2y for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:42:56 -0400 Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-428-6TsXy6sfOBa6X7zAQjtOmw-1; Wed, 09 Oct 2024 08:42:53 -0400 Received: by mail-io1-f72.google.com with SMTP id ca18e2360f4ac-82ced069d94so638574639f.0 for ; Wed, 09 Oct 2024 05:42:53 -0700 (PDT) Received: from x1n.redhat.com (pool-99-254-114-190.cpe.net.cable.rogers.com. [99.254.114.190]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-83503aacb18sm220272039f.30.2024.10.09.05.42.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 05:42:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728477774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y/0kDNEZEHcHY+mJQf631i4X5DtZp/zqgZgP9eV3P4g=; b=NQ5YuJUQQUMnlDZB3U8pVe9iuqvBZqnh7hkPYKYJxO5wFcYBz6JG4Pn05AfOzbbuVKLov6 Dy9GiIpAnkKcjD45m1a72YEK+S66QEnTxTWSbNwpOdIyfmtT0ZnFJf/IotkrpWGoI9/9du PwCDsvc/1uDyHXOT7rx/pOVbUPsGw6s= X-MC-Unique: 6TsXy6sfOBa6X7zAQjtOmw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728477772; x=1729082572; 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=y/0kDNEZEHcHY+mJQf631i4X5DtZp/zqgZgP9eV3P4g=; b=lQJ3jpAfbJnDWJLYrkHrCWwMWPV5EE9aqaAB06+hEkEv424rXk3nif+8jn1tYBtR7C EJjh8EPpBLG/Gqs5fpO2yYZQlHguVAQdpoS4N9H/NArHoyUmNN+kqh63ZyKNbA523fzc /rDrl31IK/JCY+uMAR/2YUWneTzMclkoQjvdGv/9z0BSOoY1MoT2McAr/iLL+9vQ0skA DX6+W18V0fTVMLcZhQ3dBF7sNZmXjU8vphqn9XCXkKp0dwLxGIetgIEHKBtJyHD8tWx4 8+f041UhZIqfG77fmRb93bAXhMCkJtkD7Lx79TkLniY7d3Xlc4itFv5+TbC9/5aPdyt2 XG7w== X-Gm-Message-State: AOJu0YxT0fbLtYLCjd7+gzYM3IOWaOKP6AoGLlK7NHHXsKILKYUeKra9 COAZt9UOv4kq9CykJciiM+flHCq4iuJyeNhNzktGPY2wprlkJIPIuI5hfoLqhnaHwKrl64h/Y9A H56X6m3Y30/Pp5UzSbGGLbkQFci2XPUkci6v7ais6rFrK5veNTwPmLje3QvuPYFyBoc36YI5kwX AXdVcQ/vtNjueZ8fokIZ2DZdBHv5Oa2+kXUw== X-Received: by 2002:a05:6602:2b83:b0:834:f744:d067 with SMTP id ca18e2360f4ac-8353d4a7cdamr298917939f.8.1728477772430; Wed, 09 Oct 2024 05:42:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG6H/uWXP97Zaa7s2yDrynU93ec9ZX+eQE1V3QcJlP4ZilTQQlWrAhVddifAnr37JCd0+MmJg== X-Received: by 2002:a05:6602:2b83:b0:834:f744:d067 with SMTP id ca18e2360f4ac-8353d4a7cdamr298914939f.8.1728477772015; Wed, 09 Oct 2024 05:42:52 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Peter Maydell , Fabiano Rosas , peterx@redhat.com, "Dr. David Alan Gilbert" Subject: [PULL 06/12] migration: Remove unused socket_send_channel_create_sync Date: Wed, 9 Oct 2024 08:42:32 -0400 Message-ID: <20241009124238.371084-7-peterx@redhat.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241009124238.371084-1-peterx@redhat.com> References: <20241009124238.371084-1-peterx@redhat.com> 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=170.10.133.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.151, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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.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 @redhat.com) X-ZM-MESSAGEID: 1728477789169116600 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" socket_send_channel_create_sync only use was removed by d0edb8a173 ("migration: Create the postcopy preempt channel asynchronousl= y") Remove it. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Fabiano Rosas Link: https://lore.kernel.org/r/20240919134626.166183-5-dave@treblig.org Signed-off-by: Peter Xu --- migration/socket.h | 1 - migration/socket.c | 18 ------------------ 2 files changed, 19 deletions(-) diff --git a/migration/socket.h b/migration/socket.h index 46c233ecd2..04ebbe95a1 100644 --- a/migration/socket.h +++ b/migration/socket.h @@ -22,7 +22,6 @@ #include "qemu/sockets.h" =20 void socket_send_channel_create(QIOTaskFunc f, void *data); -QIOChannel *socket_send_channel_create_sync(Error **errp); =20 void socket_start_incoming_migration(SocketAddress *saddr, Error **errp); =20 diff --git a/migration/socket.c b/migration/socket.c index 9ab89b1e08..5ec65b8c03 100644 --- a/migration/socket.c +++ b/migration/socket.c @@ -42,24 +42,6 @@ void socket_send_channel_create(QIOTaskFunc f, void *dat= a) f, data, NULL, NULL); } =20 -QIOChannel *socket_send_channel_create_sync(Error **errp) -{ - QIOChannelSocket *sioc =3D qio_channel_socket_new(); - - if (!outgoing_args.saddr) { - object_unref(OBJECT(sioc)); - error_setg(errp, "Initial sock address not set!"); - return NULL; - } - - if (qio_channel_socket_connect_sync(sioc, outgoing_args.saddr, errp) <= 0) { - object_unref(OBJECT(sioc)); - return NULL; - } - - return QIO_CHANNEL(sioc); -} - struct SocketConnectData { MigrationState *s; char *hostname; --=20 2.45.0 From nobody Sat Nov 23 22:43:16 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1728477874; cv=none; d=zohomail.com; s=zohoarc; b=C20piwV7WUvDqXcCEMjSSjdoppxX2Y2CtLE8RDkadsVgpTBOPAdpfqX20nBJDi5CP2/cUKJyu000pDqVAUAoJ7uNeUEzTPJ2FQw1hjmXXy5e7TFWYWe1mYMgXQdTaawwrCh2yITNygU0NYFfiW9+kxRMAHK3Jaji6M7+zsyEMl8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728477874; 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=EPwjO7n6gAxf8tb/k3NaSmBNEtRkZrTncHigcs6P44U=; b=BVzwD20HMStKRmkr4fOraLN7ioBqb7+IP07ZG0h07FCQ89WxxEHdoioNT0sBSsr38P1b2emlYD1nA/8ZutZjdjqWkhvIBmZAbEEnWaW3xMedFzhChZ2aF7SqTqbRynbRi4mwB38asmb9JeukMmV070VEiDM6UwbZ1Os07H96xkw= 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 172847787489892.52126616766475; Wed, 9 Oct 2024 05:44:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syW1u-0004kw-GI; Wed, 09 Oct 2024 08:43:02 -0400 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 1syW1r-0004kB-Up for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:43:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syW1q-0005TU-52 for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:42:59 -0400 Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-13-vRqT1UQSMoCRoKoz0ZaA1Q-1; Wed, 09 Oct 2024 08:42:56 -0400 Received: by mail-io1-f69.google.com with SMTP id ca18e2360f4ac-83544f524ebso33396839f.3 for ; Wed, 09 Oct 2024 05:42:55 -0700 (PDT) Received: from x1n.redhat.com (pool-99-254-114-190.cpe.net.cable.rogers.com. [99.254.114.190]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-83503aacb18sm220272039f.30.2024.10.09.05.42.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 05:42:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728477777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EPwjO7n6gAxf8tb/k3NaSmBNEtRkZrTncHigcs6P44U=; b=c0zplawT36t1l84y/EZFVWLT4cUp6KUebMMkh60N140gcjPFS+m6jlJqpSn5aXGkSiKCyY AAawi3+kpRjrPYo5TGkzEGYGmqeV5MwDah09zOg7ugacZlgsLfW9lVEY3YrBTvYHozk/ja 9Xnf7dKJJxNCsTX0eIfe4z7AIUsbzUg= X-MC-Unique: vRqT1UQSMoCRoKoz0ZaA1Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728477774; x=1729082574; 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=EPwjO7n6gAxf8tb/k3NaSmBNEtRkZrTncHigcs6P44U=; b=GQYAhRU7EEU5aZpTAk0JB6FyVFOuqcZ300AKNzdAvBYBwHhWv3GmxKhs0TGb8bnMkw pZj+HYbtCGQOnxORJkcuqrsPsXGyV2IuVDSjcC/m5VgONH6Eb1G1gwDIoxyRx8HrQiS8 fOGBaAXz0ci61bUsDh4LwHYeYp2NQknPBF8gYlplRGFKFWqoFV/wG4pg/koZrm3ImJaS kQmvgRbWsMfmoM9vqfyhXlFZSpuGkTfsVIkpFzRt7CCih0ZFZDK8iX25wluG8uYqP5zA YNtxlMW3qLbfMyzgChDVdCwztwg9hXkxg1Azl+casMqZ9QeSUedkelyi3eu5LI6LpvVd PttQ== X-Gm-Message-State: AOJu0YxZEHPRS6DoP2XVipUkWKeQlign7QUEQKpcv7eKYDhfnM0QWZiQ Ox6L4AxgX66mekpYFkxzcMNjh84CzTczAKZstbDK+uoh/46eQlzt54eT8NIwkcB3WQEQA6X5DAd 2LKMhTq/AHZnJQVIJgkhYfaqmJU5TL6tGkVPIVLrlOEYhDpxK36eON/6pa/FfnWFvLj8FcPMlRJ ERrsZxkPQfwRgahX5v6MCAZ2rTmmmxWGzHpQ== X-Received: by 2002:a05:6602:1554:b0:82c:f30d:fc72 with SMTP id ca18e2360f4ac-8353d4824demr181280239f.2.1728477774476; Wed, 09 Oct 2024 05:42:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtG12tdST9qX1w8USus5SfYTeOHD396wropQBAOzggQ9fkcTVcO4uKZYA6o/8ZcLVJV5WS3A== X-Received: by 2002:a05:6602:1554:b0:82c:f30d:fc72 with SMTP id ca18e2360f4ac-8353d4824demr181276639f.2.1728477773863; Wed, 09 Oct 2024 05:42:53 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Peter Maydell , Fabiano Rosas , peterx@redhat.com, "Dr. David Alan Gilbert" Subject: [PULL 07/12] util/userfaultfd: Return -errno on error Date: Wed, 9 Oct 2024 08:42:33 -0400 Message-ID: <20241009124238.371084-8-peterx@redhat.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241009124238.371084-1-peterx@redhat.com> References: <20241009124238.371084-1-peterx@redhat.com> 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=170.10.129.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.151, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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.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 @redhat.com) X-ZM-MESSAGEID: 1728477875520116600 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Convert (the currently unused) uffd_wakeup, uffd_copy_page and uffd_zero_page to return -errno on error rather than -1. That will make it easier to reuse in postcopy. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/20240919134626.166183-6-dave@treblig.org Signed-off-by: Peter Xu --- util/userfaultfd.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/util/userfaultfd.c b/util/userfaultfd.c index 1b2fa949d4..518d5c3586 100644 --- a/util/userfaultfd.c +++ b/util/userfaultfd.c @@ -240,7 +240,7 @@ int uffd_change_protection(int uffd_fd, void *addr, uin= t64_t length, * Copy range of source pages to the destination to resolve * missing page fault somewhere in the destination range. * - * Returns 0 on success, negative value in case of an error + * Returns 0 on success, -errno in case of an error * * @uffd_fd: UFFD file descriptor * @dst_addr: destination base address @@ -259,10 +259,11 @@ int uffd_copy_page(int uffd_fd, void *dst_addr, void = *src_addr, uffd_copy.mode =3D dont_wake ? UFFDIO_COPY_MODE_DONTWAKE : 0; =20 if (ioctl(uffd_fd, UFFDIO_COPY, &uffd_copy)) { + int e =3D errno; error_report("uffd_copy_page() failed: dst_addr=3D%p src_addr=3D%p= length=3D%" PRIu64 " mode=3D%" PRIx64 " errno=3D%i", dst_addr, src_addr, - length, (uint64_t) uffd_copy.mode, errno); - return -1; + length, (uint64_t) uffd_copy.mode, e); + return -e; } =20 return 0; @@ -273,7 +274,7 @@ int uffd_copy_page(int uffd_fd, void *dst_addr, void *s= rc_addr, * * Fill range pages with zeroes to resolve missing page fault within the r= ange. * - * Returns 0 on success, negative value in case of an error + * Returns 0 on success, -errno in case of an error * * @uffd_fd: UFFD file descriptor * @addr: base address @@ -289,10 +290,11 @@ int uffd_zero_page(int uffd_fd, void *addr, uint64_t = length, bool dont_wake) uffd_zeropage.mode =3D dont_wake ? UFFDIO_ZEROPAGE_MODE_DONTWAKE : 0; =20 if (ioctl(uffd_fd, UFFDIO_ZEROPAGE, &uffd_zeropage)) { + int e =3D errno; error_report("uffd_zero_page() failed: addr=3D%p length=3D%" PRIu64 " mode=3D%" PRIx64 " errno=3D%i", addr, length, - (uint64_t) uffd_zeropage.mode, errno); - return -1; + (uint64_t) uffd_zeropage.mode, e); + return -e; } =20 return 0; @@ -306,7 +308,7 @@ int uffd_zero_page(int uffd_fd, void *addr, uint64_t le= ngth, bool dont_wake) * via UFFD-IO IOCTLs with MODE_DONTWAKE flag set, then after that all wai= ts * for the whole memory range are satisfied in a single call to uffd_wakeu= p(). * - * Returns 0 on success, negative value in case of an error + * Returns 0 on success, -errno in case of an error * * @uffd_fd: UFFD file descriptor * @addr: base address @@ -320,9 +322,10 @@ int uffd_wakeup(int uffd_fd, void *addr, uint64_t leng= th) uffd_range.len =3D length; =20 if (ioctl(uffd_fd, UFFDIO_WAKE, &uffd_range)) { + int e =3D errno; error_report("uffd_wakeup() failed: addr=3D%p length=3D%" PRIu64 "= errno=3D%i", - addr, length, errno); - return -1; + addr, length, e); + return -e; } =20 return 0; --=20 2.45.0 From nobody Sat Nov 23 22:43:16 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1728477882; cv=none; d=zohomail.com; s=zohoarc; b=C9cnEtrf9UHx7KaHITSvsbqyKvPX4JXLQj2IXwyFhXQfAFn/lQR1uqlw7osel8CfoD8pOBdIowU/tqdsxSnHctiBrfgXvbditMRSNsciVjtc6ysVGMkr2YuqH/85naRR2fMNmM6hV6r8qMlgfLBwlUNGShmgi41rx6gM2WYIBBc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728477882; 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=c+wIGbgV5H0wjlK7GrUwKudWkLFcFUw55bTCvhh/IyA=; b=me/j7GY+FW43anqvjRjGnOMkA1JLC2q4yb+EwKtYb/ku4r1aeTOBd6eogVLNoALLJV3SqPVCt018MJf76iIMGr7i7ibJXkEx/t2L5/5/k7kB7nRh03E1TUVvosRaIqx3t2hUlwPHmX10ScuwGoptUt8o/fqjJDhyal3pddq0NHU= 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 1728477882125864.4180037491532; Wed, 9 Oct 2024 05:44:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syW1v-0004lD-IX; Wed, 09 Oct 2024 08:43:03 -0400 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 1syW1t-0004kn-HV for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:43:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syW1r-0005U7-J6 for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:43:01 -0400 Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-532-_7Urry08ONKawkh4quHZ4A-1; Wed, 09 Oct 2024 08:42:58 -0400 Received: by mail-io1-f71.google.com with SMTP id ca18e2360f4ac-8324396d0abso592609739f.0 for ; Wed, 09 Oct 2024 05:42:58 -0700 (PDT) Received: from x1n.redhat.com (pool-99-254-114-190.cpe.net.cable.rogers.com. [99.254.114.190]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-83503aacb18sm220272039f.30.2024.10.09.05.42.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 05:42:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728477779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c+wIGbgV5H0wjlK7GrUwKudWkLFcFUw55bTCvhh/IyA=; b=OeECgINOBEHukLpBZBGmGq9xBylweEku3whtTflK3TMbVmVy63QHfQOZGBgZbpu83Qmg/E M1wYodYO2KjC6yVGtTWYkOuhg1Pun9Q9ob+EnlJ5hzqpNgdTCNTUylL/zQz65myiFbncm4 DOw6LjtDRdXoR2YHscaGv+OWJaYBlNo= X-MC-Unique: _7Urry08ONKawkh4quHZ4A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728477777; x=1729082577; 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=c+wIGbgV5H0wjlK7GrUwKudWkLFcFUw55bTCvhh/IyA=; b=RiV6zkCjPqDhy9eqTB4g1G8Mb4QOU6X4l7xSKOzQTtulAr0nG0y7i0H1ux2zMQ/VWE ZrXb1R9aTsu/EIJ42K1nAVTCNYEpZUPT8vmJi0XW4nza6xUe60nd6G7gfdlQBqPbbC8o bfl0mpS3eLRAWGSq9pEK7YiLBx1g4bBTpJzNp8aWNtQzay093QSBLiFzVUg+JvqafEAa lQ+ieXFUEc5KQFSCdwu445Mq+SmgycJhA3CtQFapR7gm8QZJQuo/UghsNIRo/wttqYn1 ko4WaRY+yTSoCsqYzUHBBw3A3fHKPZHxOUDbJrTCFlUseZ2H5q2TCRMrVK5SpACL3Pay s2bA== X-Gm-Message-State: AOJu0YzC+LKazoaOBChPJSZlBm5fwRmqQeR9i35WaUkHzf/0XrC5w6zt RE9w5nD/6b+vJh+bH8mthYPySofW1tvW2rw7c32jwcn9V1vFvwd5BgVrbkkOzbTXC2pC5GuuNey M1mrbZYkmZEOyxf+v1msu4ifmmrdi3wcSkFXdDuNYnI6Gl5YVVaYJ3zdCDOdBlLG5qmJDDMm54C suY/kyk89vatM5JEvHI5W16bPGKgkTg0GtWA== X-Received: by 2002:a05:6602:60c7:b0:82a:2a67:9429 with SMTP id ca18e2360f4ac-8353d48688cmr215067439f.5.1728477776712; Wed, 09 Oct 2024 05:42:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGazowKqpzjvhCxeW3v0isqd/4xcwvSuhYSh1LvffTX72nD7KdgCm5y9YpeHx1kngccXPv51A== X-Received: by 2002:a05:6602:60c7:b0:82a:2a67:9429 with SMTP id ca18e2360f4ac-8353d48688cmr215063839f.5.1728477776154; Wed, 09 Oct 2024 05:42:56 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Peter Maydell , Fabiano Rosas , peterx@redhat.com, "Dr. David Alan Gilbert" Subject: [PULL 08/12] migration/postcopy: Use uffd helpers Date: Wed, 9 Oct 2024 08:42:34 -0400 Message-ID: <20241009124238.371084-9-peterx@redhat.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241009124238.371084-1-peterx@redhat.com> References: <20241009124238.371084-1-peterx@redhat.com> 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=170.10.133.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.151, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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.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 @redhat.com) X-ZM-MESSAGEID: 1728477883537116600 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Use the uffd_copy_page, uffd_zero_page and uffd_wakeup helpers rather than calling ioctl ourselves. They return -errno on error, and print an error_report themselves. I think this actually makes postcopy_place_page actually more consistent in it's callers. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/20240919134626.166183-7-dave@treblig.org [peterx: fix i386 build] Signed-off-by: Peter Xu --- migration/postcopy-ram.c | 48 ++++++++++++---------------------------- 1 file changed, 14 insertions(+), 34 deletions(-) diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 0fe9d83d44..83f6160a36 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -746,18 +746,10 @@ int postcopy_wake_shared(struct PostCopyFD *pcfd, RAMBlock *rb) { size_t pagesize =3D qemu_ram_pagesize(rb); - struct uffdio_range range; - int ret; trace_postcopy_wake_shared(client_addr, qemu_ram_get_idstr(rb)); - range.start =3D ROUND_DOWN(client_addr, pagesize); - range.len =3D pagesize; - ret =3D ioctl(pcfd->fd, UFFDIO_WAKE, &range); - if (ret) { - error_report("%s: Failed to wake: %zx in %s (%s)", - __func__, (size_t)client_addr, qemu_ram_get_idstr(rb), - strerror(errno)); - } - return ret; + return uffd_wakeup(pcfd->fd, + (void *)(uintptr_t)ROUND_DOWN(client_addr, pagesize= ), + pagesize); } =20 static int postcopy_request_page(MigrationIncomingState *mis, RAMBlock *rb, @@ -1275,18 +1267,10 @@ static int qemu_ufd_copy_ioctl(MigrationIncomingSta= te *mis, void *host_addr, int ret; =20 if (from_addr) { - struct uffdio_copy copy_struct; - copy_struct.dst =3D (uint64_t)(uintptr_t)host_addr; - copy_struct.src =3D (uint64_t)(uintptr_t)from_addr; - copy_struct.len =3D pagesize; - copy_struct.mode =3D 0; - ret =3D ioctl(userfault_fd, UFFDIO_COPY, ©_struct); + ret =3D uffd_copy_page(userfault_fd, host_addr, from_addr, pagesiz= e, + false); } else { - struct uffdio_zeropage zero_struct; - zero_struct.range.start =3D (uint64_t)(uintptr_t)host_addr; - zero_struct.range.len =3D pagesize; - zero_struct.mode =3D 0; - ret =3D ioctl(userfault_fd, UFFDIO_ZEROPAGE, &zero_struct); + ret =3D uffd_zero_page(userfault_fd, host_addr, pagesize, false); } if (!ret) { qemu_mutex_lock(&mis->page_request_mutex); @@ -1343,18 +1327,16 @@ int postcopy_place_page(MigrationIncomingState *mis= , void *host, void *from, RAMBlock *rb) { size_t pagesize =3D qemu_ram_pagesize(rb); + int e; =20 /* copy also acks to the kernel waking the stalled thread up * TODO: We can inhibit that ack and only do it if it was requested * which would be slightly cheaper, but we'd have to be careful * of the order of updating our page state. */ - if (qemu_ufd_copy_ioctl(mis, host, from, pagesize, rb)) { - int e =3D errno; - error_report("%s: %s copy host: %p from: %p (size: %zd)", - __func__, strerror(e), host, from, pagesize); - - return -e; + e =3D qemu_ufd_copy_ioctl(mis, host, from, pagesize, rb); + if (e) { + return e; } =20 trace_postcopy_place_page(host); @@ -1376,12 +1358,10 @@ int postcopy_place_page_zero(MigrationIncomingState= *mis, void *host, * but it's not available for everything (e.g. hugetlbpages) */ if (qemu_ram_is_uf_zeroable(rb)) { - if (qemu_ufd_copy_ioctl(mis, host, NULL, pagesize, rb)) { - int e =3D errno; - error_report("%s: %s zero host: %p", - __func__, strerror(e), host); - - return -e; + int e; + e =3D qemu_ufd_copy_ioctl(mis, host, NULL, pagesize, rb); + if (e) { + return e; } return postcopy_notify_shared_wake(rb, qemu_ram_block_host_offset(rb, --=20 2.45.0 From nobody Sat Nov 23 22:43:16 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1728477846; cv=none; d=zohomail.com; s=zohoarc; b=SgjZ+2Ap1si34gjzNAlVuZbM6nLNqKMYOuK3nqsj9uKdHizH3jeQ2I/pCQfux7fWLBgn0qipWXfslDToqoKN5ppv/w3yM/J89Be4nKbGIzvLbdEYPWvryg1cib5VQtOGDCvmwb1uzZCD7DsmujedsgBAGqa9NSdi4H9HhjS/r1s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728477846; 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=152PJdeA3wUbcFf7AgEvngUKCcBOBZ12l6LmuLbUvrQ=; b=RsYkv+flYRwT/HNUzUdqEa6uCb2SG9U30Q4rd1XXcbhIt3cd5UP9IxOx2hZLfu1XQiDTol+Qc2vk1jUghOHGuPlo4cxzzq20OCoiz1TsclRA7wHldBDcIwMltWaONcpicRuBMhnxJKVSxsP3JFXgMs1FVLNqhB3HLSfa/JmgqKQ= 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 1728477846167812.8407446594821; Wed, 9 Oct 2024 05:44:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syW1w-0004lV-UT; Wed, 09 Oct 2024 08:43:05 -0400 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 1syW1v-0004lL-KJ for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:43:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syW1u-0005Uo-1d for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:43:03 -0400 Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-31-_vnbvDF1OSuzWJsqrO8ZVw-1; Wed, 09 Oct 2024 08:43:00 -0400 Received: by mail-io1-f71.google.com with SMTP id ca18e2360f4ac-82cf147a566so624968439f.1 for ; Wed, 09 Oct 2024 05:43:00 -0700 (PDT) Received: from x1n.redhat.com (pool-99-254-114-190.cpe.net.cable.rogers.com. [99.254.114.190]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-83503aacb18sm220272039f.30.2024.10.09.05.42.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 05:42:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728477781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=152PJdeA3wUbcFf7AgEvngUKCcBOBZ12l6LmuLbUvrQ=; b=GtPtV7cSKor/u3I9P73IidbSWWWlG5XJvfxscaRLWxif+BmtU79oMmFNQU8AaR2yUA2ugu blMorkjCHpSIuc//4inGo2TFHPjeLNXcJCegz4mTAnc8iKeQZdzWE+snozxQcrpQ3Rdwox d+8uO2QYqTyGP9gl+TiGMmwsdrysPy0= X-MC-Unique: _vnbvDF1OSuzWJsqrO8ZVw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728477779; x=1729082579; 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=152PJdeA3wUbcFf7AgEvngUKCcBOBZ12l6LmuLbUvrQ=; b=lh5D3Tm3A7CohqZvR3NRQVQPGm6O1gVBci3UOcifoffmolHhRSheW43Ve1YqkoqAA9 vW7Lt5ki6twHKKx5mYrx+60Be1veH4dIomVEZcIKShVTVIx/+9iUKo8xcX4q8g4wfgtL L4SCTUsdA6VDdSQ3/VsmAD+t1UWjtDgyXSrx91bAyoJU+RUOIt5GqE2KXTRAsgIi3cPU s8liZqzicpHitKcBhmNOT9MyU/m3UQTXrfnxfnnSD247wql3fZEHIwBkU93+FSEkNOf8 exYI+xKGluGhi/DbgfCbbMsOFxrUAsyejCCncGSqdH5K6RjHrDmrNv15GE7BhDngUc8y 6RxQ== X-Gm-Message-State: AOJu0YzDa1Xx0rNn+JV25KlKpiGbAldgfp//VmQW9YNCCuxuw2pvkM7L SY1kfOvhVZnsRUeAzOpi06Pgy/XrDcyYNYvMdxHoA8dtQk9JHvJ5s9x5pKUMacLRRqk0w82wRFN 7pAzmBR1GX9ng5ufcJMldbXWI86wKsJF7r81jPWVf8ChuYr1lDai4SbsRqSpfBJo7NvDV0wdq6q grj0unw25up4NuiZxU4lHokYKTCA8CRFMApg== X-Received: by 2002:a05:6602:6424:b0:835:3957:4f7 with SMTP id ca18e2360f4ac-8353d5464d3mr253259139f.16.1728477778922; Wed, 09 Oct 2024 05:42:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGx71HISxuOWC3fSmpuC7qzDSSxBz883ofSayOmMXB/R/v2lDmP9hHbiJulzWiGt76U8f+1Pw== X-Received: by 2002:a05:6602:6424:b0:835:3957:4f7 with SMTP id ca18e2360f4ac-8353d5464d3mr253256739f.16.1728477778472; Wed, 09 Oct 2024 05:42:58 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Peter Maydell , Fabiano Rosas , peterx@redhat.com, "Dr. David Alan Gilbert" Subject: [PULL 09/12] util/userfaultfd: Remove unused uffd_poll_events Date: Wed, 9 Oct 2024 08:42:35 -0400 Message-ID: <20241009124238.371084-10-peterx@redhat.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241009124238.371084-1-peterx@redhat.com> References: <20241009124238.371084-1-peterx@redhat.com> 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=170.10.129.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.151, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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.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 @redhat.com) X-ZM-MESSAGEID: 1728477848266116600 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" uffd_poll_events has been unused since it was added; it's also just a wrapper around a plain old poll call, so doesn't add anything. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/20240919134626.166183-8-dave@treblig.org Signed-off-by: Peter Xu --- include/qemu/userfaultfd.h | 1 - util/userfaultfd.c | 28 ---------------------------- 2 files changed, 29 deletions(-) diff --git a/include/qemu/userfaultfd.h b/include/qemu/userfaultfd.h index 18a4314212..a1979308d7 100644 --- a/include/qemu/userfaultfd.h +++ b/include/qemu/userfaultfd.h @@ -39,7 +39,6 @@ int uffd_copy_page(int uffd_fd, void *dst_addr, void *src= _addr, int uffd_zero_page(int uffd_fd, void *addr, uint64_t length, bool dont_wak= e); int uffd_wakeup(int uffd_fd, void *addr, uint64_t length); int uffd_read_events(int uffd_fd, struct uffd_msg *msgs, int count); -bool uffd_poll_events(int uffd_fd, int tmo); =20 #endif /* CONFIG_LINUX */ =20 diff --git a/util/userfaultfd.c b/util/userfaultfd.c index 518d5c3586..2396104f23 100644 --- a/util/userfaultfd.c +++ b/util/userfaultfd.c @@ -358,31 +358,3 @@ int uffd_read_events(int uffd_fd, struct uffd_msg *msg= s, int count) =20 return (int) (res / sizeof(struct uffd_msg)); } - -/** - * uffd_poll_events: poll UFFD file descriptor for read - * - * Returns true if events are available for read, false otherwise - * - * @uffd_fd: UFFD file descriptor - * @tmo: timeout value - */ -bool uffd_poll_events(int uffd_fd, int tmo) -{ - int res; - struct pollfd poll_fd =3D { .fd =3D uffd_fd, .events =3D POLLIN, .reve= nts =3D 0 }; - - do { - res =3D poll(&poll_fd, 1, tmo); - } while (res < 0 && errno =3D=3D EINTR); - - if (res =3D=3D 0) { - return false; - } - if (res < 0) { - error_report("uffd_poll_events() failed: errno=3D%i", errno); - return false; - } - - return (poll_fd.revents & POLLIN) !=3D 0; -} --=20 2.45.0 From nobody Sat Nov 23 22:43:16 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1728477848; cv=none; d=zohomail.com; s=zohoarc; b=hJyccFZNAg6dfIb30JTUNMJQMnx/uwM6qrY4pTtO33UrugYMyZvIEc8guHqoCX+OSsGfcfjzNNOYGQlUHY90sdk3koHz3dO8g2v/np9n+RKqty8fcMu/RQBz0t8OxWUvcGnvPPr37Va0rsqHr5hF1H8uLtb2uAMOfZN3dZWLwl8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728477848; 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=yUYJvzmDsbGYqRdVrEwQI7vweQrLaFXP18fwBosGfqE=; b=dUQYsQBJdCKur2uf/SMg1ZZim8h0/shP5gJAzJUulryoKbqc/rNwP0ym6M7p4nEzsheo65rQRarq5T+2ElOIjYxw7VqXcGUfCe/EO9yx/qpYfihetazFviLmdjw/KzGuP9hpk8ldewuzRnURaxPCsJQ4EK61bZ8Vmm157vV8yc0= 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 1728477848295306.9499548879179; Wed, 9 Oct 2024 05:44:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syW1z-0004rk-Jo; Wed, 09 Oct 2024 08:43:08 -0400 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 1syW1x-0004o1-O5 for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:43:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syW1v-0005VG-HS for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:43:04 -0400 Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-636-83BBomIfMUuWJ6ft7-sXLA-1; Wed, 09 Oct 2024 08:43:01 -0400 Received: by mail-io1-f71.google.com with SMTP id ca18e2360f4ac-82ad9fca614so891879639f.3 for ; Wed, 09 Oct 2024 05:43:01 -0700 (PDT) Received: from x1n.redhat.com (pool-99-254-114-190.cpe.net.cable.rogers.com. [99.254.114.190]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-83503aacb18sm220272039f.30.2024.10.09.05.42.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 05:42:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728477782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yUYJvzmDsbGYqRdVrEwQI7vweQrLaFXP18fwBosGfqE=; b=WeVP7Dc6YMZbbdfveulU/EsHAywTpC9eeVwHnaym8vDOUMKhfG6EFvPN3VV2kB+TV9U5GE JvzM/dsoeakepDrcj3Z1AZBQslZXjB3NbLLErOekoQOMMWb3foo9rBx6gFduKK0tdScJkj j8UnvzvmAY8uHjuAm+H8rEwXVluPQ0A= X-MC-Unique: 83BBomIfMUuWJ6ft7-sXLA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728477780; x=1729082580; 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=yUYJvzmDsbGYqRdVrEwQI7vweQrLaFXP18fwBosGfqE=; b=bplqf2N8Czj9tmYYwVkMBK5Ff+oPHq48MMo0n9iYrTgAxNV3i6/zep/oABSc1Lvlle irjKPMwf3rzh8LI+2bcH9EMwqkagC1fiDI+tA32Q2nT+CjHAyDMROOlM7wvWwNd4Jj5v BNRSqMU3ZxIblOuOqx/RguZe5hwOi4qIHdtQ1sxW/bXP3nkKJsUm/yQPvLvuG3IC4lyM J9B/8m6q84s2FULy+gT2X1j7X2rwmgZLCGnA5712FL1AbUAZ4yB2YrTYN1iStL6Awtao 5YR0xpO2C71qtnXTCqOZpKmcH2BbHCFkz12AkvMh+qFiCJm2pBAUXad14DYaEqvRrx7D HrxA== X-Gm-Message-State: AOJu0YyIg0WZnjYPW80+0iiOi6aP7AYmJvW423fU8vjsTkCore5TB1LP czFmoJ+f2lMPzJBYIQw7hZhou65dcJpQRfC7sWhfR8e/QOIcs/a9xH06oaZUPxWZxns/zdk/UFE JBR6Up1qx14xEcO4+uAmCxqI3kUHNlB2PH33VIiZWq8daEYpkkIgFWjpQVTuDB97bL977Xxy78L WaortBP3EaYWwlWARGfY8exm5mkbbpa0kxWg== X-Received: by 2002:a05:6602:6422:b0:82c:d67d:aa91 with SMTP id ca18e2360f4ac-8353d3755d5mr300247039f.1.1728477780556; Wed, 09 Oct 2024 05:43:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFegXQDOnOHEmm+cTK6FYpgTZ7aLMxJ1N6ar6u4x4PHSJCB1poFE5KRoeApDAVzQgEDiO8C1w== X-Received: by 2002:a05:6602:6422:b0:82c:d67d:aa91 with SMTP id ca18e2360f4ac-8353d3755d5mr300243639f.1.1728477780239; Wed, 09 Oct 2024 05:43:00 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Peter Maydell , Fabiano Rosas , peterx@redhat.com, Juraj Marcin Subject: [PULL 10/12] tests/migration-test: Wait for cancellation sooner in multifd cancel Date: Wed, 9 Oct 2024 08:42:36 -0400 Message-ID: <20241009124238.371084-11-peterx@redhat.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241009124238.371084-1-peterx@redhat.com> References: <20241009124238.371084-1-peterx@redhat.com> 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=170.10.133.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.151, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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.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 @redhat.com) X-ZM-MESSAGEID: 1728477849379116600 Content-Type: text/plain; charset="utf-8" From: Juraj Marcin The source QEMU might not finish the cancellation of the migration before we start setting up the next attempt. During the setup, the test_migrate_start() function and others might need to interact with the source in a way that is not possible unless the migration is fully canceled. For example, setting capabilities when the migration is still running leads to an error. By moving the wait before the setup, we ensure this does not happen. Cc: Peter Xu Signed-off-by: Juraj Marcin Link: https://lore.kernel.org/r/20240920161319.2337625-1-jmarcin@redhat.com Signed-off-by: Peter Xu --- tests/qtest/migration-test.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 814ec109a6..95e45b5029 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -3267,6 +3267,16 @@ static void test_multifd_tcp_cancel(void) qtest_wait_qemu(to); qtest_quit(to); =20 + /* + * Ensure the source QEMU finishes its cancellation process before we + * proceed with the setup of the next migration. The test_migrate_star= t() + * function and others might want to interact with the source in a way= that + * is not possible while the migration is not canceled properly. For + * example, setting migration capabilities when the migration is still + * running leads to an error. + */ + wait_for_migration_status(from, "cancelled", NULL); + args =3D (MigrateStart){ .only_target =3D true, }; @@ -3282,8 +3292,6 @@ static void test_multifd_tcp_cancel(void) /* Start incoming migration from the 1st socket */ migrate_incoming_qmp(to2, "tcp:127.0.0.1:0", "{}"); =20 - wait_for_migration_status(from, "cancelled", NULL); - migrate_ensure_non_converge(from); =20 migrate_qmp(from, to2, NULL, NULL, "{}"); --=20 2.45.0 From nobody Sat Nov 23 22:43:16 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1728477897; cv=none; d=zohomail.com; s=zohoarc; b=YFGk1fESgIN4D1MYhkXCYqHXOdPt/oIWWI5csiKkE2Su5PPwxL1ESNROHllojCQm3vuStuLG3SmhuDAvy68I6d5NInGydG6fnLgQVyjGtEwlOKbaE04qweng3wWFSJU58tZcRCxbY1yh5TjSDpOFyfPRpazqdlRG69MwzplVbU0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728477897; 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=ufhUOpepsGW4qLY30+zYqQtKIYZv17OEXI7XMvauCAU=; b=XWCTeg4Pr65vMkfhgBnbqw7FtoizTaxw+7E7/cLFIFICgcrvbu8BjkmGDTCJTbBO94n9Mu/p64/0IzEQvbUgEzdmFqHfHcZFDfg/DTYw7feH7i2AOEIiOL7lNAOdW54SGBSIx64u2LLGnNlPNMTGTEP67Q/U0tmewkWiKvbC+bQ= 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 1728477897282459.77836928753607; Wed, 9 Oct 2024 05:44:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syW2I-000530-Vl; Wed, 09 Oct 2024 08:43:27 -0400 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 1syW21-0004sf-EK for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:43:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syW1y-0005Vu-Mh for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:43:08 -0400 Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-8-u5byBmSxN-Ow4g2Wsg2qHg-1; Wed, 09 Oct 2024 08:43:04 -0400 Received: by mail-io1-f70.google.com with SMTP id ca18e2360f4ac-82aa8af04feso684811939f.1 for ; Wed, 09 Oct 2024 05:43:04 -0700 (PDT) Received: from x1n.redhat.com (pool-99-254-114-190.cpe.net.cable.rogers.com. [99.254.114.190]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-83503aacb18sm220272039f.30.2024.10.09.05.43.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 05:43:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728477785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ufhUOpepsGW4qLY30+zYqQtKIYZv17OEXI7XMvauCAU=; b=Xpt0lAzE64vOpO6vYI9hRMnsHd0iIjXAA4OE8RPdf+7qiAnFQmDtj0a9T6yU1IJ6XgP5kf hQtS4CHncuatrc3YdKFzLCDy1+/XVfD0ln/06cZoadC0BqXHsTQAs/U4/q/caMQClu/iBc c8lX1UXUR9w//AdLYBzbRiV2m8NtGgg= X-MC-Unique: u5byBmSxN-Ow4g2Wsg2qHg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728477783; x=1729082583; 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=ufhUOpepsGW4qLY30+zYqQtKIYZv17OEXI7XMvauCAU=; b=BqzmABID9934gg5juxlKmfy+IeucOJ39IS+9eZodfcGPzrcZ8AedGDbUz3mfVE3xg4 w6hC0x6KV6PbEHkcCZSvjoXLoSnq8UQkIXrYR6DnBzr9W4Dd944+J9+147JVQQ/ahABt L54agPwzfcAO9kONIBfovm3yE08mFkYkzamjB872p+lqSYlOh+IFQHrATdoeYJS648Ic OnExLB0+TOe1jz/kMxDlSsTgYSpEArty1qCrN+D5S8+nprhYamA6PLMfv+r7l9towU5k RvU/noOgcg2lJZr3OxseU1aueM+sA0MoZBwQE7nHmW3IcoUnVYKlHE9S/vq4cHqs9+b8 bZrg== X-Gm-Message-State: AOJu0Yz3WifO4mlDoYqENTvoVWBXZYeFc4HF6XxQmxMwBojq2Lk9MUUm VM8g1+2i0EuGbqt/n4T9mvjTglhuzDDxHd6aE4ZHGzm82p+FxgeDqNtKHxg+uz66YwWiftySCLp ryTCk2X6j5gcnbTmdJYdcWI6XwRjxwcDDwyXkuW2nVLrl80T9LWPktic6uLECSAzQ0AyiWcndap qz02RW1ZBScK69I/gDFJj6h76F2uMexEJcwg== X-Received: by 2002:a05:6602:6101:b0:82a:4c58:e1e0 with SMTP id ca18e2360f4ac-8353d4f11d4mr249867439f.12.1728477782840; Wed, 09 Oct 2024 05:43:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHn5VvcapvqGxQ50KmhJFVnEWT/3/GQA3GxrhLud8Pl+7z+b3QnS8vH1AFWBM5F2i3qzn2l2g== X-Received: by 2002:a05:6602:6101:b0:82a:4c58:e1e0 with SMTP id ca18e2360f4ac-8353d4f11d4mr249862639f.12.1728477782174; Wed, 09 Oct 2024 05:43:02 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Peter Maydell , Fabiano Rosas , peterx@redhat.com, "Dr. David Alan Gilbert" , Thomas Huth Subject: [PULL 11/12] util/iova-tree: Remove deadcode Date: Wed, 9 Oct 2024 08:42:37 -0400 Message-ID: <20241009124238.371084-12-peterx@redhat.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241009124238.371084-1-peterx@redhat.com> References: <20241009124238.371084-1-peterx@redhat.com> 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=170.10.133.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.151, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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.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 @redhat.com) X-ZM-MESSAGEID: 1728477899614116600 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" iova_tree_find_address, and iova_tree_foreach have never been used since the code was originally added by: eecf5eedbd ("util: implement simple iova tree") Remove them. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Reviewed-by: Thomas Huth Link: https://lore.kernel.org/r/20240918142515.153074-1-dave@treblig.org Signed-off-by: Peter Xu --- include/qemu/iova-tree.h | 25 ------------------------- util/iova-tree.c | 23 ----------------------- 2 files changed, 48 deletions(-) diff --git a/include/qemu/iova-tree.h b/include/qemu/iova-tree.h index 2a10a7052e..44a45931d5 100644 --- a/include/qemu/iova-tree.h +++ b/include/qemu/iova-tree.h @@ -111,31 +111,6 @@ const DMAMap *iova_tree_find(const IOVATree *tree, con= st DMAMap *map); */ const DMAMap *iova_tree_find_iova(const IOVATree *tree, const DMAMap *map); =20 -/** - * iova_tree_find_address: - * - * @tree: the iova tree to search from - * @iova: the iova address to find - * - * Similar to iova_tree_find(), but it tries to find mapping with - * range iova=3Diova & size=3D0. - * - * Return: same as iova_tree_find(). - */ -const DMAMap *iova_tree_find_address(const IOVATree *tree, hwaddr iova); - -/** - * iova_tree_foreach: - * - * @tree: the iova tree to iterate on - * @iterator: the iterator for the mappings, return true to stop - * - * Iterate over the iova tree. - * - * Return: 1 if found any overlap, 0 if not, <0 if error. - */ -void iova_tree_foreach(IOVATree *tree, iova_tree_iterator iterator); - /** * iova_tree_alloc_map: * diff --git a/util/iova-tree.c b/util/iova-tree.c index 536789797e..06295e2755 100644 --- a/util/iova-tree.c +++ b/util/iova-tree.c @@ -115,13 +115,6 @@ const DMAMap *iova_tree_find_iova(const IOVATree *tree= , const DMAMap *map) return args.result; } =20 -const DMAMap *iova_tree_find_address(const IOVATree *tree, hwaddr iova) -{ - const DMAMap map =3D { .iova =3D iova, .size =3D 0 }; - - return iova_tree_find(tree, &map); -} - static inline void iova_tree_insert_internal(GTree *gtree, DMAMap *range) { /* Key and value are sharing the same range data */ @@ -148,22 +141,6 @@ int iova_tree_insert(IOVATree *tree, const DMAMap *map) return IOVA_OK; } =20 -static gboolean iova_tree_traverse(gpointer key, gpointer value, - gpointer data) -{ - iova_tree_iterator iterator =3D data; - DMAMap *map =3D key; - - g_assert(key =3D=3D value); - - return iterator(map); -} - -void iova_tree_foreach(IOVATree *tree, iova_tree_iterator iterator) -{ - g_tree_foreach(tree->tree, iova_tree_traverse, iterator); -} - void iova_tree_remove(IOVATree *tree, DMAMap map) { const DMAMap *overlap; --=20 2.45.0 From nobody Sat Nov 23 22:43:16 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1728477846; cv=none; d=zohomail.com; s=zohoarc; b=auSPHdxJ5pfewcH1yx8OfAP3UcFifmmG7GXKgSz04Y5T8YX0Jz7QeWu+3KACLuX3SUKfgZZziYMlA6tvsLZmS4M95G0RD47Zxwm6bHUKr0ZHnjPSMPtREpHod94mDsXsalZOp5Fosn08uSJR9llO+04PF3RTuwv3YbrJCUVihyI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728477846; 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=FjMBCXJg2PmGEwp55y/1gkUv3OpESanW4HCUWzVhmPI=; b=INqVHb9g0yKtqsE/zXQwdcDL9WDWLc7SIyZK8x+6BGty6ZuHgLMhvi70dGz/0oEzsTQcrYCx0I8G7AIAA9NrXt6PPdMldZV8Btk/FNY92KXv8rS0iAXzwNBaFy4K1Iqqyt2bBKnLDtTtISO346JC2Zh/PzAalnAH3ndHPTfWF+k= 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 172847784654889.73912249928787; Wed, 9 Oct 2024 05:44:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syW28-0004vX-Gl; Wed, 09 Oct 2024 08:43:18 -0400 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 1syW22-0004si-G3 for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:43:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syW1z-0005WI-U9 for qemu-devel@nongnu.org; Wed, 09 Oct 2024 08:43:09 -0400 Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-372-Z0nW3H_yNUuwVb9c619QwA-1; Wed, 09 Oct 2024 08:43:06 -0400 Received: by mail-io1-f70.google.com with SMTP id ca18e2360f4ac-8353d85fc5bso91031239f.1 for ; Wed, 09 Oct 2024 05:43:06 -0700 (PDT) Received: from x1n.redhat.com (pool-99-254-114-190.cpe.net.cable.rogers.com. [99.254.114.190]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-83503aacb18sm220272039f.30.2024.10.09.05.43.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 05:43:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728477787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FjMBCXJg2PmGEwp55y/1gkUv3OpESanW4HCUWzVhmPI=; b=fRsBt1nrDfcK8UJmzYMm/XDjh/dNNciUrAZ4wdI+AWonhDPdjGK7lkY61SaGzTkjRlPhle eNJD4kS9w9N1T9bLKF2B1giIA2VFrZiwj6MJoAoQUXzzvzLPSqJcT48Iz+6ESCcfRldV9r fnd3nt94I6nBl+PUqhilSp2BkFYdHbE= X-MC-Unique: Z0nW3H_yNUuwVb9c619QwA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728477785; x=1729082585; 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=FjMBCXJg2PmGEwp55y/1gkUv3OpESanW4HCUWzVhmPI=; b=F+QYL6uZ0U6ig/gqsV7y5D9L3Kt22EZTYF4iUoN4mAm9CSIF5t16kr7fQP5cY/VutW iypoNSyruqqgP+/cUya4maD4mNtNo0QqIHIrdQ4xU24tULWAwu5CsuTQElx+sKzlxtcl 8L9vm1YKFS/+XO7FoLUllt54rECgeBp8w8sMVHtdDeIfr7Ac5SSx+z6/+IwQq+QD0Qoi oGU+Eq6AUI5b0ssstdHXxJ6zabux9rkNzjLAvGgQ5AraW6s/FPRKzFaYEzVUJ+EsyOVH LbpxHVGqxbyPY4tBYZJVALua6ym9J86fKOQs+GsPwclSUPJZlfg9o2MH8oxRSwlJ51qW Hv7Q== X-Gm-Message-State: AOJu0Yzv2ofmq2z6xjiqYJhb9ohd679jAWE1vka9yUVaJDkAwKaCDfRM nqUwpa03+YU3CT7AmFh9pdMXTul+UCheAQbJslvXMxsWx+/b0Ljonk8GRcysvaWTwq/zhHr3xQ4 PHuFHqyQ+i5FpZvQnQ3WBXgw8ry9xE4rjHGc0pjaHVYXjiJRU4uxTVdpMDi8E1Kb+oAWuxh8FSy HbM4DL7QXOd7hKT7ZtMNX7r+K7V6UY986nAg== X-Received: by 2002:a05:6602:2d8a:b0:834:d9ff:123e with SMTP id ca18e2360f4ac-8353d50ff39mr319810839f.13.1728477784705; Wed, 09 Oct 2024 05:43:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHIvCXosOt8xAP5lvYldX30CzxM+QGXfDlfoei28oII77deoT7qgign8XXMW5pxmurpkadA0g== X-Received: by 2002:a05:6602:2d8a:b0:834:d9ff:123e with SMTP id ca18e2360f4ac-8353d50ff39mr319807439f.13.1728477784267; Wed, 09 Oct 2024 05:43:04 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Peter Maydell , Fabiano Rosas , peterx@redhat.com, Yuan Liu Subject: [PULL 12/12] migration/multifd: fix build error when qpl compression is enabled Date: Wed, 9 Oct 2024 08:42:38 -0400 Message-ID: <20241009124238.371084-13-peterx@redhat.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241009124238.371084-1-peterx@redhat.com> References: <20241009124238.371084-1-peterx@redhat.com> 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=170.10.133.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.151, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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.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 @redhat.com) X-ZM-MESSAGEID: 1728477848243116600 Content-Type: text/plain; charset="utf-8" From: Yuan Liu The page_size member has been removed from the MultiFDSendParams and MultiFDRecvParams. The function multifd_ram_page_size is used to provide the page size in the multifd compressor. Fixes: 90fa121c6c ("migration/multifd: Inline page_size and page_count") Signed-off-by: Yuan Liu Link: https://lore.kernel.org/r/20241008104527.3516755-1-yuan1.liu@intel.com Signed-off-by: Peter Xu --- migration/multifd-qpl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/migration/multifd-qpl.c b/migration/multifd-qpl.c index b0f1e2ba46..bbe466617f 100644 --- a/migration/multifd-qpl.c +++ b/migration/multifd-qpl.c @@ -389,7 +389,7 @@ static void multifd_qpl_compress_pages_slow_path(MultiF= DSendParams *p) { QplData *qpl =3D p->compress_data; MultiFDPages_t *pages =3D &p->data->u.ram; - uint32_t size =3D p->page_size; + uint32_t size =3D multifd_ram_page_size(); qpl_job *job =3D qpl->sw_job; uint8_t *zbuf =3D qpl->zbuf; uint8_t *buf; @@ -420,7 +420,7 @@ static void multifd_qpl_compress_pages(MultiFDSendParam= s *p) { QplData *qpl =3D p->compress_data; MultiFDPages_t *pages =3D &p->data->u.ram; - uint32_t size =3D p->page_size; + uint32_t size =3D multifd_ram_page_size(); QplHwJob *hw_job; uint8_t *buf; uint8_t *zbuf; @@ -560,7 +560,7 @@ static int multifd_qpl_decompress_pages_slow_path(Multi= FDRecvParams *p, Error **errp) { QplData *qpl =3D p->compress_data; - uint32_t size =3D p->page_size; + uint32_t size =3D multifd_ram_page_size(); qpl_job *job =3D qpl->sw_job; uint8_t *zbuf =3D qpl->zbuf; uint8_t *addr; @@ -598,7 +598,7 @@ static int multifd_qpl_decompress_pages_slow_path(Multi= FDRecvParams *p, static int multifd_qpl_decompress_pages(MultiFDRecvParams *p, Error **errp) { QplData *qpl =3D p->compress_data; - uint32_t size =3D p->page_size; + uint32_t size =3D multifd_ram_page_size(); uint8_t *zbuf =3D qpl->zbuf; uint8_t *addr; uint32_t len; @@ -677,7 +677,7 @@ static int multifd_qpl_recv(MultiFDRecvParams *p, Error= **errp) } for (int i =3D 0; i < p->normal_num; i++) { qpl->zlen[i] =3D be32_to_cpu(qpl->zlen[i]); - assert(qpl->zlen[i] <=3D p->page_size); + assert(qpl->zlen[i] <=3D multifd_ram_page_size()); zbuf_len +=3D qpl->zlen[i]; } =20 --=20 2.45.0