From nobody Tue Nov 26 16:17:25 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; arc=pass (i=1 dmarc=pass fromdomain=nvidia.com); dmarc=pass(p=reject dis=none) header.from=nvidia.com ARC-Seal: i=2; a=rsa-sha256; t=1706200155; cv=pass; d=zohomail.com; s=zohoarc; b=SajZQ6X/+WbAJLfQ+Gf7Xh/lxwudCoBmrLaLZJErZlc55Y5lVtzRaU1vv85DqEWBOCF3PX6C99Q97++FIxC9gWshbLw8vgVAfLrEa1w0ywDxYWwWeBsWYZxy/3AsEL1GeWVK1MtnRbiu1G/0hbGZP76XhwymKEXLTpdgqIhiDsY= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706200155; 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=hMGDN5kBfvfGqyo6Ds6NGGxr7RB3zVAKsYBNcJiHQ+I=; b=UyJ8zvXxEjnS3stfDs4+b+dj+4o7x6AW6jPIZZtevZ44oOOaXWHrnUwkVL1tRZT+Sj02/Mf+pYZ8JNT5NFLsTHSCKKxV4T7gcbR0UovIfo6mlJ/1if0tUC+F1HKvmpN34FqCdafJ2KLLAPTCoMwF6EcX67xefxUvkBmVzmOTbnI= ARC-Authentication-Results: i=2; 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; arc=pass (i=1 dmarc=pass fromdomain=nvidia.com); dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706200155866170.48747564135215; Thu, 25 Jan 2024 08:29:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rT2YK-0002Kh-9Y; Thu, 25 Jan 2024 11:26:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rT2YH-0002Jw-Eh for qemu-devel@nongnu.org; Thu, 25 Jan 2024 11:26:05 -0500 Received: from mail-dm6nam12on20601.outbound.protection.outlook.com ([2a01:111:f403:2417::601] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rT2YF-0000TE-MT for qemu-devel@nongnu.org; Thu, 25 Jan 2024 11:26:05 -0500 Received: from DM6PR07CA0082.namprd07.prod.outlook.com (2603:10b6:5:337::15) by IA1PR12MB7495.namprd12.prod.outlook.com (2603:10b6:208:419::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22; Thu, 25 Jan 2024 16:25:57 +0000 Received: from CY4PEPF0000E9DA.namprd05.prod.outlook.com (2603:10b6:5:337:cafe::4f) by DM6PR07CA0082.outlook.office365.com (2603:10b6:5:337::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.27 via Frontend Transport; Thu, 25 Jan 2024 16:25:57 +0000 Received: from mail.nvidia.com (216.228.118.232) by CY4PEPF0000E9DA.mail.protection.outlook.com (10.167.241.79) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.16 via Frontend Transport; Thu, 25 Jan 2024 16:25:57 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 25 Jan 2024 08:25:47 -0800 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 25 Jan 2024 08:25:47 -0800 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Thu, 25 Jan 2024 08:25:46 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jtm+ay/FTkDBLZ1zzKr2UIi0Irk/Fiy+3CO4Th8iQmUTm8hHlnazUOkww3IfxYgzoFy1+6iIjj3f3+qoaZJ1v7/GdqdIbp54leZHGXIsaoGzfFPIfNzfkA/HJv5hKPEaRCQCFHEVVVAedUZ4Mhr7Ev3WoaeuiyBGibHdJM8BNhbuwEZ3gWYlPAOUuNt2qvp79Vx00eMfnYisn8ONVbhJc6ZFfhevwEfFjP2oZ460mGCusxJMwGlVssXnKVV+R+carTkzb9EBulXKay21ywT1cBb+CeojIDmUYKt494CKtfqicK5XKNGVwuQ8VgYiSzlQN5IrA3P4svgFr3VJ9EjqCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hMGDN5kBfvfGqyo6Ds6NGGxr7RB3zVAKsYBNcJiHQ+I=; b=TzaluZxHBbTcS72TBLn070+t6xJlpRHT2Ls0SzmNtrWJM0McKfLB67e4elpUKhZr6zjHG6gRtutcUWwgKPEW/au4b7j5xHohFirFH3RFxCZJUBZot0UZMUW3RdmjV38iU5/w+cgzEVDsLfta+WyYYKrZopc7MQuoShimnxhIBiXVmsjqf6qB7O+ueYedHv/tZI/Xk3J8uoA1pJqk+BKG8IJyRhDEiKgpyka/N4RiSEDqaKz4IXCg8PI5qqrsMI7lPOCdfyotRRi2ZEkCj0NKGFNjnQOoV+iMrpeKEHSo9tM+F1p8Kzgafvt3H/oD11Hk3NRzKoz3/U18Vb92DPV9pA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=nongnu.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hMGDN5kBfvfGqyo6Ds6NGGxr7RB3zVAKsYBNcJiHQ+I=; b=aMPZyFL2Go9qTuGaueuRmxFp8lHICcIn0coSZ4jPzD3cRP17KCgQGEuTZskI0uZq8VMppjJy/DeOdHT0SZzt6SRhsCmCvx+O96JhdbyNH/oOMTcwQ+3I2qpz5bZRLSLdDbTTPiUtz+MpPIrppkzFAVNVXMzh3TijTU2FUCaOR5lUBdm0N2tBzDHKojXCjpN7Fk/nxtFKYzL5A43hQiT1iwizkxh8MEsfniiXMnA39zu31NgE+X0D1sfizeKciQisYZWfyqP1k5vLvYJ7l8RZ28eUqPPSYuUGHOgLbq4sk0rJz6gSGS33ymxvobvkkUUwCdqXhLxkQ4HgF/9r4uTwcA== X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.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 (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C From: Avihai Horon To: CC: Peter Xu , Fabiano Rosas , "Avihai Horon" Subject: [PATCH 10/17] migration/postcopy: Use the new TLS upgrade API for preempt channel Date: Thu, 25 Jan 2024 18:25:21 +0200 Message-ID: <20240125162528.7552-11-avihaih@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20240125162528.7552-1-avihaih@nvidia.com> References: <20240125162528.7552-1-avihaih@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9DA:EE_|IA1PR12MB7495:EE_ X-MS-Office365-Filtering-Correlation-Id: 7887305b-0140-4651-5116-08dc1dc24f8c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: l5lPSuDEljOKW0cG9F3D/5xMt1vQFsj8RnuyaHteazVSLxoSs8pKlRx4YbyUwJUXgna1iPD2WN1Qkr+uj2Lky/NselMEVhsmItKb2kHJF+n6XVhl2yii/1MhT2Vm79RG/Ngy9EWBXi/QQg5b/BkhMXleY64xjiJoEPv7+ZxxobAWNdeR3CjVy/DPwre+CVKD4qbf2VCBgS60h9gYa8r7LzPxPQ3v8OCH5ekV9iVCfnQZZbTnMDwTWjPJS74GKqJljfU1yxPxZGOrD/DBY+bH+BLAUsOuR7iMkPgI2w90exQSrBtHAqScS4c1kkvOcpeNbkrjqtRf1mBZbJx5VDbctBq6mmS/yWW49MF1FYFnujlhaNpf2jS/XxyCcy+/BrahHM2ibOy9zFhv0VkwVnObpwH8BrYgOkCG0ta/jhGw+64N6FCbQxnS4C11nOQ34ylnAcV1C+U0guzJ+rs01N0dT+fmU6fyNhX1/z6kwUoK8TrTDFNkYbfthG0IH4nVnooN7sj2UHXFvZm0aFcerbbMnhjmp6/yUR1ytxQQPdHl+DWDtmmny/JGl4iIuk7aMcRvh9WXl/Ys0sQmP+dUsl/2H9hjMo0Oht+ABFPBN35xo6TJkQE4345sF5M6/gdvd5e4vxh9zd1G6xmog45rg+BW6MrdH7FBqx7yFREpuqJ0Q3Iglsht2GJ6nQimOEkwhmRzrHalfLZRnzrZlCjrCOfj7qQVfvWm8fz6lHt91qAB66HLzxalruBhTJAN4i8hrD7T X-Forefront-Antispam-Report: CIP:216.228.118.232; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge1.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(39860400002)(396003)(346002)(136003)(376002)(230922051799003)(451199024)(1800799012)(82310400011)(186009)(64100799003)(40470700004)(46966006)(36840700001)(2906002)(5660300002)(82740400003)(7636003)(36756003)(478600001)(86362001)(356005)(1076003)(83380400001)(7696005)(107886003)(41300700001)(2616005)(47076005)(36860700001)(426003)(6666004)(26005)(336012)(6916009)(54906003)(316002)(8676002)(8936002)(4326008)(70586007)(70206006)(40460700003)(40480700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2024 16:25:57.4130 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7887305b-0140-4651-5116-08dc1dc24f8c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.232]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000E9DA.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7495 Received-SPF: softfail client-ip=2a01:111:f403:2417::601; envelope-from=avihaih@nvidia.com; helo=NAM12-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.5, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-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 @Nvidia.com) X-ZM-MESSAGEID: 1706200157443100001 Content-Type: text/plain; charset="utf-8" Use the new TLS upgrade API for postcopy preempt channel and remove old TLS code. Signed-off-by: Avihai Horon --- migration/postcopy-ram.c | 20 +++++++------------- migration/trace-events | 1 - 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 5408e028c6..3df937e7da 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -1644,15 +1644,13 @@ postcopy_preempt_send_channel_done(MigrationState *= s, qemu_sem_post(&s->postcopy_qemufile_src_sem); } =20 -static void -postcopy_preempt_tls_handshake(QIOTask *task, gpointer opaque) +static void postcopy_preempt_tls_handshake(QIOChannel *ioc, gpointer opaqu= e, + Error *err) { - g_autoptr(QIOChannel) ioc =3D QIO_CHANNEL(qio_task_get_source(task)); MigrationState *s =3D opaque; - Error *local_err =3D NULL; =20 - qio_task_propagate_error(task, &local_err); - postcopy_preempt_send_channel_done(s, ioc, local_err); + postcopy_preempt_send_channel_done(s, ioc, err); + object_unref(ioc); } =20 static void @@ -1660,7 +1658,6 @@ postcopy_preempt_send_channel_new(QIOTask *task, gpoi= nter opaque) { g_autoptr(QIOChannel) ioc =3D QIO_CHANNEL(qio_task_get_source(task)); MigrationState *s =3D opaque; - QIOChannelTLS *tioc; Error *local_err =3D NULL; =20 if (qio_task_propagate_error(task, &local_err)) { @@ -1668,14 +1665,11 @@ postcopy_preempt_send_channel_new(QIOTask *task, gp= ointer opaque) } =20 if (migrate_channel_requires_tls_upgrade(ioc)) { - tioc =3D migration_tls_client_create(ioc, s->hostname, &local_err); - if (!tioc) { + if (!migration_tls_channel_connect(ioc, "preempt", s->hostname, + postcopy_preempt_tls_handshake,= s, + false, &local_err)) { goto out; } - trace_postcopy_preempt_tls_handshake(); - qio_channel_set_name(QIO_CHANNEL(tioc), "migration-tls-preempt"); - qio_channel_tls_handshake(tioc, postcopy_preempt_tls_handshake, - s, NULL, NULL); /* Setup the channel until TLS handshake finished */ return; } diff --git a/migration/trace-events b/migration/trace-events index 2c328326e8..9a8ec67115 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -297,7 +297,6 @@ postcopy_request_shared_page(const char *sharer, const = char *rb, uint64_t rb_off postcopy_request_shared_page_present(const char *sharer, const char *rb, u= int64_t rb_offset) "%s already %s offset 0x%"PRIx64 postcopy_wake_shared(uint64_t client_addr, const char *rb) "at 0x%"PRIx64"= in %s" postcopy_page_req_del(void *addr, int count) "resolved page req %p total %= d" -postcopy_preempt_tls_handshake(void) "" postcopy_preempt_new_channel(void) "" postcopy_preempt_thread_entry(void) "" postcopy_preempt_thread_exit(void) "" --=20 2.26.3