From nobody Sun Nov 24 06:55:50 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=1726002320; cv=none; d=zohomail.com; s=zohoarc; b=RsgyKOaubT7qFUMLblKYt8CC/nTgtl4PiLNzifDwghC7OxSUvumiw8BMUTKnfLUD7MNsrg4nogK1zmayl9cRDKvA0gRSUSOpo3jrT9m/KWYBSfDc397qZj2T59sdr0zvhze4YiZrdrDlO2O5fozrybfRkOc42jlmzLv/kFc+aCA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1726002320; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NPBJIwJb7g64351J5n3RwwM19LVACSzZTdUUP7Sxplg=; b=OaXv+p0QbRf9m92NuK8JLKRgg94VnIgnmdElI1NgXL2Jnbi0LEUWFCofiBOSfNDDrpqfdNOTJ4T6pHRtxGKYrlRy9zrRH7y9IvcIQ2RXPD+PYWbDd1c0Ca1d3w3xkB92ytGFxRiuaOcR8owjP2Zu0vjc4DaSIIcmIJFD1/36O34= 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 1726002320621104.74537575959835; Tue, 10 Sep 2024 14:05:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so82l-00083Y-BW; Tue, 10 Sep 2024 17:04:59 -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 1so82k-000835-2W for qemu-devel@nongnu.org; Tue, 10 Sep 2024 17:04:58 -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 1so82i-0008WF-EJ for qemu-devel@nongnu.org; Tue, 10 Sep 2024 17:04:57 -0400 Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-132-loLItL1OP6KuAaoJi2nRJA-1; Tue, 10 Sep 2024 17:04:54 -0400 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-7a9a6251df5so804084185a.3 for ; Tue, 10 Sep 2024 14:04:54 -0700 (PDT) Received: from x1n.redhat.com (pool-99-254-121-117.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a9a796adb3sm337731585a.51.2024.09.10.14.04.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 14:04:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1726002295; 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; bh=NPBJIwJb7g64351J5n3RwwM19LVACSzZTdUUP7Sxplg=; b=WA/E+oNzaeKf5iYWXr6jvCgDPYONQOQnIS6GFteBfo1J0kQSGTrm4erIQ+kd9WCr7ThT49 rkSPwS06ZrMXQNoHIxuvbIIsbYiP/oWnnxVIoPYHZn+LBD1LVbkL+Ew6Lb578WbM8AP3TM eUxVmCnPa0WwLm9XEVOM7iFTF3iD25w= X-MC-Unique: loLItL1OP6KuAaoJi2nRJA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726002293; x=1726607093; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NPBJIwJb7g64351J5n3RwwM19LVACSzZTdUUP7Sxplg=; b=JNi0v9HXN3qsWyGPDBdyxAHRhYmwZLlTFdHq1gmlStZHky69T2+a6LDINMHxxo0CtW ZzsDDFceJKsNQRTGimxyVybi/+yvWhXi7KbNl4FthS2PvLAOHFEVjXVMZrTuOBP7MmhZ F11mhZdf3xr3bagY1+E4wOxL/P9MI9DLKUegf37P454M7tZYfgEGDy9fZtReR4Cmcqe0 yCtlMMNtYne1Jkbps2FNF0o34YUpRq49PBD/Zhvnc4n0+5UrkXwHioBS04VvmNAVTZJK JqZvcp/7Frp4YyxmjIM4GKyA4++VWcgxTVJKPRJPHjCUmdSVtUPJ+WIW5Nhka8y9V1Ye WlAQ== X-Gm-Message-State: AOJu0YwIh1/ETxuwVY1gS4fgGTiYOslg3VMWKXNSqunRLrINcbn8JmH4 WgI/N3xg8ULogLpVUzBDc3F76oCWB0mXBVPtqfL1LJw5eR5SOWWEe0GQVVSUCviOlVS9PGckOFN 6xfZ0sDBvp91Cz3O7ltpsiaB+7YIGK+TbDF9SPoqSg8AuovYccvcVTNszfdwS2O/csgHQnOXCHJ 8cVeH+7rF9EWojaoxGSzi4UYMtDKp1ArOphA== X-Received: by 2002:a05:620a:29d6:b0:7a9:c964:b32d with SMTP id af79cd13be357-7a9c964b62cmr324461985a.54.1726002293488; Tue, 10 Sep 2024 14:04:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHf6p80q0FY5ibnCRE0PuvhAVl2gTDuimAqCKp8nZbC/vAU9aZnoVDEPh9yHP6JFdLS/vOLww== X-Received: by 2002:a05:620a:29d6:b0:7a9:c964:b32d with SMTP id af79cd13be357-7a9c964b62cmr324457785a.54.1726002293081; Tue, 10 Sep 2024 14:04:53 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: peterx@redhat.com, Fabiano Rosas , Prasad Pandit , Yichen Wang , Bryan Zhang , Hao Xiang , Yuan Liu Subject: [PATCH] migration/multifd: Fix build for qatzip Date: Tue, 10 Sep 2024 17:04:50 -0400 Message-ID: <20240910210450.3835123-1-peterx@redhat.com> X-Mailer: git-send-email 2.45.0 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.145, 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, 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: 1726002322810116600 Content-Type: text/plain; charset="utf-8" The qatzip series was based on an older commit, it applied cleanly even though it has conflicts. Neither CI nor myself found the build will break as it's skipped by default when qatzip library was missing. Fix the build issues. No need to copy stable as it just landed 9.2. Cc: Yichen Wang Cc: Bryan Zhang Cc: Hao Xiang Cc: Yuan Liu Fixes: 80484f9459 ("migration: Introduce 'qatzip' compression method") Signed-off-by: Peter Xu --- Qatzip developers: would you help me to double check whether this is the right fix? --- migration/multifd-qatzip.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/migration/multifd-qatzip.c b/migration/multifd-qatzip.c index 3c787ed879..7b68397625 100644 --- a/migration/multifd-qatzip.c +++ b/migration/multifd-qatzip.c @@ -160,7 +160,8 @@ static void qatzip_send_cleanup(MultiFDSendParams *p, E= rror **errp) */ static int qatzip_send_prepare(MultiFDSendParams *p, Error **errp) { - MultiFDPages_t *pages =3D p->pages; + uint32_t page_size =3D multifd_ram_page_size(); + MultiFDPages_t *pages =3D &p->data->u.ram; QatzipData *q =3D p->compress_data; int ret; unsigned int in_len, out_len; @@ -179,12 +180,12 @@ static int qatzip_send_prepare(MultiFDSendParams *p, = Error **errp) * implementation. */ for (int i =3D 0; i < pages->normal_num; i++) { - memcpy(q->in_buf + (i * p->page_size), + memcpy(q->in_buf + (i * page_size), pages->block->host + pages->offset[i], - p->page_size); + page_size); } =20 - in_len =3D pages->normal_num * p->page_size; + in_len =3D pages->normal_num * page_size; if (in_len > q->in_len) { error_setg(errp, "multifd %u: unexpectedly large input", p->id); return -1; @@ -197,7 +198,7 @@ static int qatzip_send_prepare(MultiFDSendParams *p, Er= ror **errp) p->id, ret); return -1; } - if (in_len !=3D pages->normal_num * p->page_size) { + if (in_len !=3D pages->normal_num * page_size) { error_setg(errp, "multifd %u: QATzip failed to compress all input", p->id); return -1; @@ -329,7 +330,8 @@ static int qatzip_recv(MultiFDRecvParams *p, Error **er= rp) int ret; unsigned int in_len, out_len; uint32_t in_size =3D p->next_packet_size; - uint32_t expected_size =3D p->normal_num * p->page_size; + uint32_t page_size =3D multifd_ram_page_size(); + uint32_t expected_size =3D p->normal_num * page_size; uint32_t flags =3D p->flags & MULTIFD_FLAG_COMPRESSION_MASK; =20 if (in_size > q->in_len) { @@ -370,9 +372,7 @@ static int qatzip_recv(MultiFDRecvParams *p, Error **er= rp) =20 /* Copy each page to its appropriate location. */ for (int i =3D 0; i < p->normal_num; i++) { - memcpy(p->host + p->normal[i], - q->out_buf + p->page_size * i, - p->page_size); + memcpy(p->host + p->normal[i], q->out_buf + page_size * i, page_si= ze); } return 0; } --=20 2.45.0