From nobody Mon Nov 25 01:57:11 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1718385605; cv=none; d=zohomail.com; s=zohoarc; b=aEzk1/fKa/91EjRLaC7/gzkNqlNCt2T9ouyRLZ6NJJE3djBqQVBYtixxcgoXfWGjQPeOkoNghrVG/pb7uZ58qERuTKg41JncF75U0mTqZZn3fCLN7KNKjVMDrxwGq7jA6+2v9J85RBXeUe1I0XUSqUNPL7h+NWLB0MzkXGIfvtM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718385605; 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=yx7Tw7BVV5ItBj54IuIkXhOV34oE+O0rjeGv2yRXDDI=; b=Lxxo1Eou8zOa81B/TghDoLrQaLQ98LVhN2fbf43lex3NB48i1O6106dPRoPbh6YKvc6+3/gCP7hQw++1RQNu8uKslGtsC22jELDTTNnP6QSf8gavBmC3KdtthJ+AgQ99Jh8vcEiGLAIbWJCPvvlTLr4jid4BwDcjW0420v/krDs= 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 1718385605548573.9662358133768; Fri, 14 Jun 2024 10:20:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIAZ3-0000zS-9X; Fri, 14 Jun 2024 13:18:13 -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 1sIAZ1-0000yu-Rx for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:11 -0400 Received: from smtp-out1.suse.de ([2a07:de40:b251:101:10:150:64:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIAZ0-00042g-60 for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:11 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0398C339FB; Fri, 14 Jun 2024 17:18:08 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 6181713AB1; Fri, 14 Jun 2024 17:18:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id kCAOCk57bGaVAgAAD6G6ig (envelope-from ); Fri, 14 Jun 2024 17:18:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385488; h=from:from:reply-to: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=yx7Tw7BVV5ItBj54IuIkXhOV34oE+O0rjeGv2yRXDDI=; b=Wf1xm8vZOrNSShDsYf6584GlMatTQAq6aia+gI3XBWIy+JQy1WZ1/e4xIO52vjh7jWRwbp Bi4Lyuu978gkJnjTSwWeFiYnzYNa9vxV3FIS0gf5peS6VR8/0N7Hd7JvaT9VFAo5JoWbQG bHesqZFjQ79QYs16wf2IQn9udvpyjw0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385488; h=from:from:reply-to: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=yx7Tw7BVV5ItBj54IuIkXhOV34oE+O0rjeGv2yRXDDI=; b=aFqbeu0rUOkIXTbTEvCsH3vmXeWyKSe9LGSUgLySgftOBijAjczLpIWRb4G88o77JUho1d m3e3CScoVASrkOCg== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=Wf1xm8vZ; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=aFqbeu0r DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385488; h=from:from:reply-to: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=yx7Tw7BVV5ItBj54IuIkXhOV34oE+O0rjeGv2yRXDDI=; b=Wf1xm8vZOrNSShDsYf6584GlMatTQAq6aia+gI3XBWIy+JQy1WZ1/e4xIO52vjh7jWRwbp Bi4Lyuu978gkJnjTSwWeFiYnzYNa9vxV3FIS0gf5peS6VR8/0N7Hd7JvaT9VFAo5JoWbQG bHesqZFjQ79QYs16wf2IQn9udvpyjw0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385488; h=from:from:reply-to: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=yx7Tw7BVV5ItBj54IuIkXhOV34oE+O0rjeGv2yRXDDI=; b=aFqbeu0rUOkIXTbTEvCsH3vmXeWyKSe9LGSUgLySgftOBijAjczLpIWRb4G88o77JUho1d m3e3CScoVASrkOCg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Nicholas Piggin , Thomas Huth Subject: [PULL 01/18] tests/qtest: Move common define from libqos-spapr.h to new ppc-util.h Date: Fri, 14 Jun 2024 14:17:45 -0300 Message-Id: <20240614171802.28451-2-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240614171802.28451-1-farosas@suse.de> References: <20240614171802.28451-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 0398C339FB X-Spam-Score: -3.01 X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FREEMAIL_CC(0.00)[redhat.com,linaro.org,gmail.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,suse.de:dkim]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com] X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org 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=2a07:de40:b251:101:10:150:64:1; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1718385606589100015 Content-Type: text/plain; charset="utf-8" From: Nicholas Piggin The spapr QEMU machine defaults is useful outside libqos, so create a new header for ppc specific qtests and move it there. Reviewed-by: Thomas Huth Signed-off-by: Nicholas Piggin Signed-off-by: Fabiano Rosas --- tests/qtest/boot-serial-test.c | 2 +- tests/qtest/libqos/libqos-spapr.h | 7 ------- tests/qtest/ppc-util.h | 19 +++++++++++++++++++ tests/qtest/prom-env-test.c | 2 +- tests/qtest/pxe-test.c | 2 +- 5 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 tests/qtest/ppc-util.h diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c index df389adeeb..3b92fa5d50 100644 --- a/tests/qtest/boot-serial-test.c +++ b/tests/qtest/boot-serial-test.c @@ -15,7 +15,7 @@ =20 #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/libqos-spapr.h" +#include "ppc-util.h" =20 static const uint8_t bios_avr[] =3D { 0x88, 0xe0, /* ldi r24, 0x08 */ diff --git a/tests/qtest/libqos/libqos-spapr.h b/tests/qtest/libqos/libqos-= spapr.h index e4483c14f8..a446276416 100644 --- a/tests/qtest/libqos/libqos-spapr.h +++ b/tests/qtest/libqos/libqos-spapr.h @@ -9,11 +9,4 @@ QOSState *qtest_spapr_boot(const char *cmdline_fmt, ...) G_GNUC_PRINTF(1, 2); void qtest_spapr_shutdown(QOSState *qs); =20 -/* List of capabilities needed to silence warnings with TCG */ -#define PSERIES_DEFAULT_CAPABILITIES \ - "cap-cfpc=3Dbroken," \ - "cap-sbbc=3Dbroken," \ - "cap-ibs=3Dbroken," \ - "cap-ccf-assist=3Doff," - #endif diff --git a/tests/qtest/ppc-util.h b/tests/qtest/ppc-util.h new file mode 100644 index 0000000000..f68ee93520 --- /dev/null +++ b/tests/qtest/ppc-util.h @@ -0,0 +1,19 @@ +/* + * PowerPC misc useful things + * + * Copyright (c) 2024, IBM Corporation. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef PPC_UTIL_H +#define PPC_UTIL_H + +/* List of capabilities needed to silence warnings with TCG */ +#define PSERIES_DEFAULT_CAPABILITIES \ + "cap-cfpc=3Dbroken," \ + "cap-sbbc=3Dbroken," \ + "cap-ibs=3Dbroken," \ + "cap-ccf-assist=3Doff," + +#endif /* PPC_UTIL_H */ diff --git a/tests/qtest/prom-env-test.c b/tests/qtest/prom-env-test.c index 39ccb59797..14705105ad 100644 --- a/tests/qtest/prom-env-test.c +++ b/tests/qtest/prom-env-test.c @@ -21,7 +21,7 @@ =20 #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/libqos-spapr.h" +#include "ppc-util.h" =20 #define MAGIC 0xcafec0de #define ADDRESS 0x4000 diff --git a/tests/qtest/pxe-test.c b/tests/qtest/pxe-test.c index e4b48225a5..a3f900fbea 100644 --- a/tests/qtest/pxe-test.c +++ b/tests/qtest/pxe-test.c @@ -16,7 +16,7 @@ #include #include "libqtest.h" #include "boot-sector.h" -#include "libqos/libqos-spapr.h" +#include "ppc-util.h" =20 #define NETNAME "net0" =20 --=20 2.35.3 From nobody Mon Nov 25 01:57:11 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1718385618; cv=none; d=zohomail.com; s=zohoarc; b=ehMqUhY2YuoSDulWAcINFrn9aStto6oXj2Ms8vnYAU7aNhuh2qCs58rMicLeP0SG+SDv2imBDbcK7Y4YWYBxBXeyk0S5a3bDylyWssF0CtZck3VL7+DzuAe9Ba4Klov/a5+ScD8kDu2kbkL8Mwctio+Twldum/MGT66CLaSnqpI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718385618; 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=7j5PnkuOsB2uZytqvjcjkx4Y/pW+wy8yTMFINUWLAhQ=; b=CkRKj+KQeHjJDFVX5Z1sje+arN0OXkYi6pqs9/w76Nw2/pfh2ziVYsg6erNbNoZ/8LHmtF9lbFnPzNz8s4zR/NzFsJatSIEiPk+5dF6qa+78/KgO3w1UDRfqQGU1fd6fK1F59eh+2mOf5Vm1Oqevr0M+s6q7fVMKpmNC8o5k+jI= 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 1718385618376318.313867025073; Fri, 14 Jun 2024 10:20:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIAZ4-00010M-UF; Fri, 14 Jun 2024 13:18:14 -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 1sIAZ3-0000zb-AE for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:13 -0400 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIAZ1-00042p-Iz for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:13 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 0E9A020724; Fri, 14 Jun 2024 17:18:10 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 6E6FD13AB1; Fri, 14 Jun 2024 17:18:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id AExMDVB7bGaVAgAAD6G6ig (envelope-from ); Fri, 14 Jun 2024 17:18:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385490; h=from:from:reply-to: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=7j5PnkuOsB2uZytqvjcjkx4Y/pW+wy8yTMFINUWLAhQ=; b=0axxg9YBCTupt30hYBvZcJelXnkio1myLRwp4VFunvBNYIadvwt44QmtrMRUOgnnur1PTh EmUCzOa5DshLf4C/1DEJ0KdzAz+iHokgkaY2D7iLGLy93lMIghGm2dAvWrMvITcrYyFpQo bnFcKCCNMu4rLxqRyTwYsUmDeJgjgxA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385490; h=from:from:reply-to: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=7j5PnkuOsB2uZytqvjcjkx4Y/pW+wy8yTMFINUWLAhQ=; b=pIhX9Qfhnpp0K+7/S5B/ffO9Qe/NeKn9tHb2V3R5G4GT6oUVoZwkRG9HnEW72dFuAtLHek RJfVrRqpQs6jFPCw== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=0axxg9YB; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=pIhX9Qfh DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385490; h=from:from:reply-to: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=7j5PnkuOsB2uZytqvjcjkx4Y/pW+wy8yTMFINUWLAhQ=; b=0axxg9YBCTupt30hYBvZcJelXnkio1myLRwp4VFunvBNYIadvwt44QmtrMRUOgnnur1PTh EmUCzOa5DshLf4C/1DEJ0KdzAz+iHokgkaY2D7iLGLy93lMIghGm2dAvWrMvITcrYyFpQo bnFcKCCNMu4rLxqRyTwYsUmDeJgjgxA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385490; h=from:from:reply-to: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=7j5PnkuOsB2uZytqvjcjkx4Y/pW+wy8yTMFINUWLAhQ=; b=pIhX9Qfhnpp0K+7/S5B/ffO9Qe/NeKn9tHb2V3R5G4GT6oUVoZwkRG9HnEW72dFuAtLHek RJfVrRqpQs6jFPCw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Nicholas Piggin , Thomas Huth Subject: [PULL 02/18] tests/qtest/migration-test: Quieten ppc64 QEMU warnings Date: Fri, 14 Jun 2024 14:17:46 -0300 Message-Id: <20240614171802.28451-3-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240614171802.28451-1-farosas@suse.de> References: <20240614171802.28451-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FREEMAIL_CC(0.00)[redhat.com,linaro.org,gmail.com]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,suse.de:dkim]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com] X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Queue-Id: 0E9A020724 X-Spam-Score: -3.01 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=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1718385618619100005 Content-Type: text/plain; charset="utf-8" From: Nicholas Piggin Reviewed-by: Thomas Huth Signed-off-by: Nicholas Piggin Signed-off-by: Fabiano Rosas --- tests/qtest/migration-test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index b7e3406471..48f59822f4 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -21,6 +21,7 @@ #include "chardev/char.h" #include "crypto/tlscredspsk.h" #include "qapi/qmp/qlist.h" +#include "ppc-util.h" =20 #include "migration-helpers.h" #include "tests/migration/migration-test.h" @@ -742,7 +743,8 @@ static int test_migrate_start(QTestState **from, QTestS= tate **to, "until'", end_address, start_address= ); machine_alias =3D "pseries"; machine_opts =3D "vsmt=3D8"; - arch_opts =3D g_strdup("-nodefaults"); + arch_opts =3D g_strdup("-nodefaults " + "-machine " PSERIES_DEFAULT_CAPABILITIES); } else if (strcmp(arch, "aarch64") =3D=3D 0) { memory_size =3D "150M"; machine_alias =3D "virt"; --=20 2.35.3 From nobody Mon Nov 25 01:57:11 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1718385643; cv=none; d=zohomail.com; s=zohoarc; b=BHyyse5gc9iwwpjvyyAXAz4sBFhW/Uw9Uano6nTDmo0SLGlLOlXdqpBZwhHkZD0XE1A5BVG0VznlDhjUdjrM6qPqHJrvHLEKcowitFGy7wbWUS5B5ex5vyXCp+InzXDOZmPxDpTJ9EkMdD0+NL/R8FlDatMH6XkKYaqbxYtJeHc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718385643; 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=Zz5zC2gQSW95yYPjIKbEysWkbNjNXmIWq7dvZuw2xEI=; b=TAKNWXOnbaKIQPI8SN0bNxsRbVZ4Fu8xlLvWmSuSxhFEFri+E9NaeNX4IN5uMck5emgL7fT/8+7mghIXGYjUOTZG405CiO7IwB764vyMh47CUhNGkY6gp3PUxWd0OeyMe2JmBk7MWU7oFsd5DWgz8fEvqIeQlD23R/OgshCOqpo= 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 1718385643531783.4585298629452; Fri, 14 Jun 2024 10:20:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIAZ7-00011I-S3; Fri, 14 Jun 2024 13:18:17 -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 1sIAZ6-00010m-06 for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:16 -0400 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIAZ4-000436-AX for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:15 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 5753B20725; Fri, 14 Jun 2024 17:18:12 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 7A9D713AB1; Fri, 14 Jun 2024 17:18:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 2Ks5EFJ7bGaVAgAAD6G6ig (envelope-from ); Fri, 14 Jun 2024 17:18:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385492; h=from:from:reply-to: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=Zz5zC2gQSW95yYPjIKbEysWkbNjNXmIWq7dvZuw2xEI=; b=P5835Ly8ibstZ8JtsD/CceM1tq9rAO9qS+0YAmp8vM9JjwlB+EMGmco9eNUlnwvzongCzK XiPx3LiOWLmj4CUkNTSnb4Xs1BV2M0sBxao5dvpcF88sfRwY/MvaIQORSfZTzqs+LwPeFH 3pBSepqPjLw5ggyLbi2gKQiNwIPsyZk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385492; h=from:from:reply-to: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=Zz5zC2gQSW95yYPjIKbEysWkbNjNXmIWq7dvZuw2xEI=; b=be4PUfEz23Ozb1ahQJ1LAbkAGe/ku7syTTEMch4d8H2Jky8u29N3NiEPUljhKJeE8NhK5r 2UmIPPwvLVuDk9Bw== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385492; h=from:from:reply-to: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=Zz5zC2gQSW95yYPjIKbEysWkbNjNXmIWq7dvZuw2xEI=; b=P5835Ly8ibstZ8JtsD/CceM1tq9rAO9qS+0YAmp8vM9JjwlB+EMGmco9eNUlnwvzongCzK XiPx3LiOWLmj4CUkNTSnb4Xs1BV2M0sBxao5dvpcF88sfRwY/MvaIQORSfZTzqs+LwPeFH 3pBSepqPjLw5ggyLbi2gKQiNwIPsyZk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385492; h=from:from:reply-to: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=Zz5zC2gQSW95yYPjIKbEysWkbNjNXmIWq7dvZuw2xEI=; b=be4PUfEz23Ozb1ahQJ1LAbkAGe/ku7syTTEMch4d8H2Jky8u29N3NiEPUljhKJeE8NhK5r 2UmIPPwvLVuDk9Bw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Nicholas Piggin , Thomas Huth , Prasad Pandit Subject: [PULL 03/18] tests/qtest/migration-test: Enable on ppc64 TCG Date: Fri, 14 Jun 2024 14:17:47 -0300 Message-Id: <20240614171802.28451-4-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240614171802.28451-1-farosas@suse.de> References: <20240614171802.28451-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,linaro.org,gmail.com,fedoraproject.org]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCPT_COUNT_FIVE(0.00)[6]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FREEMAIL_ENVRCPT(0.00)[gmail.com] 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=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1718385644736100003 Content-Type: text/plain; charset="utf-8" From: Nicholas Piggin ppc64 with TCG seems to no longer be failing this test, perhaps since commit 03bfc2188f061 ("physmem: Fix migration dirty bitmap coherency with TCG memory access") which is not ppc specific but was seen to hit ppc64 quite easily. Let's enable it again. The s390x problem has been identified so mention it while we are adjusting the comment. Reviewed-by: Thomas Huth Signed-off-by: Nicholas Piggin Reviewed-by: Prasad Pandit Signed-off-by: Fabiano Rosas --- tests/qtest/migration-test.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 48f59822f4..ef9ddef1c8 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -3454,19 +3454,9 @@ int main(int argc, char **argv) #endif =20 /* - * On ppc64, the test only works with kvm-hv, but not with kvm-pr and = TCG - * is touchy due to race conditions on dirty bits (especially on PPC f= or - * some reason) - */ - if (g_str_equal(arch, "ppc64") && - (!has_kvm || access("/sys/module/kvm_hv", F_OK))) { - g_test_message("Skipping tests: kvm_hv not available"); - goto test_add_done; - } - - /* - * Similar to ppc64, s390x seems to be touchy with TCG, so disable it - * there until the problems are resolved + * On s390x with TCG, migration is observed to hang due to the 'pendin= g' + * state of the flic interrupt controller not being migrated or + * reconstructed post-migration. Disable it until the problem is resol= ved. */ if (g_str_equal(arch, "s390x") && !has_kvm) { g_test_message("Skipping tests: s390x host with KVM is required"); --=20 2.35.3 From nobody Mon Nov 25 01:57:11 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1718385557; cv=none; d=zohomail.com; s=zohoarc; b=FXGvkvXHf/d8jykTKFyJ5kJp67LbYf5fg4JLMg4dxaOl9lMfvfDSexHzjUS+Y+JkhMF8Dye15HYU7nuTf8v2m5fdCCkgtyS9MQinADO8DUk4RCT80vbGTah8rgUOUWkPnz8caysqda7cI5M9dksUUGS9qZSAhAM+ZbdNFXmzPJw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718385557; 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=5Aws4khzscTtE/UXma9tVeQJFLcYjczXhseH9nYlb6E=; b=Bpy14sgVVjkbOKvTlsCUsgxnCCADot1oO8VKrCH5eXwMVwZFTbuy/8Q7pODmlrZc7tgtC1pdv1r0Z62BttBKGViPP2uyubUyJt8Fbp/ewk02Lt49smiX+9JlhMivyVH8wMvPBXbrHB7UPnsVuuTuAoixMO11BeQBsrnJ3+KvM7I= 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 1718385557594736.0955126424165; Fri, 14 Jun 2024 10:19:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIAZ9-00011j-FD; Fri, 14 Jun 2024 13:18:19 -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 1sIAZ8-00011M-2Z for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:18 -0400 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIAZ5-00043G-T6 for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:17 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 37C4920726; Fri, 14 Jun 2024 17:18:14 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id C05F813AB1; Fri, 14 Jun 2024 17:18:12 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 8PKCIVR7bGaVAgAAD6G6ig (envelope-from ); Fri, 14 Jun 2024 17:18:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385494; h=from:from:reply-to: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=5Aws4khzscTtE/UXma9tVeQJFLcYjczXhseH9nYlb6E=; b=bnK+8vlXfeXwGzF+KnlNRcXb3JJWo6krtjjZvZS3V3qY9zBh0vrzSc/P8Beyj1Bm1H2gPP jTnKC6ZpnRKJ7qaKpTWra66ZkBPBUysFMz72C/m87CLpdiX9dfNgsW+HmzJNiLOOfqIgG7 ixmSXi+Yw9ai5/6pHELB+6kqGMWG9AM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385494; h=from:from:reply-to: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=5Aws4khzscTtE/UXma9tVeQJFLcYjczXhseH9nYlb6E=; b=CPxd+6zYSDZaBxbi43hLk37XHXviI8+HeJxQR+N4uW1UtjHQELEeuN2GfxGIyZ+7Eu1ZVK gafQFmzBfzjG53Cg== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=bnK+8vlX; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=CPxd+6zY DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385494; h=from:from:reply-to: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=5Aws4khzscTtE/UXma9tVeQJFLcYjczXhseH9nYlb6E=; b=bnK+8vlXfeXwGzF+KnlNRcXb3JJWo6krtjjZvZS3V3qY9zBh0vrzSc/P8Beyj1Bm1H2gPP jTnKC6ZpnRKJ7qaKpTWra66ZkBPBUysFMz72C/m87CLpdiX9dfNgsW+HmzJNiLOOfqIgG7 ixmSXi+Yw9ai5/6pHELB+6kqGMWG9AM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385494; h=from:from:reply-to: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=5Aws4khzscTtE/UXma9tVeQJFLcYjczXhseH9nYlb6E=; b=CPxd+6zYSDZaBxbi43hLk37XHXviI8+HeJxQR+N4uW1UtjHQELEeuN2GfxGIyZ+7Eu1ZVK gafQFmzBfzjG53Cg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Nicholas Piggin Subject: [PULL 04/18] tests/qtest/migration-test: Use custom asm bios for ppc64 Date: Fri, 14 Jun 2024 14:17:48 -0300 Message-Id: <20240614171802.28451-5-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240614171802.28451-1-farosas@suse.de> References: <20240614171802.28451-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 37C4920726 X-Spam-Score: -3.01 X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_TLS_ALL(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,suse.de:dkim]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,linaro.org,gmail.com]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DKIM_TRACE(0.00)[suse.de:+]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_ENVRCPT(0.00)[gmail.com] X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org 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=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1718385558410100009 Content-Type: text/plain; charset="utf-8" From: Nicholas Piggin Similar to other archs, build a custom bios memory updater. Running the test with OF code is a cool trick, but SLOF takes a long time to boot. This reduces test time by around 3x (150s to 50s). Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin Signed-off-by: Fabiano Rosas --- tests/migration/Makefile | 2 +- tests/migration/migration-test.h | 1 + tests/migration/ppc64/Makefile | 15 +++++++ tests/migration/ppc64/a-b-kernel.S | 66 ++++++++++++++++++++++++++++++ tests/migration/ppc64/a-b-kernel.h | 42 +++++++++++++++++++ tests/qtest/migration-test.c | 37 +++-------------- 6 files changed, 131 insertions(+), 32 deletions(-) create mode 100644 tests/migration/ppc64/Makefile create mode 100644 tests/migration/ppc64/a-b-kernel.S create mode 100644 tests/migration/ppc64/a-b-kernel.h diff --git a/tests/migration/Makefile b/tests/migration/Makefile index 13e99b1692..2c5ee287ec 100644 --- a/tests/migration/Makefile +++ b/tests/migration/Makefile @@ -5,7 +5,7 @@ # See the COPYING file in the top-level directory. # =20 -TARGET_LIST =3D i386 aarch64 s390x +TARGET_LIST =3D i386 aarch64 s390x ppc64 =20 SRC_PATH =3D ../.. =20 diff --git a/tests/migration/migration-test.h b/tests/migration/migration-t= est.h index 68512c0b1b..194df7df6f 100644 --- a/tests/migration/migration-test.h +++ b/tests/migration/migration-test.h @@ -22,6 +22,7 @@ /* PPC */ #define PPC_TEST_MEM_START (1 * 1024 * 1024) #define PPC_TEST_MEM_END (100 * 1024 * 1024) +#define PPC_H_PUT_TERM_CHAR 0x58 =20 /* ARM */ #define ARM_TEST_MEM_START (0x40000000 + 1 * 1024 * 1024) diff --git a/tests/migration/ppc64/Makefile b/tests/migration/ppc64/Makefile new file mode 100644 index 0000000000..a3a2d98ac8 --- /dev/null +++ b/tests/migration/ppc64/Makefile @@ -0,0 +1,15 @@ +.PHONY: all clean +all: a-b-kernel.h + +a-b-kernel.h: ppc64.kernel + echo "$$__note" > $@ + xxd -i $< | sed -e 's/.*int.*//' >> $@ + +ppc64.kernel: ppc64.elf + $(CROSS_PREFIX)objcopy -O binary -S $< $@ + +ppc64.elf: a-b-kernel.S + $(CROSS_PREFIX)gcc -static -o $@ -nostdlib -Wl,--build-id=3Dnone $< + +clean: + $(RM) *.kernel *.elf diff --git a/tests/migration/ppc64/a-b-kernel.S b/tests/migration/ppc64/a-b= -kernel.S new file mode 100644 index 0000000000..0613a8d18e --- /dev/null +++ b/tests/migration/ppc64/a-b-kernel.S @@ -0,0 +1,66 @@ +# +# Copyright (c) 2024 IBM, Inc +# +# This work is licensed under the terms of the GNU GPL, version 2 or later. +# See the COPYING file in the top-level directory. + +#include "../migration-test.h" + +.section .text + +.macro print ch + li %r3,PPC_H_PUT_TERM_CHAR + li %r4,0 + li %r5,1 + li %r6,\ch + sldi %r6,%r6,56 + sc 1 +.endm + + .globl _start +_start: +. =3D 0x100 + /* + * Enter 64-bit mode. Not necessary because the test uses 32-bit + * addresses, but those constants could easily be changed and break + * in 32-bit mode. + */ + mfmsr %r9 + li %r10,-1 + rldimi %r9,%r10,63,0 + mtmsrd %r9 + + /* + * Set up test memory region. Non-volatiles are used because the + * hcall can clobber regs. + * r20 - start address + * r21 - number of pages + */ + lis %r20,PPC_TEST_MEM_START@h + ori %r20,%r20,PPC_TEST_MEM_START@l + lis %r9,PPC_TEST_MEM_END@h + ori %r9,%r9,PPC_TEST_MEM_END@l + subf %r21,%r20,%r9 + li %r10,TEST_MEM_PAGE_SIZE + divd %r21,%r21,%r10 + + print 'A' + + li %r3,0 + mr %r9,%r20 + mtctr %r21 +1: stb %r3,0(%r9) + addi %r9,%r9,TEST_MEM_PAGE_SIZE + bdnz 1b + +loop: + mr %r9,%r20 + mtctr %r21 +1: lbz %r3,0(%r9) + addi %r3,%r3,1 + stb %r3,0(%r9) + addi %r9,%r9,TEST_MEM_PAGE_SIZE + bdnz 1b + + print 'B' + b loop diff --git a/tests/migration/ppc64/a-b-kernel.h b/tests/migration/ppc64/a-b= -kernel.h new file mode 100644 index 0000000000..673317efdb --- /dev/null +++ b/tests/migration/ppc64/a-b-kernel.h @@ -0,0 +1,42 @@ +/* This file is automatically generated from the assembly file in + * tests/migration/ppc64. Edit that file and then run "make all" + * inside tests/migration to update, and then remember to send both + * the header and the assembler differences in your patch submission. + */ +unsigned char ppc64_kernel[] =3D { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x7d, 0x20, 0x00, 0xa6, 0x39, 0x40, 0xff, 0xff, + 0x79, 0x49, 0xf8, 0x0e, 0x7d, 0x20, 0x01, 0x64, 0x3e, 0x80, 0x00, 0x10, + 0x62, 0x94, 0x00, 0x00, 0x3d, 0x20, 0x06, 0x40, 0x61, 0x29, 0x00, 0x00, + 0x7e, 0xb4, 0x48, 0x50, 0x39, 0x40, 0x10, 0x00, 0x7e, 0xb5, 0x53, 0xd2, + 0x38, 0x60, 0x00, 0x58, 0x38, 0x80, 0x00, 0x00, 0x38, 0xa0, 0x00, 0x01, + 0x38, 0xc0, 0x00, 0x41, 0x78, 0xc6, 0xc1, 0xc6, 0x44, 0x00, 0x00, 0x22, + 0x38, 0x60, 0x00, 0x00, 0x7e, 0x89, 0xa3, 0x78, 0x7e, 0xa9, 0x03, 0xa6, + 0x98, 0x69, 0x00, 0x00, 0x39, 0x29, 0x10, 0x00, 0x42, 0x00, 0xff, 0xf8, + 0x7e, 0x89, 0xa3, 0x78, 0x7e, 0xa9, 0x03, 0xa6, 0x88, 0x69, 0x00, 0x00, + 0x38, 0x63, 0x00, 0x01, 0x98, 0x69, 0x00, 0x00, 0x39, 0x29, 0x10, 0x00, + 0x42, 0x00, 0xff, 0xf0, 0x38, 0x60, 0x00, 0x58, 0x38, 0x80, 0x00, 0x00, + 0x38, 0xa0, 0x00, 0x01, 0x38, 0xc0, 0x00, 0x42, 0x78, 0xc6, 0xc1, 0xc6, + 0x44, 0x00, 0x00, 0x22, 0x4b, 0xff, 0xff, 0xcc +}; + diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index ef9ddef1c8..d6f5ceed80 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -128,6 +128,7 @@ static char *bootpath; */ #include "tests/migration/i386/a-b-bootblock.h" #include "tests/migration/aarch64/a-b-kernel.h" +#include "tests/migration/ppc64/a-b-kernel.h" #include "tests/migration/s390x/a-b-bios.h" =20 static void bootfile_create(char *dir, bool suspend_me) @@ -147,10 +148,8 @@ static void bootfile_create(char *dir, bool suspend_me) content =3D s390x_elf; len =3D sizeof(s390x_elf); } else if (strcmp(arch, "ppc64") =3D=3D 0) { - /* - * sane architectures can be programmed at the boot prompt - */ - return; + content =3D ppc64_kernel; + len =3D sizeof(ppc64_kernel); } else if (strcmp(arch, "aarch64") =3D=3D 0) { content =3D aarch64_kernel; len =3D sizeof(aarch64_kernel); @@ -181,29 +180,10 @@ static void wait_for_serial(const char *side) { g_autofree char *serialpath =3D g_strdup_printf("%s/%s", tmpfs, side); FILE *serialfile =3D fopen(serialpath, "r"); - const char *arch =3D qtest_get_arch(); - int started =3D (strcmp(side, "src_serial") =3D=3D 0 && - strcmp(arch, "ppc64") =3D=3D 0) ? 0 : 1; =20 do { int readvalue =3D fgetc(serialfile); =20 - if (!started) { - /* SLOF prints its banner before starting test, - * to ignore it, mark the start of the test with '_', - * ignore all characters until this marker - */ - switch (readvalue) { - case '_': - started =3D 1; - break; - case EOF: - fseek(serialfile, 0, SEEK_SET); - usleep(1000); - break; - } - continue; - } switch (readvalue) { case 'A': /* Fine */ @@ -215,8 +195,6 @@ static void wait_for_serial(const char *side) return; =20 case EOF: - started =3D (strcmp(side, "src_serial") =3D=3D 0 && - strcmp(arch, "ppc64") =3D=3D 0) ? 0 : 1; fseek(serialfile, 0, SEEK_SET); usleep(1000); break; @@ -737,14 +715,11 @@ static int test_migrate_start(QTestState **from, QTes= tState **to, memory_size =3D "256M"; start_address =3D PPC_TEST_MEM_START; end_address =3D PPC_TEST_MEM_END; - arch_source =3D g_strdup_printf("-prom-env 'use-nvramrc?=3Dtrue' -= prom-env " - "'nvramrc=3Dhex .\" _\" begin %x %x " - "do i c@ 1 + i c! 1000 +loop .\" B\"= 0 " - "until'", end_address, start_address= ); machine_alias =3D "pseries"; machine_opts =3D "vsmt=3D8"; - arch_opts =3D g_strdup("-nodefaults " - "-machine " PSERIES_DEFAULT_CAPABILITIES); + arch_opts =3D g_strdup_printf( + "-nodefaults -machine " PSERIES_DEFAULT_CAPABILITIES " " + "-bios %s", bootpath); } else if (strcmp(arch, "aarch64") =3D=3D 0) { memory_size =3D "150M"; machine_alias =3D "virt"; --=20 2.35.3 From nobody Mon Nov 25 01:57:11 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1718385557; cv=none; d=zohomail.com; s=zohoarc; b=PY5AQGXsqhrTBImp6Li0rBAPu6t4vayTnMBL1zCCYv9I39b30mREctbTqMcSP970s4rI6Gb9RWlhlvdtv0Z+BI8PernADajL+6aRX4tk0PPIvm30QRfjtRbm1tviSPeAEVBwYROW4N6En/zHgEItFhpZuID3SvkMSxo3tdFt1u8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718385557; 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=4hUPgvDKyi/wtpUXOmTf8v57I6UfGLNlrkJdxsx0ACY=; b=lQfPaB61ACj2QuyTT+u2NMivar/YUqtBZNG//0K/JGiF4moKgZv/5Yc1lIMbgdLemeSxn/SjZAy249E2yCwamJsJhT/V1LQKMuF+UZP1cl7UeD7OjkV3c5c6Mr4sQ+UrmG51tcGMcTH2oM+iXbbIoixCTpxZesO1T0nYNmVupRA= 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 1718385557724446.0680747149489; Fri, 14 Jun 2024 10:19:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIAZB-000124-2x; Fri, 14 Jun 2024 13:18:21 -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 1sIAZA-00011m-36 for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:20 -0400 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIAZ7-00043Q-Ik for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:19 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3BA4C20727; Fri, 14 Jun 2024 17:18:16 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 9883213AB1; Fri, 14 Jun 2024 17:18:14 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id GBy+F1Z7bGaVAgAAD6G6ig (envelope-from ); Fri, 14 Jun 2024 17:18:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385496; h=from:from:reply-to: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=4hUPgvDKyi/wtpUXOmTf8v57I6UfGLNlrkJdxsx0ACY=; b=NqWzXQffxN07XsbXp5hOF9g2IFVQ2zdhXXSi3r9lnzDl+0GfN7wKozwrvaJ7ZFX7B7bc4+ obUY1OwisDAM2l8rxV8CRtmnaQDZUFUBrbCBgQoFFPPW4PwFk+gRFGaOYzBwFDf/KpbUKh +KgQ7B4z+vWNfwJ8l39o+EfVWAqEr3s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385496; h=from:from:reply-to: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=4hUPgvDKyi/wtpUXOmTf8v57I6UfGLNlrkJdxsx0ACY=; b=dmKK6DFQevoEiVwknMTSdDF+JTrSMOpFX+tzgMv/r1dWtTyJUMD0obUWoOJy7FhVzk2lQz LY44ZSa61XamSTAQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385496; h=from:from:reply-to: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=4hUPgvDKyi/wtpUXOmTf8v57I6UfGLNlrkJdxsx0ACY=; b=NqWzXQffxN07XsbXp5hOF9g2IFVQ2zdhXXSi3r9lnzDl+0GfN7wKozwrvaJ7ZFX7B7bc4+ obUY1OwisDAM2l8rxV8CRtmnaQDZUFUBrbCBgQoFFPPW4PwFk+gRFGaOYzBwFDf/KpbUKh +KgQ7B4z+vWNfwJ8l39o+EfVWAqEr3s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385496; h=from:from:reply-to: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=4hUPgvDKyi/wtpUXOmTf8v57I6UfGLNlrkJdxsx0ACY=; b=dmKK6DFQevoEiVwknMTSdDF+JTrSMOpFX+tzgMv/r1dWtTyJUMD0obUWoOJy7FhVzk2lQz LY44ZSa61XamSTAQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Yuan Liu , Nanhai Zou Subject: [PULL 05/18] docs/migration: add qpl compression feature Date: Fri, 14 Jun 2024 14:17:49 -0300 Message-Id: <20240614171802.28451-6-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240614171802.28451-1-farosas@suse.de> References: <20240614171802.28451-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[intel.com:email,intel.com:url,suse.de:email]; RCVD_TLS_ALL(0.00)[] 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=2a07:de40:b251:101:10:150:64:2; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1718385558448100013 Content-Type: text/plain; charset="utf-8" From: Yuan Liu add Intel Query Processing Library (QPL) compression method introduction Signed-off-by: Yuan Liu Reviewed-by: Nanhai Zou Reviewed-by: Fabiano Rosas Acked-by: Peter Xu Signed-off-by: Fabiano Rosas --- docs/devel/migration/features.rst | 1 + docs/devel/migration/qpl-compression.rst | 260 +++++++++++++++++++++++ 2 files changed, 261 insertions(+) create mode 100644 docs/devel/migration/qpl-compression.rst diff --git a/docs/devel/migration/features.rst b/docs/devel/migration/featu= res.rst index d5ca7b86d5..bc98b65075 100644 --- a/docs/devel/migration/features.rst +++ b/docs/devel/migration/features.rst @@ -12,3 +12,4 @@ Migration has plenty of features to support different use= cases. virtio mapped-ram CPR + qpl-compression diff --git a/docs/devel/migration/qpl-compression.rst b/docs/devel/migratio= n/qpl-compression.rst new file mode 100644 index 0000000000..990992d786 --- /dev/null +++ b/docs/devel/migration/qpl-compression.rst @@ -0,0 +1,260 @@ +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +QPL Compression +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +The Intel Query Processing Library (Intel ``QPL``) is an open-source libra= ry to +provide compression and decompression features and it is based on deflate +compression algorithm (RFC 1951). + +The ``QPL`` compression relies on Intel In-Memory Analytics Accelerator(``= IAA``) +and Shared Virtual Memory(``SVM``) technology, they are new features suppo= rted +from Intel 4th Gen Intel Xeon Scalable processors, codenamed Sapphire Rapi= ds +processor(``SPR``). + +For more ``QPL`` introduction, please refer to `QPL Introduction +`_ + +QPL Compression Framework +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D + +:: + + +----------------+ +------------------+ + | MultiFD Thread | |accel-config tool | + +-------+--------+ +--------+---------+ + | | + | | + |compress/decompress | + +-------+--------+ | Setup IAA + | QPL library | | Resources + +-------+---+----+ | + | | | + | +-------------+-------+ + | Open IAA | + | Devices +-----+-----+ + | |idxd driver| + | +-----+-----+ + | | + | | + | +-----+-----+ + +-----------+IAA Devices| + Submit jobs +-----------+ + via enqcmd + + +QPL Build And Installation +-------------------------- + +.. code-block:: shell + + $git clone --recursive https://github.com/intel/qpl.git qpl + $mkdir qpl/build + $cd qpl/build + $cmake -DCMAKE_BUILD_TYPE=3DRelease -DCMAKE_INSTALL_PREFIX=3D/usr -DQPL_= LIBRARY_TYPE=3DSHARED .. + $sudo cmake --build . --target install + +For more details about ``QPL`` installation, please refer to `QPL Installa= tion +`_ + +IAA Device Management +--------------------- + +The number of ``IAA`` devices will vary depending on the Xeon product mode= l. +On a ``SPR`` server, there can be a maximum of 8 ``IAA`` devices, with up = to +4 devices per socket. + +By default, all ``IAA`` devices are disabled and need to be configured and +enabled by users manually. + +Check the number of devices through the following command + +.. code-block:: shell + + #lspci -d 8086:0cfe + 6a:02.0 System peripheral: Intel Corporation Device 0cfe + 6f:02.0 System peripheral: Intel Corporation Device 0cfe + 74:02.0 System peripheral: Intel Corporation Device 0cfe + 79:02.0 System peripheral: Intel Corporation Device 0cfe + e7:02.0 System peripheral: Intel Corporation Device 0cfe + ec:02.0 System peripheral: Intel Corporation Device 0cfe + f1:02.0 System peripheral: Intel Corporation Device 0cfe + f6:02.0 System peripheral: Intel Corporation Device 0cfe + +IAA Device Configuration And Enabling +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The ``accel-config`` tool is used to enable ``IAA`` devices and configure +``IAA`` hardware resources(work queues and engines). One ``IAA`` device +has 8 work queues and 8 processing engines, multiple engines can be assign= ed +to a work queue via ``group`` attribute. + +For ``accel-config`` installation, please refer to `accel-config installat= ion +`_ + +One example of configuring and enabling an ``IAA`` device. + +.. code-block:: shell + + #accel-config config-engine iax1/engine1.0 -g 0 + #accel-config config-engine iax1/engine1.1 -g 0 + #accel-config config-engine iax1/engine1.2 -g 0 + #accel-config config-engine iax1/engine1.3 -g 0 + #accel-config config-engine iax1/engine1.4 -g 0 + #accel-config config-engine iax1/engine1.5 -g 0 + #accel-config config-engine iax1/engine1.6 -g 0 + #accel-config config-engine iax1/engine1.7 -g 0 + #accel-config config-wq iax1/wq1.0 -g 0 -s 128 -p 10 -b 1 -t 128 -m shar= ed -y user -n app1 -d user + #accel-config enable-device iax1 + #accel-config enable-wq iax1/wq1.0 + +.. note:: + IAX is an early name for IAA + +- The ``IAA`` device index is 1, use ``ls -lh /sys/bus/dsa/devices/iax*`` + command to query the ``IAA`` device index. + +- 8 engines and 1 work queue are configured in group 0, so all compression= jobs + submitted to this work queue can be processed by all engines at the same= time. + +- Set work queue attributes including the work mode, work queue size and s= o on. + +- Enable the ``IAA1`` device and work queue 1.0 + +.. note:: + + Set work queue mode to shared mode, since ``QPL`` library only supports + shared mode + +For more detailed configuration, please refer to `IAA Configuration Samples +`_ + +IAA Unit Test +^^^^^^^^^^^^^ + +- Enabling ``IAA`` devices for Xeon platform, please refer to `IAA User Gu= ide + `_ + +- ``IAA`` device driver is Intel Data Accelerator Driver (idxd), it is + recommended that the minimum version of Linux kernel is 5.18. + +- Add ``"intel_iommu=3Don,sm_on"`` parameter to kernel command line + for ``SVM`` feature enabling. + +Here is an easy way to verify ``IAA`` device driver and ``SVM`` with `iaa_= test +`_ + +.. code-block:: shell + + #./test/iaa_test + [ info] alloc wq 0 shared size 128 addr 0x7f26cebe5000 batch sz 0xfffff= ffe xfer sz 0x80000000 + [ info] test noop: tflags 0x1 num_desc 1 + [ info] preparing descriptor for noop + [ info] Submitted all noop jobs + [ info] verifying task result for 0x16f7e20 + [ info] test with op 0 passed + + +IAA Resources Allocation For Migration +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +There is no ``IAA`` resource configuration parameters for migration and +``accel-config`` tool configuration cannot directly specify the ``IAA`` +resources used for migration. + +The multifd migration with ``QPL`` compression method will use all work +queues that are enabled and shared mode. + +.. note:: + + Accessing IAA resources requires ``sudo`` command or ``root`` privileges + by default. Administrators can modify the IAA device node ownership + so that QEMU can use IAA with specified user permissions. + + For example + + #chown -R qemu /dev/iax + +Shared Virtual Memory(SVM) Introduction +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +An ability for an accelerator I/O device to operate in the same virtual +memory space of applications on host processors. It also implies the +ability to operate from pageable memory, avoiding functional requirements +to pin memory for DMA operations. + +When using ``SVM`` technology, users do not need to reserve memory for the +``IAA`` device and perform pin memory operation. The ``IAA`` device can +directly access data using the virtual address of the process. + +For more ``SVM`` technology, please refer to +`Shared Virtual Addressing (SVA) with ENQCMD +`_ + + +How To Use QPL Compression In Migration +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +1 - Installation of ``QPL`` library and ``accel-config`` library if using = IAA + +2 - Configure and enable ``IAA`` devices and work queues via ``accel-confi= g`` + +3 - Build ``QEMU`` with ``--enable-qpl`` parameter + + E.g. configure --target-list=3Dx86_64-softmmu --enable-kvm ``--enable-qp= l`` + +4 - Enable ``QPL`` compression during migration + + Set ``migrate_set_parameter multifd-compression qpl`` when migrating, the + ``QPL`` compression does not support configuring the compression level, = it + only supports one compression level. + +The Difference Between QPL And ZLIB +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Although both ``QPL`` and ``ZLIB`` are based on the deflate compression +algorithm, and ``QPL`` can support the header and tail of ``ZLIB``, ``QPL`` +is still not fully compatible with the ``ZLIB`` compression in the migrati= on. + +``QPL`` only supports 4K history buffer, and ``ZLIB`` is 32K by default. +``ZLIB`` compresses data that ``QPL`` may not decompress correctly and +vice versa. + +``QPL`` does not support the ``Z_SYNC_FLUSH`` operation in ``ZLIB`` stream= ing +compression, current ``ZLIB`` implementation uses ``Z_SYNC_FLUSH``, so each +``multifd`` thread has a ``ZLIB`` streaming context, and all page compress= ion +and decompression are based on this stream. ``QPL`` cannot decompress such= data +and vice versa. + +The introduction for ``Z_SYNC_FLUSH``, please refer to `Zlib Manual +`_ + +The Best Practices +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +When user enables the IAA device for ``QPL`` compression, it is recommended +to add ``-mem-prealloc`` parameter to the destination boot parameters. This +parameter can avoid the occurrence of I/O page fault and reduce the overhe= ad +of IAA compression and decompression. + +The example of booting with ``-mem-prealloc`` parameter + +.. code-block:: shell + + $qemu-system-x86_64 --enable-kvm -cpu host --mem-prealloc ... + + +An example about I/O page fault measurement of destination without +``-mem-prealloc``, the ``svm_prq`` indicates the number of I/O page fault +occurrences and processing time. + +.. code-block:: shell + + #echo 1 > /sys/kernel/debug/iommu/intel/dmar_perf_latency + #echo 2 > /sys/kernel/debug/iommu/intel/dmar_perf_latency + #echo 3 > /sys/kernel/debug/iommu/intel/dmar_perf_latency + #echo 4 > /sys/kernel/debug/iommu/intel/dmar_perf_latency + #cat /sys/kernel/debug/iommu/intel/dmar_perf_latency + IOMMU: dmar18 Register Base Address: c87fc000 + <0.1us 0.1us-1us 1us-10us 10us-100us 100us-1ms = 1ms-10ms >=3D10ms min(us) max(us) average(us) + inv_iotlb 0 286 123 0 0 = 0 0 0 1 0 + inv_devtlb 0 276 133 0 0 = 0 0 0 2 0 + inv_iec 0 0 0 0 0 = 0 0 0 0 0 + svm_prq 0 0 25206 364 395 = 0 0 1 556 9 --=20 2.35.3 From nobody Mon Nov 25 01:57:11 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1718385616; cv=none; d=zohomail.com; s=zohoarc; b=Bx2GvQRr0KX6d/40zoryi0bsXCfESkj1UoBBICi03Hw1ZzkO9XNjbA5ak4tyVwPoSv/vIlhPcoKmDF6SvvsdX2MmMu5jVAaWLtZ2LubB5yp3yFuVRLE2yT8Do+TFarEmIiOB7g8yRZ41wB19ffJmQajye7wYfM7+JpkhQzDC0og= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718385616; 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=pjjpGXZWWLF+wOKcACa+P9jcUGJ2fsrBlh5BBqndgIU=; b=O9uz5oXn+cbdEFNVdOc0QbbgQxrZX/rv7M+av1pIEROXBKshlEOEwxAGacWQCM8MWj99gWAZHxW2oI3Ozz3cx9c57nP1KOOKVWrifVBmGQaI9cHhLdlhKswgn3wSB1XP1MVw9awHvHtZQJdh6TGFG2/+At4XU/Y4dCRmE/iUNKo= 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 171838561614049.74274021843473; Fri, 14 Jun 2024 10:20:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIAZC-00013J-TZ; Fri, 14 Jun 2024 13:18:22 -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 1sIAZB-00012L-Ik for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:21 -0400 Received: from smtp-out1.suse.de ([195.135.223.130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIAZ9-00043b-ME for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:21 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 45401339FA; Fri, 14 Jun 2024 17:18:18 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A466A13AB1; Fri, 14 Jun 2024 17:18:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 0Me7Glh7bGaVAgAAD6G6ig (envelope-from ); Fri, 14 Jun 2024 17:18:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385498; h=from:from:reply-to: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=pjjpGXZWWLF+wOKcACa+P9jcUGJ2fsrBlh5BBqndgIU=; b=S5LRfDgCxf8p3BnvLphj/Uj5fsvKTqbWevXP+1h2c9CH4nluuUU9pMr2weUR/TMS8siSae j8b55IlxDeCRo4JTH1ZdOJOlGrV/vv+7ppgvzrEzHn0r/jWwEDMU7K3i++iiSxYEsKISnI 61ElH3yuBGywNEjhm0lTGVnXDyG9Xns= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385498; h=from:from:reply-to: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=pjjpGXZWWLF+wOKcACa+P9jcUGJ2fsrBlh5BBqndgIU=; b=t7TuJaCme9GaFEMdneskIWBDenYJQC07dzKO+JJ1ZcoBqljGt+E7v8wAb1Z/3UgD2ZUHl2 MYkQ4d/mYivWjCCA== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=S5LRfDgC; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=t7TuJaCm DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385498; h=from:from:reply-to: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=pjjpGXZWWLF+wOKcACa+P9jcUGJ2fsrBlh5BBqndgIU=; b=S5LRfDgCxf8p3BnvLphj/Uj5fsvKTqbWevXP+1h2c9CH4nluuUU9pMr2weUR/TMS8siSae j8b55IlxDeCRo4JTH1ZdOJOlGrV/vv+7ppgvzrEzHn0r/jWwEDMU7K3i++iiSxYEsKISnI 61ElH3yuBGywNEjhm0lTGVnXDyG9Xns= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385498; h=from:from:reply-to: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=pjjpGXZWWLF+wOKcACa+P9jcUGJ2fsrBlh5BBqndgIU=; b=t7TuJaCme9GaFEMdneskIWBDenYJQC07dzKO+JJ1ZcoBqljGt+E7v8wAb1Z/3UgD2ZUHl2 MYkQ4d/mYivWjCCA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Yuan Liu , Nanhai Zou Subject: [PULL 06/18] migration/multifd: put IOV initialization into compression method Date: Fri, 14 Jun 2024 14:17:50 -0300 Message-Id: <20240614171802.28451-7-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240614171802.28451-1-farosas@suse.de> References: <20240614171802.28451-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 45401339FA X-Spam-Score: -3.01 X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; MIME_TRACE(0.00)[0:+]; FUZZY_BLOCKED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; ARC_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; FROM_EQ_ENVFROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCPT_COUNT_FIVE(0.00)[5]; DBL_BLOCKED_OPENRESOLVER(0.00)[intel.com:email,suse.de:email,suse.de:dkim] X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org 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=195.135.223.130; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1718385616629100001 Content-Type: text/plain; charset="utf-8" From: Yuan Liu Different compression methods may require different numbers of IOVs. Based on streaming compression of zlib and zstd, all pages will be compressed to a data block, so two IOVs are needed for packet header and compressed data block. Signed-off-by: Yuan Liu Reviewed-by: Nanhai Zou Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/multifd-zlib.c | 7 +++++++ migration/multifd-zstd.c | 8 +++++++- migration/multifd.c | 22 ++++++++++++---------- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/migration/multifd-zlib.c b/migration/multifd-zlib.c index 737a9645d2..2ced69487e 100644 --- a/migration/multifd-zlib.c +++ b/migration/multifd-zlib.c @@ -70,6 +70,10 @@ static int zlib_send_setup(MultiFDSendParams *p, Error *= *errp) goto err_free_zbuff; } p->compress_data =3D z; + + /* Needs 2 IOVs, one for packet header and one for compressed data */ + p->iov =3D g_new0(struct iovec, 2); + return 0; =20 err_free_zbuff: @@ -101,6 +105,9 @@ static void zlib_send_cleanup(MultiFDSendParams *p, Err= or **errp) z->buf =3D NULL; g_free(p->compress_data); p->compress_data =3D NULL; + + g_free(p->iov); + p->iov =3D NULL; } =20 /** diff --git a/migration/multifd-zstd.c b/migration/multifd-zstd.c index 256858df0a..ca17b7e310 100644 --- a/migration/multifd-zstd.c +++ b/migration/multifd-zstd.c @@ -52,7 +52,6 @@ static int zstd_send_setup(MultiFDSendParams *p, Error **= errp) struct zstd_data *z =3D g_new0(struct zstd_data, 1); int res; =20 - p->compress_data =3D z; z->zcs =3D ZSTD_createCStream(); if (!z->zcs) { g_free(z); @@ -77,6 +76,10 @@ static int zstd_send_setup(MultiFDSendParams *p, Error *= *errp) error_setg(errp, "multifd %u: out of memory for zbuff", p->id); return -1; } + p->compress_data =3D z; + + /* Needs 2 IOVs, one for packet header and one for compressed data */ + p->iov =3D g_new0(struct iovec, 2); return 0; } =20 @@ -98,6 +101,9 @@ static void zstd_send_cleanup(MultiFDSendParams *p, Erro= r **errp) z->zbuff =3D NULL; g_free(p->compress_data); p->compress_data =3D NULL; + + g_free(p->iov); + p->iov =3D NULL; } =20 /** diff --git a/migration/multifd.c b/migration/multifd.c index f317bff077..d82885fdbb 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -137,6 +137,13 @@ static int nocomp_send_setup(MultiFDSendParams *p, Err= or **errp) p->write_flags |=3D QIO_CHANNEL_WRITE_FLAG_ZERO_COPY; } =20 + if (multifd_use_packets()) { + /* We need one extra place for the packet header */ + p->iov =3D g_new0(struct iovec, p->page_count + 1); + } else { + p->iov =3D g_new0(struct iovec, p->page_count); + } + return 0; } =20 @@ -150,6 +157,8 @@ static int nocomp_send_setup(MultiFDSendParams *p, Erro= r **errp) */ static void nocomp_send_cleanup(MultiFDSendParams *p, Error **errp) { + g_free(p->iov); + p->iov =3D NULL; return; } =20 @@ -228,6 +237,7 @@ static int nocomp_send_prepare(MultiFDSendParams *p, Er= ror **errp) */ static int nocomp_recv_setup(MultiFDRecvParams *p, Error **errp) { + p->iov =3D g_new0(struct iovec, p->page_count); return 0; } =20 @@ -240,6 +250,8 @@ static int nocomp_recv_setup(MultiFDRecvParams *p, Erro= r **errp) */ static void nocomp_recv_cleanup(MultiFDRecvParams *p) { + g_free(p->iov); + p->iov =3D NULL; } =20 /** @@ -783,8 +795,6 @@ static bool multifd_send_cleanup_channel(MultiFDSendPar= ams *p, Error **errp) p->packet_len =3D 0; g_free(p->packet); p->packet =3D NULL; - g_free(p->iov); - p->iov =3D NULL; multifd_send_state->ops->send_cleanup(p, errp); =20 return *errp =3D=3D NULL; @@ -1179,11 +1189,6 @@ bool multifd_send_setup(void) p->packet =3D g_malloc0(p->packet_len); p->packet->magic =3D cpu_to_be32(MULTIFD_MAGIC); p->packet->version =3D cpu_to_be32(MULTIFD_VERSION); - - /* We need one extra place for the packet header */ - p->iov =3D g_new0(struct iovec, page_count + 1); - } else { - p->iov =3D g_new0(struct iovec, page_count); } p->name =3D g_strdup_printf("multifdsend_%d", i); p->page_size =3D qemu_target_page_size(); @@ -1353,8 +1358,6 @@ static void multifd_recv_cleanup_channel(MultiFDRecvP= arams *p) p->packet_len =3D 0; g_free(p->packet); p->packet =3D NULL; - g_free(p->iov); - p->iov =3D NULL; g_free(p->normal); p->normal =3D NULL; g_free(p->zero); @@ -1602,7 +1605,6 @@ int multifd_recv_setup(Error **errp) p->packet =3D g_malloc0(p->packet_len); } p->name =3D g_strdup_printf("multifdrecv_%d", i); - p->iov =3D g_new0(struct iovec, page_count); p->normal =3D g_new0(ram_addr_t, page_count); p->zero =3D g_new0(ram_addr_t, page_count); p->page_count =3D page_count; --=20 2.35.3 From nobody Mon Nov 25 01:57:11 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1718385573; cv=none; d=zohomail.com; s=zohoarc; b=UIjyfBramjvoh6vKyHZw+xRZs7rTWcXWUcTnb9puMB2IAWJhqnxhJ24POFAkYjprJqaEQXCRxZBhxqkFJmAHHVLizo+Aqi0b2ASWS+Be9jWTqMZLzUzOHGY/LzW2soHe+Kxj8XEy7CuZdDmKFGWDxJGtc1uZyXueCcu+7gVewEA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718385573; 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=/oUUxkja25yKI5x3Xf7VoUaogDWc4vwbKUzr6RmUlPM=; b=bksIy0miRBVv6q9EGT/fGPVeJkYPP/N8ag/ZAx9Z7JQSPB0CuCnt1OcIZ9QesJTYqTpw+ENBEodPuIjMnX8ay27YJd4QsjT0XDIfjraKJnNvm0nOa+mqYZsUXoO7Qs5zF7Xsab64h9/kG6BC2wB/h5E35SR6KkmOepUPwGgg6rI= 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 1718385573777942.9335826082732; Fri, 14 Jun 2024 10:19:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIAZE-00015D-Fp; Fri, 14 Jun 2024 13:18:24 -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 1sIAZD-00013K-5o for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:23 -0400 Received: from smtp-out1.suse.de ([2a07:de40:b251:101:10:150:64:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIAZB-00043m-H8 for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:22 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 50E41339FB; Fri, 14 Jun 2024 17:18:20 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id AF46413AB1; Fri, 14 Jun 2024 17:18:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id GLpWHVp7bGaVAgAAD6G6ig (envelope-from ); Fri, 14 Jun 2024 17:18:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385500; h=from:from:reply-to: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=/oUUxkja25yKI5x3Xf7VoUaogDWc4vwbKUzr6RmUlPM=; b=Mrq+fztzuP/4wlaDaI32hQUxIyMvXFsMNALoHNlRBSBBmS2enOoAV3zmk85eu5D/TzK9db WOdyHV3pdW3CHj3vXg2Lbiv/WnShu5TVDwHRijma+XIuiseMedYrvRIa3Y2f9g/WY303eS WJ2bnHUp/okUhgaCO6tMtUdZyMXJ51I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385500; h=from:from:reply-to: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=/oUUxkja25yKI5x3Xf7VoUaogDWc4vwbKUzr6RmUlPM=; b=j7Ph3lAEQdAeAjA6c9I/V1dhgQ1uM+Z/6gOZ1NiLdON168p4Ayvlj/cFelUPLm1nUnFAvs 4cO5uR3sfvux1oDg== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=Mrq+fztz; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=j7Ph3lAE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385500; h=from:from:reply-to: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=/oUUxkja25yKI5x3Xf7VoUaogDWc4vwbKUzr6RmUlPM=; b=Mrq+fztzuP/4wlaDaI32hQUxIyMvXFsMNALoHNlRBSBBmS2enOoAV3zmk85eu5D/TzK9db WOdyHV3pdW3CHj3vXg2Lbiv/WnShu5TVDwHRijma+XIuiseMedYrvRIa3Y2f9g/WY303eS WJ2bnHUp/okUhgaCO6tMtUdZyMXJ51I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385500; h=from:from:reply-to: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=/oUUxkja25yKI5x3Xf7VoUaogDWc4vwbKUzr6RmUlPM=; b=j7Ph3lAEQdAeAjA6c9I/V1dhgQ1uM+Z/6gOZ1NiLdON168p4Ayvlj/cFelUPLm1nUnFAvs 4cO5uR3sfvux1oDg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Yuan Liu , Nanhai Zou Subject: [PULL 07/18] configure: add --enable-qpl build option Date: Fri, 14 Jun 2024 14:17:51 -0300 Message-Id: <20240614171802.28451-8-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240614171802.28451-1-farosas@suse.de> References: <20240614171802.28451-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 50E41339FB X-Spam-Score: -3.01 X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; MIME_TRACE(0.00)[0:+]; FUZZY_BLOCKED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; ARC_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; FROM_EQ_ENVFROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCPT_COUNT_FIVE(0.00)[5]; DBL_BLOCKED_OPENRESOLVER(0.00)[intel.com:email,suse.de:email,suse.de:dkim] X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org 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=2a07:de40:b251:101:10:150:64:1; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1718385575448100003 Content-Type: text/plain; charset="utf-8" From: Yuan Liu add --enable-qpl and --disable-qpl options to enable and disable the QPL compression method for multifd migration. The Query Processing Library (QPL) is an open-source library that supports data compression and decompression features. It is based on the deflate compression algorithm and use Intel In-Memory Analytics Accelerator(IAA) hardware for compression and decompression acceleration. For more live migration with IAA, please refer to the document docs/devel/migration/qpl-compression.rst Signed-off-by: Yuan Liu Reviewed-by: Nanhai Zou Reviewed-by: Fabiano Rosas Signed-off-by: Fabiano Rosas --- meson.build | 8 ++++++++ meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 3 +++ 3 files changed, 13 insertions(+) diff --git a/meson.build b/meson.build index 3a2f126490..c16574710c 100644 --- a/meson.build +++ b/meson.build @@ -1201,6 +1201,12 @@ if not get_option('zstd').auto() or have_block required: get_option('zstd'), method: 'pkg-config') endif +qpl =3D not_found +if not get_option('qpl').auto() or have_system + qpl =3D dependency('qpl', version: '>=3D1.5.0', + required: get_option('qpl'), + method: 'pkg-config') +endif virgl =3D not_found =20 have_vhost_user_gpu =3D have_tools and host_os =3D=3D 'linux' and pixman.f= ound() @@ -2333,6 +2339,7 @@ config_host_data.set('CONFIG_MALLOC_TRIM', has_malloc= _trim) config_host_data.set('CONFIG_STATX', has_statx) config_host_data.set('CONFIG_STATX_MNT_ID', has_statx_mnt_id) config_host_data.set('CONFIG_ZSTD', zstd.found()) +config_host_data.set('CONFIG_QPL', qpl.found()) config_host_data.set('CONFIG_FUSE', fuse.found()) config_host_data.set('CONFIG_FUSE_LSEEK', fuse_lseek.found()) config_host_data.set('CONFIG_SPICE_PROTOCOL', spice_protocol.found()) @@ -4446,6 +4453,7 @@ summary_info +=3D {'snappy support': snappy} summary_info +=3D {'bzip2 support': libbzip2} summary_info +=3D {'lzfse support': liblzfse} summary_info +=3D {'zstd support': zstd} +summary_info +=3D {'Query Processing Library support': qpl} summary_info +=3D {'NUMA host support': numa} summary_info +=3D {'capstone': capstone} summary_info +=3D {'libpmem support': libpmem} diff --git a/meson_options.txt b/meson_options.txt index 4c1583eb40..dd680a5faf 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -259,6 +259,8 @@ option('xkbcommon', type : 'feature', value : 'auto', description: 'xkbcommon support') option('zstd', type : 'feature', value : 'auto', description: 'zstd compression support') +option('qpl', type : 'feature', value : 'auto', + description: 'Query Processing Library support') option('fuse', type: 'feature', value: 'auto', description: 'FUSE block device export') option('fuse_lseek', type : 'feature', value : 'auto', diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index 6ce5a8b72a..73ae8cedfc 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -220,6 +220,7 @@ meson_options_help() { printf "%s\n" ' Xen PCI passthrough support' printf "%s\n" ' xkbcommon xkbcommon support' printf "%s\n" ' zstd zstd compression support' + printf "%s\n" ' qpl Query Processing Library support' } _meson_option_parse() { case $1 in @@ -558,6 +559,8 @@ _meson_option_parse() { --disable-xkbcommon) printf "%s" -Dxkbcommon=3Ddisabled ;; --enable-zstd) printf "%s" -Dzstd=3Denabled ;; --disable-zstd) printf "%s" -Dzstd=3Ddisabled ;; + --enable-qpl) printf "%s" -Dqpl=3Denabled ;; + --disable-qpl) printf "%s" -Dqpl=3Ddisabled ;; *) return 1 ;; esac } --=20 2.35.3 From nobody Mon Nov 25 01:57:11 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1718385557; cv=none; d=zohomail.com; s=zohoarc; b=S1O66kFN7bEpoczRH1x7VZLmQA/8MoZgv3O5SHMLhbjcMs+b6yGEEN3V/365ecm/l9S3J0ift3cuAhYJ8uPkXtEMz5SXuUJn3Ye0UgStkJq7WAQ7bUgThJudeIKYiJSl4coO/aq1eqkShvWj4n2KCvhVdtfcBhJcIX8vrCGsN4M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718385557; 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=TrBSPx3LSmG3AYZQqHnKCZnzkS8srk2opnauqCWnh+w=; b=NVxyyjSJFEMVQd1sCkPzfy+Mqoj+LOSEtnhCfAJdWPs+0XVjbxMfTrXkNm/5vdcOoCmbrhMzRgwj03JTH5uC00nRZMcNlYJxlIMQqc63WmC7v6IBwSms1xMZ/Mz3kqtxnDyriLB1aXx5GiTMDMPL8qOD6Aic6fCbR8x6TTnIpY4= 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 1718385557576797.4237868554222; Fri, 14 Jun 2024 10:19:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIAZH-000169-Nq; Fri, 14 Jun 2024 13:18: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 1sIAZF-00015U-DP for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:25 -0400 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIAZD-00043y-ML for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:25 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6200320724; Fri, 14 Jun 2024 17:18:22 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id BB76A13AB1; Fri, 14 Jun 2024 17:18:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id kBgyIFx7bGaVAgAAD6G6ig (envelope-from ); Fri, 14 Jun 2024 17:18:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385502; h=from:from:reply-to: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=TrBSPx3LSmG3AYZQqHnKCZnzkS8srk2opnauqCWnh+w=; b=cGDEBWxyJ1RogZKRxBLMlnGi8rLNq6qClVN8Z0EL4OxAtkUtOg/KzbCUbppg80qv5N6NrS qiMlMGZJlYzluBJOxkWQB70B3yIBQK3AVFvTS+zRAijDl1Ghva1LbvqdMt94ARoxhvmFe6 bmB0Coqda+pZP5JpcsdNwC3z5Crth3k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385502; h=from:from:reply-to: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=TrBSPx3LSmG3AYZQqHnKCZnzkS8srk2opnauqCWnh+w=; b=u18y6pblX/I9vNPVAcC5nuGIjZzWbRw1N6kqaq+1qSgl2Q9dCyJIsGFWQ3fQOdf1hv0cmd aZsy/eFLeJ6nVpBg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385502; h=from:from:reply-to: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=TrBSPx3LSmG3AYZQqHnKCZnzkS8srk2opnauqCWnh+w=; b=cGDEBWxyJ1RogZKRxBLMlnGi8rLNq6qClVN8Z0EL4OxAtkUtOg/KzbCUbppg80qv5N6NrS qiMlMGZJlYzluBJOxkWQB70B3yIBQK3AVFvTS+zRAijDl1Ghva1LbvqdMt94ARoxhvmFe6 bmB0Coqda+pZP5JpcsdNwC3z5Crth3k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385502; h=from:from:reply-to: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=TrBSPx3LSmG3AYZQqHnKCZnzkS8srk2opnauqCWnh+w=; b=u18y6pblX/I9vNPVAcC5nuGIjZzWbRw1N6kqaq+1qSgl2Q9dCyJIsGFWQ3fQOdf1hv0cmd aZsy/eFLeJ6nVpBg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Yuan Liu , Nanhai Zou Subject: [PULL 08/18] migration/multifd: add qpl compression method Date: Fri, 14 Jun 2024 14:17:52 -0300 Message-Id: <20240614171802.28451-9-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240614171802.28451-1-farosas@suse.de> References: <20240614171802.28451-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[intel.com:email,suse.de:email]; RCVD_TLS_ALL(0.00)[] 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=2a07:de40:b251:101:10:150:64:2; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1718385558435100010 Content-Type: text/plain; charset="utf-8" From: Yuan Liu add the Query Processing Library (QPL) compression method Introduce the qpl as a new multifd migration compression method, it can use In-Memory Analytics Accelerator(IAA) to accelerate compression and decompression, which can not only reduce network bandwidth requirement but also reduce host compression and decompression CPU overhead. How to enable qpl compression during migration: migrate_set_parameter multifd-compression qpl There is no qpl compression level parameter added since it only supports level one, users do not need to specify the qpl compression level. Signed-off-by: Yuan Liu Reviewed-by: Nanhai Zou Reviewed-by: Peter Xu Reviewed-by: Fabiano Rosas [fixed docs spacing in migration.json] Signed-off-by: Fabiano Rosas --- hw/core/qdev-properties-system.c | 2 +- migration/meson.build | 1 + migration/multifd-qpl.c | 20 ++++++++++++++++++++ migration/multifd.h | 1 + qapi/migration.json | 8 +++++++- 5 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 migration/multifd-qpl.c diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index d79d6f4b53..6ccd7224f6 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -659,7 +659,7 @@ const PropertyInfo qdev_prop_fdc_drive_type =3D { const PropertyInfo qdev_prop_multifd_compression =3D { .name =3D "MultiFDCompression", .description =3D "multifd_compression values, " - "none/zlib/zstd", + "none/zlib/zstd/qpl", .enum_table =3D &MultiFDCompression_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, diff --git a/migration/meson.build b/migration/meson.build index bdc3244bce..5f146fe8a9 100644 --- a/migration/meson.build +++ b/migration/meson.build @@ -39,6 +39,7 @@ endif =20 system_ss.add(when: rdma, if_true: files('rdma.c')) system_ss.add(when: zstd, if_true: files('multifd-zstd.c')) +system_ss.add(when: qpl, if_true: files('multifd-qpl.c')) =20 specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: files('ram.c', diff --git a/migration/multifd-qpl.c b/migration/multifd-qpl.c new file mode 100644 index 0000000000..056a68a060 --- /dev/null +++ b/migration/multifd-qpl.c @@ -0,0 +1,20 @@ +/* + * Multifd qpl compression accelerator implementation + * + * Copyright (c) 2023 Intel Corporation + * + * Authors: + * Yuan Liu + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ +#include "qemu/osdep.h" +#include "qemu/module.h" + +static void multifd_qpl_register(void) +{ + /* noop */ +} + +migration_init(multifd_qpl_register); diff --git a/migration/multifd.h b/migration/multifd.h index c9d9b09239..5b7d9b15f8 100644 --- a/migration/multifd.h +++ b/migration/multifd.h @@ -40,6 +40,7 @@ MultiFDRecvData *multifd_get_recv_data(void); #define MULTIFD_FLAG_NOCOMP (0 << 1) #define MULTIFD_FLAG_ZLIB (1 << 1) #define MULTIFD_FLAG_ZSTD (2 << 1) +#define MULTIFD_FLAG_QPL (4 << 1) =20 /* This value needs to be a multiple of qemu_target_page_size() */ #define MULTIFD_PACKET_SIZE (512 * 1024) diff --git a/qapi/migration.json b/qapi/migration.json index a351fd3714..a35d0b5b83 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -554,11 +554,17 @@ # # @zstd: use zstd compression method. # +# @qpl: use qpl compression method. Query Processing Library(qpl) is +# based on the deflate compression algorithm and use the Intel +# In-Memory Analytics Accelerator(IAA) accelerated compression +# and decompression. (Since 9.1) +# # Since: 5.0 ## { 'enum': 'MultiFDCompression', 'data': [ 'none', 'zlib', - { 'name': 'zstd', 'if': 'CONFIG_ZSTD' } ] } + { 'name': 'zstd', 'if': 'CONFIG_ZSTD' }, + { 'name': 'qpl', 'if': 'CONFIG_QPL' } ] } =20 ## # @MigMode: --=20 2.35.3 From nobody Mon Nov 25 01:57:11 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1718385586; cv=none; d=zohomail.com; s=zohoarc; b=FOBtXLNsSzdXIdsv2iH0f63JYBNEGLgmevSH6miYTqClo+lcr6Ivaoqugh/w8nASTpq9xFhNKCQysEuzw1gcyL6cttFdsq1UYFdOC8yQcnuMLcC/KzXnhg5z1EjOhlOcyM7Xq8pSSi9twa4yxj3wRsQ+Wa4dpPy5B5OxPOuGlgA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718385586; 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=rKQ+UvrKUDVvIEdQ2MPCcUE36t6xt8+2LMyymHctKEY=; b=NjuP2uZBSJ29/sK8/Komupvt+qJ8IulWOUQ2CL9foWHg1HpGTKEO1pp1IpTrCAuTEf7xIf4eUFNqaEE+TYaxDoldyxX4I9yFaiX7CAfz7WU+woVp+XtP7PzcTgcdZPKnyEX5A6/Lvd8gr+mvcWmYBrOwwhazOM2nAEovnTnefXM= 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 1718385586554449.0697870784021; Fri, 14 Jun 2024 10:19:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIAZM-00016o-M2; Fri, 14 Jun 2024 13:18:32 -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 1sIAZH-00016B-T2 for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:27 -0400 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIAZF-00044E-OV for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:27 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6B36320726; Fri, 14 Jun 2024 17:18:24 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id CC35E13AB1; Fri, 14 Jun 2024 17:18:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id mO6BJF57bGaVAgAAD6G6ig (envelope-from ); Fri, 14 Jun 2024 17:18:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385504; h=from:from:reply-to: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=rKQ+UvrKUDVvIEdQ2MPCcUE36t6xt8+2LMyymHctKEY=; b=qjNXH6U5WKi+0zIs757ibu9UzAHUpghrTuBhhEYUaXcIal0+lJDDqslZe+PYMYdSbGa/Rw UozFseGu48NLpMFuqw6y7RXig9L1biJu/v2BQoYXhUQph/w4f/LK4BnmoaKwZGMrvjxRwW 0BobWIJjg/H0q0FtAxE8CsFKEmJ5ruY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385504; h=from:from:reply-to: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=rKQ+UvrKUDVvIEdQ2MPCcUE36t6xt8+2LMyymHctKEY=; b=PQNeNuclBEta/mHZCJPAYAMUfs6OvooJPt29Kj9GrtC+lSxlO2NAKhibWLE7qr2oGLY2oJ JdMd5xiXVJqT/VCA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=qjNXH6U5; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=PQNeNucl DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385504; h=from:from:reply-to: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=rKQ+UvrKUDVvIEdQ2MPCcUE36t6xt8+2LMyymHctKEY=; b=qjNXH6U5WKi+0zIs757ibu9UzAHUpghrTuBhhEYUaXcIal0+lJDDqslZe+PYMYdSbGa/Rw UozFseGu48NLpMFuqw6y7RXig9L1biJu/v2BQoYXhUQph/w4f/LK4BnmoaKwZGMrvjxRwW 0BobWIJjg/H0q0FtAxE8CsFKEmJ5ruY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385504; h=from:from:reply-to: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=rKQ+UvrKUDVvIEdQ2MPCcUE36t6xt8+2LMyymHctKEY=; b=PQNeNuclBEta/mHZCJPAYAMUfs6OvooJPt29Kj9GrtC+lSxlO2NAKhibWLE7qr2oGLY2oJ JdMd5xiXVJqT/VCA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Yuan Liu , Nanhai Zou Subject: [PULL 09/18] migration/multifd: implement initialization of qpl compression Date: Fri, 14 Jun 2024 14:17:53 -0300 Message-Id: <20240614171802.28451-10-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240614171802.28451-1-farosas@suse.de> References: <20240614171802.28451-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 6B36320726 X-Spam-Score: -3.01 X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; MIME_TRACE(0.00)[0:+]; FUZZY_BLOCKED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; ARC_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; FROM_EQ_ENVFROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCPT_COUNT_FIVE(0.00)[5]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,suse.de:dkim,intel.com:email] X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org 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=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1718385588537100007 Content-Type: text/plain; charset="utf-8" From: Yuan Liu during initialization, a software job is allocated to each channel for software path fallabck when the IAA hardware is unavailable or the hardware job submission fails. If the IAA hardware is available, multiple hardware jobs are allocated for batch processing. Signed-off-by: Yuan Liu Reviewed-by: Nanhai Zou Reviewed-by: Fabiano Rosas Signed-off-by: Fabiano Rosas --- migration/multifd-qpl.c | 328 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 327 insertions(+), 1 deletion(-) diff --git a/migration/multifd-qpl.c b/migration/multifd-qpl.c index 056a68a060..6791a204d5 100644 --- a/migration/multifd-qpl.c +++ b/migration/multifd-qpl.c @@ -9,12 +9,338 @@ * This work is licensed under the terms of the GNU GPL, version 2 or late= r. * See the COPYING file in the top-level directory. */ + #include "qemu/osdep.h" #include "qemu/module.h" +#include "qapi/error.h" +#include "multifd.h" +#include "qpl/qpl.h" + +typedef struct { + /* the QPL hardware path job */ + qpl_job *job; + /* indicates if fallback to software path is required */ + bool fallback_sw_path; + /* output data from the software path */ + uint8_t *sw_output; + /* output data length from the software path */ + uint32_t sw_output_len; +} QplHwJob; + +typedef struct { + /* array of hardware jobs, the number of jobs equals the number pages = */ + QplHwJob *hw_jobs; + /* the QPL software job for the slow path and software fallback */ + qpl_job *sw_job; + /* the number of pages that the QPL needs to process at one time */ + uint32_t page_num; + /* array of compressed page buffers */ + uint8_t *zbuf; + /* array of compressed page lengths */ + uint32_t *zlen; + /* the status of the hardware device */ + bool hw_avail; +} QplData; + +/** + * check_hw_avail: check if IAA hardware is available + * + * If the IAA hardware does not exist or is unavailable, + * the QPL hardware job initialization will fail. + * + * Returns true if IAA hardware is available, otherwise false. + * + * @job_size: indicates the hardware job size if hardware is available + */ +static bool check_hw_avail(uint32_t *job_size) +{ + qpl_path_t path =3D qpl_path_hardware; + uint32_t size =3D 0; + qpl_job *job; + + if (qpl_get_job_size(path, &size) !=3D QPL_STS_OK) { + return false; + } + assert(size > 0); + job =3D g_malloc0(size); + if (qpl_init_job(path, job) !=3D QPL_STS_OK) { + g_free(job); + return false; + } + g_free(job); + *job_size =3D size; + return true; +} + +/** + * multifd_qpl_free_sw_job: clean up software job + * + * Free the software job resources. + * + * @qpl: pointer to the QplData structure + */ +static void multifd_qpl_free_sw_job(QplData *qpl) +{ + assert(qpl); + if (qpl->sw_job) { + qpl_fini_job(qpl->sw_job); + g_free(qpl->sw_job); + qpl->sw_job =3D NULL; + } +} + +/** + * multifd_qpl_free_jobs: clean up hardware jobs + * + * Free all hardware job resources. + * + * @qpl: pointer to the QplData structure + */ +static void multifd_qpl_free_hw_job(QplData *qpl) +{ + assert(qpl); + if (qpl->hw_jobs) { + for (int i =3D 0; i < qpl->page_num; i++) { + qpl_fini_job(qpl->hw_jobs[i].job); + g_free(qpl->hw_jobs[i].job); + qpl->hw_jobs[i].job =3D NULL; + } + g_free(qpl->hw_jobs); + qpl->hw_jobs =3D NULL; + } +} + +/** + * multifd_qpl_init_sw_job: initialize a software job + * + * Use the QPL software path to initialize a job + * + * @qpl: pointer to the QplData structure + * @errp: pointer to an error + */ +static int multifd_qpl_init_sw_job(QplData *qpl, Error **errp) +{ + qpl_path_t path =3D qpl_path_software; + uint32_t size =3D 0; + qpl_job *job =3D NULL; + qpl_status status; + + status =3D qpl_get_job_size(path, &size); + if (status !=3D QPL_STS_OK) { + error_setg(errp, "qpl_get_job_size failed with error %d", status); + return -1; + } + job =3D g_malloc0(size); + status =3D qpl_init_job(path, job); + if (status !=3D QPL_STS_OK) { + error_setg(errp, "qpl_init_job failed with error %d", status); + g_free(job); + return -1; + } + qpl->sw_job =3D job; + return 0; +} + +/** + * multifd_qpl_init_jobs: initialize hardware jobs + * + * Use the QPL hardware path to initialize jobs + * + * @qpl: pointer to the QplData structure + * @size: the size of QPL hardware path job + * @errp: pointer to an error + */ +static void multifd_qpl_init_hw_job(QplData *qpl, uint32_t size, Error **e= rrp) +{ + qpl_path_t path =3D qpl_path_hardware; + qpl_job *job =3D NULL; + qpl_status status; + + qpl->hw_jobs =3D g_new0(QplHwJob, qpl->page_num); + for (int i =3D 0; i < qpl->page_num; i++) { + job =3D g_malloc0(size); + status =3D qpl_init_job(path, job); + /* the job initialization should succeed after check_hw_avail */ + assert(status =3D=3D QPL_STS_OK); + qpl->hw_jobs[i].job =3D job; + } +} + +/** + * multifd_qpl_init: initialize QplData structure + * + * Allocate and initialize a QplData structure + * + * Returns a QplData pointer on success or NULL on error + * + * @num: the number of pages + * @size: the page size + * @errp: pointer to an error + */ +static QplData *multifd_qpl_init(uint32_t num, uint32_t size, Error **errp) +{ + uint32_t job_size =3D 0; + QplData *qpl; + + qpl =3D g_new0(QplData, 1); + qpl->page_num =3D num; + if (multifd_qpl_init_sw_job(qpl, errp) !=3D 0) { + g_free(qpl); + return NULL; + } + qpl->hw_avail =3D check_hw_avail(&job_size); + if (qpl->hw_avail) { + multifd_qpl_init_hw_job(qpl, job_size, errp); + } + qpl->zbuf =3D g_malloc0(size * num); + qpl->zlen =3D g_new0(uint32_t, num); + return qpl; +} + +/** + * multifd_qpl_deinit: clean up QplData structure + * + * Free jobs, buffers and the QplData structure + * + * @qpl: pointer to the QplData structure + */ +static void multifd_qpl_deinit(QplData *qpl) +{ + if (qpl) { + multifd_qpl_free_sw_job(qpl); + multifd_qpl_free_hw_job(qpl); + g_free(qpl->zbuf); + g_free(qpl->zlen); + g_free(qpl); + } +} + +/** + * multifd_qpl_send_setup: set up send side + * + * Set up the channel with QPL compression. + * + * Returns 0 on success or -1 on error + * + * @p: Params for the channel being used + * @errp: pointer to an error + */ +static int multifd_qpl_send_setup(MultiFDSendParams *p, Error **errp) +{ + QplData *qpl; + + qpl =3D multifd_qpl_init(p->page_count, p->page_size, errp); + if (!qpl) { + return -1; + } + p->compress_data =3D qpl; + + /* + * the page will be compressed independently and sent using an IOV. The + * additional two IOVs are used to store packet header and compressed = data + * length + */ + p->iov =3D g_new0(struct iovec, p->page_count + 2); + return 0; +} + +/** + * multifd_qpl_send_cleanup: clean up send side + * + * Close the channel and free memory. + * + * @p: Params for the channel being used + * @errp: pointer to an error + */ +static void multifd_qpl_send_cleanup(MultiFDSendParams *p, Error **errp) +{ + multifd_qpl_deinit(p->compress_data); + p->compress_data =3D NULL; + g_free(p->iov); + p->iov =3D NULL; +} + +/** + * multifd_qpl_send_prepare: prepare data to be able to send + * + * Create a compressed buffer with all the pages that we are going to + * send. + * + * Returns 0 on success or -1 on error + * + * @p: Params for the channel being used + * @errp: pointer to an error + */ +static int multifd_qpl_send_prepare(MultiFDSendParams *p, Error **errp) +{ + /* Implement in next patch */ + return -1; +} + +/** + * multifd_qpl_recv_setup: set up receive side + * + * Create the compressed channel and buffer. + * + * Returns 0 on success or -1 on error + * + * @p: Params for the channel being used + * @errp: pointer to an error + */ +static int multifd_qpl_recv_setup(MultiFDRecvParams *p, Error **errp) +{ + QplData *qpl; + + qpl =3D multifd_qpl_init(p->page_count, p->page_size, errp); + if (!qpl) { + return -1; + } + p->compress_data =3D qpl; + return 0; +} + +/** + * multifd_qpl_recv_cleanup: set up receive side + * + * Close the channel and free memory. + * + * @p: Params for the channel being used + */ +static void multifd_qpl_recv_cleanup(MultiFDRecvParams *p) +{ + multifd_qpl_deinit(p->compress_data); + p->compress_data =3D NULL; +} + +/** + * multifd_qpl_recv: read the data from the channel into actual pages + * + * Read the compressed buffer, and uncompress it into the actual + * pages. + * + * Returns 0 on success or -1 on error + * + * @p: Params for the channel being used + * @errp: pointer to an error + */ +static int multifd_qpl_recv(MultiFDRecvParams *p, Error **errp) +{ + /* Implement in next patch */ + return -1; +} + +static MultiFDMethods multifd_qpl_ops =3D { + .send_setup =3D multifd_qpl_send_setup, + .send_cleanup =3D multifd_qpl_send_cleanup, + .send_prepare =3D multifd_qpl_send_prepare, + .recv_setup =3D multifd_qpl_recv_setup, + .recv_cleanup =3D multifd_qpl_recv_cleanup, + .recv =3D multifd_qpl_recv, +}; =20 static void multifd_qpl_register(void) { - /* noop */ + multifd_register_ops(MULTIFD_COMPRESSION_QPL, &multifd_qpl_ops); } =20 migration_init(multifd_qpl_register); --=20 2.35.3 From nobody Mon Nov 25 01:57:11 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1718385595; cv=none; d=zohomail.com; s=zohoarc; b=iOuyr9kMv0KVaP/+suIpRFicKMhrJiSphTfeemJm20OuLmsfX7Tvf2O0DJTXKbwUmM4/uaJW/E3W6A2DF14irPIw7QmtcfmS/+mta7wM8RPk9hrSNHLfynxU7MFeM6ZRUJ55K4TTmjDCVXAAwgeUblsYHBY8suyuOnEGeaLFvEw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718385595; 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=aFo0CsKkUDQ5hPVyNwZKwQv3oRQSX4qaPViHeUbWKv0=; b=EbXWIG3J96tsla8l0EpRjj+x13WEthJjXeV5/NU7uuXhOIENypD6eayrLr9VVmEMw7tqeEafnZwFueEiMMt/Nx4OoPeAWO7fX5LRIY1i/sNSY5VvQ/Aa09okuu46W49pEmfE36SufWrt125bN3mgfLbrZof4BtznevG/yPpuOu8= 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 1718385595353729.8152708181232; Fri, 14 Jun 2024 10:19:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIAZN-00017a-Qz; Fri, 14 Jun 2024 13:18:34 -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 1sIAZL-00016n-8P for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:32 -0400 Received: from smtp-out1.suse.de ([195.135.223.130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIAZH-00044g-SC for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:30 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 795D121906; Fri, 14 Jun 2024 17:18:26 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D469A13AB1; Fri, 14 Jun 2024 17:18:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id SNlYJmB7bGaVAgAAD6G6ig (envelope-from ); Fri, 14 Jun 2024 17:18:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385506; h=from:from:reply-to: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=aFo0CsKkUDQ5hPVyNwZKwQv3oRQSX4qaPViHeUbWKv0=; b=hvei5j0ziqxEEgkrMgDvTnkRRbj6xMwxylv0UFDzY5gaXHf6Jm9OMVsAcTTZQYq9QAMUs/ V9h58Dq7y4decQpNJPN7/NteYO1dqDXfjVY1nvahIh0Zgz73g9oGSZ0bRmFKsNmb2jTh6f d2SCj97pIhsE/cmdvZEUk4CDfe5+p9M= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385506; h=from:from:reply-to: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=aFo0CsKkUDQ5hPVyNwZKwQv3oRQSX4qaPViHeUbWKv0=; b=Zkiw1jBqDRJ3A7/oldX0+Sg7QjH5p3ZkfIEQRj0qu0STIFSpr5GvJH6MQx8VxspC5+btxq At2UiwQqmYfSXIAg== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385506; h=from:from:reply-to: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=aFo0CsKkUDQ5hPVyNwZKwQv3oRQSX4qaPViHeUbWKv0=; b=hvei5j0ziqxEEgkrMgDvTnkRRbj6xMwxylv0UFDzY5gaXHf6Jm9OMVsAcTTZQYq9QAMUs/ V9h58Dq7y4decQpNJPN7/NteYO1dqDXfjVY1nvahIh0Zgz73g9oGSZ0bRmFKsNmb2jTh6f d2SCj97pIhsE/cmdvZEUk4CDfe5+p9M= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385506; h=from:from:reply-to: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=aFo0CsKkUDQ5hPVyNwZKwQv3oRQSX4qaPViHeUbWKv0=; b=Zkiw1jBqDRJ3A7/oldX0+Sg7QjH5p3ZkfIEQRj0qu0STIFSpr5GvJH6MQx8VxspC5+btxq At2UiwQqmYfSXIAg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Yuan Liu , Nanhai Zou Subject: [PULL 10/18] migration/multifd: implement qpl compression and decompression Date: Fri, 14 Jun 2024 14:17:54 -0300 Message-Id: <20240614171802.28451-11-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240614171802.28451-1-farosas@suse.de> References: <20240614171802.28451-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,intel.com:email]; RCVD_TLS_ALL(0.00)[] 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=195.135.223.130; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1718385596581100003 Content-Type: text/plain; charset="utf-8" From: Yuan Liu QPL compression and decompression will use IAA hardware path if the IAA hardware is available. Otherwise the QPL library software path is used. The hardware path will automatically fall back to QPL software path if the IAA queues are busy. In some scenarios, this may happen frequently, such as configuring 4 channels but only one IAA device is available. In the case of insufficient IAA hardware resources, retry and fallback can help optimize performance: 1. Retry + SW fallback: total time: 14649 ms downtime: 25 ms throughput: 17666.57 mbps pages-per-second: 1509647 2. No fallback, always wait for work queues to become available total time: 18381 ms downtime: 25 ms throughput: 13698.65 mbps pages-per-second: 859607 If both the hardware and software paths fail, the uncompressed page is sent directly. Signed-off-by: Yuan Liu Reviewed-by: Nanhai Zou Reviewed-by: Fabiano Rosas Signed-off-by: Fabiano Rosas --- migration/multifd-qpl.c | 424 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 420 insertions(+), 4 deletions(-) diff --git a/migration/multifd-qpl.c b/migration/multifd-qpl.c index 6791a204d5..9265098ee7 100644 --- a/migration/multifd-qpl.c +++ b/migration/multifd-qpl.c @@ -13,9 +13,14 @@ #include "qemu/osdep.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qapi/qapi-types-migration.h" +#include "exec/ramblock.h" #include "multifd.h" #include "qpl/qpl.h" =20 +/* Maximum number of retries to resubmit a job if IAA work queues are full= */ +#define MAX_SUBMIT_RETRY_NUM (3) + typedef struct { /* the QPL hardware path job */ qpl_job *job; @@ -260,6 +265,225 @@ static void multifd_qpl_send_cleanup(MultiFDSendParam= s *p, Error **errp) p->iov =3D NULL; } =20 +/** + * multifd_qpl_prepare_job: prepare the job + * + * Set the QPL job parameters and properties. + * + * @job: pointer to the qpl_job structure + * @is_compression: indicates compression and decompression + * @input: pointer to the input data buffer + * @input_len: the length of the input data + * @output: pointer to the output data buffer + * @output_len: the length of the output data + */ +static void multifd_qpl_prepare_job(qpl_job *job, bool is_compression, + uint8_t *input, uint32_t input_len, + uint8_t *output, uint32_t output_len) +{ + job->op =3D is_compression ? qpl_op_compress : qpl_op_decompress; + job->next_in_ptr =3D input; + job->next_out_ptr =3D output; + job->available_in =3D input_len; + job->available_out =3D output_len; + job->flags =3D QPL_FLAG_FIRST | QPL_FLAG_LAST | QPL_FLAG_OMIT_VERIFY; + /* only supports compression level 1 */ + job->level =3D 1; +} + +/** + * multifd_qpl_prepare_comp_job: prepare the compression job + * + * Set the compression job parameters and properties. + * + * @job: pointer to the qpl_job structure + * @input: pointer to the input data buffer + * @output: pointer to the output data buffer + * @size: the page size + */ +static void multifd_qpl_prepare_comp_job(qpl_job *job, uint8_t *input, + uint8_t *output, uint32_t size) +{ + /* + * Set output length to less than the page size to force the job to + * fail in case it compresses to a larger size. We'll send that page + * without compression and skip the decompression operation on the + * destination. + */ + multifd_qpl_prepare_job(job, true, input, size, output, size - 1); +} + +/** + * multifd_qpl_prepare_decomp_job: prepare the decompression job + * + * Set the decompression job parameters and properties. + * + * @job: pointer to the qpl_job structure + * @input: pointer to the input data buffer + * @len: the length of the input data + * @output: pointer to the output data buffer + * @size: the page size + */ +static void multifd_qpl_prepare_decomp_job(qpl_job *job, uint8_t *input, + uint32_t len, uint8_t *output, + uint32_t size) +{ + multifd_qpl_prepare_job(job, false, input, len, output, size); +} + +/** + * multifd_qpl_fill_iov: fill in the IOV + * + * Fill in the QPL packet IOV + * + * @p: Params for the channel being used + * @data: pointer to the IOV data + * @len: The length of the IOV data + */ +static void multifd_qpl_fill_iov(MultiFDSendParams *p, uint8_t *data, + uint32_t len) +{ + p->iov[p->iovs_num].iov_base =3D data; + p->iov[p->iovs_num].iov_len =3D len; + p->iovs_num++; + p->next_packet_size +=3D len; +} + +/** + * multifd_qpl_fill_packet: fill the compressed page into the QPL packet + * + * Fill the compressed page length and IOV into the QPL packet + * + * @idx: The index of the compressed length array + * @p: Params for the channel being used + * @data: pointer to the compressed page buffer + * @len: The length of the compressed page + */ +static void multifd_qpl_fill_packet(uint32_t idx, MultiFDSendParams *p, + uint8_t *data, uint32_t len) +{ + QplData *qpl =3D p->compress_data; + + qpl->zlen[idx] =3D cpu_to_be32(len); + multifd_qpl_fill_iov(p, data, len); +} + +/** + * multifd_qpl_submit_job: submit a job to the hardware + * + * Submit a QPL hardware job to the IAA device + * + * Returns true if the job is submitted successfully, otherwise false. + * + * @job: pointer to the qpl_job structure + */ +static bool multifd_qpl_submit_job(qpl_job *job) +{ + qpl_status status; + uint32_t num =3D 0; + +retry: + status =3D qpl_submit_job(job); + if (status =3D=3D QPL_STS_QUEUES_ARE_BUSY_ERR) { + if (num < MAX_SUBMIT_RETRY_NUM) { + num++; + goto retry; + } + } + return (status =3D=3D QPL_STS_OK); +} + +/** + * multifd_qpl_compress_pages_slow_path: compress pages using slow path + * + * Compress the pages using software. If compression fails, the uncompress= ed + * page will be sent. + * + * @p: Params for the channel being used + */ +static void multifd_qpl_compress_pages_slow_path(MultiFDSendParams *p) +{ + QplData *qpl =3D p->compress_data; + uint32_t size =3D p->page_size; + qpl_job *job =3D qpl->sw_job; + uint8_t *zbuf =3D qpl->zbuf; + uint8_t *buf; + + for (int i =3D 0; i < p->pages->normal_num; i++) { + buf =3D p->pages->block->host + p->pages->offset[i]; + multifd_qpl_prepare_comp_job(job, buf, zbuf, size); + if (qpl_execute_job(job) =3D=3D QPL_STS_OK) { + multifd_qpl_fill_packet(i, p, zbuf, job->total_out); + } else { + /* send the uncompressed page */ + multifd_qpl_fill_packet(i, p, buf, size); + } + zbuf +=3D size; + } +} + +/** + * multifd_qpl_compress_pages: compress pages + * + * Submit the pages to the IAA hardware for compression. If hardware + * compression fails, it falls back to software compression. If software + * compression also fails, the uncompressed page is sent. + * + * @p: Params for the channel being used + */ +static void multifd_qpl_compress_pages(MultiFDSendParams *p) +{ + QplData *qpl =3D p->compress_data; + MultiFDPages_t *pages =3D p->pages; + uint32_t size =3D p->page_size; + QplHwJob *hw_job; + uint8_t *buf; + uint8_t *zbuf; + + for (int i =3D 0; i < pages->normal_num; i++) { + buf =3D pages->block->host + pages->offset[i]; + zbuf =3D qpl->zbuf + (size * i); + hw_job =3D &qpl->hw_jobs[i]; + multifd_qpl_prepare_comp_job(hw_job->job, buf, zbuf, size); + if (multifd_qpl_submit_job(hw_job->job)) { + hw_job->fallback_sw_path =3D false; + } else { + /* + * The IAA work queue is full, any immediate subsequent job + * submission is likely to fail, sending the page via the QPL + * software path at this point gives us a better chance of + * finding the queue open for the next pages. + */ + hw_job->fallback_sw_path =3D true; + multifd_qpl_prepare_comp_job(qpl->sw_job, buf, zbuf, size); + if (qpl_execute_job(qpl->sw_job) =3D=3D QPL_STS_OK) { + hw_job->sw_output =3D zbuf; + hw_job->sw_output_len =3D qpl->sw_job->total_out; + } else { + hw_job->sw_output =3D buf; + hw_job->sw_output_len =3D size; + } + } + } + + for (int i =3D 0; i < pages->normal_num; i++) { + buf =3D pages->block->host + pages->offset[i]; + zbuf =3D qpl->zbuf + (size * i); + hw_job =3D &qpl->hw_jobs[i]; + if (hw_job->fallback_sw_path) { + multifd_qpl_fill_packet(i, p, hw_job->sw_output, + hw_job->sw_output_len); + continue; + } + if (qpl_wait_job(hw_job->job) =3D=3D QPL_STS_OK) { + multifd_qpl_fill_packet(i, p, zbuf, hw_job->job->total_out); + } else { + /* send the uncompressed page */ + multifd_qpl_fill_packet(i, p, buf, size); + } + } +} + /** * multifd_qpl_send_prepare: prepare data to be able to send * @@ -273,8 +497,26 @@ static void multifd_qpl_send_cleanup(MultiFDSendParams= *p, Error **errp) */ static int multifd_qpl_send_prepare(MultiFDSendParams *p, Error **errp) { - /* Implement in next patch */ - return -1; + QplData *qpl =3D p->compress_data; + uint32_t len =3D 0; + + if (!multifd_send_prepare_common(p)) { + goto out; + } + + /* The first IOV is used to store the compressed page lengths */ + len =3D p->pages->normal_num * sizeof(uint32_t); + multifd_qpl_fill_iov(p, (uint8_t *) qpl->zlen, len); + if (qpl->hw_avail) { + multifd_qpl_compress_pages(p); + } else { + multifd_qpl_compress_pages_slow_path(p); + } + +out: + p->flags |=3D MULTIFD_FLAG_QPL; + multifd_send_fill_packet(p); + return 0; } =20 /** @@ -312,6 +554,140 @@ static void multifd_qpl_recv_cleanup(MultiFDRecvParam= s *p) p->compress_data =3D NULL; } =20 +/** + * multifd_qpl_process_and_check_job: process and check a QPL job + * + * Process the job and check whether the job output length is the + * same as the specified length + * + * Returns true if the job execution succeeded and the output length + * is equal to the specified length, otherwise false. + * + * @job: pointer to the qpl_job structure + * @is_hardware: indicates whether the job is a hardware job + * @len: Specified output length + * @errp: pointer to an error + */ +static bool multifd_qpl_process_and_check_job(qpl_job *job, bool is_hardwa= re, + uint32_t len, Error **errp) +{ + qpl_status status; + + status =3D (is_hardware ? qpl_wait_job(job) : qpl_execute_job(job)); + if (status !=3D QPL_STS_OK) { + error_setg(errp, "qpl job failed with error %d", status); + return false; + } + if (job->total_out !=3D len) { + error_setg(errp, "qpl decompressed len %u, expected len %u", + job->total_out, len); + return false; + } + return true; +} + +/** + * multifd_qpl_decompress_pages_slow_path: decompress pages using slow path + * + * Decompress the pages using software + * + * Returns 0 on success or -1 on error + * + * @p: Params for the channel being used + * @errp: pointer to an error + */ +static int multifd_qpl_decompress_pages_slow_path(MultiFDRecvParams *p, + Error **errp) +{ + QplData *qpl =3D p->compress_data; + uint32_t size =3D p->page_size; + qpl_job *job =3D qpl->sw_job; + uint8_t *zbuf =3D qpl->zbuf; + uint8_t *addr; + uint32_t len; + + for (int i =3D 0; i < p->normal_num; i++) { + len =3D qpl->zlen[i]; + addr =3D p->host + p->normal[i]; + /* the page is uncompressed, load it */ + if (len =3D=3D size) { + memcpy(addr, zbuf, size); + zbuf +=3D size; + continue; + } + multifd_qpl_prepare_decomp_job(job, zbuf, len, addr, size); + if (!multifd_qpl_process_and_check_job(job, false, size, errp)) { + return -1; + } + zbuf +=3D len; + } + return 0; +} + +/** + * multifd_qpl_decompress_pages: decompress pages + * + * Decompress the pages using the IAA hardware. If hardware + * decompression fails, it falls back to software decompression. + * + * Returns 0 on success or -1 on error + * + * @p: Params for the channel being used + * @errp: pointer to an error + */ +static int multifd_qpl_decompress_pages(MultiFDRecvParams *p, Error **errp) +{ + QplData *qpl =3D p->compress_data; + uint32_t size =3D p->page_size; + uint8_t *zbuf =3D qpl->zbuf; + uint8_t *addr; + uint32_t len; + qpl_job *job; + + for (int i =3D 0; i < p->normal_num; i++) { + addr =3D p->host + p->normal[i]; + len =3D qpl->zlen[i]; + /* the page is uncompressed if received length equals the page siz= e */ + if (len =3D=3D size) { + memcpy(addr, zbuf, size); + zbuf +=3D size; + continue; + } + + job =3D qpl->hw_jobs[i].job; + multifd_qpl_prepare_decomp_job(job, zbuf, len, addr, size); + if (multifd_qpl_submit_job(job)) { + qpl->hw_jobs[i].fallback_sw_path =3D false; + } else { + /* + * The IAA work queue is full, any immediate subsequent job + * submission is likely to fail, sending the page via the QPL + * software path at this point gives us a better chance of + * finding the queue open for the next pages. + */ + qpl->hw_jobs[i].fallback_sw_path =3D true; + job =3D qpl->sw_job; + multifd_qpl_prepare_decomp_job(job, zbuf, len, addr, size); + if (!multifd_qpl_process_and_check_job(job, false, size, errp)= ) { + return -1; + } + } + zbuf +=3D len; + } + + for (int i =3D 0; i < p->normal_num; i++) { + /* ignore pages that have already been processed */ + if (qpl->zlen[i] =3D=3D size || qpl->hw_jobs[i].fallback_sw_path) { + continue; + } + + job =3D qpl->hw_jobs[i].job; + if (!multifd_qpl_process_and_check_job(job, true, size, errp)) { + return -1; + } + } + return 0; +} /** * multifd_qpl_recv: read the data from the channel into actual pages * @@ -325,8 +701,48 @@ static void multifd_qpl_recv_cleanup(MultiFDRecvParams= *p) */ static int multifd_qpl_recv(MultiFDRecvParams *p, Error **errp) { - /* Implement in next patch */ - return -1; + QplData *qpl =3D p->compress_data; + uint32_t in_size =3D p->next_packet_size; + uint32_t flags =3D p->flags & MULTIFD_FLAG_COMPRESSION_MASK; + uint32_t len =3D 0; + uint32_t zbuf_len =3D 0; + int ret; + + if (flags !=3D MULTIFD_FLAG_QPL) { + error_setg(errp, "multifd %u: flags received %x flags expected %x", + p->id, flags, MULTIFD_FLAG_QPL); + return -1; + } + multifd_recv_zero_page_process(p); + if (!p->normal_num) { + assert(in_size =3D=3D 0); + return 0; + } + + /* read compressed page lengths */ + len =3D p->normal_num * sizeof(uint32_t); + assert(len < in_size); + ret =3D qio_channel_read_all(p->c, (void *) qpl->zlen, len, errp); + if (ret !=3D 0) { + return ret; + } + 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); + zbuf_len +=3D qpl->zlen[i]; + } + + /* read compressed pages */ + assert(in_size =3D=3D len + zbuf_len); + ret =3D qio_channel_read_all(p->c, (void *) qpl->zbuf, zbuf_len, errp); + if (ret !=3D 0) { + return ret; + } + + if (qpl->hw_avail) { + return multifd_qpl_decompress_pages(p, errp); + } + return multifd_qpl_decompress_pages_slow_path(p, errp); } =20 static MultiFDMethods multifd_qpl_ops =3D { --=20 2.35.3 From nobody Mon Nov 25 01:57:11 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1718385584; cv=none; d=zohomail.com; s=zohoarc; b=W83dJDzILJH27mM/Ppo2ioinjUwgsVGFPUfeQdbkZkdqnNxDvzGfPCVOBvw2X/GX68h04vr5+v74pNLlr9gmKG+D9VRpHOsGdB0mTrKefHxXQ5cXTYJ9mLrEOrCE3GdUzvEuLwpEzSo+/z0uUVERkQ1J3eLu4oO1zXlTTIKLkOg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718385584; 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=cusFWByzTv9oqEECxIQtHKfWkTS05sjLtk4FuQQCIPo=; b=Ry7ZoCjCARBdTlTCT5ADhx9hR5hMR7oTRW54N13QqubOjWfXbVI9axC9gLELPbV8s7v2QuYaJ+71hBCte5vyGRhAufA8UgsR4TGIeCf95ubhyLtjUp+dWRSMQuIKmx0bOFQ4Gt2iK5EvbjK2v04ZyzV6or7nxl8b/FEGMRgrzTU= 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 1718385584457804.217008486792; Fri, 14 Jun 2024 10:19:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIAZR-00018K-Ru; Fri, 14 Jun 2024 13:18:37 -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 1sIAZM-000176-Tk for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:32 -0400 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIAZL-000457-0u for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:32 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 8F91A20724; Fri, 14 Jun 2024 17:18:28 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E49D213AB1; Fri, 14 Jun 2024 17:18:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id +HwaKmJ7bGaVAgAAD6G6ig (envelope-from ); Fri, 14 Jun 2024 17:18:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385508; h=from:from:reply-to: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=cusFWByzTv9oqEECxIQtHKfWkTS05sjLtk4FuQQCIPo=; b=BbPYCKc2YDIwmcXmoFEaGYpffYQxLjRtSvXwfOPEwZlNoPgkcPvyb6NJATJ10km0wf2DVg 5ecmXbBXePsTnYtB0sBfpl43nbaSgbsnT77WOf75LWWtA0JKBwYo0SESRZE+S71msv7cbs WgSyUDcfOeYswRpeywf/JXf26sZWeLY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385508; h=from:from:reply-to: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=cusFWByzTv9oqEECxIQtHKfWkTS05sjLtk4FuQQCIPo=; b=KKlbz/zckeV/S0bfUuHfhUomoo3T+nPjAE8UpTtE7QbvNjnWikLa8aWLjeiDZAQYuhPU1N RXv+QoxhA6SJMlBA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=BbPYCKc2; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="KKlbz/zc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385508; h=from:from:reply-to: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=cusFWByzTv9oqEECxIQtHKfWkTS05sjLtk4FuQQCIPo=; b=BbPYCKc2YDIwmcXmoFEaGYpffYQxLjRtSvXwfOPEwZlNoPgkcPvyb6NJATJ10km0wf2DVg 5ecmXbBXePsTnYtB0sBfpl43nbaSgbsnT77WOf75LWWtA0JKBwYo0SESRZE+S71msv7cbs WgSyUDcfOeYswRpeywf/JXf26sZWeLY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385508; h=from:from:reply-to: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=cusFWByzTv9oqEECxIQtHKfWkTS05sjLtk4FuQQCIPo=; b=KKlbz/zckeV/S0bfUuHfhUomoo3T+nPjAE8UpTtE7QbvNjnWikLa8aWLjeiDZAQYuhPU1N RXv+QoxhA6SJMlBA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Yuan Liu , Nanhai Zou Subject: [PULL 11/18] tests/migration-test: add qpl compression test Date: Fri, 14 Jun 2024 14:17:55 -0300 Message-Id: <20240614171802.28451-12-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240614171802.28451-1-farosas@suse.de> References: <20240614171802.28451-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; MIME_TRACE(0.00)[0:+]; FUZZY_BLOCKED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; ARC_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; FROM_EQ_ENVFROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCPT_COUNT_FIVE(0.00)[5]; DBL_BLOCKED_OPENRESOLVER(0.00)[intel.com:email,suse.de:email,suse.de:dkim] X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Queue-Id: 8F91A20724 X-Spam-Score: -3.01 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=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1718385586463100003 Content-Type: text/plain; charset="utf-8" From: Yuan Liu add qpl to compression method test for multifd migration the qpl compression supports software path and hardware path(IAA device), and the hardware path is used first by default. If the hardware path is unavailable, it will automatically fallback to the software path for testing. Signed-off-by: Yuan Liu Reviewed-by: Nanhai Zou Reviewed-by: Peter Xu Reviewed-by: Fabiano Rosas Signed-off-by: Fabiano Rosas --- tests/qtest/migration-test.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index d6f5ceed80..887cd9fe42 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -2638,6 +2638,15 @@ test_migrate_precopy_tcp_multifd_zstd_start(QTestSta= te *from, } #endif /* CONFIG_ZSTD */ =20 +#ifdef CONFIG_QPL +static void * +test_migrate_precopy_tcp_multifd_qpl_start(QTestState *from, + QTestState *to) +{ + return test_migrate_precopy_tcp_multifd_start_common(from, to, "qpl"); +} +#endif /* CONFIG_QPL */ + static void test_multifd_tcp_uri_none(void) { MigrateCommon args =3D { @@ -2718,6 +2727,17 @@ static void test_multifd_tcp_zstd(void) } #endif =20 +#ifdef CONFIG_QPL +static void test_multifd_tcp_qpl(void) +{ + MigrateCommon args =3D { + .listen_uri =3D "defer", + .start_hook =3D test_migrate_precopy_tcp_multifd_qpl_start, + }; + test_precopy_common(&args); +} +#endif + #ifdef CONFIG_GNUTLS static void * test_migrate_multifd_tcp_tls_psk_start_match(QTestState *from, @@ -3593,6 +3613,10 @@ int main(int argc, char **argv) migration_test_add("/migration/multifd/tcp/plain/zstd", test_multifd_tcp_zstd); #endif +#ifdef CONFIG_QPL + migration_test_add("/migration/multifd/tcp/plain/qpl", + test_multifd_tcp_qpl); +#endif #ifdef CONFIG_GNUTLS migration_test_add("/migration/multifd/tcp/tls/psk/match", test_multifd_tcp_tls_psk_match); --=20 2.35.3 From nobody Mon Nov 25 01:57:11 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1718385563; cv=none; d=zohomail.com; s=zohoarc; b=B6O1Vsbpf5l73SylptoFqh6Lw7wJoD24OiLZO2SDqwQanO4sAWfGMUgI3rxlYIdLZtiBnJDGHpXDmtDqkqBQVY3iPSPfNfR6xAwxFKnItlJMRiyxI2VN2spec2E0O42woFQcltWgLKfH9gE0da0aRuBqzPUrEsE8iTEmqtkPRfA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718385563; h=Content-Type: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=NLzeyc/X1R/2F7Z/mZ8QhCI6C6667LCgP8daYEWJFF0=; b=Yt0YG1trfFl45Z4mPR3DbICvdhFMUYLYj0wdw05UAeLoShPB0nPqL0bapZLE7W7ueoYiYWxtoaOqZbqcErW/VJ/a4y6prQl/Au48syM/tZxzwYaIuBhWoLTUQGCJ10gp3U0UxFey2CVEX7wR1Q0Za7sYccH73B4AEVZGAI/MI5U= 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 1718385563253918.2053021793704; Fri, 14 Jun 2024 10:19:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIAZS-000190-Oa; Fri, 14 Jun 2024 13:18:38 -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 1sIAZO-00017j-PL for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:34 -0400 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIAZM-00045V-Mk for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:34 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A675B20727; Fri, 14 Jun 2024 17:18:30 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 0515713AB1; Fri, 14 Jun 2024 17:18:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id gGdrL2R7bGaVAgAAD6G6ig (envelope-from ); Fri, 14 Jun 2024 17:18:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385510; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NLzeyc/X1R/2F7Z/mZ8QhCI6C6667LCgP8daYEWJFF0=; b=g3swic/cAHL5NjpEOnM43jmiTQ7Xuw8TLbLC6kSFnpO3xjYWj8f9EOBP8MOfVd4xLbKufD 4JdYvLimCa9IgtWda5kSZaoF7KKGNO6iDRX6n1jPsLkyFI160zL4VKosefESMFY0IhsvNV c6LEh4VqdCDJpEQz3ZUjcbIZlsMsjQk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385510; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NLzeyc/X1R/2F7Z/mZ8QhCI6C6667LCgP8daYEWJFF0=; b=OefEhbZLftHbtwZXl5HkGGsZYbwmjtudbTHkXOJvt8XYdyeNHmdhdMK92hd9ks3EF4oArc S865mYmIbYmvvZAw== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385510; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NLzeyc/X1R/2F7Z/mZ8QhCI6C6667LCgP8daYEWJFF0=; b=g3swic/cAHL5NjpEOnM43jmiTQ7Xuw8TLbLC6kSFnpO3xjYWj8f9EOBP8MOfVd4xLbKufD 4JdYvLimCa9IgtWda5kSZaoF7KKGNO6iDRX6n1jPsLkyFI160zL4VKosefESMFY0IhsvNV c6LEh4VqdCDJpEQz3ZUjcbIZlsMsjQk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385510; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NLzeyc/X1R/2F7Z/mZ8QhCI6C6667LCgP8daYEWJFF0=; b=OefEhbZLftHbtwZXl5HkGGsZYbwmjtudbTHkXOJvt8XYdyeNHmdhdMK92hd9ks3EF4oArc S865mYmIbYmvvZAw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Shameer Kolothum , Zhangfei Gao Subject: [PULL 12/18] docs/migration: add uadk compression feature Date: Fri, 14 Jun 2024 14:17:56 -0300 Message-Id: <20240614171802.28451-13-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240614171802.28451-1-farosas@suse.de> References: <20240614171802.28451-1-farosas@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-3.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCPT_COUNT_FIVE(0.00)[5]; FROM_HAS_DN(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,linaro.org:email] X-Spam-Score: -3.30 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=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1718385564348100003 From: Shameer Kolothum Document UADK(User Space Accelerator Development Kit) library details and how to use that for migration. Signed-off-by: Shameer Kolothum Reviewed-by: Zhangfei Gao [s/Qemu/QEMU in docs] Signed-off-by: Fabiano Rosas --- docs/devel/migration/features.rst | 1 + docs/devel/migration/uadk-compression.rst | 144 ++++++++++++++++++++++ 2 files changed, 145 insertions(+) create mode 100644 docs/devel/migration/uadk-compression.rst diff --git a/docs/devel/migration/features.rst b/docs/devel/migration/featu= res.rst index bc98b65075..58f8fd9e16 100644 --- a/docs/devel/migration/features.rst +++ b/docs/devel/migration/features.rst @@ -13,3 +13,4 @@ Migration has plenty of features to support different use= cases. mapped-ram CPR qpl-compression + uadk-compression diff --git a/docs/devel/migration/uadk-compression.rst b/docs/devel/migrati= on/uadk-compression.rst new file mode 100644 index 0000000000..3f73345dd5 --- /dev/null +++ b/docs/devel/migration/uadk-compression.rst @@ -0,0 +1,144 @@ +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D +User Space Accelerator Development Kit (UADK) Compression +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D +UADK is a general-purpose user space accelerator framework that uses shared +virtual addressing (SVA) to provide a unified programming interface for +hardware acceleration of cryptographic and compression algorithms. + +UADK includes Unified/User-space-access-intended Accelerator Framework (UA= CCE), +which enables hardware accelerators from different vendors that support SV= A to +adapt to UADK. + +Currently, HiSilicon Kunpeng hardware accelerators have been registered wi= th +UACCE. Through the UADK framework, users can run cryptographic and compres= sion +algorithms using hardware accelerators instead of CPUs, freeing up CPU +computing power and improving computing performance. + +https://github.com/Linaro/uadk/tree/master/docs + +UADK Framework +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +UADK consists of UACCE, vendors' drivers, and an algorithm layer. UADK req= uires +the hardware accelerator to support SVA, and the operating system to suppo= rt +IOMMU and SVA. Hardware accelerators from different vendors are registered= as +different character devices with UACCE by using kernel-mode drivers of the +vendors. A user can access the hardware accelerators by performing user-mo= de +operations on the character devices. + +:: + + +----------------------------------+ + | apps | + +----+------------------------+----+ + | | + | | + +-------+--------+ +-------+-------+ + | scheduler | | alg libraries | + +-------+--------+ +-------+-------+ + | | + | | + | | + | +--------+------+ + | | vendor drivers| + | +-+-------------+ + | | + | | + +--+------------------+--+ + | libwd | + User +----+-------------+-----+ + -------------------------------------------------- + Kernel +--+-----+ +------+ + | uacce | | smmu | + +---+----+ +------+ + | + +---+------------------+ + | vendor kernel driver | + +----------------------+ + -------------------------------------------------- + +----------------------+ + | HW Accelerators | + +----------------------+ + +UADK Installation +----------------- +Build UADK +^^^^^^^^^^ + +.. code-block:: shell + + git clone https://github.com/Linaro/uadk.git + cd uadk + mkdir build + ./autogen.sh + ./configure --prefix=3D$PWD/build + make + make install + +Without --prefix, UADK will be installed to /usr/local/lib by default. +If get error:"cannot find -lnuma", please install the libnuma-dev + +Run pkg-config libwd to ensure env is setup correctly +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +* export PKG_CONFIG_PATH=3D$PWD/build/lib/pkgconfig +* pkg-config libwd --cflags --libs + -I/usr/local/include -L/usr/local/lib -lwd + +* export PKG_CONFIG_PATH is required on demand. + Not required if UADK is installed to /usr/local/lib + +UADK Host Kernel Requirements +----------------------------- +User needs to make sure that ``UACCE`` is already supported in Linux kerne= l. +The kernel version should be at least v5.9 with SVA (Shared Virtual +Addressing) enabled. + +Kernel Configuration +^^^^^^^^^^^^^^^^^^^^ + +``UACCE`` could be built as module or built-in. + +Here's an example to enable UACCE with hardware accelerator in HiSilicon +Kunpeng platform. + +* CONFIG_IOMMU_SVA_LIB=3Dy +* CONFIG_ARM_SMMU=3Dy +* CONFIG_ARM_SMMU_V3=3Dy +* CONFIG_ARM_SMMU_V3_SVA=3Dy +* CONFIG_PCI_PASID=3Dy +* CONFIG_UACCE=3Dy +* CONFIG_CRYPTO_DEV_HISI_QM=3Dy +* CONFIG_CRYPTO_DEV_HISI_ZIP=3Dy + +Make sure all these above kernel configurations are selected. + +Accelerator dev node permissions +-------------------------------- +Harware accelerators(eg: HiSilicon Kunpeng Zip accelerator) gets registere= d to +UADK and char devices are created in dev directory. In order to access res= ources +on hardware accelerator devices, write permission should be provided to us= er. + +.. code-block:: shell + + $ sudo chmod 777 /dev/hisi_zip-* + +How To Use UADK Compression In QEMU Migration +--------------------------------------------- +* Make sure UADK is installed as above +* Build ``QEMU`` with ``--enable-uadk`` parameter + + E.g. configure --target-list=3Daarch64-softmmu --enable-kvm ``--enable-u= adk`` + +* Enable ``UADK`` compression during migration + + Set ``migrate_set_parameter multifd-compression uadk`` + +Since UADK uses Shared Virtual Addressing(SVA) and device access virtual m= emory +directly it is possible that SMMUv3 may enounter page faults while walking= the +IO page tables. This may impact the performance. In order to mitigate this, +please make sure to specify ``-mem-prealloc`` parameter to the destination= VM +boot parameters. + +Though both UADK and ZLIB are based on the deflate compression=C2=A0algori= thm, UADK +is not fully compatible with ZLIB. Hence, please make sure to use ``uadk``= on +both source and destination during migration. --=20 2.35.3 From nobody Mon Nov 25 01:57:11 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1718385600; cv=none; d=zohomail.com; s=zohoarc; b=dpt5VDmpAu7NbONZCY+Z9+0hc0XlQT+r7xhFXGv13GFpt1jb0DLVqvWu9ESzS4zLLun20zF47oGfm8JzWSqLEkEQ+Umycqb3wjnt0rCotCF34khOpGQbSuX8afeYBxJEUYYNj9iXCslPBhWT5Oq/4980PVywp+eGyYMWjFQGsb4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718385600; 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=DB7SLOs6gcfqpQZjc/YzZDAovxQaY2aowoNpB52Z6PU=; b=f/NXF4134gbREGIkQ7B1z33+Fbj93XHB5chzQkwacpVO4Qbbcs/ab6A20xdKTohT58DWQjUujHjIJEiGJpisWBgiJTREYNPUmsbbGBhswt8HcyzmA55flsDkjARhhGDZZraPh3aFBeeSTxLk8p3PRMGPxTgJZa/NPmrAbq9hQwQ= 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 1718385600455648.8729193657472; Fri, 14 Jun 2024 10:20:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIAZU-00019j-3A; Fri, 14 Jun 2024 13:18:40 -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 1sIAZQ-00018G-Ro for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:37 -0400 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIAZO-00047K-PN for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:36 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A65D620726; Fri, 14 Jun 2024 17:18:32 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 10A8813AB1; Fri, 14 Jun 2024 17:18:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id WIc5MmZ7bGaVAgAAD6G6ig (envelope-from ); Fri, 14 Jun 2024 17:18:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385513; h=from:from:reply-to: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=DB7SLOs6gcfqpQZjc/YzZDAovxQaY2aowoNpB52Z6PU=; b=uelrg4jwjHZhDixuP4vudq4N0m6Qn63BWdVT1J6jdy5Jf6BpO3QdWqD3cEeQ4m2PrVrI4g kW1p8eoHpV4kc+bgZxvf1wUciNyQ6BMTSFmXFRsFNEIBfFeXm2ItXTe1bYMOh3BH/iMlWY BAHyGRMQ8Aumdpg1+RIIU3rq9V9agXI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385513; h=from:from:reply-to: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=DB7SLOs6gcfqpQZjc/YzZDAovxQaY2aowoNpB52Z6PU=; b=IyritM7CsEKBjXggskb9LRu/r9XRsBpSjFvuwOoVKs3K/+QqHzR4l6mMuqV1tTK5yKTXpy vFamTWQo4+t4PLCA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385512; h=from:from:reply-to: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=DB7SLOs6gcfqpQZjc/YzZDAovxQaY2aowoNpB52Z6PU=; b=qaShqWFY9jOO3hNSR2zZFAVny71n70hnbbkYbSzxB68axfKcymobMOidYAvBx7qhxFf73L vPQXyBCiM9SgcCwS+gaX0kdtnEng5k92x/MNxn/Igssb18YluTUNGhTNTLlyojWXwAx3xD xUQl7Wfz5A/uRBbh1m1KFASKJ+HQdHM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385512; h=from:from:reply-to: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=DB7SLOs6gcfqpQZjc/YzZDAovxQaY2aowoNpB52Z6PU=; b=nHGBm5z2Mkgcxzj1Mazj9SY63NBR3gqnbx4UhSyQvXyinwNGuLG1Ew/RhddmyfsYl9C09I F45k17BO9sokjZDA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Shameer Kolothum , Zhangfei Gao Subject: [PULL 13/18] configure: Add uadk option Date: Fri, 14 Jun 2024 14:17:57 -0300 Message-Id: <20240614171802.28451-14-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240614171802.28451-1-farosas@suse.de> References: <20240614171802.28451-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,linaro.org:email]; RCVD_TLS_ALL(0.00)[] 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=2a07:de40:b251:101:10:150:64:2; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1718385602555100006 Content-Type: text/plain; charset="utf-8" From: Shameer Kolothum Add --enable-uadk and --disable-uadk options to enable and disable UADK compression accelerator. This is for using UADK based hardware accelerators for live migration. Reviewed-by: Fabiano Rosas Signed-off-by: Shameer Kolothum Reviewed-by: Zhangfei Gao Signed-off-by: Fabiano Rosas --- meson.build | 14 ++++++++++++++ meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 3 +++ 3 files changed, 19 insertions(+) diff --git a/meson.build b/meson.build index c16574710c..97e00d6f59 100644 --- a/meson.build +++ b/meson.build @@ -1207,6 +1207,18 @@ if not get_option('qpl').auto() or have_system required: get_option('qpl'), method: 'pkg-config') endif +uadk =3D not_found +if not get_option('uadk').auto() or have_system + libwd =3D dependency('libwd', version: '>=3D2.6', + required: get_option('uadk'), + method: 'pkg-config') + libwd_comp =3D dependency('libwd_comp', version: '>=3D2.6', + required: get_option('uadk'), + method: 'pkg-config') + if libwd.found() and libwd_comp.found() + uadk =3D declare_dependency(dependencies: [libwd, libwd_comp]) + endif +endif virgl =3D not_found =20 have_vhost_user_gpu =3D have_tools and host_os =3D=3D 'linux' and pixman.f= ound() @@ -2340,6 +2352,7 @@ config_host_data.set('CONFIG_STATX', has_statx) config_host_data.set('CONFIG_STATX_MNT_ID', has_statx_mnt_id) config_host_data.set('CONFIG_ZSTD', zstd.found()) config_host_data.set('CONFIG_QPL', qpl.found()) +config_host_data.set('CONFIG_UADK', uadk.found()) config_host_data.set('CONFIG_FUSE', fuse.found()) config_host_data.set('CONFIG_FUSE_LSEEK', fuse_lseek.found()) config_host_data.set('CONFIG_SPICE_PROTOCOL', spice_protocol.found()) @@ -4454,6 +4467,7 @@ summary_info +=3D {'bzip2 support': libbzip2} summary_info +=3D {'lzfse support': liblzfse} summary_info +=3D {'zstd support': zstd} summary_info +=3D {'Query Processing Library support': qpl} +summary_info +=3D {'UADK Library support': uadk} summary_info +=3D {'NUMA host support': numa} summary_info +=3D {'capstone': capstone} summary_info +=3D {'libpmem support': libpmem} diff --git a/meson_options.txt b/meson_options.txt index dd680a5faf..7a79dd8970 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -261,6 +261,8 @@ option('zstd', type : 'feature', value : 'auto', description: 'zstd compression support') option('qpl', type : 'feature', value : 'auto', description: 'Query Processing Library support') +option('uadk', type : 'feature', value : 'auto', + description: 'UADK Library support') option('fuse', type: 'feature', value: 'auto', description: 'FUSE block device export') option('fuse_lseek', type : 'feature', value : 'auto', diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index 73ae8cedfc..58d49a447d 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -221,6 +221,7 @@ meson_options_help() { printf "%s\n" ' xkbcommon xkbcommon support' printf "%s\n" ' zstd zstd compression support' printf "%s\n" ' qpl Query Processing Library support' + printf "%s\n" ' uadk UADK Library support' } _meson_option_parse() { case $1 in @@ -561,6 +562,8 @@ _meson_option_parse() { --disable-zstd) printf "%s" -Dzstd=3Ddisabled ;; --enable-qpl) printf "%s" -Dqpl=3Denabled ;; --disable-qpl) printf "%s" -Dqpl=3Ddisabled ;; + --enable-uadk) printf "%s" -Duadk=3Denabled ;; + --disable-uadk) printf "%s" -Duadk=3Ddisabled ;; *) return 1 ;; esac } --=20 2.35.3 From nobody Mon Nov 25 01:57:11 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1718385557; cv=none; d=zohomail.com; s=zohoarc; b=ayJX7YDjhGrBZ7/7cEARnO06EagD6Ty1dU8rXFLaPHmnarb3ByLsF/EFA4T9+hhGQ27SQeZholZ5U2f0kAzJ8H7vhRQYyhVYqP3lnEIE3u/MZ0nzaMDiwfaNziIVBar68GGwvhmKkaqNVOWyU0UEeNjynPid2E94Wc1D1rWiF+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718385557; 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=QraaRodgcIYNu8jkrWwRQj/dxHjZULEGFRoh2RfEryk=; b=NnV/HS9nDvowNoClrrgyaT4zIR7Rm4QGoi8IqEoWfBn3VhbUW+2PMN6atQlyoTS7MCy3kO8JIvA1KjwFr3jFm3fy80fK3kBwxcjeXBNJtSMHrE9M8pxaZclUWTL27yehdass0m3KN2VrJYq19PdSaIOW31V7KlVBuMV/RmANIws= 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 1718385557534564.9562637759032; Fri, 14 Jun 2024 10:19:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIAZV-0001AF-9N; Fri, 14 Jun 2024 13:18:42 -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 1sIAZS-00018u-I7 for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:38 -0400 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIAZQ-00047g-KM for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:38 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 0017220728; Fri, 14 Jun 2024 17:18:34 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 1B9F513AB5; Fri, 14 Jun 2024 17:18:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id UEn6NGh7bGaVAgAAD6G6ig (envelope-from ); Fri, 14 Jun 2024 17:18:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385515; h=from:from:reply-to: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=QraaRodgcIYNu8jkrWwRQj/dxHjZULEGFRoh2RfEryk=; b=KHY/b444rPNGff9q5EDmIo5AZSyBwI1hYkp0eyN/5KiSoI/2wzzL3AUi8xbQshDCyz+lK4 FMXI+dm3QHf90DNk4t501XKoXMguXmpfKS3QAO009sNb3unaC65V0HwU3dvFcsoyUZo0pQ 48Lb3bZWXmZRRar9MklpiV5TPAxPHVA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385515; h=from:from:reply-to: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=QraaRodgcIYNu8jkrWwRQj/dxHjZULEGFRoh2RfEryk=; b=WP4jw/PkHiAuphfR6s62H5V9jNXGokKy1+DPUF4GcqVngJwPOzWDLB/epBN2EpWFChIdWO fQH3kFrD92oCXLCw== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="KHY/b444"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="WP4jw/Pk" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385515; h=from:from:reply-to: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=QraaRodgcIYNu8jkrWwRQj/dxHjZULEGFRoh2RfEryk=; b=KHY/b444rPNGff9q5EDmIo5AZSyBwI1hYkp0eyN/5KiSoI/2wzzL3AUi8xbQshDCyz+lK4 FMXI+dm3QHf90DNk4t501XKoXMguXmpfKS3QAO009sNb3unaC65V0HwU3dvFcsoyUZo0pQ 48Lb3bZWXmZRRar9MklpiV5TPAxPHVA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385515; h=from:from:reply-to: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=QraaRodgcIYNu8jkrWwRQj/dxHjZULEGFRoh2RfEryk=; b=WP4jw/PkHiAuphfR6s62H5V9jNXGokKy1+DPUF4GcqVngJwPOzWDLB/epBN2EpWFChIdWO fQH3kFrD92oCXLCw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Shameer Kolothum , Markus Armbruster , Zhangfei Gao Subject: [PULL 14/18] migration/multifd: add uadk compression framework Date: Fri, 14 Jun 2024 14:17:58 -0300 Message-Id: <20240614171802.28451-15-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240614171802.28451-1-farosas@suse.de> References: <20240614171802.28451-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 0017220728 X-Spam-Score: -3.01 X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; MIME_TRACE(0.00)[0:+]; FUZZY_BLOCKED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; ARC_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; FROM_EQ_ENVFROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCPT_COUNT_FIVE(0.00)[6]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,suse.de:dkim,linaro.org:email] X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org 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=2a07:de40:b251:101:10:150:64:2; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1718385558436100011 Content-Type: text/plain; charset="utf-8" From: Shameer Kolothum Adds the skeleton to support uadk compression method. Complete functionality will be added in subsequent patches. Acked-by: Markus Armbruster Reviewed-by: Fabiano Rosas Signed-off-by: Shameer Kolothum Reviewed-by: Zhangfei Gao Signed-off-by: Fabiano Rosas --- hw/core/qdev-properties-system.c | 2 +- migration/meson.build | 1 + migration/multifd-uadk.c | 20 ++++++++++++++++++++ migration/multifd.h | 5 +++-- qapi/migration.json | 5 ++++- 5 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 migration/multifd-uadk.c diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index 6ccd7224f6..f13350b4fb 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -659,7 +659,7 @@ const PropertyInfo qdev_prop_fdc_drive_type =3D { const PropertyInfo qdev_prop_multifd_compression =3D { .name =3D "MultiFDCompression", .description =3D "multifd_compression values, " - "none/zlib/zstd/qpl", + "none/zlib/zstd/qpl/uadk", .enum_table =3D &MultiFDCompression_lookup, .get =3D qdev_propinfo_get_enum, .set =3D qdev_propinfo_set_enum, diff --git a/migration/meson.build b/migration/meson.build index 5f146fe8a9..5ce2acb41e 100644 --- a/migration/meson.build +++ b/migration/meson.build @@ -40,6 +40,7 @@ endif system_ss.add(when: rdma, if_true: files('rdma.c')) system_ss.add(when: zstd, if_true: files('multifd-zstd.c')) system_ss.add(when: qpl, if_true: files('multifd-qpl.c')) +system_ss.add(when: uadk, if_true: files('multifd-uadk.c')) =20 specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: files('ram.c', diff --git a/migration/multifd-uadk.c b/migration/multifd-uadk.c new file mode 100644 index 0000000000..c2bb07535b --- /dev/null +++ b/migration/multifd-uadk.c @@ -0,0 +1,20 @@ +/* + * Multifd UADK compression accelerator implementation + * + * Copyright (c) 2024 Huawei Technologies R & D (UK) Ltd + * + * Authors: + * Shameer Kolothum + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "qemu/module.h" + +static void multifd_uadk_register(void) +{ + /* noop for now */ +} +migration_init(multifd_uadk_register); diff --git a/migration/multifd.h b/migration/multifd.h index 5b7d9b15f8..0ecd6f47d7 100644 --- a/migration/multifd.h +++ b/migration/multifd.h @@ -34,13 +34,14 @@ MultiFDRecvData *multifd_get_recv_data(void); /* Multifd Compression flags */ #define MULTIFD_FLAG_SYNC (1 << 0) =20 -/* We reserve 3 bits for compression methods */ -#define MULTIFD_FLAG_COMPRESSION_MASK (7 << 1) +/* We reserve 4 bits for compression methods */ +#define MULTIFD_FLAG_COMPRESSION_MASK (0xf << 1) /* we need to be compatible. Before compression value was 0 */ #define MULTIFD_FLAG_NOCOMP (0 << 1) #define MULTIFD_FLAG_ZLIB (1 << 1) #define MULTIFD_FLAG_ZSTD (2 << 1) #define MULTIFD_FLAG_QPL (4 << 1) +#define MULTIFD_FLAG_UADK (8 << 1) =20 /* This value needs to be a multiple of qemu_target_page_size() */ #define MULTIFD_PACKET_SIZE (512 * 1024) diff --git a/qapi/migration.json b/qapi/migration.json index a35d0b5b83..470f746cc5 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -559,12 +559,15 @@ # In-Memory Analytics Accelerator(IAA) accelerated compression # and decompression. (Since 9.1) # +# @uadk: use UADK library compression method. (Since 9.1) +# # Since: 5.0 ## { 'enum': 'MultiFDCompression', 'data': [ 'none', 'zlib', { 'name': 'zstd', 'if': 'CONFIG_ZSTD' }, - { 'name': 'qpl', 'if': 'CONFIG_QPL' } ] } + { 'name': 'qpl', 'if': 'CONFIG_QPL' }, + { 'name': 'uadk', 'if': 'CONFIG_UADK' } ] } =20 ## # @MigMode: --=20 2.35.3 From nobody Mon Nov 25 01:57:11 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1718385600; cv=none; d=zohomail.com; s=zohoarc; b=Z0Zd2tA/NXbOQpjTqXOm4kd5mkPq83nTIIUVHCqGDIGVOcC7q0f1zq9DYt6g2e+ukVtrdTkmCzhpbYvFk1nb25CuM/4eJzS6futnBRIb/jQoq5mCO6o9AnSn5ZwDRWc81JLOLHtVOfDiBZKDQaRngxrX294LsHzYEnpcRIfQk0M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718385600; 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=rRyPkSc3TYWVxDutYkXNAPRAADM09kh1d2QpwzpjCVU=; b=bddR8bq2W0cnjRA4gLAza83Tzj39De7lTm25OOthrIlga+1llMzLfhoNHjNvEZUjXtPcvpbdGUq4iNb5w5TzgOTcWHLQCoNADaJYrvEbWnStFZJjhsNqZRKsJ+MHVFAHx1nhL97rzrNbvwoKYD/zaypFYzopRhUjiF5Dnt//5xs= 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 1718385600456981.629312588772; Fri, 14 Jun 2024 10:20:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIAZW-0001As-FI; Fri, 14 Jun 2024 13:18:42 -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 1sIAZU-00019l-3B for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:40 -0400 Received: from smtp-out1.suse.de ([2a07:de40:b251:101:10:150:64:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIAZS-000480-BG for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:39 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id F3681227BF; Fri, 14 Jun 2024 17:18:36 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 6027013AB1; Fri, 14 Jun 2024 17:18:35 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id kFAGCmt7bGaVAgAAD6G6ig (envelope-from ); Fri, 14 Jun 2024 17:18:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385517; h=from:from:reply-to: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=rRyPkSc3TYWVxDutYkXNAPRAADM09kh1d2QpwzpjCVU=; b=iXCMCRUcP0ExAD/ndjZoMXnM8rJ5ao4w+htoFDEUE8UlHMNwFLyxN90SyJfRA30XOmgSOP CoaOnlK4tNY3/AeqfcKc8+ioJfNTr7AhrlNJjKW8yOwEujQw90nnmRKFP4rMZUWIghiFST lLZf66B5q+Xmoo2BxTsYgJyiAjq4S9Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385517; h=from:from:reply-to: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=rRyPkSc3TYWVxDutYkXNAPRAADM09kh1d2QpwzpjCVU=; b=lw1/Ow+6MchfCPG5ZMDw07Mf31QEDKHZwBVLHaqsoABclIIijl8gyXTemVSQTPfFSswxBP GfW/mEyO3QbIdXAg== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385517; h=from:from:reply-to: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=rRyPkSc3TYWVxDutYkXNAPRAADM09kh1d2QpwzpjCVU=; b=iXCMCRUcP0ExAD/ndjZoMXnM8rJ5ao4w+htoFDEUE8UlHMNwFLyxN90SyJfRA30XOmgSOP CoaOnlK4tNY3/AeqfcKc8+ioJfNTr7AhrlNJjKW8yOwEujQw90nnmRKFP4rMZUWIghiFST lLZf66B5q+Xmoo2BxTsYgJyiAjq4S9Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385517; h=from:from:reply-to: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=rRyPkSc3TYWVxDutYkXNAPRAADM09kh1d2QpwzpjCVU=; b=lw1/Ow+6MchfCPG5ZMDw07Mf31QEDKHZwBVLHaqsoABclIIijl8gyXTemVSQTPfFSswxBP GfW/mEyO3QbIdXAg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Shameer Kolothum , Zhangfei Gao Subject: [PULL 15/18] migration/multifd: Add UADK initialization Date: Fri, 14 Jun 2024 14:17:59 -0300 Message-Id: <20240614171802.28451-16-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240614171802.28451-1-farosas@suse.de> References: <20240614171802.28451-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[linaro.org:email,suse.de:email]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: -2.80 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=2a07:de40:b251:101:10:150:64:1; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1718385602569100008 Content-Type: text/plain; charset="utf-8" From: Shameer Kolothum Initialize UADK session and allocate buffers required. The actual compression/decompression will only be done in a subsequent patch. Signed-off-by: Shameer Kolothum Reviewed-by: Fabiano Rosas Reviewed-by: Zhangfei Gao Signed-off-by: Fabiano Rosas --- migration/multifd-uadk.c | 209 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 208 insertions(+), 1 deletion(-) diff --git a/migration/multifd-uadk.c b/migration/multifd-uadk.c index c2bb07535b..535411a405 100644 --- a/migration/multifd-uadk.c +++ b/migration/multifd-uadk.c @@ -12,9 +12,216 @@ =20 #include "qemu/osdep.h" #include "qemu/module.h" +#include "qapi/error.h" +#include "migration.h" +#include "multifd.h" +#include "options.h" +#include "uadk/wd_comp.h" +#include "uadk/wd_sched.h" + +struct wd_data { + handle_t handle; + uint8_t *buf; + uint32_t *buf_hdr; +}; + +static bool uadk_hw_init(void) +{ + char alg[] =3D "zlib"; + int ret; + + ret =3D wd_comp_init2(alg, SCHED_POLICY_RR, TASK_HW); + if (ret && ret !=3D -WD_EEXIST) { + return false; + } else { + return true; + } +} + +static struct wd_data *multifd_uadk_init_sess(uint32_t count, + uint32_t page_size, + bool compress, Error **errp) +{ + struct wd_comp_sess_setup ss =3D {0}; + struct sched_params param =3D {0}; + uint32_t size =3D count * page_size; + struct wd_data *wd; + + if (!uadk_hw_init()) { + error_setg(errp, "multifd: UADK hardware not available"); + return NULL; + } + + wd =3D g_new0(struct wd_data, 1); + ss.alg_type =3D WD_ZLIB; + if (compress) { + ss.op_type =3D WD_DIR_COMPRESS; + /* Add an additional page for handling output > input */ + size +=3D page_size; + } else { + ss.op_type =3D WD_DIR_DECOMPRESS; + } + + /* We use default level 1 compression and 4K window size */ + param.type =3D ss.op_type; + ss.sched_param =3D ¶m; + + wd->handle =3D wd_comp_alloc_sess(&ss); + if (!wd->handle) { + error_setg(errp, "multifd: failed wd_comp_alloc_sess"); + goto out; + } + + wd->buf =3D g_try_malloc(size); + if (!wd->buf) { + error_setg(errp, "multifd: out of mem for uadk buf"); + goto out_free_sess; + } + wd->buf_hdr =3D g_new0(uint32_t, count); + return wd; + +out_free_sess: + wd_comp_free_sess(wd->handle); +out: + wd_comp_uninit2(); + g_free(wd); + return NULL; +} + +static void multifd_uadk_uninit_sess(struct wd_data *wd) +{ + wd_comp_free_sess(wd->handle); + wd_comp_uninit2(); + g_free(wd->buf); + g_free(wd->buf_hdr); + g_free(wd); +} + +/** + * multifd_uadk_send_setup: setup send side + * + * Returns 0 for success or -1 for error + * + * @p: Params for the channel that we are using + * @errp: pointer to an error + */ +static int multifd_uadk_send_setup(MultiFDSendParams *p, Error **errp) +{ + struct wd_data *wd; + + wd =3D multifd_uadk_init_sess(p->page_count, p->page_size, true, errp); + if (!wd) { + return -1; + } + + p->compress_data =3D wd; + assert(p->iov =3D=3D NULL); + /* + * Each page will be compressed independently and sent using an IOV. T= he + * additional two IOVs are used to store packet header and compressed = data + * length + */ + + p->iov =3D g_new0(struct iovec, p->page_count + 2); + return 0; +} + +/** + * multifd_uadk_send_cleanup: cleanup send side + * + * Close the channel and return memory. + * + * @p: Params for the channel that we are using + * @errp: pointer to an error + */ +static void multifd_uadk_send_cleanup(MultiFDSendParams *p, Error **errp) +{ + struct wd_data *wd =3D p->compress_data; + + multifd_uadk_uninit_sess(wd); + p->compress_data =3D NULL; +} + +/** + * multifd_uadk_send_prepare: prepare data to be able to send + * + * Create a compressed buffer with all the pages that we are going to + * send. + * + * Returns 0 for success or -1 for error + * + * @p: Params for the channel that we are using + * @errp: pointer to an error + */ +static int multifd_uadk_send_prepare(MultiFDSendParams *p, Error **errp) +{ + return -1; +} + +/** + * multifd_uadk_recv_setup: setup receive side + * + * Create the compressed channel and buffer. + * + * Returns 0 for success or -1 for error + * + * @p: Params for the channel that we are using + * @errp: pointer to an error + */ +static int multifd_uadk_recv_setup(MultiFDRecvParams *p, Error **errp) +{ + struct wd_data *wd; + + wd =3D multifd_uadk_init_sess(p->page_count, p->page_size, false, errp= ); + if (!wd) { + return -1; + } + p->compress_data =3D wd; + return 0; +} + +/** + * multifd_uadk_recv_cleanup: cleanup receive side + * + * Close the channel and return memory. + * + * @p: Params for the channel that we are using + */ +static void multifd_uadk_recv_cleanup(MultiFDRecvParams *p) +{ + struct wd_data *wd =3D p->compress_data; + + multifd_uadk_uninit_sess(wd); + p->compress_data =3D NULL; +} + +/** + * multifd_uadk_recv: read the data from the channel into actual pages + * + * Read the compressed buffer, and uncompress it into the actual + * pages. + * + * Returns 0 for success or -1 for error + * + * @p: Params for the channel that we are using + * @errp: pointer to an error + */ +static int multifd_uadk_recv(MultiFDRecvParams *p, Error **errp) +{ + return -1; +} + +static MultiFDMethods multifd_uadk_ops =3D { + .send_setup =3D multifd_uadk_send_setup, + .send_cleanup =3D multifd_uadk_send_cleanup, + .send_prepare =3D multifd_uadk_send_prepare, + .recv_setup =3D multifd_uadk_recv_setup, + .recv_cleanup =3D multifd_uadk_recv_cleanup, + .recv =3D multifd_uadk_recv, +}; =20 static void multifd_uadk_register(void) { - /* noop for now */ + multifd_register_ops(MULTIFD_COMPRESSION_UADK, &multifd_uadk_ops); } migration_init(multifd_uadk_register); --=20 2.35.3 From nobody Mon Nov 25 01:57:11 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1718385627; cv=none; d=zohomail.com; s=zohoarc; b=HzNfu2BzsCdDq1SO5fGV82jG/sw6tP+KqL9LyfA4/HgzkIDstcoP98h9ABhCZZv1yH2t+4pjGbntMmAFwpCFamxG1oAidxDAf2YgpgyMCE7EQ37UOHjQ6JvUKPOP/6fFYrSgdpTskzzNAMhl+S6X2neCBbzlgUPYqBFZHOxe3iU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718385627; 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=xiYfKzaoqYgWx2X7V35EUZ3Y/jAjSllIfrc0d1B/zZ0=; b=WaYyLvOsDBNnRWF5SoygDzMuVB1/Q4KgwuByRS4Gl0qpC5/64YMbnivF1B/GDJBbJaV6MNmOVAhy4+VHhk1sONtZkU+Nj0XQ+qF82srF6ri/FxYVTS3yYZPbobsXcgLJMqZXzyfpUSaSJhkl4e3sdDxRGIqV+8eGRpbEY0WkVI4= 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 1718385627944335.7241120265418; Fri, 14 Jun 2024 10:20:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIAZa-0001Ba-2c; Fri, 14 Jun 2024 13:18:46 -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 1sIAZW-0001At-IM for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:43 -0400 Received: from smtp-out1.suse.de ([195.135.223.130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIAZU-00048S-Ep for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:42 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0CC39227EA; Fri, 14 Jun 2024 17:18:39 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 6A14313AB1; Fri, 14 Jun 2024 17:18:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id iEJCDG17bGaVAgAAD6G6ig (envelope-from ); Fri, 14 Jun 2024 17:18:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385519; h=from:from:reply-to: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=xiYfKzaoqYgWx2X7V35EUZ3Y/jAjSllIfrc0d1B/zZ0=; b=bTJEz1v6aNPt38+BmX06Emra1hagcg3M1pvmK4mE89nrhxAINRWS/wItxRxcgK5la+6pTN 2yEgJU/1XcBUeYGzEbR/07sKaxqkPm8kZxmhJw25n60XN6tOVOu+spGjqBXskTLM8jCjPk p+pr42Gdh7gb0BI0c2ppEOsKbFtrlMM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385519; h=from:from:reply-to: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=xiYfKzaoqYgWx2X7V35EUZ3Y/jAjSllIfrc0d1B/zZ0=; b=OLYmx9lum2Alouxkiz1VJrXR/emxR4cyDSqWMFWRe0wkd6vD3kayI0lhHxgLhQFxdKTFBh 5Iy6e3/ErQQ6XnAw== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=bTJEz1v6; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=OLYmx9lu DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385519; h=from:from:reply-to: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=xiYfKzaoqYgWx2X7V35EUZ3Y/jAjSllIfrc0d1B/zZ0=; b=bTJEz1v6aNPt38+BmX06Emra1hagcg3M1pvmK4mE89nrhxAINRWS/wItxRxcgK5la+6pTN 2yEgJU/1XcBUeYGzEbR/07sKaxqkPm8kZxmhJw25n60XN6tOVOu+spGjqBXskTLM8jCjPk p+pr42Gdh7gb0BI0c2ppEOsKbFtrlMM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385519; h=from:from:reply-to: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=xiYfKzaoqYgWx2X7V35EUZ3Y/jAjSllIfrc0d1B/zZ0=; b=OLYmx9lum2Alouxkiz1VJrXR/emxR4cyDSqWMFWRe0wkd6vD3kayI0lhHxgLhQFxdKTFBh 5Iy6e3/ErQQ6XnAw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Shameer Kolothum , Zhangfei Gao Subject: [PULL 16/18] migration/multifd: Add UADK based compression and decompression Date: Fri, 14 Jun 2024 14:18:00 -0300 Message-Id: <20240614171802.28451-17-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240614171802.28451-1-farosas@suse.de> References: <20240614171802.28451-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 0CC39227EA X-Spam-Score: -3.01 X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; MIME_TRACE(0.00)[0:+]; FUZZY_BLOCKED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; ARC_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; FROM_EQ_ENVFROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCPT_COUNT_FIVE(0.00)[5]; DBL_BLOCKED_OPENRESOLVER(0.00)[linaro.org:email,suse.de:email,suse.de:dkim] X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org 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=195.135.223.130; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1718385628674100003 Content-Type: text/plain; charset="utf-8" From: Shameer Kolothum Uses UADK wd_do_comp_sync() API to (de)compress a normal page using hardware accelerator. Reviewed-by: Fabiano Rosas Signed-off-by: Shameer Kolothum Reviewed-by: Zhangfei Gao Signed-off-by: Fabiano Rosas --- migration/multifd-uadk.c | 132 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 130 insertions(+), 2 deletions(-) diff --git a/migration/multifd-uadk.c b/migration/multifd-uadk.c index 535411a405..70bba92eaa 100644 --- a/migration/multifd-uadk.c +++ b/migration/multifd-uadk.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include "qemu/module.h" #include "qapi/error.h" +#include "exec/ramblock.h" #include "migration.h" #include "multifd.h" #include "options.h" @@ -142,6 +143,15 @@ static void multifd_uadk_send_cleanup(MultiFDSendParam= s *p, Error **errp) p->compress_data =3D NULL; } =20 +static inline void prepare_next_iov(MultiFDSendParams *p, void *base, + uint32_t len) +{ + p->iov[p->iovs_num].iov_base =3D (uint8_t *)base; + p->iov[p->iovs_num].iov_len =3D len; + p->next_packet_size +=3D len; + p->iovs_num++; +} + /** * multifd_uadk_send_prepare: prepare data to be able to send * @@ -155,7 +165,56 @@ static void multifd_uadk_send_cleanup(MultiFDSendParam= s *p, Error **errp) */ static int multifd_uadk_send_prepare(MultiFDSendParams *p, Error **errp) { - return -1; + struct wd_data *uadk_data =3D p->compress_data; + uint32_t hdr_size; + uint8_t *buf =3D uadk_data->buf; + int ret =3D 0; + + if (!multifd_send_prepare_common(p)) { + goto out; + } + + hdr_size =3D p->pages->normal_num * sizeof(uint32_t); + /* prepare the header that stores the lengths of all compressed data */ + prepare_next_iov(p, uadk_data->buf_hdr, hdr_size); + + for (int i =3D 0; i < p->pages->normal_num; i++) { + struct wd_comp_req creq =3D { + .op_type =3D WD_DIR_COMPRESS, + .src =3D p->pages->block->host + p->pages->offset[i], + .src_len =3D p->page_size, + .dst =3D buf, + /* Set dst_len to double the src in case compressed out >=3D p= age_size */ + .dst_len =3D p->page_size * 2, + }; + + ret =3D wd_do_comp_sync(uadk_data->handle, &creq); + if (ret || creq.status) { + error_setg(errp, "multifd %u: failed compression, ret %d statu= s %d", + p->id, ret, creq.status); + return -1; + } + if (creq.dst_len < p->page_size) { + uadk_data->buf_hdr[i] =3D cpu_to_be32(creq.dst_len); + prepare_next_iov(p, buf, creq.dst_len); + buf +=3D creq.dst_len; + } else { + /* + * Send raw data if compressed out >=3D page_size. We might be= better + * off sending raw data if output is slightly less than page_s= ize + * as well because at the receive end we can skip the decompre= ssion. + * But it is tricky to find the right number here. + */ + uadk_data->buf_hdr[i] =3D cpu_to_be32(p->page_size); + prepare_next_iov(p, p->pages->block->host + p->pages->offset[i= ], + p->page_size); + buf +=3D p->page_size; + } + } +out: + p->flags |=3D MULTIFD_FLAG_UADK; + multifd_send_fill_packet(p); + return 0; } =20 /** @@ -208,7 +267,76 @@ static void multifd_uadk_recv_cleanup(MultiFDRecvParam= s *p) */ static int multifd_uadk_recv(MultiFDRecvParams *p, Error **errp) { - return -1; + struct wd_data *uadk_data =3D p->compress_data; + uint32_t in_size =3D p->next_packet_size; + uint32_t flags =3D p->flags & MULTIFD_FLAG_COMPRESSION_MASK; + uint32_t hdr_len =3D p->normal_num * sizeof(uint32_t); + uint32_t data_len =3D 0; + uint8_t *buf =3D uadk_data->buf; + int ret =3D 0; + + if (flags !=3D MULTIFD_FLAG_UADK) { + error_setg(errp, "multifd %u: flags received %x flags expected %x", + p->id, flags, MULTIFD_FLAG_ZLIB); + return -1; + } + + multifd_recv_zero_page_process(p); + if (!p->normal_num) { + assert(in_size =3D=3D 0); + return 0; + } + + /* read compressed data lengths */ + assert(hdr_len < in_size); + ret =3D qio_channel_read_all(p->c, (void *) uadk_data->buf_hdr, + hdr_len, errp); + if (ret !=3D 0) { + return ret; + } + + for (int i =3D 0; i < p->normal_num; i++) { + uadk_data->buf_hdr[i] =3D be32_to_cpu(uadk_data->buf_hdr[i]); + data_len +=3D uadk_data->buf_hdr[i]; + assert(uadk_data->buf_hdr[i] <=3D p->page_size); + } + + /* read compressed data */ + assert(in_size =3D=3D hdr_len + data_len); + ret =3D qio_channel_read_all(p->c, (void *)buf, data_len, errp); + if (ret !=3D 0) { + return ret; + } + + for (int i =3D 0; i < p->normal_num; i++) { + struct wd_comp_req creq =3D { + .op_type =3D WD_DIR_DECOMPRESS, + .src =3D buf, + .src_len =3D uadk_data->buf_hdr[i], + .dst =3D p->host + p->normal[i], + .dst_len =3D p->page_size, + }; + + if (uadk_data->buf_hdr[i] =3D=3D p->page_size) { + memcpy(p->host + p->normal[i], buf, p->page_size); + buf +=3D p->page_size; + continue; + } + + ret =3D wd_do_comp_sync(uadk_data->handle, &creq); + if (ret || creq.status) { + error_setg(errp, "multifd %u: failed decompression, ret %d sta= tus %d", + p->id, ret, creq.status); + return -1; + } + if (creq.dst_len !=3D p->page_size) { + error_setg(errp, "multifd %u: decompressed length error", p->i= d); + return -1; + } + buf +=3D uadk_data->buf_hdr[i]; + } + + return 0; } =20 static MultiFDMethods multifd_uadk_ops =3D { --=20 2.35.3 From nobody Mon Nov 25 01:57:11 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1718385618; cv=none; d=zohomail.com; s=zohoarc; b=fN/GWBe544TPGx/EI/Qd7O8LSHPcI8Uq0fA0rb56X3/WuUNaFwVOs4ELKpfEdkPDmqX6uIf2Yy+h3VEUpLkBnY2yj2KtyzqIG/YVM513dja4AsYgOYUDcPOm6g/0JyLMhAptXvhbbQ2hCJL6dhSboKAzmYQza8S5+rk4U5YBah4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718385618; h=Content-Type: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=Xtlv/iJp31EbgfFZ2ZGN/+gGwSneOADkPzuBXNQmve4=; b=iEO1Y29l5hpCihyHHUa1aaBfINRAZ+hGE1aczFNgccGGNbn1DkNIkOnwWwMmgyflyz0Hrh+5BA6s46vQhVjvjeUOB4RUvUoiMp/nKei5PXokbbOPixNnzOfqxngXfx8O8uugqKMHpO27DNb0d/1icg5JvteJ/Y8bex0sGtZCZQ4= 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 1718385618378882.8287234576101; Fri, 14 Jun 2024 10:20:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIAZd-0001FI-Rj; Fri, 14 Jun 2024 13:18:49 -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 1sIAZa-0001Bb-7o for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:46 -0400 Received: from smtp-out1.suse.de ([195.135.223.130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIAZW-00048m-Jh for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:44 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 236FB228B2; Fri, 14 Jun 2024 17:18:41 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 7695613AB1; Fri, 14 Jun 2024 17:18:39 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id mDQkD297bGaVAgAAD6G6ig (envelope-from ); Fri, 14 Jun 2024 17:18:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385521; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Xtlv/iJp31EbgfFZ2ZGN/+gGwSneOADkPzuBXNQmve4=; b=rOZMCK/Z7LbLDFGBHCteAVndhSKVyzGZJqrvIoTT6W9ZSq81BpMWtS8d2OrnsHXUvZTmhm paVhe5k2aCRua1GP0IURuWsnMGwXbjUV5yN4KeqZmtMrgYYyfX905l7xwM0f2/q47YwkQZ z8xE51L9LcJcHBXVMEYLWOOCQJ8SHIc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385521; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Xtlv/iJp31EbgfFZ2ZGN/+gGwSneOADkPzuBXNQmve4=; b=mkwgXbW0qcJLHJUqnGMSBXcOAsXRy9miLVSot+FDDaM7DL/5CdhRr2dqVsn8v7wA9ohx3/ OETf3KTiYtUK+AAw== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="rOZMCK/Z"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=mkwgXbW0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385521; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Xtlv/iJp31EbgfFZ2ZGN/+gGwSneOADkPzuBXNQmve4=; b=rOZMCK/Z7LbLDFGBHCteAVndhSKVyzGZJqrvIoTT6W9ZSq81BpMWtS8d2OrnsHXUvZTmhm paVhe5k2aCRua1GP0IURuWsnMGwXbjUV5yN4KeqZmtMrgYYyfX905l7xwM0f2/q47YwkQZ z8xE51L9LcJcHBXVMEYLWOOCQJ8SHIc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385521; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Xtlv/iJp31EbgfFZ2ZGN/+gGwSneOADkPzuBXNQmve4=; b=mkwgXbW0qcJLHJUqnGMSBXcOAsXRy9miLVSot+FDDaM7DL/5CdhRr2dqVsn8v7wA9ohx3/ OETf3KTiYtUK+AAw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Shameer Kolothum , Zhangfei Gao Subject: [PULL 17/18] migration/multifd: Switch to no compression when no hardware support Date: Fri, 14 Jun 2024 14:18:01 -0300 Message-Id: <20240614171802.28451-18-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240614171802.28451-1-farosas@suse.de> References: <20240614171802.28451-1-farosas@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-3.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; MIME_TRACE(0.00)[0:+]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[linaro.org:email,suse.de:email,suse.de:dkim] X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Queue-Id: 236FB228B2 X-Spam-Score: -3.51 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=195.135.223.130; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1718385618642100006 From: Shameer Kolothum Send raw packets over if UADK hardware support is not available. This=C2=A0= is to satisfy=C2=A0 Qemu qtest CI which may run on platforms that don't have UADK hardware support. Subsequent patch will add support for uadk migration qtest. Reviewed-by: Fabiano Rosas Signed-off-by: Shameer Kolothum Reviewed-by: Zhangfei Gao Signed-off-by: Fabiano Rosas --- migration/multifd-uadk.c | 92 +++++++++++++++++++++++----------------- 1 file changed, 53 insertions(+), 39 deletions(-) diff --git a/migration/multifd-uadk.c b/migration/multifd-uadk.c index 70bba92eaa..d12353fb21 100644 --- a/migration/multifd-uadk.c +++ b/migration/multifd-uadk.c @@ -17,6 +17,7 @@ #include "migration.h" #include "multifd.h" #include "options.h" +#include "qemu/error-report.h" #include "uadk/wd_comp.h" #include "uadk/wd_sched.h" =20 @@ -48,29 +49,29 @@ static struct wd_data *multifd_uadk_init_sess(uint32_t = count, uint32_t size =3D count * page_size; struct wd_data *wd; =20 - if (!uadk_hw_init()) { - error_setg(errp, "multifd: UADK hardware not available"); - return NULL; - } - wd =3D g_new0(struct wd_data, 1); - ss.alg_type =3D WD_ZLIB; - if (compress) { - ss.op_type =3D WD_DIR_COMPRESS; - /* Add an additional page for handling output > input */ - size +=3D page_size; + + if (uadk_hw_init()) { + ss.alg_type =3D WD_ZLIB; + if (compress) { + ss.op_type =3D WD_DIR_COMPRESS; + /* Add an additional page for handling output > input */ + size +=3D page_size; + } else { + ss.op_type =3D WD_DIR_DECOMPRESS; + } + /* We use default level 1 compression and 4K window size */ + param.type =3D ss.op_type; + ss.sched_param =3D ¶m; + + wd->handle =3D wd_comp_alloc_sess(&ss); + if (!wd->handle) { + error_setg(errp, "multifd: failed wd_comp_alloc_sess"); + goto out; + } } else { - ss.op_type =3D WD_DIR_DECOMPRESS; - } - - /* We use default level 1 compression and 4K window size */ - param.type =3D ss.op_type; - ss.sched_param =3D ¶m; - - wd->handle =3D wd_comp_alloc_sess(&ss); - if (!wd->handle) { - error_setg(errp, "multifd: failed wd_comp_alloc_sess"); - goto out; + /* For CI test use */ + warn_report_once("UADK hardware not available. Switch to no compre= ssion mode"); } =20 wd->buf =3D g_try_malloc(size); @@ -82,7 +83,9 @@ static struct wd_data *multifd_uadk_init_sess(uint32_t co= unt, return wd; =20 out_free_sess: - wd_comp_free_sess(wd->handle); + if (wd->handle) { + wd_comp_free_sess(wd->handle); + } out: wd_comp_uninit2(); g_free(wd); @@ -91,7 +94,9 @@ out: =20 static void multifd_uadk_uninit_sess(struct wd_data *wd) { - wd_comp_free_sess(wd->handle); + if (wd->handle) { + wd_comp_free_sess(wd->handle); + } wd_comp_uninit2(); g_free(wd->buf); g_free(wd->buf_hdr); @@ -188,23 +193,26 @@ static int multifd_uadk_send_prepare(MultiFDSendParam= s *p, Error **errp) .dst_len =3D p->page_size * 2, }; =20 - ret =3D wd_do_comp_sync(uadk_data->handle, &creq); - if (ret || creq.status) { - error_setg(errp, "multifd %u: failed compression, ret %d statu= s %d", - p->id, ret, creq.status); - return -1; + if (uadk_data->handle) { + ret =3D wd_do_comp_sync(uadk_data->handle, &creq); + if (ret || creq.status) { + error_setg(errp, "multifd %u: failed compression, ret %d s= tatus %d", + p->id, ret, creq.status); + return -1; + } + if (creq.dst_len < p->page_size) { + uadk_data->buf_hdr[i] =3D cpu_to_be32(creq.dst_len); + prepare_next_iov(p, buf, creq.dst_len); + buf +=3D creq.dst_len; + } } - if (creq.dst_len < p->page_size) { - uadk_data->buf_hdr[i] =3D cpu_to_be32(creq.dst_len); - prepare_next_iov(p, buf, creq.dst_len); - buf +=3D creq.dst_len; - } else { - /* - * Send raw data if compressed out >=3D page_size. We might be= better - * off sending raw data if output is slightly less than page_s= ize - * as well because at the receive end we can skip the decompre= ssion. - * But it is tricky to find the right number here. - */ + /* + * Send raw data if no UADK hardware or if compressed out >=3D pag= e_size. + * We might be better off sending raw data if output is slightly l= ess + * than page_size as well because at the receive end we can skip t= he + * decompression. But it is tricky to find the right number here. + */ + if (!uadk_data->handle || creq.dst_len >=3D p->page_size) { uadk_data->buf_hdr[i] =3D cpu_to_be32(p->page_size); prepare_next_iov(p, p->pages->block->host + p->pages->offset[i= ], p->page_size); @@ -323,6 +331,12 @@ static int multifd_uadk_recv(MultiFDRecvParams *p, Err= or **errp) continue; } =20 + if (unlikely(!uadk_data->handle)) { + error_setg(errp, "multifd %u: UADK HW not available for decomp= ression", + p->id); + return -1; + } + ret =3D wd_do_comp_sync(uadk_data->handle, &creq); if (ret || creq.status) { error_setg(errp, "multifd %u: failed decompression, ret %d sta= tus %d", --=20 2.35.3 From nobody Mon Nov 25 01:57:11 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1718385602; cv=none; d=zohomail.com; s=zohoarc; b=et0kcyfTwE/ECtIgBnjommlC0hOHW9QGaIbgZBeyrOT5z4S4XrLtDL1FbEArA58d62guDSICLPD1E5EproxOuaGzFFSNV9KOuuDuL/+O++HUQ4jsIMqmdfimp0lU0OBG0Ml//s4ATR/p99LSRNpsussviNKXFucdVGwVACnft5w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718385602; 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=W4uSWMK+zakMhIXRijyp3RM/ddH0uOyYITEpZS1y8eQ=; b=nLMFB0FOWe5QxaS+g85DNBRZRHPadA+adjqRmWZJbmoVpmRv2QP1pDCOQAha2QPbOH+x95py2aemNO1wnMAJSulpwxVKiEWgWaJJztQvRrowr8qIZ3pr5vkGl7WM9nZqnuCG9AJcEvXhNuoBTuqOdcFCFPaid7/TTHzVCLR/axo= 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 1718385602380668.9011500911964; Fri, 14 Jun 2024 10:20:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIAZj-0001MU-RX; Fri, 14 Jun 2024 13:18: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 1sIAZc-0001FD-4S for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:49 -0400 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIAZY-000495-DT for qemu-devel@nongnu.org; Fri, 14 Jun 2024 13:18:46 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E06F020724; Fri, 14 Jun 2024 17:18:42 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 81FCE13AB1; Fri, 14 Jun 2024 17:18:41 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id kMMrEnF7bGaVAgAAD6G6ig (envelope-from ); Fri, 14 Jun 2024 17:18:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385522; h=from:from:reply-to: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=W4uSWMK+zakMhIXRijyp3RM/ddH0uOyYITEpZS1y8eQ=; b=sOJryaaTH3ETk83ARX2HjB91fIxvxEHWXEKlukilcRlqJ01yB+oWn7K5mR1le8BcTLTWtp wREX5tiZ75xTHtBRBCkagddMIYNhl2S5BynWREwU41YgaLeiGnMn6wtngqfzKiX0eLmW9G 0lKvjz2udFFCvQ6HVnLbsjsTZVPGXko= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385522; h=from:from:reply-to: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=W4uSWMK+zakMhIXRijyp3RM/ddH0uOyYITEpZS1y8eQ=; b=wKAT1mBrZbc41HDE/d8RDcBfrFXFj/t1R95borAstxiofD4M18QrU2yiEZj3s3iyPDzyZc hKgYmp7/erj7rhBQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718385522; h=from:from:reply-to: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=W4uSWMK+zakMhIXRijyp3RM/ddH0uOyYITEpZS1y8eQ=; b=sOJryaaTH3ETk83ARX2HjB91fIxvxEHWXEKlukilcRlqJ01yB+oWn7K5mR1le8BcTLTWtp wREX5tiZ75xTHtBRBCkagddMIYNhl2S5BynWREwU41YgaLeiGnMn6wtngqfzKiX0eLmW9G 0lKvjz2udFFCvQ6HVnLbsjsTZVPGXko= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718385522; h=from:from:reply-to: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=W4uSWMK+zakMhIXRijyp3RM/ddH0uOyYITEpZS1y8eQ=; b=wKAT1mBrZbc41HDE/d8RDcBfrFXFj/t1R95borAstxiofD4M18QrU2yiEZj3s3iyPDzyZc hKgYmp7/erj7rhBQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Shameer Kolothum Subject: [PULL 18/18] tests/migration-test: add uadk compression test Date: Fri, 14 Jun 2024 14:18:02 -0300 Message-Id: <20240614171802.28451-19-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240614171802.28451-1-farosas@suse.de> References: <20240614171802.28451-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; RCVD_TLS_ALL(0.00)[] 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=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1718385602542100005 Content-Type: text/plain; charset="utf-8" From: Shameer Kolothum Reviewed-by: Fabiano Rosas Signed-off-by: Shameer Kolothum Signed-off-by: Fabiano Rosas --- tests/qtest/migration-test.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 887cd9fe42..0dccb4beff 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -2646,6 +2646,14 @@ test_migrate_precopy_tcp_multifd_qpl_start(QTestStat= e *from, return test_migrate_precopy_tcp_multifd_start_common(from, to, "qpl"); } #endif /* CONFIG_QPL */ +#ifdef CONFIG_UADK +static void * +test_migrate_precopy_tcp_multifd_uadk_start(QTestState *from, + QTestState *to) +{ + return test_migrate_precopy_tcp_multifd_start_common(from, to, "uadk"); +} +#endif /* CONFIG_UADK */ =20 static void test_multifd_tcp_uri_none(void) { @@ -2738,6 +2746,17 @@ static void test_multifd_tcp_qpl(void) } #endif =20 +#ifdef CONFIG_UADK +static void test_multifd_tcp_uadk(void) +{ + MigrateCommon args =3D { + .listen_uri =3D "defer", + .start_hook =3D test_migrate_precopy_tcp_multifd_uadk_start, + }; + test_precopy_common(&args); +} +#endif + #ifdef CONFIG_GNUTLS static void * test_migrate_multifd_tcp_tls_psk_start_match(QTestState *from, @@ -3617,6 +3636,10 @@ int main(int argc, char **argv) migration_test_add("/migration/multifd/tcp/plain/qpl", test_multifd_tcp_qpl); #endif +#ifdef CONFIG_UADK + migration_test_add("/migration/multifd/tcp/plain/uadk", + test_multifd_tcp_uadk); +#endif #ifdef CONFIG_GNUTLS migration_test_add("/migration/multifd/tcp/tls/psk/match", test_multifd_tcp_tls_psk_match); --=20 2.35.3