From nobody Mon Dec 23 23:20:13 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1734691391; cv=none; d=zohomail.com; s=zohoarc; b=fJuxoX4P1gBr3v1yPcl0/NA/QrgYTA+uVrvqDQDquND/32LczlivhpDascuahE8KiXrQYc8Qa/LmeRtOrAiIWTue5/O5BvGiL3P+R0bzGjb6XmsxWvN72XPRevPF/GKz+j8ipOK/sIB6OfJ7MeN98LH9tyHGP9EZXITwvkscX1Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734691391; 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=XupcwXC4o3WF/HULC2+F2cneFMCliOmRf8I9otsFFoY=; b=dz87GVTGVIkr849dqY06Lyy3OIL+7vg47QT5I77umObSUSUTkWreRZWHCTNPxjg2IlaTQ2EFZ7PeiVXF8Cq7G276AYgXLzp9aWdlBRffeZuQ7hXryv9BlnAs8n6ZNjJ52aHX/LgMncjLv+ZmpoeIg/lnqJkNbHdfL7EzDqTMxyg= 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 173469139162486.85862550153843; Fri, 20 Dec 2024 02:43:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOaT6-0001qc-SR; Fri, 20 Dec 2024 05:42:53 -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 1tOaSx-0001nM-Oq; Fri, 20 Dec 2024 05:42:45 -0500 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOaSw-0005CO-5K; Fri, 20 Dec 2024 05:42:43 -0500 Received: by mail-pg1-x533.google.com with SMTP id 41be03b00d2f7-7ea9739647bso1146473a12.0; Fri, 20 Dec 2024 02:42:41 -0800 (PST) Received: from wheely.local0.net (14-200-18-130.tpgi.com.au. [14.200.18.130]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee06dfd3sm5376942a91.32.2024.12.20.02.42.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 02:42:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734691360; x=1735296160; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XupcwXC4o3WF/HULC2+F2cneFMCliOmRf8I9otsFFoY=; b=Ynu1bUmlM2Rtrzp7v9pUsjTpReyS6Dg9Jc8nHfU/2r+nz6rNKKTReJOcp+tXfVp+CO A2HnpyKuf1sTZOLXDd2QySH1PBoH/YEPW2MEmurZjYorcYHH0mSQbmROvDqVwaTRCGuc k/pYgBWW8T/XwB3gC0cq0P0lVPhRDQVrjNkJsxG/9RUNjpzPrsnWgBGPCC4XRyQb/Eat UE4hFs076h4Upl5gZGevRZlT+8tFOSK42AjoC8fUveyAmeyhJs8AyB9GlEeB7dveM9cU ZcQJsNy2kTdEhvqZB1Fi35OKAnRH8AuPPJmdebFViI1Nw0DMEYd84gl7pVNkWY5l0Yim YGng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734691360; x=1735296160; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XupcwXC4o3WF/HULC2+F2cneFMCliOmRf8I9otsFFoY=; b=Z6B5ZLDxuFckeybKmCwNWgHjZdZuPAS5vMxcn/syXinuL66lci8GSIM92h7gTL0Gs9 uuv4/te/Nix1mQHiM39+clSIsm9jyFA1uxqpKY8375Sg3ELELxRXlSt2wMyion9dgVHw 8KqwHsgXErsxFIE7WFD1yPXA2a5ZJqLWNGaBAcu9U5fTvLsWD4i1z1H/ORVjJN++MTaW MTeyr0Hh3LMSnaA5B2baQsnduGHHqwDQojDU79ObYveh98JJv+9TT36SctuJoZOpd+w9 6w4wWW4vIAMy2htXKOcyV3C3pmjyTWVnak9x+enRHWnevxIii/1wafl2VtcUwzU4PD/b tSnw== X-Forwarded-Encrypted: i=1; AJvYcCU66/7USo7gPJmtnj5toDkWLOubmuXADI6M/5x9SVzNJX4OgcH3dsdPWsxffVBuBvicX20kFwDXACAy@nongnu.org X-Gm-Message-State: AOJu0YyzapgNBekOJkMRP6wJEmZNBi7MpOxJfZJ70GgJb56La2T0rnuo 5vTTWrap3RhUPzQJquuX682UZCy1khL7UqsBLFG2De1NWubsTutBHzd2RA== X-Gm-Gg: ASbGnct1CdgAD475rEpIqDETZFDyBSIyF2DDQxoPkWrBWFAVwpdmwMGhOFHqo2CnrjK thLF5FG6oNQyXh/xTgisyWL6k1gOdEXSBDee4UmcxyiorFt8DJIxsGDAFspDjS7UKmEN8oeoHIB 2w42UxDp6AskUhjXqxny7dBh4iQPeAlVFTgmxqR6ycWB9IC8CJlTBSdC/DCgPLLRhbAiECCUB3m 3yyuVxUz+ShXtvAgUTyWSSspy4nSMrO+UQlO4/XXBP723SZzi4Sxm4PVIb0okuk/6wJ70TVnibN diebb3G0jQ== X-Google-Smtp-Source: AGHT+IHJhPOBTvl9hvqnAZAZ22ZbgfEzsYzSOUpu2MkVulCan7laK8qWWrQZ8Uj1EucTtG726jT1rw== X-Received: by 2002:a17:90b:524b:b0:2ee:c457:bf83 with SMTP id 98e67ed59e1d1-2f452e38c6cmr3862965a91.19.1734691360038; Fri, 20 Dec 2024 02:42:40 -0800 (PST) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kevin Wolf , Hanna Reitz , Pavel Dovgalyuk , Paolo Bonzini , Stefan Hajnoczi , Fam Zheng , Ronnie Sahlberg , John Snow , "Michael S. Tsirkin" , Jason Wang , Vladimir Sementsov-Ogievskiy , Peter Xu , Fabiano Rosas , "Dr. David Alan Gilbert" , Markus Armbruster , Michael Roth , Wainer dos Santos Moschetta Subject: [PATCH 01/17] replay: Fix migration use of clock for statistics Date: Fri, 20 Dec 2024 20:42:03 +1000 Message-ID: <20241220104220.2007786-2-npiggin@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241220104220.2007786-1-npiggin@gmail.com> References: <20241220104220.2007786-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=npiggin@gmail.com; helo=mail-pg1-x533.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1734691393760116600 Content-Type: text/plain; charset="utf-8" Migration reads CLOCK_HOST when not holding the replay_mutex, which asserts when recording a trace. These are not guest visible so should be CLOCK_REALTIME like other statistics in MigrationState, which do not require the replay_mutex. Signed-off-by: Nicholas Piggin Reviewed-by: Pavel Dovgalyuk --- migration/migration.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 8c5bd0a75c8..2eb9e50a263 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -3433,7 +3433,7 @@ static void *migration_thread(void *opaque) { MigrationState *s =3D opaque; MigrationThread *thread =3D NULL; - int64_t setup_start =3D qemu_clock_get_ms(QEMU_CLOCK_HOST); + int64_t setup_start =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME); MigThrError thr_error; bool urgent =3D false; Error *local_err =3D NULL; @@ -3504,7 +3504,7 @@ static void *migration_thread(void *opaque) goto out; } =20 - s->setup_time =3D qemu_clock_get_ms(QEMU_CLOCK_HOST) - setup_start; + s->setup_time =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME) - setup_start; =20 trace_migration_thread_setup_complete(); =20 @@ -3584,7 +3584,7 @@ static void *bg_migration_thread(void *opaque) =20 migration_rate_set(RATE_LIMIT_DISABLED); =20 - setup_start =3D qemu_clock_get_ms(QEMU_CLOCK_HOST); + setup_start =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME); /* * We want to save vmstate for the moment when migration has been * initiated but also we want to save RAM content while VM is running. @@ -3629,7 +3629,7 @@ static void *bg_migration_thread(void *opaque) goto fail_setup; } =20 - s->setup_time =3D qemu_clock_get_ms(QEMU_CLOCK_HOST) - setup_start; + s->setup_time =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME) - setup_start; =20 trace_migration_thread_setup_complete(); =20 --=20 2.45.2 From nobody Mon Dec 23 23:20:13 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1734691393; cv=none; d=zohomail.com; s=zohoarc; b=Yo/5EMYG37MyKtrCmbvIUSXoHk/NUARA28eff+pnFJ7NhrYxGv0wdp0P2xGeZ85LPT+BNOuJ2pFFXXi3s/pakleQzEUbSOoKWkDvurjxikeH57dnhQXMibLUnWoq91rZ5KOFbx2A3gJj0QaHLIkGIqQ0CJgTYoLig9sXCgH25h0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734691393; 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=HYauowC6m1dSqSOOvIXZEtWuC27GaY5hc1iCZUJ/IDY=; b=kCCooWr0ECD38nFd0dywcxJdYNFNDCkE/j2m9zxdSK+bkhpW00+fH7l6QFOWvsnIZuMtRgncWWT0imnI06B8O9QccGuAVcy8AMI4ZHYeeeBM/pbzbHOy3KGmvQ2dNTEE208sFB1q8tBuz5KQvYV7x/atiiBM5lPQG9Lei0fwK78= 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 1734691393639168.72563033498545; Fri, 20 Dec 2024 02:43:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOaTI-00020s-Ro; Fri, 20 Dec 2024 05:43:06 -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 1tOaT6-0001s3-JJ; Fri, 20 Dec 2024 05:42:52 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOaT4-0005Cp-5H; Fri, 20 Dec 2024 05:42:51 -0500 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-2161eb94cceso11761945ad.2; Fri, 20 Dec 2024 02:42:49 -0800 (PST) Received: from wheely.local0.net (14-200-18-130.tpgi.com.au. [14.200.18.130]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee06dfd3sm5376942a91.32.2024.12.20.02.42.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 02:42:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734691368; x=1735296168; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HYauowC6m1dSqSOOvIXZEtWuC27GaY5hc1iCZUJ/IDY=; b=H30Fdw7dF6wscp97B8ckdyV/pR2uvnEhVarRxbUUD/jrxPWyT5OD0yYrbjiNj2KymO oXMbjnI6sa7GdUsrx0cdwkDO+oXIn2OqRxc9jOI/tuAZ4gBIvg4cfrKA04yyJf1QIzD5 KdrChpf7vVj40X+Xd4Y7nJvIiJ8qLzufbb7bn7+KR1p19C4NzVmhzYnO08/rw6yOLxwV x/7gi8fq1ozAv33fsrnyaUFtSrBl0snTHOVEqOkjRhcql5jSuPg4Qq5fl+4UoEHZzcKX vNGQ/i7qUnJ/4dQTAqe24g1HcZ9zq2Tgw6fUM8rbMOF5bX/uQsA0It+8qOLEEL9Nr6SF 4cTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734691368; x=1735296168; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HYauowC6m1dSqSOOvIXZEtWuC27GaY5hc1iCZUJ/IDY=; b=DJ+l+buaVjNQBpe7DXnrJ2ouuHhgAq5rk8W+VMe4MEwKSDB/ZN5CbwA6ThO6SfZHdQ i7n3jnJbvV2tIcoTM+CwACx8UddntKl7iqqtmGXPmrvR3BizDErPap7CLK5K/SopZ6Gt B67WOS0djGvmnGkig4Mibq13uU5axJCweo/7AJYopz16gY7RPNA3LJx1AuE9REJy1npF 2d6aRwPByMG9DjbTPDPJh6Dyy0jYFttUF5P6vKZIEIX784+YNqKHVXmeSfPquH1DVOq8 wJaqxRteb/hRcrV+A6S8IN1oh+ZNI2P7g/hXQ1I7KSMc19j8pLGD/uhGZ3mHb3S+v9rX tQ3Q== X-Forwarded-Encrypted: i=1; AJvYcCVdAGYFpEYg0KexkJfYYtq7SqNk7wfhBG7hUWmQkg/GSHq6hwMtIq7EVq8zIr9whCXuPk8SXIdxjvcm@nongnu.org X-Gm-Message-State: AOJu0Yyd3WN38Z2q0EvD7A48/XA4eDS4V8GQflVBPEaWxB5VOerbDGJC 1Hi8QKuj8gF+vCRFb5p9tEv0e0xY+XG5uHFtzjP46IOCAQUs8PDqSU3qtw== X-Gm-Gg: ASbGncuxzVzNdqK9KQnkelLlS86udb+N1fwgUDHghb0LAv2c5qnlTwaP5OquW9OlxQg C5lzDO1UmOP7cLcQQH/D1KZNIPMUce2YZ5YQrIJRRVIXaTU13D602fIFEkPTWTBm6aF9GJuU8+C qmZjPNLCnrBYngiMwLaF4BN/hMKQr8tVmqL0rqTlawFtYaYaBFlNgoqPZ92S1Pq71vIYeEKJnjX oADUwSBUG9GprQ4vsDD6P+hy374Ot44kKPOdr9LXsaS7AKGvqy2aByTvNSak7UDNfeSR/7jzUMH RwifB7wYow== X-Google-Smtp-Source: AGHT+IG1LubnhyxHCMdczXSH/fXeerTfPXvXsmGZLINQD0+k2LGCX5KTQV6fRZoo9KcSXow1AgaTQw== X-Received: by 2002:a17:90a:c2c8:b0:2ee:ead6:6213 with SMTP id 98e67ed59e1d1-2f452e4c536mr3868057a91.19.1734691368253; Fri, 20 Dec 2024 02:42:48 -0800 (PST) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kevin Wolf , Hanna Reitz , Pavel Dovgalyuk , Paolo Bonzini , Stefan Hajnoczi , Fam Zheng , Ronnie Sahlberg , John Snow , "Michael S. Tsirkin" , Jason Wang , Vladimir Sementsov-Ogievskiy , Peter Xu , Fabiano Rosas , "Dr. David Alan Gilbert" , Markus Armbruster , Michael Roth , Wainer dos Santos Moschetta Subject: [PATCH 02/17] replay: Fix migration replay_mutex locking Date: Fri, 20 Dec 2024 20:42:04 +1000 Message-ID: <20241220104220.2007786-3-npiggin@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241220104220.2007786-1-npiggin@gmail.com> References: <20241220104220.2007786-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=npiggin@gmail.com; helo=mail-pl1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1734691395513116600 Content-Type: text/plain; charset="utf-8" Migration causes a number of events that need to go in the replay trace, such as vm state transitions. The replay_mutex lock needs to be held for these. The simplest approach seems to be just take it up-front when taking the bql. Signed-off-by: Nicholas Piggin Reviewed-by: Pavel Dovgalyuk --- migration/migration.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/migration/migration.c b/migration/migration.c index 2eb9e50a263..277fca954c1 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -24,6 +24,7 @@ #include "socket.h" #include "sysemu/runstate.h" #include "sysemu/sysemu.h" +#include "sysemu/replay.h" #include "sysemu/cpu-throttle.h" #include "rdma.h" #include "ram.h" @@ -2518,6 +2519,7 @@ static int postcopy_start(MigrationState *ms, Error *= *errp) } =20 trace_postcopy_start(); + replay_mutex_lock(); bql_lock(); trace_postcopy_start_set_run(); =20 @@ -2629,6 +2631,7 @@ static int postcopy_start(MigrationState *ms, Error *= *errp) migration_downtime_end(ms); =20 bql_unlock(); + replay_mutex_unlock(); =20 if (migrate_postcopy_ram()) { /* @@ -2670,6 +2673,7 @@ fail: } migration_call_notifiers(ms, MIG_EVENT_PRECOPY_FAILED, NULL); bql_unlock(); + replay_mutex_unlock(); return -1; } =20 @@ -2721,6 +2725,7 @@ static int migration_completion_precopy(MigrationStat= e *s, { int ret; =20 + replay_mutex_lock(); bql_lock(); =20 if (!migrate_mode_is_cpr(s)) { @@ -2746,6 +2751,7 @@ static int migration_completion_precopy(MigrationStat= e *s, s->block_inactive); out_unlock: bql_unlock(); + replay_mutex_unlock(); return ret; } =20 @@ -3633,6 +3639,7 @@ static void *bg_migration_thread(void *opaque) =20 trace_migration_thread_setup_complete(); =20 + replay_mutex_lock(); bql_lock(); =20 if (migration_stop_vm(s, RUN_STATE_PAUSED)) { @@ -3666,6 +3673,7 @@ static void *bg_migration_thread(void *opaque) */ migration_bh_schedule(bg_migration_vm_start_bh, s); bql_unlock(); + replay_mutex_unlock(); =20 while (migration_is_active()) { MigIterateState iter_state =3D bg_migration_iteration_run(s); @@ -3695,6 +3703,7 @@ fail: migrate_set_state(&s->state, MIGRATION_STATUS_ACTIVE, MIGRATION_STATUS_FAILED); bql_unlock(); + replay_mutex_unlock(); } =20 fail_setup: --=20 2.45.2 From nobody Mon Dec 23 23:20:13 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1734691403; cv=none; d=zohomail.com; s=zohoarc; b=U37/fGaeCfxy6egER3a8RIXh+x2sJ5UasykGUhHzP37JqNAUfJvcpH3xE8XrgRJKqS/m83PkQ1+J1BUN5bPBnXjetuHIDqLT+qDgsGwoJl2qp02lZRaIiWnbAQ6P6i5ARl1Kdnn6ulo0Jvmp3oHrAT8LYlh/HY75wS3Gw99DZR8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734691403; 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=L7UjIHOVv+OKh4Jj/WPmNrW7ybF61f5r2ui4Jn5w6rc=; b=jCsuP6/AvvPCuS/S4FJ5BmalmifyT9Py6YuyK8JmAcrdUpgYErHOs9tq285DQ7znGFq5r05gsBvnOR+VHksOgcrGtVoV4LE4gW7E7/ajyOH5sMo6zD4yTUqzXXW/JkIad5Ygv7S/DVKb8JhuqqahpczeaSgNDHmakJW5U/rfAI4= 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 1734691403129462.1227557256966; Fri, 20 Dec 2024 02:43:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOaTL-000260-VS; Fri, 20 Dec 2024 05:43: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 1tOaTE-0001xf-Gp; Fri, 20 Dec 2024 05:43:00 -0500 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOaTC-0005E7-3B; Fri, 20 Dec 2024 05:43:00 -0500 Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-2f43da61ba9so1387630a91.2; Fri, 20 Dec 2024 02:42:57 -0800 (PST) Received: from wheely.local0.net (14-200-18-130.tpgi.com.au. [14.200.18.130]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee06dfd3sm5376942a91.32.2024.12.20.02.42.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 02:42:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734691376; x=1735296176; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=L7UjIHOVv+OKh4Jj/WPmNrW7ybF61f5r2ui4Jn5w6rc=; b=eAfZ8oj1JI5QOaKdSP9jZA+pU4ZK2fm5QZIVdel+4sPtM9pDxuw+ClN3CFLQRuLwWJ VfQngWOyligW03Vq+xp0754O94JOH0xYzWZmf1+x4aZh6QmAjldheVVEHsoQfEcv2Goz Xu2loBFjLNqSG5aZM2KXfwMM9jBqRQKKe7rXHP49FJQYrX9Gl6jQl0lEfmjpL7F9j3fG 2K/7zUpYQErNGFQQOH45KDUa+yJq1vRj2L0YKgljgKcm1jHlb6K9Ygl80s2zd+nvqJfi 1qxtrADroIEXvgIqClFs5id7lVJ0vnoOZTFCbqOsa5gFV3Fdi3PgEIxJI/LjFPxeVXkJ /trw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734691376; x=1735296176; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=L7UjIHOVv+OKh4Jj/WPmNrW7ybF61f5r2ui4Jn5w6rc=; b=r/sVQTPWEE3XbjGKAZPb/dHFwhGU3YNEm5HuRiUP5SaHJxM1NCIQi/K70iGd2Z0Iy/ e8rXcJGBZg97rVgBGSbTgRC5wqbvc8ngfnG9xBPUXH7Mk3HI2dLfwyhBQkjjsgm9IsiH KhEGkOvkouiW3OnRpuRwjyn0G8oWQJfCzvGH70jr1Mq9IzVJFhqQXMxJ+Igvk0Z2Qt2B MyVC4Q3RQnn7zCwFio2DsK1MXvVPXZvR3z9f36jPueez0Xh/sqC9/ZbRkaDLOrleebwT 1Kb8Xuu9ofMGH7TqD5rNUMuFltfl8Uq5SrzYHYae5djJJzD89oiyFzd9yA14aLrUIKvi +zPQ== X-Forwarded-Encrypted: i=1; AJvYcCWzxBagxVmck8t+TG+rZRbOoVAqupXqnXvYATDPhcc7uWsFIzYgkcHE1hBOZWvPBo0SxHVjIz8cey3V@nongnu.org X-Gm-Message-State: AOJu0Yx64PfN0nh95Z6SgA+rrJ42UudzrPsWjrLmWibBfYZgGek/giMX v1pcJ+RY0t4TwiUBTfUbLu2qjpDnnz+t5end4JPGDKlJhOGdW7AgtQyccg== X-Gm-Gg: ASbGncsK8DN2sgfxYwBDcE1YwzU6tsDkeXfV+2pBAF4+1tivaM61Ux9Muts9Tn89/Yk aGcIYqPrHA2ZT0PxcDlcGxmr2j606FcGsowVtcAmg8UvqJioIEWmiwGg4YALhB0JUuR+TkeXYgX epJzF+quaG0BrGGP+L0K69aZEVFfkOdSVWuB4E+daojkKLvf6QOtPXrK8jLjWelT9xXUhEFmYDH Inn4CHkfRk8OiZGZok2qSWK40wS8vomLpafVxcxS0O5pd1ai6Ocpn1cVIA4AGEmcF2/3nAy0hEL cTtjQAQZ+Q== X-Google-Smtp-Source: AGHT+IFpEO2mU3YazmwaSvwTXh5RjLvdXAy/gg0immkL7bGmAtb+tnPhxDRh5ieZbEDB5u8m3z1bpg== X-Received: by 2002:a17:90b:2cc3:b0:2ee:693e:ed7c with SMTP id 98e67ed59e1d1-2f452eeb5ffmr3909648a91.33.1734691376160; Fri, 20 Dec 2024 02:42:56 -0800 (PST) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kevin Wolf , Hanna Reitz , Pavel Dovgalyuk , Paolo Bonzini , Stefan Hajnoczi , Fam Zheng , Ronnie Sahlberg , John Snow , "Michael S. Tsirkin" , Jason Wang , Vladimir Sementsov-Ogievskiy , Peter Xu , Fabiano Rosas , "Dr. David Alan Gilbert" , Markus Armbruster , Michael Roth , Wainer dos Santos Moschetta Subject: [PATCH 03/17] async: rework async event API for replay Date: Fri, 20 Dec 2024 20:42:05 +1000 Message-ID: <20241220104220.2007786-4-npiggin@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241220104220.2007786-1-npiggin@gmail.com> References: <20241220104220.2007786-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=npiggin@gmail.com; helo=mail-pj1-x1031.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1734691403988116600 Content-Type: text/plain; charset="utf-8" Replace the functions replay_bh_schedule_event() and replay_bh_schedule_oneshot_event() with qemu_bh_schedule_event() and aio_bh_schedule_oneshot_event(), respectively. Direct API conversions use QEMU_CLOCK_VIRTUAL, because the virtual clocks then go via the replay path when replay is enabled. Signed-off-by: Nicholas Piggin Reviewed-by: Pavel Dovgalyuk --- docs/devel/replay.rst | 7 ++++--- include/block/aio.h | 35 +++++++++++++++++++++++++++++++---- include/sysemu/replay.h | 2 +- backends/rng-builtin.c | 2 +- block/block-backend.c | 24 ++++++++++++++---------- block/io.c | 5 +++-- block/iscsi.c | 5 +++-- block/nfs.c | 10 ++++++---- block/null.c | 4 ++-- block/nvme.c | 8 +++++--- hw/ide/core.c | 7 ++++--- hw/net/virtio-net.c | 14 +++++++------- replay/replay-events.c | 2 +- stubs/replay-tools.c | 2 +- util/async.c | 39 +++++++++++++++++++++++++++++++++++++-- 15 files changed, 120 insertions(+), 46 deletions(-) diff --git a/docs/devel/replay.rst b/docs/devel/replay.rst index 40f58d9d4fc..ca816d87587 100644 --- a/docs/devel/replay.rst +++ b/docs/devel/replay.rst @@ -171,9 +171,10 @@ Bottom halves ------------- =20 Bottom half callbacks, that affect the guest state, should be invoked thro= ugh -``replay_bh_schedule_event`` or ``replay_bh_schedule_oneshot_event`` funct= ions. -Their invocations are saved in record mode and synchronized with the exist= ing -log in replay mode. +``qemu_bh_schedule_event`` or ``aio_bh_schedule_oneshot_event`` functions +the with the appropriate clock type (e.g., QEMU_CLOCK_VIRTUAL. Their +invocations are saved in record mode and synchronized with the existing lo= g in +replay mode. =20 Disk I/O events are completely deterministic in our model, because in both record and replay modes we start virtual machine from the same diff --git a/include/block/aio.h b/include/block/aio.h index 43883a8a33a..bc323b0d936 100644 --- a/include/block/aio.h +++ b/include/block/aio.h @@ -286,17 +286,30 @@ void aio_context_unref(AioContext *ctx); * @name: A human-readable identifier for debugging purposes. */ void aio_bh_schedule_oneshot_full(AioContext *ctx, QEMUBHFunc *cb, void *o= paque, - const char *name); + const char *name, QEMUClockType clock_ty= pe); =20 /** - * aio_bh_schedule_oneshot: Allocate a new bottom half structure that will= run - * only once and as soon as possible. + * aio_bh_schedule_oneshot_event: Allocate a new bottom half structure that + * will run only once and as soon as possible. * * A convenience wrapper for aio_bh_schedule_oneshot_full() that uses cb a= s the * name string. */ +#define aio_bh_schedule_oneshot_event(ctx, cb, opaque, clock_type) \ + aio_bh_schedule_oneshot_full((ctx), (cb), (opaque), (stringify(cb)), \ + clock_type) + +/** + * aio_bh_schedule_oneshot: Allocate a new bottom half structure that will= run + * only once and as soon as possible. + * + * A legacy wrapper for aio_bh_schedule_oneshot_event() that uses realtime + * as the clock type. Callers should specify the clock time in order to be + * compatible with record/replay. + */ #define aio_bh_schedule_oneshot(ctx, cb, opaque) \ - aio_bh_schedule_oneshot_full((ctx), (cb), (opaque), (stringify(cb))) + aio_bh_schedule_oneshot_full((ctx), (cb), (opaque), (stringify(cb)), \ + QEMU_CLOCK_REALTIME) =20 /** * aio_bh_new_full: Allocate a new bottom half structure. @@ -378,6 +391,20 @@ void aio_bh_call(QEMUBH *bh); */ int aio_bh_poll(AioContext *ctx); =20 +/** + * qemu_bh_schedule_event: Schedule a bottom half. + * + * Scheduling a bottom half interrupts the main loop and causes the + * execution of the callback that was passed to qemu_bh_new. + * + * Bottom halves that are scheduled from a bottom half handler are instant= ly + * invoked. This can create an infinite loop if a bottom half handler + * schedules itself. + * + * @bh: The bottom half to be scheduled. + */ +void qemu_bh_schedule_event(QEMUBH *bh, QEMUClockType clock_type); + /** * qemu_bh_schedule: Schedule a bottom half. * diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h index cba74fa9bce..30a7ae47518 100644 --- a/include/sysemu/replay.h +++ b/include/sysemu/replay.h @@ -126,7 +126,7 @@ void replay_flush_events(void); /*! Adds bottom half event to the queue */ void replay_bh_schedule_event(QEMUBH *bh); /* Adds oneshot bottom half event to the queue */ -void replay_bh_schedule_oneshot_event(AioContext *ctx, +void replay_bh_oneshot_event(AioContext *ctx, QEMUBHFunc *cb, void *opaque); /*! Adds input event to the queue */ void replay_input_event(QemuConsole *src, InputEvent *evt); diff --git a/backends/rng-builtin.c b/backends/rng-builtin.c index f367eb665cf..eef5c61f4f5 100644 --- a/backends/rng-builtin.c +++ b/backends/rng-builtin.c @@ -38,7 +38,7 @@ static void rng_builtin_request_entropy(RngBackend *b, Rn= gRequest *req) { RngBuiltin *s =3D RNG_BUILTIN(b); =20 - replay_bh_schedule_event(s->bh); + qemu_bh_schedule_event(s->bh, QEMU_CLOCK_VIRTUAL); } =20 static void rng_builtin_init(Object *obj) diff --git a/block/block-backend.c b/block/block-backend.c index 85bcdedcef6..2168729340d 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -1530,8 +1530,8 @@ BlockAIOCB *blk_abort_aio_request(BlockBackend *blk, acb->blk =3D blk; acb->ret =3D ret; =20 - replay_bh_schedule_oneshot_event(qemu_get_current_aio_context(), - error_callback_bh, acb); + aio_bh_schedule_oneshot_event(qemu_get_current_aio_context(), + error_callback_bh, acb, QEMU_CLOCK_VIRTU= AL); return &acb->common; } =20 @@ -1588,8 +1588,9 @@ static BlockAIOCB *blk_aio_prwv(BlockBackend *blk, in= t64_t offset, =20 acb->has_returned =3D true; if (acb->rwco.ret !=3D NOT_DONE) { - replay_bh_schedule_oneshot_event(qemu_get_current_aio_context(), - blk_aio_complete_bh, acb); + aio_bh_schedule_oneshot_event(qemu_get_current_aio_context(), + blk_aio_complete_bh, acb, + QEMU_CLOCK_VIRTUAL); } =20 return &acb->common; @@ -1894,8 +1895,9 @@ BlockAIOCB *blk_aio_zone_report(BlockBackend *blk, in= t64_t offset, =20 acb->has_returned =3D true; if (acb->rwco.ret !=3D NOT_DONE) { - replay_bh_schedule_oneshot_event(qemu_get_current_aio_context(), - blk_aio_complete_bh, acb); + aio_bh_schedule_oneshot_event(qemu_get_current_aio_context(), + blk_aio_complete_bh, acb, + QEMU_CLOCK_VIRTUAL); } =20 return &acb->common; @@ -1935,8 +1937,9 @@ BlockAIOCB *blk_aio_zone_mgmt(BlockBackend *blk, Bloc= kZoneOp op, =20 acb->has_returned =3D true; if (acb->rwco.ret !=3D NOT_DONE) { - replay_bh_schedule_oneshot_event(qemu_get_current_aio_context(), - blk_aio_complete_bh, acb); + aio_bh_schedule_oneshot_event(qemu_get_current_aio_context(), + blk_aio_complete_bh, acb, + QEMU_CLOCK_VIRTUAL); } =20 return &acb->common; @@ -1974,8 +1977,9 @@ BlockAIOCB *blk_aio_zone_append(BlockBackend *blk, in= t64_t *offset, aio_co_enter(qemu_get_current_aio_context(), co); acb->has_returned =3D true; if (acb->rwco.ret !=3D NOT_DONE) { - replay_bh_schedule_oneshot_event(qemu_get_current_aio_context(), - blk_aio_complete_bh, acb); + aio_bh_schedule_oneshot_event(qemu_get_current_aio_context(), + blk_aio_complete_bh, acb, + QEMU_CLOCK_VIRTUAL); } =20 return &acb->common; diff --git a/block/io.c b/block/io.c index 301514c8808..fcce0710824 100644 --- a/block/io.c +++ b/block/io.c @@ -335,8 +335,9 @@ static void coroutine_fn bdrv_co_yield_to_drain(BlockDr= iverState *bs, bdrv_inc_in_flight(bs); } =20 - replay_bh_schedule_oneshot_event(qemu_get_aio_context(), - bdrv_co_drain_bh_cb, &data); + aio_bh_schedule_oneshot_event(qemu_get_aio_context(), + bdrv_co_drain_bh_cb, &data, + QEMU_CLOCK_VIRTUAL); =20 qemu_coroutine_yield(); /* If we are resumed from some other event (such as an aio completion = or a diff --git a/block/iscsi.c b/block/iscsi.c index 979bf90cb79..98ed86b9831 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -285,8 +285,9 @@ iscsi_co_generic_cb(struct iscsi_context *iscsi, int st= atus, } =20 if (iTask->co) { - replay_bh_schedule_oneshot_event(iTask->iscsilun->aio_context, - iscsi_co_generic_bh_cb, iTask); + aio_bh_schedule_oneshot_event(iTask->iscsilun->aio_context, + iscsi_co_generic_bh_cb, iTask, + QEMU_CLOCK_VIRTUAL); } else { iTask->complete =3D 1; } diff --git a/block/nfs.c b/block/nfs.c index 0500f60c08f..66d9df0d89b 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -256,8 +256,9 @@ nfs_co_generic_cb(int ret, struct nfs_context *nfs, voi= d *data, if (task->ret < 0) { error_report("NFS Error: %s", nfs_get_error(nfs)); } - replay_bh_schedule_oneshot_event(task->client->aio_context, - nfs_co_generic_bh_cb, task); + aio_bh_schedule_oneshot_event(task->client->aio_context, + nfs_co_generic_bh_cb, task, + QEMU_CLOCK_VIRTUAL); } =20 static int coroutine_fn nfs_co_preadv(BlockDriverState *bs, int64_t offset, @@ -723,8 +724,9 @@ nfs_get_allocated_file_size_cb(int ret, struct nfs_cont= ext *nfs, void *data, if (task->ret < 0) { error_report("NFS Error: %s", nfs_get_error(nfs)); } - replay_bh_schedule_oneshot_event(task->client->aio_context, - nfs_co_generic_bh_cb, task); + aio_bh_schedule_oneshot_event(task->client->aio_context, + nfs_co_generic_bh_cb, task, + QEMU_CLOCK_VIRTUAL); } =20 static int64_t coroutine_fn nfs_co_get_allocated_file_size(BlockDriverStat= e *bs) diff --git a/block/null.c b/block/null.c index 4730acc1eb2..d35b42cbb44 100644 --- a/block/null.c +++ b/block/null.c @@ -183,8 +183,8 @@ static inline BlockAIOCB *null_aio_common(BlockDriverSt= ate *bs, timer_mod_ns(&acb->timer, qemu_clock_get_ns(QEMU_CLOCK_REALTIME) + s->latency_n= s); } else { - replay_bh_schedule_oneshot_event(bdrv_get_aio_context(bs), - null_bh_cb, acb); + aio_bh_schedule_oneshot_event(bdrv_get_aio_context(bs), + null_bh_cb, acb, QEMU_CLOCK_VIRTUAL); } return &acb->common; } diff --git a/block/nvme.c b/block/nvme.c index 3b588b139f6..4069639dc7a 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -344,8 +344,9 @@ static void nvme_put_free_req_locked(NVMeQueuePair *q, = NVMeRequest *req) static void nvme_wake_free_req_locked(NVMeQueuePair *q) { if (!qemu_co_queue_empty(&q->free_req_queue)) { - replay_bh_schedule_oneshot_event(q->s->aio_context, - nvme_free_req_queue_cb, q); + aio_bh_schedule_oneshot_event(q->s->aio_context, + nvme_free_req_queue_cb, q, + QEMU_CLOCK_VIRTUAL); } } =20 @@ -1177,7 +1178,8 @@ static void nvme_rw_cb(void *opaque, int ret) /* The rw coroutine hasn't yielded, don't try to enter. */ return; } - replay_bh_schedule_oneshot_event(data->ctx, nvme_rw_cb_bh, data); + aio_bh_schedule_oneshot_event(data->ctx, nvme_rw_cb_bh, data, + QEMU_CLOCK_VIRTUAL); } =20 static coroutine_fn int nvme_co_prw_aligned(BlockDriverState *bs, diff --git a/hw/ide/core.c b/hw/ide/core.c index 08d92184554..c527caf3d69 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -516,7 +516,7 @@ static void ide_issue_trim_cb(void *opaque, int ret) done: iocb->aiocb =3D NULL; if (iocb->bh) { - replay_bh_schedule_event(iocb->bh); + qemu_bh_schedule_event(iocb->bh, QEMU_CLOCK_VIRTUAL); } } =20 @@ -2368,8 +2368,9 @@ void ide_ctrl_write(void *opaque, uint32_t addr, uint= 32_t val) s =3D &bus->ifs[i]; s->status |=3D BUSY_STAT; } - replay_bh_schedule_oneshot_event(qemu_get_aio_context(), - ide_bus_perform_srst, bus); + aio_bh_schedule_oneshot_event(qemu_get_aio_context(), + ide_bus_perform_srst, bus, + QEMU_CLOCK_VIRTUAL); } =20 bus->cmd =3D val; diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 4fd1f9accab..ecbf274cb04 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -415,10 +415,10 @@ static void virtio_net_set_status(struct VirtIODevice= *vdev, uint8_t status) =20 if (queue_started) { if (q->tx_timer) { - timer_mod(q->tx_timer, - qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + n->= tx_timeout); + timer_mod(q->tx_timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUA= L) + + n->tx_timeout); } else { - replay_bh_schedule_event(q->tx_bh); + qemu_bh_schedule_event(q->tx_bh, QEMU_CLOCK_VIRTUAL); } } else { if (q->tx_timer) { @@ -2705,7 +2705,7 @@ static void virtio_net_tx_complete(NetClientState *nc= , ssize_t len) */ virtio_queue_set_notification(q->tx_vq, 0); if (q->tx_bh) { - replay_bh_schedule_event(q->tx_bh); + qemu_bh_schedule_event(q->tx_bh, QEMU_CLOCK_VIRTUAL); } else { timer_mod(q->tx_timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + n->tx_timeou= t); @@ -2871,7 +2871,7 @@ static void virtio_net_handle_tx_bh(VirtIODevice *vde= v, VirtQueue *vq) return; } virtio_queue_set_notification(vq, 0); - replay_bh_schedule_event(q->tx_bh); + qemu_bh_schedule_event(q->tx_bh, QEMU_CLOCK_VIRTUAL); } =20 static void virtio_net_tx_timer(void *opaque) @@ -2954,7 +2954,7 @@ static void virtio_net_tx_bh(void *opaque) /* If we flush a full burst of packets, assume there are * more coming and immediately reschedule */ if (ret >=3D n->tx_burst) { - replay_bh_schedule_event(q->tx_bh); + qemu_bh_schedule_event(q->tx_bh, QEMU_CLOCK_VIRTUAL); q->tx_waiting =3D 1; return; } @@ -2968,7 +2968,7 @@ static void virtio_net_tx_bh(void *opaque) return; } else if (ret > 0) { virtio_queue_set_notification(q->tx_vq, 0); - replay_bh_schedule_event(q->tx_bh); + qemu_bh_schedule_event(q->tx_bh, QEMU_CLOCK_VIRTUAL); q->tx_waiting =3D 1; } } diff --git a/replay/replay-events.c b/replay/replay-events.c index 2e46eda6bf8..d4b095b2097 100644 --- a/replay/replay-events.c +++ b/replay/replay-events.c @@ -131,7 +131,7 @@ void replay_bh_schedule_event(QEMUBH *bh) } } =20 -void replay_bh_schedule_oneshot_event(AioContext *ctx, +void replay_bh_oneshot_event(AioContext *ctx, QEMUBHFunc *cb, void *opaque) { if (events_enabled) { diff --git a/stubs/replay-tools.c b/stubs/replay-tools.c index 3e8ca3212d9..31985af35f7 100644 --- a/stubs/replay-tools.c +++ b/stubs/replay-tools.c @@ -30,7 +30,7 @@ void replay_bh_schedule_event(QEMUBH *bh) qemu_bh_schedule(bh); } =20 -void replay_bh_schedule_oneshot_event(AioContext *ctx, +void replay_bh_oneshot_event(AioContext *ctx, QEMUBHFunc *cb, void *opaque) { aio_bh_schedule_oneshot(ctx, cb, opaque); diff --git a/util/async.c b/util/async.c index 99db28389f6..b88083ecbe7 100644 --- a/util/async.c +++ b/util/async.c @@ -36,6 +36,7 @@ #include "qemu/coroutine_int.h" #include "qemu/coroutine-tls.h" #include "sysemu/cpu-timers.h" +#include "sysemu/replay.h" #include "trace.h" =20 /***********************************************************/ @@ -126,8 +127,8 @@ static QEMUBH *aio_bh_dequeue(BHList *head, unsigned *f= lags) return bh; } =20 -void aio_bh_schedule_oneshot_full(AioContext *ctx, QEMUBHFunc *cb, - void *opaque, const char *name) +static void do_aio_bh_schedule_oneshot_full(AioContext *ctx, QEMUBHFunc *c= b, + void *opaque, const char *name) { QEMUBH *bh; bh =3D g_new(QEMUBH, 1); @@ -140,6 +141,24 @@ void aio_bh_schedule_oneshot_full(AioContext *ctx, QEM= UBHFunc *cb, aio_bh_enqueue(bh, BH_SCHEDULED | BH_ONESHOT); } =20 +void aio_bh_schedule_oneshot_full(AioContext *ctx, QEMUBHFunc *cb, + void *opaque, const char *name, + QEMUClockType clock_type) +{ + switch (clock_type) { + case QEMU_CLOCK_VIRTUAL: + case QEMU_CLOCK_VIRTUAL_RT: + if (replay_mode !=3D REPLAY_MODE_NONE) { + /* Record/replay must intercept bh events */ + replay_bh_oneshot_event(ctx, cb, opaque); + break; + } + /* fallthrough */ + default: + do_aio_bh_schedule_oneshot_full(ctx, cb, opaque, name); + } +} + QEMUBH *aio_bh_new_full(AioContext *ctx, QEMUBHFunc *cb, void *opaque, const char *name, MemReentrancyGuard *reentrancy_g= uard) { @@ -226,6 +245,22 @@ int aio_bh_poll(AioContext *ctx) return ret; } =20 +void qemu_bh_schedule_event(QEMUBH *bh, QEMUClockType clock_type) +{ + switch (clock_type) { + case QEMU_CLOCK_VIRTUAL: + case QEMU_CLOCK_VIRTUAL_RT: + if (replay_mode !=3D REPLAY_MODE_NONE) { + /* Record/replay must intercept bh events */ + replay_bh_schedule_event(bh); + break; + } + /* fallthrough */ + default: + aio_bh_enqueue(bh, BH_SCHEDULED); + } +} + void qemu_bh_schedule_idle(QEMUBH *bh) { aio_bh_enqueue(bh, BH_SCHEDULED | BH_IDLE); --=20 2.45.2 From nobody Mon Dec 23 23:20:13 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1734691409; cv=none; d=zohomail.com; s=zohoarc; b=Ws3XWQVlwB8aLu2OZtFVMchtNcsge6V4rMUYPJ85me0DA8pZn96MUTSVhxjYWuh7EqX3c7IbK+bWbhxmCn1N37MIFX2veCbdhywrilI86iBAM3gLc0dWDFO5yrRpnD1Di6AzF7jPJUr3DuXQsbBqpjE9x7E9K5n7zXb9v/JhY/4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734691409; 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=rmIt+w92XaivxUque0yXLMfcfuiQLuXv/FcE3kAIH5M=; b=oH9TzdyU+xmg05oswIgjnQuSsQedpACfA3T6WFe6h3ZS+3isNW4juPpwYjB1MEJXPtqacp5H9wyx27msiR9IMtQaEnQnCEVYhJ6WWksNZylFPPMUuDn/8a+noh4LDpussHqbXmnRS8P9Nzs0+PgKdU2H88pK1XZpQ+i7wlWDD0w= 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 1734691409209359.74832071852325; Fri, 20 Dec 2024 02:43:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOaTN-0002Al-HH; Fri, 20 Dec 2024 05:43:09 -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 1tOaTL-00026I-OL; Fri, 20 Dec 2024 05:43:07 -0500 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOaTJ-0005Ev-Vl; Fri, 20 Dec 2024 05:43:07 -0500 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-801986033f9so1086230a12.1; Fri, 20 Dec 2024 02:43:05 -0800 (PST) Received: from wheely.local0.net (14-200-18-130.tpgi.com.au. [14.200.18.130]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee06dfd3sm5376942a91.32.2024.12.20.02.42.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 02:43:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734691384; x=1735296184; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rmIt+w92XaivxUque0yXLMfcfuiQLuXv/FcE3kAIH5M=; b=hAgmrFIeMSC7F4k+KFlP9Z/2FFkLR94tQdrIZy6cigiUM0glu+eKSSS598DQ+apo8w MLcQUKbizR+uGQQQQkxosYTa7A07jK4U6K8uMHZeMeewdx1Nhu7cAldKDndzpDsd0DBY 2oxL33gqBtmrMdDVjpq3n1ltuqJdkv6XPU4yxH6IxnpaRkyDu/8WxGt28TDsuYNlSvaE MGF4Y6UcAs2+WqSWq6cXhLk2O3YUSF/B2JtSQLdn9e9I7vnsypschH51jyKTC13Y/gh/ tpXeZ9YGZJbMVBpy/krvCccgiyJG02j43zfFOlSWEXgeB7wQdZGn5JPO4p+qYwn6zl/O qHhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734691384; x=1735296184; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rmIt+w92XaivxUque0yXLMfcfuiQLuXv/FcE3kAIH5M=; b=DBk3LEnRPVTqcTaeUAqiH/5yb2pmKUZR5GnHFhd9rvoSw0huCNuRyDYp1XJmxLhKuH bxBr3hMOmHpnQh2CwOcdmr7aGS5H9Fx+ZaysAzOPeGFmgd30JWECz2oqbEqSB+y5x7p9 JbG2AD1C2sVekiI8nrbu8Mk8b+EWqtkKc0paFFh30tipz7+ROFG9OImsuVnqv/t7nR/L 3IfveqMI8/4ArTN1F/GpONHQNNYhH70LFgSUxE+4QXdcy0ctxg3qZu2Un361H6LDLRbb M964e34nnVfa726Cq0WGpDei64+zTYIBy7wcfj4egPOBuLQjvtrLcU2Gh+nhTAKFaewy UIiQ== X-Forwarded-Encrypted: i=1; AJvYcCV03gUaJ9/B37pn43t2DqW/7C0a32pXOBk1iIZ+cv9K8NfmkagvRvs7r+bg51zyzkxmqLxIaRXTeUHh@nongnu.org X-Gm-Message-State: AOJu0YwqjNccEp2+zHcVKDACXJ1p9jiyI5lPNDAn2u/LfhYhAFA+8Y8M mvoJ34xd381/EJcVDStat7VjL6GX1XXR9r7mW8ucUg5KGBIkghA/NWb80Q== X-Gm-Gg: ASbGncu5BGSPw9HBndn4DhyEqgTxZXxhYzxsQsNg37YBmoVI4v0PN2mxBo8XMdBWsOg iJhVqbTYr6tkIqNVCPDj3bwS9qRqGzv9yO1VvfULWMrdQpbvx+bjHU/JQH36wjZUcYR2yV9P5Ya Gs/+GYqQe1GpTvedfK6n14ZDzW430mhq5N3Jhdy6vjWdsgw3X7/BwaAslrTn3WMYsNhv/IC0zcC A6wl8/8Se+SH1FVNgqVk3/zK2hyC5EQwkqJ29Imi/XQ/fTtUnvNK2kL2Y6cGWnVi0W50ps/pJIu ksQ+5KZ75w== X-Google-Smtp-Source: AGHT+IEeO0yTP2vWGhKbv7rX2frFeEeF23qt7RPC0w32ViOPm0biwVYsXXb/Ut9rNfBedi3q3UN8tg== X-Received: by 2002:a17:90a:da8e:b0:2ee:fdf3:38dd with SMTP id 98e67ed59e1d1-2f452ec2919mr3435905a91.23.1734691383996; Fri, 20 Dec 2024 02:43:03 -0800 (PST) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kevin Wolf , Hanna Reitz , Pavel Dovgalyuk , Paolo Bonzini , Stefan Hajnoczi , Fam Zheng , Ronnie Sahlberg , John Snow , "Michael S. Tsirkin" , Jason Wang , Vladimir Sementsov-Ogievskiy , Peter Xu , Fabiano Rosas , "Dr. David Alan Gilbert" , Markus Armbruster , Michael Roth , Wainer dos Santos Moschetta Subject: [PATCH 04/17] util/main-loop: Convert to new bh API Date: Fri, 20 Dec 2024 20:42:06 +1000 Message-ID: <20241220104220.2007786-5-npiggin@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241220104220.2007786-1-npiggin@gmail.com> References: <20241220104220.2007786-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::535; envelope-from=npiggin@gmail.com; helo=mail-pg1-x535.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1734691409567116600 Content-Type: text/plain; charset="utf-8" Convert qemu_bh_schedule() to qemu_bh_schedule_event(), which can specify the clock type, making it compatible with record-replay. The notify event does not affect target machine state, so it should use QEMU_CLOCK_REALTIME so it is not recorded and replayed. Signed-off-by: Nicholas Piggin Reviewed-by: Pavel Dovgalyuk --- util/main-loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/main-loop.c b/util/main-loop.c index a0386cfeb60..6180a183f50 100644 --- a/util/main-loop.c +++ b/util/main-loop.c @@ -148,7 +148,7 @@ void qemu_notify_event(void) if (!qemu_aio_context) { return; } - qemu_bh_schedule(qemu_notify_bh); + qemu_bh_schedule_event(qemu_notify_bh, QEMU_CLOCK_REALTIME); } =20 static GArray *gpollfds; --=20 2.45.2 From nobody Mon Dec 23 23:20:13 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1734691403; cv=none; d=zohomail.com; s=zohoarc; b=c8SMKvtxXaeJ8RwB1TQl0jOAZ3dqEhJikrsTu5CMayRZAaWaHKaow8ipGN4dniiUbmasmWbIE/Hvt10J/M+NLiclLa0W0ea8w9YGGlkSNWmI5cAcFCS4xNGDt/zEZKEjIUl9hamWnLQ98SdMtV3+pKHGmo+wkVux6IQy7B8/CQg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734691403; 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=qqqVPjhisoejpakdnzFLtY2uBOq7jpbxi6SFzwY7o/A=; b=Y9ZVrUure422bpfLEIHeo52mibmoFgNyMiH4qHkyg+3hIJO585EnQBXn46SL0ejoOBzdPCRGMXLSrd65plCCWda5xwJNKHZqALhyojXdjfrXS5JnsEGGLbTVuH8fMUzSpT4za855nYfTOkYy6jZbErlKxgjteFetnnbuHE5bqAk= 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 1734691403042992.6290844380753; Fri, 20 Dec 2024 02:43:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOaTW-00031Z-Iu; Fri, 20 Dec 2024 05:43:18 -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 1tOaTV-0002yJ-56; Fri, 20 Dec 2024 05:43:17 -0500 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOaTT-0005GK-J5; Fri, 20 Dec 2024 05:43:16 -0500 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-2166360285dso16684995ad.1; Fri, 20 Dec 2024 02:43:14 -0800 (PST) Received: from wheely.local0.net (14-200-18-130.tpgi.com.au. [14.200.18.130]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee06dfd3sm5376942a91.32.2024.12.20.02.43.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 02:43:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734691393; x=1735296193; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qqqVPjhisoejpakdnzFLtY2uBOq7jpbxi6SFzwY7o/A=; b=RKrV9DC83Z+Iy/E+BcMtbaBdGlikH3kXd7bri9ZZiZe3ZBHMUexCveMBCgbg3JixcD qviP6OrG8rylXzejYqQeDNd76ZP1qfVmsamBzZkkoIzpMxbZ3/l4hzObQgN3lSdfs8zN Pw+5OIwWhzKPEChYcvl8qFiJxxTreBICU9E0DvlnhOnEkLyblU+FtUtEOVORGg8He0XT wnsvwZVGGf9ESbjs8xnfkMeIUExUWQ94fGSKB/Ojq6KpGtDw8jdqYKugwFyne0ms1uHD K8D7IV8v97MQn8lcXbOBIZgToy/EbVEMuNZIzgs16z/L7pcxiYZiib1QvbHcqlpaPfKw 3b3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734691393; x=1735296193; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qqqVPjhisoejpakdnzFLtY2uBOq7jpbxi6SFzwY7o/A=; b=HB7mAtbVNqDVY/fEYUjWpoq8KrdJffh8f2EwM4lSxccxmr6OOYwBS7CsiI0ddlDjcV 9YAVqUo37Rnvn/MHH1C9yh2tvNSrPxKkg9t6yqPnY91E+KQPp9X4N3GIqmkoZYVw+iSc HI8GNyxdfWRS4/5L8RBiEYC/awTYQvOHvV8ExUQvbRBwi0E9cssSdDShrLDbiSEfOngu 7Xj+sKKDOrw2ABdIuswb26lFrUPKx/mGg6g02oE54qOXHy/V1YKoub7otF0pDTrsTHBA 5lMLP1wc1t1sup+XgbnigMiwsUl5ERKlivT6bFJpsF7wm9cTArdrWIWTsMRDP+025kWt oDww== X-Forwarded-Encrypted: i=1; AJvYcCW6gDdPW3TRdw1aJVjtyw8WmK74eD8uz2y97TzCLaWt+KzLivUKmvmwNP22NJFa4BA3CSW2khQM3oh9@nongnu.org X-Gm-Message-State: AOJu0Yzlng8/Zs2xZwlb76/IkfFv8FcAJHA0WsU/m/4z3Loha36/Ds62 AFVlivDELeMiAHRGlJ71ENmtVhkDMSyPIXD+HRwJ1bpOiZ10ifDWHiY0ig== X-Gm-Gg: ASbGncvg9T/FICPazUFBVJnnpy2Ax3ckOQPPrwP82r9idqajmJdMvw5/hVDyKHgTcU8 IIdLcBJbSQ8687d8cKjjHTbCrrS5y5Uu1uOVOkf4fwxHjelowBombkTBtFlypN8iptdCUcIbEAk Us8Sh0PrmPzvu0c0wBDlLqsxdUzpsmgdFs5EhUH1/CKMYw/tUl4gjtrS6NouVe6C8bC6cviw3TV T5MMglDY1s9LB/+i6PP7m0z4E6+NcV/BfVr/djypNvR1T6YeO8N37OhUDE8KFqjDnM8pw/JRna3 hA0zsulSxw== X-Google-Smtp-Source: AGHT+IHvuPhQtfGfPl/FhyQDI1QhJnqg8A5k80OSOsRQ16uzRV3BdG9q3NEZiOVj5aYsiS4WJs3rEg== X-Received: by 2002:a17:90b:5184:b0:2ee:d824:b594 with SMTP id 98e67ed59e1d1-2f452eeb56cmr3146804a91.31.1734691392777; Fri, 20 Dec 2024 02:43:12 -0800 (PST) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kevin Wolf , Hanna Reitz , Pavel Dovgalyuk , Paolo Bonzini , Stefan Hajnoczi , Fam Zheng , Ronnie Sahlberg , John Snow , "Michael S. Tsirkin" , Jason Wang , Vladimir Sementsov-Ogievskiy , Peter Xu , Fabiano Rosas , "Dr. David Alan Gilbert" , Markus Armbruster , Michael Roth , Wainer dos Santos Moschetta Subject: [PATCH 05/17] util/thread-pool: Convert to new bh API Date: Fri, 20 Dec 2024 20:42:07 +1000 Message-ID: <20241220104220.2007786-6-npiggin@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241220104220.2007786-1-npiggin@gmail.com> References: <20241220104220.2007786-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=npiggin@gmail.com; helo=mail-pl1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1734691403633116600 Content-Type: text/plain; charset="utf-8" Convert qemu_bh_schedule() to qemu_bh_schedule_event(), which can specify the clock type, making it compatible with record-replay. The thread pool management does not affect target machine state, so it should use QEMU_CLOCK_REALTIME so it is not recorded and replayed. Signed-off-by: Nicholas Piggin Reviewed-by: Pavel Dovgalyuk --- util/thread-pool.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/thread-pool.c b/util/thread-pool.c index 27eb777e855..010eb4ad9a6 100644 --- a/util/thread-pool.c +++ b/util/thread-pool.c @@ -115,7 +115,7 @@ static void *worker_thread(void *opaque) smp_wmb(); req->state =3D THREAD_DONE; =20 - qemu_bh_schedule(pool->completion_bh); + qemu_bh_schedule_event(pool->completion_bh, QEMU_CLOCK_REALTIME); qemu_mutex_lock(&pool->lock); } =20 @@ -167,7 +167,7 @@ static void spawn_thread(ThreadPool *pool) * inherit the correct affinity instead of the vcpu affinity. */ if (!pool->pending_threads) { - qemu_bh_schedule(pool->new_thread_bh); + qemu_bh_schedule_event(pool->new_thread_bh, QEMU_CLOCK_REALTIME); } } =20 @@ -195,7 +195,7 @@ restart: /* Schedule ourselves in case elem->common.cb() calls aio_poll= () to * wait for another request that completed at the same time. */ - qemu_bh_schedule(pool->completion_bh); + qemu_bh_schedule_event(pool->completion_bh, QEMU_CLOCK_REALTIM= E); =20 elem->common.cb(elem->common.opaque, elem->ret); =20 @@ -225,7 +225,7 @@ static void thread_pool_cancel(BlockAIOCB *acb) QEMU_LOCK_GUARD(&pool->lock); if (elem->state =3D=3D THREAD_QUEUED) { QTAILQ_REMOVE(&pool->request_list, elem, reqs); - qemu_bh_schedule(pool->completion_bh); + qemu_bh_schedule_event(pool->completion_bh, QEMU_CLOCK_REALTIME); =20 elem->state =3D THREAD_DONE; elem->ret =3D -ECANCELED; --=20 2.45.2 From nobody Mon Dec 23 23:20:13 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1734691419; cv=none; d=zohomail.com; s=zohoarc; b=AFtDsd7RgiXQulqSibGLkZBI9yMS04m9vaVto5UTFgZ6XYAAdGQWc2dnXX57xXT5HNhlY2/JA6mWTtyER88ZRNyzcgk0GHm7T4pRwGCIO5ceOfnNuOoIKoNoep85p4vaci7TWp1N0DhofgeIx57umu0mLUSg/6vM3yUwc5mdRT0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734691419; 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=zksXftHHwiMlh0b8VvEId2Ivj+FLbCTYmyX55d90oHA=; b=BKkWe13eJ70VUrEQTrJBxV13dSju7ll+XOidxlSgRCGHNwvwym/wlYGSz6u7PYXIaBhnftjN6nrYyk9TQ7eTyjnvnB3WBXUuni/civ9+lwFnzEz4jGRE0THevaBcooSrO3fCz9eVOw/5yWCsH7UtEyWhYHm4oWAo6pVCysw93QQ= 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 1734691419652210.61640063446794; Fri, 20 Dec 2024 02:43:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOaTf-0003Td-9C; Fri, 20 Dec 2024 05:43:27 -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 1tOaTc-0003LQ-8R; Fri, 20 Dec 2024 05:43:24 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOaTa-0005Ho-KM; Fri, 20 Dec 2024 05:43:23 -0500 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2ef28f07dbaso1233023a91.2; Fri, 20 Dec 2024 02:43:21 -0800 (PST) Received: from wheely.local0.net (14-200-18-130.tpgi.com.au. [14.200.18.130]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee06dfd3sm5376942a91.32.2024.12.20.02.43.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 02:43:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734691400; x=1735296200; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zksXftHHwiMlh0b8VvEId2Ivj+FLbCTYmyX55d90oHA=; b=Gd1lPxw4Z7HqQG6bw/Zn8NioIy2CA1UXuYQQ9yH6agmHjD1fiKUgjIMxPdJ9LJnIj3 3dI3nyBfj2Hs1LWJrUMs6OWDkrxL2tOHxuG4Xblf4yb6iykyg/IiRPH9UJwAFMZwzQZW LRbchVrrnJQX5ltXZzWgjbXYETXkNI3f1gIQMgEF4sg9djybiCened/5lg/uR0x8jd3o lOUc+7rEVSjsM/4Ashfet8WK5R3KUnNu0YnFsjfsCObJu7dbEuVzAsJVnQFX140ntdBZ ECOQE945BZmy4ghyVHg4OL/vlZd+Y1ClMXBQ3Lu5Rcq840RLoDDf/PpJ6X/E6kKURLWB YtEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734691400; x=1735296200; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zksXftHHwiMlh0b8VvEId2Ivj+FLbCTYmyX55d90oHA=; b=N27SwVBcXRkIBF0Wd7DrydHAqkmpdXlwe56qPGu8F9MpDWWUTty6x44DdRJO+GVmAG fe+80BHxPFznCg6vfoVCtvnh81AJ1qig0eYnnNUmbSJrr8m4dqUh13AlcZ0uiN4P7Jlf UVKMcMkO864Xkyn3XakiHYYdFuu8a/SDjqJZB4d9WH5bpIDlLfgwmt8qLxVxj9edIRJD leUdph7Cwh+IFewW6k/SbIMsZJoAI8J5IDswvanyUm5cNsT57qJy6PvfIg6kuifNbjiR Ys2aYyDolsGU8HgcINaGkIhqlO3RUDxZ1PHlCLfJD8Xk4xXjp4ke2NjyS0dX1OgmmIsy nrQw== X-Forwarded-Encrypted: i=1; AJvYcCV2iGKpnV/TeH9nUVJtF6rwlZuhdoNMw7V/4KqJvfCedIGqr6DJtvXZ8DJIhH9QlABjQdknRn4AYBh0@nongnu.org X-Gm-Message-State: AOJu0YwFIvFih5VHlPLlVCEEHmXxNgiAgkvy4uVTn2ngqIZd3NGBRBAK HWq2mc2xY4E+c0VrIxkqPiMxfSFLtI11mmox9deNeInocpq5O5NuRpnYZQ== X-Gm-Gg: ASbGncuVRror67onntK1QLQcZkJ6iCqIzNWaKAwhGvW/pDmp3UVmagfK/5Mzg4z3bZQ Xpqh+fzjyRkvUiM/ETDo3/xL6gPPNa98/FsGsthNWaEeffPRsefOvZ4GkzM/JoWE0oFJO7e8mKu yMif4J/kqrfH3oxdn6sCd0ghQsWHY9ScZRNgVG6xIGNYYKnu1XE4Xfljf7N68A6MQvBJBod+40v zrUha8gZ4/5rwJWN0/zu3wPfbLZlvjzCeXyB7O6ICS1eKttJTdbYM76RbYjqSxrPO7SrxvFjxNb gaakoUmgdg== X-Google-Smtp-Source: AGHT+IHiVTvCdG8c+tqi1QzE1itrqIdqMLNwmktRH+xJ4aSdg114C7HWjkLMwJf8tbeM+EZ1JcD7nA== X-Received: by 2002:a17:90a:d00b:b0:2ee:9a82:5a93 with SMTP id 98e67ed59e1d1-2f452e1d13amr4007490a91.14.1734691400492; Fri, 20 Dec 2024 02:43:20 -0800 (PST) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kevin Wolf , Hanna Reitz , Pavel Dovgalyuk , Paolo Bonzini , Stefan Hajnoczi , Fam Zheng , Ronnie Sahlberg , John Snow , "Michael S. Tsirkin" , Jason Wang , Vladimir Sementsov-Ogievskiy , Peter Xu , Fabiano Rosas , "Dr. David Alan Gilbert" , Markus Armbruster , Michael Roth , Wainer dos Santos Moschetta Subject: [PATCH 06/17] util/aio-wait: Convert to new bh API Date: Fri, 20 Dec 2024 20:42:08 +1000 Message-ID: <20241220104220.2007786-7-npiggin@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241220104220.2007786-1-npiggin@gmail.com> References: <20241220104220.2007786-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=npiggin@gmail.com; helo=mail-pj1-x1032.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1734691421468116600 Content-Type: text/plain; charset="utf-8" Convert qemu_bh_schedule() to qemu_bh_schedule_event(), which can specify the clock type, making it compatible with record-replay. aio_wait_kick does not affect target machine state, so it should use QEMU_CLOCK_REALTIME so it is not recorded and replayed. Signed-off-by: Nicholas Piggin Reviewed-by: Pavel Dovgalyuk --- util/aio-wait.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/aio-wait.c b/util/aio-wait.c index b5336cf5fd2..2137abd4d29 100644 --- a/util/aio-wait.c +++ b/util/aio-wait.c @@ -51,7 +51,8 @@ void aio_wait_kick(void) smp_mb(); =20 if (qatomic_read(&global_aio_wait.num_waiters)) { - aio_bh_schedule_oneshot(qemu_get_aio_context(), dummy_bh_cb, NULL); + aio_bh_schedule_oneshot_event(qemu_get_aio_context(), dummy_bh_cb, + NULL, QEMU_CLOCK_REALTIME); } } =20 --=20 2.45.2 From nobody Mon Dec 23 23:20:13 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1734691461; cv=none; d=zohomail.com; s=zohoarc; b=mNypK6z+5fwOO9ClmLmw70A84/0kqD56VzfAaLhJpymK8n/icJl1sI0TM8H2Pb2uJBewJIFBarN6DwWq8WuMZ1bcoUgSyVpb1KAagBeW53UxAQ38F/5dHVhE9hVaHjOvY8KKoICHfXYZr4LqZiwAbrI0V6mJLu7RvjYdTAnWzO8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734691461; 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=QBfCSDwU8LQFcTcaCgA2fhYXCIcXyYzKBDWtkVyojeU=; b=dNssFs+vbdvi3cd+qqToL35HW6iMXVEqaQ98Xhm4IXZkkddUFx4weupwZrU9RDCJ32BLv+5N72oOuQtASF562IGP2mn4qm+bUq3P8T6mbJA/5HWrbVFUxxnIJbYOX6CA+LKMoNut1g5Z7gT8DT298ml8Z+vSsU0XfmYbZttljds= 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 1734691461143251.7310053282182; Fri, 20 Dec 2024 02:44:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOaTl-0004A9-Tr; Fri, 20 Dec 2024 05:43:34 -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 1tOaTk-0003xQ-1M; Fri, 20 Dec 2024 05:43:32 -0500 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOaTi-0005Ii-G7; Fri, 20 Dec 2024 05:43:31 -0500 Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-2ee709715d9so1258535a91.3; Fri, 20 Dec 2024 02:43:29 -0800 (PST) Received: from wheely.local0.net (14-200-18-130.tpgi.com.au. [14.200.18.130]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee06dfd3sm5376942a91.32.2024.12.20.02.43.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 02:43:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734691408; x=1735296208; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QBfCSDwU8LQFcTcaCgA2fhYXCIcXyYzKBDWtkVyojeU=; b=UMjBvM5hrgaMu+hIgdIxaka0q+cLJrV/RVky8EF5veGyIfV4xeyixVhibYUY+TENPs nitOjK9Lbu2gJvWZsKGSmIQxgnMnLtfvrMrO9bAw3UYG1iV79KlgVheTmGVIPLUJLdyn s6SVDecocF0sHW9LDcS1X1ETglJPtGHn/xspihx4NlGg1ZsmZTA3TiAbm3gDkAudMJLf 0RhGyQy/CGgdhNNF23CEdpoIqIXu1b4uDtIOMwwCUvNixiz4cWytQb1zW0O6CghPU5Qm jYwGIbHJUb68yh3ZMQPdtzlJ36IzIIuUcwxOcF9jIdMCDIoKwuBcqgK84hp3Y6JMVpTN Ycwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734691408; x=1735296208; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QBfCSDwU8LQFcTcaCgA2fhYXCIcXyYzKBDWtkVyojeU=; b=Ny7LQbjLr/Ith9sL4tdyW6ZbZBNHtLNBytuemEG1tvoRJ/L5qi/4AMZYziYDRBhKyG Hri0gtW3Bg5WS1ZdVfsUlYb3BTLixXsei7Y7yOqIjTN4O/2MVApvoGfSn5XeycTwGRvc KoUFnGbnruQ0P9fnnh+OjiUT8n3spZuZEMm6BCAzuNtZoqBHdywBm4izW84OmgSnveV5 1irZtCMIltzCDhc5xGSoFZpshbRH8HzjnmR29um4UgS5xdkdxJwIEWHhqRR/A0eegqiB yd6zEA1sgyoWPtpP531oiD4uVFOS+Z9FOcmOFGvdEE31Q+Jyl0rk8y+F2YIlGBmHGoOt tpnw== X-Forwarded-Encrypted: i=1; AJvYcCXyPbQSDlFK2a5DPrTgIlOnKhDwS5hRuVu3aVe7H7rnii096Q1P3s1FjajrLSI+PgRxAAQQbdrm2gs+@nongnu.org X-Gm-Message-State: AOJu0Yw5j7Klhu99sqcgytxr+PTyUhQBMgHLCIJFr6KXzbYbDVt7S8U4 drgUUrU+e1D8OHD6GnFM1FhGlJdaZZlPG/RrzWr3klGnnueqddam50bG8Q== X-Gm-Gg: ASbGncs/Xll0IFrk3UUiVPBUspo+V1O5RXu+utjfFLaIdfby0YS4pXwULZTWjXtTWKX WEOgMEINldXhSXGYNZJ79FS88DEngMBtA3LmBl2eDiMF+tSV645Kn9avzXdn2p9lGYGHdOEzuHM ZUrshGbvDNkYr5cw9z/tLyGxG2blfxVPdHDEChQn0qHzsbO0wxb3AuzjQoTEle9IHih7M4h5nIX YXoLd9vYNBf0zsHrlM8UxUgfhttcVRhwNyXlaYS2By+v8gKWDACKP2z23H7OOBdCeODo2BxG6Zp BM/pCWxApw== X-Google-Smtp-Source: AGHT+IElEt/zuUs5W64t2CXQPKauNpjjfBqCIxRvI+xKK5wXhQOGNM88/BRn+nIaRajHENsjTcXH6Q== X-Received: by 2002:a17:90b:538e:b0:2ee:f80c:6884 with SMTP id 98e67ed59e1d1-2f452eed77emr3868617a91.33.1734691408238; Fri, 20 Dec 2024 02:43:28 -0800 (PST) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kevin Wolf , Hanna Reitz , Pavel Dovgalyuk , Paolo Bonzini , Stefan Hajnoczi , Fam Zheng , Ronnie Sahlberg , John Snow , "Michael S. Tsirkin" , Jason Wang , Vladimir Sementsov-Ogievskiy , Peter Xu , Fabiano Rosas , "Dr. David Alan Gilbert" , Markus Armbruster , Michael Roth , Wainer dos Santos Moschetta Subject: [PATCH 07/17] async/coroutine: Convert to new bh API Date: Fri, 20 Dec 2024 20:42:09 +1000 Message-ID: <20241220104220.2007786-8-npiggin@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241220104220.2007786-1-npiggin@gmail.com> References: <20241220104220.2007786-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=npiggin@gmail.com; helo=mail-pj1-x1029.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1734691461732116600 Content-Type: text/plain; charset="utf-8" Convert qemu_bh_schedule() to qemu_bh_schedule_event() and aio_bh_schedule_oneshot() to aio_bh_schedule_oneshot_event(), which can specify the clock type, making it compatible with record-replay. Coroutine scheduling does not affect target machine state, so it should use QEMU_CLOCK_REALTIME so it is not recorded and replayed. Signed-off-by: Nicholas Piggin Reviewed-by: Pavel Dovgalyuk --- job.c | 3 ++- util/async.c | 2 +- scripts/block-coroutine-wrapper.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/job.c b/job.c index 660ce22c56b..45e9d9fc096 100644 --- a/job.c +++ b/job.c @@ -1109,7 +1109,8 @@ static void coroutine_fn job_co_entry(void *opaque) job->deferred_to_main_loop =3D true; job->busy =3D true; } - aio_bh_schedule_oneshot(qemu_get_aio_context(), job_exit, job); + aio_bh_schedule_oneshot_event(qemu_get_aio_context(), job_exit, job, + QEMU_CLOCK_REALTIME); } =20 void job_start(Job *job) diff --git a/util/async.c b/util/async.c index b88083ecbe7..6ac994effec 100644 --- a/util/async.c +++ b/util/async.c @@ -683,7 +683,7 @@ void aio_co_schedule(AioContext *ctx, Coroutine *co) =20 QSLIST_INSERT_HEAD_ATOMIC(&ctx->scheduled_coroutines, co, co_scheduled_next); - qemu_bh_schedule(ctx->co_schedule_bh); + qemu_bh_schedule_event(ctx->co_schedule_bh, QEMU_CLOCK_REALTIME); =20 aio_context_unref(ctx); } diff --git a/scripts/block-coroutine-wrapper.py b/scripts/block-coroutine-w= rapper.py index dbbde99e39e..c111c322487 100644 --- a/scripts/block-coroutine-wrapper.py +++ b/scripts/block-coroutine-wrapper.py @@ -292,7 +292,8 @@ def gen_no_co_wrapper(func: FuncDecl) -> str: }}; assert(qemu_in_coroutine()); =20 - aio_bh_schedule_oneshot(qemu_get_aio_context(), {name}_bh, &s); + aio_bh_schedule_oneshot_event(qemu_get_aio_context(), {name}_bh, &s, + QEMU_CLOCK_REALTIME); qemu_coroutine_yield(); =20 {func.ret} --=20 2.45.2 From nobody Mon Dec 23 23:20:13 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1734691483; cv=none; d=zohomail.com; s=zohoarc; b=MloUSmWNXxQ8WlECb+2n9oi2jZu/LxWZhnQNn6Uop3AL9bHoAjgbg3flQNbkPumukuPm6TJK243l81IpExuaVpMFtHKtJjweicv1gsnJT/ovuc8TL3VEhBzy8A7m76w/aA3vbmAch0GiudP1n1q+szn1iNTgJ7wzOG7lgzsGHe4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734691483; 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=V0IjIoEMmcVCUPTQhUBxK0EywoWT0wIO+ygbxxKxmGc=; b=kGoWjG81+GEnRj28laJBdPR1F1MyFa5nc8aQFSrYiwG6swjyIzePr1NznVsQiuyoztMu3rYfhIti0eJekAAg4idZyKUWVL5VqbMRIX6vC2UOSlIlbN1sl71ZCPxmcq219xA7vnHt1d/rqCaxM8Mt9R6d5QWG5YWIH/ycoF5gH4I= 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 1734691483370976.0968686712944; Fri, 20 Dec 2024 02:44:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOaTv-00050S-9t; Fri, 20 Dec 2024 05:43:43 -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 1tOaTt-0004rR-Dl; Fri, 20 Dec 2024 05:43:41 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOaTr-0005JZ-DD; Fri, 20 Dec 2024 05:43:40 -0500 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-21631789fcdso19257085ad.1; Fri, 20 Dec 2024 02:43:37 -0800 (PST) Received: from wheely.local0.net (14-200-18-130.tpgi.com.au. [14.200.18.130]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee06dfd3sm5376942a91.32.2024.12.20.02.43.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 02:43:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734691416; x=1735296216; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=V0IjIoEMmcVCUPTQhUBxK0EywoWT0wIO+ygbxxKxmGc=; b=hRR6U6IU0OWyro6znan63w+vdzBXCXf+KL1UjZH5eVBcgfXzki326vjdcXb0cSgiXz pqgttHzIlbm551FYT/pAJr3TN8NY+ZlkIpCrPi2izh3gX/Tiv+OU7bIQZcvH87eGVgoI MXIBvMs5Q1qo1m2OwpwMwOpv/odj9NTU+gdmi/d/RYXyRHKMKtxnBQzhb2OPXyXB+T3G PfnGyNzpEVS1kbXyiPBOQPtzvfFapUG6MuTtLCmaoH53msuWtznoNIwVwcTftHRT16CU t6fUgb008Vly9+nz3VjZ2cFpKVUtMfj+UWGVk0XWzq+Q7ySe+wYdW/ho4iCtTQdYtdWm ZMrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734691416; x=1735296216; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=V0IjIoEMmcVCUPTQhUBxK0EywoWT0wIO+ygbxxKxmGc=; b=E+OsD/22ezu5sV57EZPqrlF0WKzym62Vv7hyVpFIl2mwtLYBJIzYK2/dVnAzKbCv7k cKRfGJGigUv4a9OcENAP9rqsuCAv0UhcwU2dRvKocFCwi8HZCbycepWOLPbOJIyBJJQ+ QkKtOOlD9HjpG9F3KFk4VCqnIws2NrcCvb6mFgCgDX/QpLMzATYGgZZaw6XesPdxp4KB vTS1xr8Igq61wmtaqABf9CBaM/lhgYK0y+CtNNXIT9Y1j0JElsjzbszVXGgOZObLbj6D WMhfU3wN0a/ZlzfAr5ix4wNaHGUo6T9+QU4YZi0nLL1gbhr79kQSW2OD9iig8ar8o/Ad WL6w== X-Forwarded-Encrypted: i=1; AJvYcCXd+5mxN+FPOFQe9e352rrvKgZ+MD7VmV8Ht42+sYrDd5QQaotLhvciWq+ySc1yNP/r94F0EzC5gw+1@nongnu.org X-Gm-Message-State: AOJu0Yyii3OGM46dAZN0QQMAAG/NxJvKL40SdH/Ix0LsCC7CYawETwcd cUEaLt59IfEDFnJNKnokEWhmQmhBpxLONlUucbXZrvu597rkVSD6cOzRBA== X-Gm-Gg: ASbGnctWpsL+uT6jT3pyttHd9OCfEgeLsSHd4lX6kNNIkhNM2+Hlbus3vtXna0rcfU0 7WD1wWikIhYKgg2RcARrq24e4BO+fmclxha6m+F2nC8Vy93OrDvepwfxDFgW4faDuy9l/W/w6R8 aqzhL5YpDpBVAmsbBYMBa2pqDinrYyKkytlWq4dVUaj6phw8ktOFfL5CW5f8oMVkG5Hw1BTovgD eDt5QeVIcv3KC2Bp8xOT2nLZ777XjJA2BMJmyVrCSrSnt6jnwFlx+eoB7/CONAG95fmJh9oT+XY 17db/nZVhQ== X-Google-Smtp-Source: AGHT+IGZOnLDRB9f6nVuNkvmDrIyRKLfWegwsQxJ6Eg03DBqPaPtAt2ggEKMnmkHLsY0oLSOoOVptw== X-Received: by 2002:a17:90b:524d:b0:2ee:9229:e4bd with SMTP id 98e67ed59e1d1-2f4536030d8mr3458864a91.2.1734691415974; Fri, 20 Dec 2024 02:43:35 -0800 (PST) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kevin Wolf , Hanna Reitz , Pavel Dovgalyuk , Paolo Bonzini , Stefan Hajnoczi , Fam Zheng , Ronnie Sahlberg , John Snow , "Michael S. Tsirkin" , Jason Wang , Vladimir Sementsov-Ogievskiy , Peter Xu , Fabiano Rosas , "Dr. David Alan Gilbert" , Markus Armbruster , Michael Roth , Wainer dos Santos Moschetta Subject: [PATCH 08/17] migration: Convert to new bh API Date: Fri, 20 Dec 2024 20:42:10 +1000 Message-ID: <20241220104220.2007786-9-npiggin@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241220104220.2007786-1-npiggin@gmail.com> References: <20241220104220.2007786-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=npiggin@gmail.com; helo=mail-pl1-x634.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1734691483806116600 Content-Type: text/plain; charset="utf-8" Convert aio_bh_schedule_oneshot() to aio_bh_schedule_oneshot_event(), which can specify the clock type, making it compatible with record-replay. Snapsohtting does not affect target machine state, so it should use QEMU_CLOCK_REALTIME so it is not recorded and replayed. Signed-off-by: Nicholas Piggin Reviewed-by: Pavel Dovgalyuk --- migration/savevm.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 98821c81207..8477f116c79 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -3441,8 +3441,9 @@ static int coroutine_fn snapshot_save_job_run(Job *jo= b, Error **errp) SnapshotJob *s =3D container_of(job, SnapshotJob, common); s->errp =3D errp; s->co =3D qemu_coroutine_self(); - aio_bh_schedule_oneshot(qemu_get_aio_context(), - snapshot_save_job_bh, job); + aio_bh_schedule_oneshot_event(qemu_get_aio_context(), + snapshot_save_job_bh, job, + QEMU_CLOCK_REALTIME); qemu_coroutine_yield(); return s->ret ? 0 : -1; } @@ -3452,8 +3453,9 @@ static int coroutine_fn snapshot_load_job_run(Job *jo= b, Error **errp) SnapshotJob *s =3D container_of(job, SnapshotJob, common); s->errp =3D errp; s->co =3D qemu_coroutine_self(); - aio_bh_schedule_oneshot(qemu_get_aio_context(), - snapshot_load_job_bh, job); + aio_bh_schedule_oneshot_event(qemu_get_aio_context(), + snapshot_load_job_bh, job, + QEMU_CLOCK_REALTIME); qemu_coroutine_yield(); return s->ret ? 0 : -1; } @@ -3463,8 +3465,9 @@ static int coroutine_fn snapshot_delete_job_run(Job *= job, Error **errp) SnapshotJob *s =3D container_of(job, SnapshotJob, common); s->errp =3D errp; s->co =3D qemu_coroutine_self(); - aio_bh_schedule_oneshot(qemu_get_aio_context(), - snapshot_delete_job_bh, job); + aio_bh_schedule_oneshot_event(qemu_get_aio_context(), + snapshot_delete_job_bh, job, + QEMU_CLOCK_REALTIME); qemu_coroutine_yield(); return s->ret ? 0 : -1; } --=20 2.45.2 From nobody Mon Dec 23 23:20:13 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1734691461; cv=none; d=zohomail.com; s=zohoarc; b=EuMYExGs8sCA15CZ9G5pgI6H9oVIgpPbB71KBnR6iRIuXeI8wYTtEE+ywE/ChK0HzZH/hmZcZDjSOCv7hVGGWLg2tSsjVlG93C3R1oX81JcVqUGKn2smt+Wy7f7cmPXdAxIqGZuNZ2QOBiyFJFDSp2pGYrlzinTiCvL5pWPtDMk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734691461; 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=NtU2WBbloNvmM8bd+xiOwv1bzHXwrM/Uep66/BPP7j4=; b=cvAHfqRgE8Cr1nTvNdDW4t5E62OMKx5XokyHgHQjD21HNOuJqB28E4wGrybRigAvrrad1ptmYQRmIB9c6BQVLB90lmuDYIeEBqPTDoaIhAZUNRb5pvm3KzuE9me72JKWcneoYSEe9e6eNEhGNs6mUsCYrNDM7HIDHdO0Krouy7Y= 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 1734691460841739.756746876523; Fri, 20 Dec 2024 02:44:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOaU2-0005fh-85; Fri, 20 Dec 2024 05:43:50 -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 1tOaTz-0005S0-CG; Fri, 20 Dec 2024 05:43:47 -0500 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOaTx-0005NN-P3; Fri, 20 Dec 2024 05:43:47 -0500 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-218c80a97caso15009905ad.0; Fri, 20 Dec 2024 02:43:45 -0800 (PST) Received: from wheely.local0.net (14-200-18-130.tpgi.com.au. [14.200.18.130]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee06dfd3sm5376942a91.32.2024.12.20.02.43.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 02:43:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734691424; x=1735296224; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NtU2WBbloNvmM8bd+xiOwv1bzHXwrM/Uep66/BPP7j4=; b=Hq9XZFYIUC4FA33TgDU3u1itPYVFhmq+O84K1QmLo4infpJrmdOXv5TRl0ZkERFc+R bPAXRg94Y+CY5onocxXzUGeglmjSdoqHDfm01DTDwDGeI/2GnPY8Alq4D3ef9xDk1nyx nm0yFl3UOHiAKGJ0jFLkH5AUHVyDuZa3xzl5SGjHHEAXYIZsNI5fp9OYKtwvqRUQ2tRY 8qj4rORZur3WCMnZRTEsCZN6f266MxD6doz38ld1aXsYW4I6C1ZV4BHTmqRYCPcXuXk6 mCCS1AytPWdMXo2O+SYW/ftdPGRSXLUHRDdZupCRGwhzujMXa+VedA0ErMfYX2LJiCAt B4Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734691424; x=1735296224; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NtU2WBbloNvmM8bd+xiOwv1bzHXwrM/Uep66/BPP7j4=; b=J9lWTnI9ZmN8/k/w7SwKKlMwlApMdiaOTe2C1x9zpNptBNb6me10X96PSw8B2Snr8o +S+aX8E8EIAGgdqAW8rmBkMtqxQx6x3LNCIW/bNPy/pKX63hqtsqF5QoORQgKhw3z505 bM9FVCyp2ZlpHccRdUKeO5Z30zfJBdsxExc0KZQjLdWHxY/ahkkpSdHS7DlRVKuIUBtE YbPTumFufw1fal2dqqqfd1Cx89ELF9z7PbKRERw/ciB5iMCkM/CPt49bdlt7u116vxsU SHJSlobzaTzZJjTendmKvROse6jQ0Mh1evEO/zvBCqx1Ur3jjC6BEkZ54nEkgtx3niAJ tpoA== X-Forwarded-Encrypted: i=1; AJvYcCUIPOrcfl6SSDNavs/947rO5OqTz8boCFabZfnyNOw84gcDsMeNMwCTegSWXy4CQ+GH3tUolASaKDw1@nongnu.org X-Gm-Message-State: AOJu0Yz5AZqXvKIDix1XkAiaTsWuQhZZJDoWIGWO28aXWndDP4MVZDQ9 7p1aH2R/NPBKA7LMN8mATvuVNbeX5ae2/mWoGEPkPehcKLr/KuawKX3fBA== X-Gm-Gg: ASbGncuqOjV+/1NXz7dikhuwbyHjDTP1NpdKt0gvRwADJ8zUXO/ndbi1tTLi+KcJnCb G+1IEZG0r0LCjU8aq89us0Xb4Fz98D7CRXbrFCfBpZPf20ITCUBBnotLEUt2dqD1G8aHmd9SWON 4UFOb4v9Umi4fWUsRl48zWf+yFMB+/JG27DGVVTFTtsi7U2XJ6qlmfq8SAhJtBMzDgfGDMUQC30 YUC1HZM5gaNLHkP8ILmeTlotZDVssGBJF/FuF76zPnLS4+6nzCeEe74UO6JkA8zRN+OGIaPXKef Kjn79C0p+A== X-Google-Smtp-Source: AGHT+IGIxTht2CABRku1kWFFweNlzAyHnUbbd/4JeiRH49/oGaO48MkU6bHK00GL5ZI2SpNsSCz/MA== X-Received: by 2002:a17:902:d587:b0:216:5af7:eb2a with SMTP id d9443c01a7336-219e6ebb70bmr37150545ad.33.1734691423848; Fri, 20 Dec 2024 02:43:43 -0800 (PST) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kevin Wolf , Hanna Reitz , Pavel Dovgalyuk , Paolo Bonzini , Stefan Hajnoczi , Fam Zheng , Ronnie Sahlberg , John Snow , "Michael S. Tsirkin" , Jason Wang , Vladimir Sementsov-Ogievskiy , Peter Xu , Fabiano Rosas , "Dr. David Alan Gilbert" , Markus Armbruster , Michael Roth , Wainer dos Santos Moschetta Subject: [PATCH 09/17] monitor: Convert to new bh API Date: Fri, 20 Dec 2024 20:42:11 +1000 Message-ID: <20241220104220.2007786-10-npiggin@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241220104220.2007786-1-npiggin@gmail.com> References: <20241220104220.2007786-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=npiggin@gmail.com; helo=mail-pl1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1734691461705116600 Content-Type: text/plain; charset="utf-8" Convert aio_bh_schedule_oneshot() to aio_bh_schedule_oneshot_event(), which can specify the clock type, making it compatible with record-replay. Monitor creation and input does not affect target machine state, so it should use QEMU_CLOCK_REALTIME so it is not recorded and replayed. Signed-off-by: Nicholas Piggin Reviewed-by: Pavel Dovgalyuk --- monitor/monitor.c | 3 ++- monitor/qmp.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/monitor/monitor.c b/monitor/monitor.c index 56786c0ccc7..accdee88b51 100644 --- a/monitor/monitor.c +++ b/monitor/monitor.c @@ -583,7 +583,8 @@ void monitor_resume(Monitor *mon) ctx =3D qemu_get_aio_context(); } =20 - aio_bh_schedule_oneshot(ctx, monitor_accept_input, mon); + aio_bh_schedule_oneshot_event(ctx, monitor_accept_input, mon, + QEMU_CLOCK_REALTIME); } =20 trace_monitor_suspend(mon, -1); diff --git a/monitor/qmp.c b/monitor/qmp.c index 5e538f34c0d..c6fec04860f 100644 --- a/monitor/qmp.c +++ b/monitor/qmp.c @@ -541,8 +541,9 @@ void monitor_init_qmp(Chardev *chr, bool pretty, Error = **errp) * since chardev might be running in the monitor I/O * thread. Schedule a bottom half. */ - aio_bh_schedule_oneshot(iothread_get_aio_context(mon_iothread), - monitor_qmp_setup_handlers_bh, mon); + aio_bh_schedule_oneshot_event(iothread_get_aio_context(mon_iothrea= d), + monitor_qmp_setup_handlers_bh, mon, + QEMU_CLOCK_REALTIME); /* The bottom half will add @mon to @mon_list */ } else { qemu_chr_fe_set_handlers(&mon->common.chr, monitor_can_read, --=20 2.45.2 From nobody Mon Dec 23 23:20:13 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1734691459; cv=none; d=zohomail.com; s=zohoarc; b=hJc2X6yts7N0bIoLC0alAOJbdaKhkiMHnczV0PFc7KAS6sBLZLjgPz0tRYQisXnTRPpD8DKRlgjTS9IIc34oASI1qgv5JFsjhszlPxNjGI1+AOWXLVYLKDj7KzCosXjJcbZzTjAxLonC3hQPLBrnKTSK6DhFI/B/pjTHsIM3VUo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734691459; 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=3jvfp4tXxGdJYBXXPUHySvHV3oIx1k2wq60uhteeuWk=; b=SA7zLd4QNowAyhI4cu6y4za1hGDYJ/57lWAAPz0I4q98aJtPL6EXlOWP7/OzSysMqNx4q54e57Ea5AO9vMEmpYn8bmcYknRqEb0TxXJm1nyoHgbQmeF2vMKHg31acZHxMTS/dL4nSRo855/7GqZcWU9VK9aM9JwLpI8RuM+jaHo= 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 1734691459541273.5970473833381; Fri, 20 Dec 2024 02:44:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOaUD-00060p-FJ; Fri, 20 Dec 2024 05:44:01 -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 1tOaU7-0005uR-Lu; Fri, 20 Dec 2024 05:43:57 -0500 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOaU5-0005O3-LS; Fri, 20 Dec 2024 05:43:54 -0500 Received: by mail-pg1-x533.google.com with SMTP id 41be03b00d2f7-7fd2ff40782so1534633a12.2; Fri, 20 Dec 2024 02:43:52 -0800 (PST) Received: from wheely.local0.net (14-200-18-130.tpgi.com.au. [14.200.18.130]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee06dfd3sm5376942a91.32.2024.12.20.02.43.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 02:43:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734691431; x=1735296231; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3jvfp4tXxGdJYBXXPUHySvHV3oIx1k2wq60uhteeuWk=; b=ilzwcpYvP7PHwFaUEV+2hOuQJcL0mC5pKg1tSvxmt9ANkwUC8qhFuFT5Jh1+S8w/wU E3PC1+Kv/sCck1wKbbURk71AYlzn5PwhhpJHyPzFZNda2SPykj4PiUxfc0JTxv+ujFkI dgfxzVuTxHYMFtEQNGtobuSlXRdYmDaCBpPnHjBXCGCujt/d7e7/+dE3hVbOuGM4DaIi gC0nj32viyxI5+cN2MTYXK71z8EvgRzRlxthuZGLBSfi2TEZwEFhePVN25cs+2uMLrSh lK05ElngcrF/A5p39bHkdApIAZRWfsHQr888xRX3BT1iG6ZN7UrLvaehYZTMTt9uI3oP XKEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734691431; x=1735296231; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3jvfp4tXxGdJYBXXPUHySvHV3oIx1k2wq60uhteeuWk=; b=GjxA5yaEBU86nKULlObVoWWTGNBzWWdclGks6FusRQRVWuGXCOaIoJaKNOgyTZcIfs tmJRdNKhDiknAjoLgVxcY9VS51YR5aTRcCY6/HGoPId8vxa7xecBgWJgVZJOu1TyJbQF xzXlaD8cYFPyOl/uIIzFEL7Piy8+VbbySIv6GWzIFE3VMMNr2M23+6HBhYoCcMJDk37Q 5N5mEtKH56Ib1kC2WqCEzGLq+0atW3SQuk0YJn8EXMcGhvrey9cpgFZmpogDpxnZxQ4o kSDVSYEtUwhK3ovLSWuuSIx4SjEsASIDt/5LwvYWyradnvjK+LuFA3rBJyiTMRyYap/I 87+g== X-Forwarded-Encrypted: i=1; AJvYcCX5FdI5SNQoh8IYCHJS11lL3Z6LnA102tEAC5jIRJwJLtCYyjCDBzUfkYneLzlXQtJwW4UOu+pheUEn@nongnu.org X-Gm-Message-State: AOJu0Yyp2dnloc24F13PcT1WWWepcVCvBs0fHEwhwa629IDYTYl2slsE kzIh1b74O9qY07yGmL+hgf77k5V4d9SkQ+xXjRw96G1ylVRqPIwFEnQQ/A== X-Gm-Gg: ASbGncsghU5DStpgyGGZGgjPIDkVGxg+dM0qckZACRvVNUPpJJkAhmFu7PilOM3GyB3 jj0Y37YbutMPSATqb0k6xNKBoHzh7vMewDXCZSNiAAbQBZXQSEjHjZTljnFUAKpvfd2vUdeOmjl DYkUScoCiwCy+yjMpfGNiIojIb8doPrc4GLw57WD/tIk0ylUd28Sac9Ed2MJTi7eIS5aH4/q+Lr jonoxzSRR7bGE5wEtqI6q9RBbYVasikmsI6bWKc4kMjm2GJsag12A3BUEf2gmok5Ap4eYpwfqXY 3Gx83c0WRw== X-Google-Smtp-Source: AGHT+IEBXh3mgydDemWGOsIGc+458hM4rBbHR3qnIMTvhJO7NHHHPbbS2Zxl60i2wmMi7Nekxhe8EQ== X-Received: by 2002:a17:90b:2f07:b0:2ea:9ccb:d1f4 with SMTP id 98e67ed59e1d1-2f452d32b5fmr4561997a91.0.1734691431583; Fri, 20 Dec 2024 02:43:51 -0800 (PST) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kevin Wolf , Hanna Reitz , Pavel Dovgalyuk , Paolo Bonzini , Stefan Hajnoczi , Fam Zheng , Ronnie Sahlberg , John Snow , "Michael S. Tsirkin" , Jason Wang , Vladimir Sementsov-Ogievskiy , Peter Xu , Fabiano Rosas , "Dr. David Alan Gilbert" , Markus Armbruster , Michael Roth , Wainer dos Santos Moschetta Subject: [PATCH 10/17] qmp: Convert to new bh API Date: Fri, 20 Dec 2024 20:42:12 +1000 Message-ID: <20241220104220.2007786-11-npiggin@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241220104220.2007786-1-npiggin@gmail.com> References: <20241220104220.2007786-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=npiggin@gmail.com; helo=mail-pg1-x533.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1734691461662116600 Content-Type: text/plain; charset="utf-8" Convert aio_bh_schedule_oneshot() to aio_bh_schedule_oneshot_event(), which can specify the clock type, making it compatible with record-replay. qmp dispatching does not affect target machine state, so it should use QEMU_CLOCK_REALTIME so it is not recorded and replayed. Signed-off-by: Nicholas Piggin Reviewed-by: Pavel Dovgalyuk --- qapi/qmp-dispatch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c index 176b549473c..4a07d75a856 100644 --- a/qapi/qmp-dispatch.c +++ b/qapi/qmp-dispatch.c @@ -254,8 +254,9 @@ QDict *coroutine_mixed_fn qmp_dispatch(const QmpCommand= List *cmds, QObject *requ .errp =3D &err, .co =3D qemu_coroutine_self(), }; - aio_bh_schedule_oneshot(iohandler_get_aio_context(), do_qmp_dispat= ch_bh, - &data); + aio_bh_schedule_oneshot_event(iohandler_get_aio_context(), + do_qmp_dispatch_bh, &data, + QEMU_CLOCK_REALTIME); qemu_coroutine_yield(); } qobject_unref(args); --=20 2.45.2 From nobody Mon Dec 23 23:20:13 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1734691461; cv=none; d=zohomail.com; s=zohoarc; b=iMBBvVoblzXLE/8tbFkB0LAwJtQB1wW5k+OtewrSDSFAgPDFjMpecwyTZcw9ISqlN70ZYlVCzcKlHLguoJlR7MQBRknIyqGxTwORNoMYS8cMLAD7yesYLodEjesx4egc/HLOy23mINYa025O8UFp6oDphspWyEO01GUFxbYpB+8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734691461; 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=Ov1yKiOsdPvfFrptmu7MR0EFv3xHuopr7cPf6vnnWy4=; b=MAiPsjaqDbwQQtR51YknE+uhyOUIg5uVt9ez3nVIcEcxmLOHLUcEJUHbdeC1zn4NGHuBAvlqpH9KtvbexCVbw3kTKcjOjwrhGipmR7RNfbW4/X5FeiITfXmxVBcdclRWnEAd3gk5rtqyCCes1ITdn4kEI5ZDWYvi9UAT+Pjq03Y= 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 1734691461390924.4753759372553; Fri, 20 Dec 2024 02:44:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOaUO-0006YP-Sj; Fri, 20 Dec 2024 05:44:12 -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 1tOaUG-0006LZ-4T; Fri, 20 Dec 2024 05:44:05 -0500 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOaUD-0005Ps-OO; Fri, 20 Dec 2024 05:44:03 -0500 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-7fd17f2312bso1311894a12.0; Fri, 20 Dec 2024 02:44:00 -0800 (PST) Received: from wheely.local0.net (14-200-18-130.tpgi.com.au. [14.200.18.130]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee06dfd3sm5376942a91.32.2024.12.20.02.43.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 02:43:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734691439; x=1735296239; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ov1yKiOsdPvfFrptmu7MR0EFv3xHuopr7cPf6vnnWy4=; b=XYPrpGPUyyYURBoU8tDhf/cCaVy4vDaEV50QJnhYCW3QuBt4zqpYkaYBlXE8ELsbX6 2SlLWFFhpwOB/tc/eZ9ZPFFTIZB20d7mC0LeggmNqZR/ZTR+/l5mhiXf7L3U2RmK6ir7 YRn3mjhTbnabjbBf9sg0SUwwHrsTJqlF171WHwBwANi/4S7/LHtQt+WHYEXQU2V8GqKw TMUnRyPcTYvK52EVaea9rp07OIFHmfbTXJSECzT2wn/hFoKFA7GnA14hrSPpBerVuSV1 Wr3HE5simThAC5EadVw+/n8O0meAR3GBGnRDVOupRANeDlniPCOEJiBk3xnHgtyE9dyd Zsow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734691439; x=1735296239; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ov1yKiOsdPvfFrptmu7MR0EFv3xHuopr7cPf6vnnWy4=; b=R8Yv/Uw9VYMPH5/Ct8xW3lY+Mz9Omnc7QQfYP8FLteTS/41Mv4tCF7HmtjIyN6jSqh Cr9mYXWtjufqlgRb6duTgFbrdu4SNETgPKPT1qUNsxooOah68SgEm0eHAdoNs3I3+W5K 9Tkl/r5BDwumKLqe/8KSTjBQHIrfHyQexbSoV4VxQr3uEwLcmgYDNcz+/MA8htAV3V/G 0iFxRwoWpT1cNvD2pKpSzHW0sKzbLmTLbNpG7FZsQf8cEYEl7lH7HmZYTw9JLtF+ofWq uro2q2L1Q9dJTzQwvyz0U1G2sQ5At1gXqZxdO2blboG16Xv38CZYoo2Bw07cxJPCd0Re qNKA== X-Forwarded-Encrypted: i=1; AJvYcCUVli86TQNnkMOZfd6ZC53C2E8k0zcchQKBfTH0sP/XEI9p+I6LYhtGA1LQy9fFZxYrQfNyZjzkzqSl@nongnu.org X-Gm-Message-State: AOJu0Yz4Y4kgjUWakMs/mROjUAyTRj2lI5fG/uh+rjrKLiCDn9E5gBQe N7YtRGkOJTmOVPHeHPQGNfP6zRGTILRcA5P/rOjfB+DPruSD/C9BcocHVw== X-Gm-Gg: ASbGncvmPiqD5vUCbdsXVnV0IWsHK4gZeudsaQDA5cio+3UP+3A6U0tYmKibiS5j2dm 4C3F3r1xz5pV/QsGMVWF38qkibwBleENbz98wRQtM87nzCa7FmnmuJHN9eSvKrAeUGa97DG31Bt DAewRHRcsLNJtMaMlWnd7W4dsim5OvynC//anfOYt+l3qfo9vjgTR2bGkze4EeLV0KvrdFelEaM Iwyn/nntPRf/90UOBwW1tUnREyREcvLvdz5X2N7aX4LfpoVmAS+0w93TbrJFvrXcd55CiAIs8Vf B0cyhJcl0Q== X-Google-Smtp-Source: AGHT+IFvRyMq8CdIVQg0yGz2vSHPh1Q6JBHCFzvh0AcDChmEcYMn2r5HtpVkz+aKO0r/TzoPfaqpOw== X-Received: by 2002:a17:90b:3cc6:b0:2ee:aa95:6de9 with SMTP id 98e67ed59e1d1-2f452eed7e1mr3872323a91.33.1734691439408; Fri, 20 Dec 2024 02:43:59 -0800 (PST) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kevin Wolf , Hanna Reitz , Pavel Dovgalyuk , Paolo Bonzini , Stefan Hajnoczi , Fam Zheng , Ronnie Sahlberg , John Snow , "Michael S. Tsirkin" , Jason Wang , Vladimir Sementsov-Ogievskiy , Peter Xu , Fabiano Rosas , "Dr. David Alan Gilbert" , Markus Armbruster , Michael Roth , Wainer dos Santos Moschetta Subject: [PATCH 11/17] block: Convert to new bh API Date: Fri, 20 Dec 2024 20:42:13 +1000 Message-ID: <20241220104220.2007786-12-npiggin@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241220104220.2007786-1-npiggin@gmail.com> References: <20241220104220.2007786-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=npiggin@gmail.com; helo=mail-pg1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1734691461797116600 Content-Type: text/plain; charset="utf-8" Convert qemu_bh_schedule() to qemu_bh_schedule_event() and aio_bh_schedule_oneshot() to aio_bh_schedule_oneshot_event(), which can specify the clock type, making it compatible with record-replay. unreferencing a bdrv does not affect target machine state, so it should use QEMU_CLOCK_REALTIME so it is not recorded and replayed. blkreplay has cases at startup where the device is used before the event code is set up, so it needs special handling to avoid creating bh replay events. Signed-off-by: Nicholas Piggin Reviewed-by: Pavel Dovgalyuk --- include/block/aio.h | 9 +++++++++ block.c | 4 +++- block/blkreplay.c | 10 +++++++++- replay/replay-events.c | 7 ++----- util/async.c | 5 +++++ 5 files changed, 28 insertions(+), 7 deletions(-) diff --git a/include/block/aio.h b/include/block/aio.h index bc323b0d936..26859bd0b93 100644 --- a/include/block/aio.h +++ b/include/block/aio.h @@ -405,6 +405,15 @@ int aio_bh_poll(AioContext *ctx); */ void qemu_bh_schedule_event(QEMUBH *bh, QEMUClockType clock_type); =20 +/** + * qemu_bh_schedule_event_noreplay: Schedule a bottom half avoiding replay. + * + * This function is not to be used outside record-replay code. + * + * @bh: The bottom half to be scheduled. + */ +void qemu_bh_schedule_event_noreplay(QEMUBH *bh); + /** * qemu_bh_schedule: Schedule a bottom half. * diff --git a/block.c b/block.c index 7d90007cae8..77e6c6b3c7e 100644 --- a/block.c +++ b/block.c @@ -7144,7 +7144,9 @@ void bdrv_schedule_unref(BlockDriverState *bs) if (!bs) { return; } - aio_bh_schedule_oneshot(qemu_get_aio_context(), bdrv_schedule_unref_bh= , bs); + aio_bh_schedule_oneshot_event(qemu_get_aio_context(), + bdrv_schedule_unref_bh, bs, + QEMU_CLOCK_REALTIME); } =20 struct BdrvOpBlocker { diff --git a/block/blkreplay.c b/block/blkreplay.c index 792d980aa9d..c6b9d91062e 100644 --- a/block/blkreplay.c +++ b/block/blkreplay.c @@ -67,7 +67,15 @@ static void block_request_create(uint64_t reqid, BlockDr= iverState *bs, .co =3D co, .bh =3D aio_bh_new(bdrv_get_aio_context(bs), blkreplay_bh_cb, req), }; - replay_block_event(req->bh, reqid); + if (replay_events_enabled()) { + replay_block_event(req->bh, reqid); + } else { + /* + * block can be used before replay is initialized. Work around + * that here. + */ + qemu_bh_schedule_event_noreplay(req->bh); + } } =20 static int coroutine_fn GRAPH_RDLOCK diff --git a/replay/replay-events.c b/replay/replay-events.c index d4b095b2097..6a7c27cac1e 100644 --- a/replay/replay-events.c +++ b/replay/replay-events.c @@ -154,11 +154,8 @@ void replay_add_input_sync_event(void) =20 void replay_block_event(QEMUBH *bh, uint64_t id) { - if (events_enabled) { - replay_add_event(REPLAY_ASYNC_EVENT_BLOCK, bh, NULL, id); - } else { - qemu_bh_schedule(bh); - } + g_assert(events_enabled); + replay_add_event(REPLAY_ASYNC_EVENT_BLOCK, bh, NULL, id); } =20 static void replay_save_event(Event *event) diff --git a/util/async.c b/util/async.c index 6ac994effec..5d2c76dec08 100644 --- a/util/async.c +++ b/util/async.c @@ -261,6 +261,11 @@ void qemu_bh_schedule_event(QEMUBH *bh, QEMUClockType = clock_type) } } =20 +void qemu_bh_schedule_event_noreplay(QEMUBH *bh) +{ + aio_bh_enqueue(bh, BH_SCHEDULED); +} + void qemu_bh_schedule_idle(QEMUBH *bh) { aio_bh_enqueue(bh, BH_SCHEDULED | BH_IDLE); --=20 2.45.2 From nobody Mon Dec 23 23:20:13 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1734691465; cv=none; d=zohomail.com; s=zohoarc; b=CtMrqJz3+9s91AZWOZCoubT+E0a/IE0bLDJ43yQqgf18WwGcktyowJ6VJ1tNx9DlcP7bh1ugGckRDa+eIaugbl9CufS88lFgy3yej0h2feQZL+zUVcIOgjMk5G/tRHLERnfiFrkYg0plTF0olYPMVQfeOaCPFoTaF1157naHlM0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734691465; 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=6iYuLZgbonS1IR/x+IP4SM/fqY76/CEG9s7cHCYyGpU=; b=gocFYXcTo90vY40w8I2nBsphcQFhS+smH9ZwX6VrZ/SJt6u/+YpgcDoxsTPBZYL81mOOLgN20PQTs2WmQtZn6j+Gd/4Ywzhaz/DNI/ckQ6ImpT8iGAfQkku6Vag4eE75eDzvD3TvXfeVQnHmP5FibMBSS9l5RIAlEeZFhGF49wU= 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 1734691464987613.1876270956154; Fri, 20 Dec 2024 02:44:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOaUQ-0006jF-C2; Fri, 20 Dec 2024 05:44:14 -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 1tOaUN-0006Ua-Gf; Fri, 20 Dec 2024 05:44:11 -0500 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOaUM-0005QP-5C; Fri, 20 Dec 2024 05:44:11 -0500 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-21654fdd5daso16183195ad.1; Fri, 20 Dec 2024 02:44:08 -0800 (PST) Received: from wheely.local0.net (14-200-18-130.tpgi.com.au. [14.200.18.130]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee06dfd3sm5376942a91.32.2024.12.20.02.43.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 02:44:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734691447; x=1735296247; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6iYuLZgbonS1IR/x+IP4SM/fqY76/CEG9s7cHCYyGpU=; b=A9J3o0jVwZN8Ch2KrnAq5ukWGssEAru3VnCLLGlxR4a0rdfi2Ew9fWrYLicFmvVCG5 qBCazDK7jghAc1zfhkcxy36/NycMCFJMLOGhm6HRnTs/gyKhUO0TZIxTPLtXhsnYnVMt Jy/xU5yWx8WTxeEb0DsTuOBxm5Gumw2xHbLS8sQ4TUWDntuDT2YIEBbMgt1yLa1Eejiv zn8Bu5dkIXc//DOHQ9n9VSQQwfBLXJ6QGwYvCzobArJYA2Xc6G/zkrQJnNZ9thQg5Kid UnFCtWvLAiPluD6DGXZDKR1T6l+jR2TTqTI0aFO8XtrvrpaJDwEIOe6AD8JmtTaV+o5o 0+LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734691447; x=1735296247; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6iYuLZgbonS1IR/x+IP4SM/fqY76/CEG9s7cHCYyGpU=; b=OAzhTuotXekheJZDDI7GIR3K6pIQsacafYOB52pdMhAxHhZk8l29wvVhBFo1AgxTfJ 3x6PFdzbGapijmvNs36AgvHFUwsZ3wqawv/b0fFOAt6MA9LhfYzxgGG1iu+28g6+r5xA omc3/dNA6DSpq+TvifWQN3F66jjQ1RPXK5R4/kMzpDp+Hxr4osjSAMs4omtdFna8R+sQ B7vK76LPwfFL6c8NB0wr7bpaBzCl0veP5b8rD2fLlYOMm+DxMFvddBEAG0EJ8i6yohYo O2Y0fHiDC6K5wAEYiLArMEOvJi80xPFPwZTQw6w96pBrZfzn469Sf+lP8zPh1cTPtOJo nm5A== X-Forwarded-Encrypted: i=1; AJvYcCXD3KwIlJSxAEUkUuG5oAjuNU77fGkWdldUNINeyxvTc+X/4xTee1l7odlx+2+o/z7hpPtjVXn34dS1@nongnu.org X-Gm-Message-State: AOJu0YzSRqgFjwSA7HeWEWOz/OyH/0i2UF+ZpmMSSb8J4W5QpWU2F/Yw vciAb+mVi8mXVhQxYQnw9trJ2n7lnI24nLJB8lf6ciEhkNH4o/HHWRcGrg== X-Gm-Gg: ASbGncsKh85AAoKmbHM1V55lPgZsTcO1qZ+9BVSvn+kDgUD7i3OeBd+LgSLyMHPlerO p9hxAoxVF9+SzHhu2Vi0ujvSMJreWkq0NE1B8JKsZ/TEpIPaTcgcwMz87dDx4QK+dW4YaUH6mCh XDrWUL4pox01nBBmY5Y2S6os9nEfQN/yP3p6eDdzf00/hqEnnSgB62+6P6uHbJjoaDWfXa1HcVV ymcR4AYjgkoiETctfyK8Y53P29i2ts5XCM8oio35N6tck8WgOH/rTlCPNV1xiijl5CizoefMUCU cT/yjsNfrg== X-Google-Smtp-Source: AGHT+IG3aaxYwAaHxmCsiQXVE89K6qWiw4Q2poUWePsa42NqcKFrbxoScOGi5DQ8TIshqinb/y/L0g== X-Received: by 2002:a17:90b:2652:b0:2f2:ab09:c256 with SMTP id 98e67ed59e1d1-2f452f01cd4mr3873285a91.33.1734691447161; Fri, 20 Dec 2024 02:44:07 -0800 (PST) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kevin Wolf , Hanna Reitz , Pavel Dovgalyuk , Paolo Bonzini , Stefan Hajnoczi , Fam Zheng , Ronnie Sahlberg , John Snow , "Michael S. Tsirkin" , Jason Wang , Vladimir Sementsov-Ogievskiy , Peter Xu , Fabiano Rosas , "Dr. David Alan Gilbert" , Markus Armbruster , Michael Roth , Wainer dos Santos Moschetta Subject: [PATCH 12/17] hw/ide: Fix record-replay and convert to new bh API Date: Fri, 20 Dec 2024 20:42:14 +1000 Message-ID: <20241220104220.2007786-13-npiggin@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241220104220.2007786-1-npiggin@gmail.com> References: <20241220104220.2007786-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=npiggin@gmail.com; helo=mail-pl1-x62f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1734691465687116600 Content-Type: text/plain; charset="utf-8" Convert qemu_bh_schedule() to qemu_bh_schedule_event(), which can specify the clock type, making it compatible with record-replay. Restarting the IDE device does affect target machine state, so it should use QEMU_CLOCK_VIRTUAL to recorded and replay the bh. This fixes hangs in record/replay when using IDE devices. Signed-off-by: Nicholas Piggin Reviewed-by: Pavel Dovgalyuk --- hw/ide/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index c527caf3d69..500ea73c8be 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -2780,7 +2780,7 @@ static void ide_restart_cb(void *opaque, bool running= , RunState state) =20 if (!bus->bh) { bus->bh =3D qemu_bh_new(ide_restart_bh, bus); - qemu_bh_schedule(bus->bh); + qemu_bh_schedule_event(bus->bh, QEMU_CLOCK_VIRTUAL); } } =20 --=20 2.45.2 From nobody Mon Dec 23 23:20:13 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1734691463; cv=none; d=zohomail.com; s=zohoarc; b=XXjPKFmHJRvQbM8lS1x+aIVuz69lDQTpHtBtA8blufqx/iXE/ZLtHZprOteBjjBuflxAeqY6EqyiRTrDW0zf7pm0DOw27whzdQHL/RWpKgpE/BNU/C1S1+kDER3ZvJUMSA7GDYS3DZetuGkCk/XXob+lVNmexsLWO4KXCcdl7ZE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734691463; 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=gK96j8dWCREGXgJwMGuVlSSEE1tC1GR6d2jBmPlZZVA=; b=Dkb2cGCzespwoOhOOpzOoMzdrY9SXnamttJ8TyN1fw6PbpaDLt1WWff9x+1I2wwc+N5pdkiSLjNK80rnh3oX+Pt7efAZDahXz9g00Qg0dzBcIiQlnQbwFuGstvnqZJHEzohNTjszm8dvhczHMYt7FTZaBtjvJZOIW3rdZ2UwPBQ= 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 1734691463449383.4261106500712; Fri, 20 Dec 2024 02:44:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOaUV-0007LA-SE; Fri, 20 Dec 2024 05:44:20 -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 1tOaUU-0007CF-Hw; Fri, 20 Dec 2024 05:44:18 -0500 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOaUS-0005Rd-Tj; Fri, 20 Dec 2024 05:44:18 -0500 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-7fd17f2312bso1312076a12.0; Fri, 20 Dec 2024 02:44:16 -0800 (PST) Received: from wheely.local0.net (14-200-18-130.tpgi.com.au. [14.200.18.130]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee06dfd3sm5376942a91.32.2024.12.20.02.44.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 02:44:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734691455; x=1735296255; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gK96j8dWCREGXgJwMGuVlSSEE1tC1GR6d2jBmPlZZVA=; b=Td4f1Tv/JfnZL4Elus48aX0gwrTK+3D9BAR1rhG+S9ZDf5r+MbPpEej2OHWGQ9SE5q NX5tXU+yPVS14BSZv2j3Zzjtz80qT7PIsfs6YueG0QE57p0wgBENEKQRHOsJ1s1vYVjg kli6C0VgsCrdwdUGX5OonMoMPmx65TVMVCYnUDyOmVX3/06Ke6JUPxxUyoxiVy9oVzw7 S+rcgBa9KtXNHVoc/FXXNeiT2tkotVB3CnCKfD5Z5GgUMua6+GIKNKEPdYcZ+usKfkRF svcnv2yzPyqA1H94YfG0ct4ySqFQrCeM/DDB89dTcbMTq9Si1eHoal9NXOW5tWkGRikU 8SKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734691455; x=1735296255; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gK96j8dWCREGXgJwMGuVlSSEE1tC1GR6d2jBmPlZZVA=; b=Ahsmf0b4d2pVjYjf+e2Sh1VuV0AdmxQySgDFkh+iMuvp5/BhF0jR5r/OU8G88nwEaf AdU/XgE45NkfHpqDUUXY/aj2lHtYrwIIV3B77fCS/xKNQwjrIuzJViu9hPO9cBFvyLxq r/L+II3JqParF4+uC9TiRAC1oPrFEcNiCN82jdWKfH1+OtfAF6QAY9k9PfgrL2KWslcz 2bLJfwHFq8Go5G/wReOXJQlDicXu2Y6+WnOtu+N1Mqv/+ibzzC73FdDA0pNXE/CDmVVq Uu5YhBqBd4IqiwyVotsDtrCqu+EMf1x3F+wcnvNaYMVLRUwmdZeLhXN/IZSAx84esNuJ 4LKQ== X-Forwarded-Encrypted: i=1; AJvYcCWpuaqZyI4QlOFVqeC4+iIctq/SkI79apOe8eSZRS/pUeA23moMPCj6c8FbudjlpiEJ5Mw+pE8L6L5K@nongnu.org X-Gm-Message-State: AOJu0YyG5HUbnjwd68ewoFiT2WsWipkRa75IcOMuIGgHXDM0N20Hrw5C MhlzvJQTlb8ntTswDgtBwMnJ7que1YNBG9WGBjo/2xlxqaW23/BHi6KEzQ== X-Gm-Gg: ASbGnctQUD3J9C6quxt+dsm0jA+2MQNqntBnpBNWuj2Exg6Z2PlfBRYn1OC0DuTEY51 qTHygBFoL7S13cpuc/SiqxhgLUcPinKBFBOMQyzNC1hvJ9u3O/EwaUdVIq8ft3r/9bYSpyLZIDu GK9skYJ785Yrr8UamCHAr5QVtC48MecGSMN3+K7DxbcQ+nZJykfqw5QI6Isn4l/NsqO+NQ1zjXP uSzeiqdOb4oRBEeNxaReHGi6mtEY5YZNw/HzRHtvHQQVfKIdDDgRTBTIdJq66HhjiF/VHRc2r1c PQc8gTsNpw== X-Google-Smtp-Source: AGHT+IHZFHLin5x6wJnLdKPCeP9ORVvAm7tn/Fzr3fGVEOIA6Fdk4Fw0nxh1zvmUre6+GFtkqiZjSg== X-Received: by 2002:a17:90b:134d:b0:2ea:4c4f:bd20 with SMTP id 98e67ed59e1d1-2f452eed773mr3451099a91.32.1734691454890; Fri, 20 Dec 2024 02:44:14 -0800 (PST) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kevin Wolf , Hanna Reitz , Pavel Dovgalyuk , Paolo Bonzini , Stefan Hajnoczi , Fam Zheng , Ronnie Sahlberg , John Snow , "Michael S. Tsirkin" , Jason Wang , Vladimir Sementsov-Ogievskiy , Peter Xu , Fabiano Rosas , "Dr. David Alan Gilbert" , Markus Armbruster , Michael Roth , Wainer dos Santos Moschetta Subject: [PATCH 13/17] hw/scsi: Convert to new bh API Date: Fri, 20 Dec 2024 20:42:15 +1000 Message-ID: <20241220104220.2007786-14-npiggin@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241220104220.2007786-1-npiggin@gmail.com> References: <20241220104220.2007786-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=npiggin@gmail.com; helo=mail-pg1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1734691463681116600 Content-Type: text/plain; charset="utf-8" Convert aio_bh_schedule_oneshot() to aio_bh_schedule_oneshot_event(), which can specify the clock type, making it compatible with record-replay. Operations on SCSI reqs do affect target machine state, so it should use QEMU_CLOCK_VIRTUAL to recorded and replay the bh. This fixes hangs in record/replay when using SCSI devices. Signed-off-by: Nicholas Piggin Reviewed-by: Pavel Dovgalyuk --- hw/scsi/scsi-bus.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 2f1678d51e7..16f294ce6b7 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -166,9 +166,17 @@ static void scsi_device_for_each_req_async(SCSIDevice = *s, =20 /* Paired with blk_dec_in_flight() in scsi_device_for_each_req_async_b= h() */ blk_inc_in_flight(s->conf.blk); - aio_bh_schedule_oneshot(blk_get_aio_context(s->conf.blk), - scsi_device_for_each_req_async_bh, - data); + + /* + * This is called by device reset and does not affect the observable s= tate + * of the target (because it is being reset), and by scsi_dma_restart_= cb + * to restart DMA on vmstate change which also should not affect the s= tate + * of the target (XXX is this really true?), so QEMU_CLOCK_REALTIME sh= ould + * be used to avoid record-replay of the bh event. + */ + aio_bh_schedule_oneshot_event(blk_get_aio_context(s->conf.blk), + scsi_device_for_each_req_async_bh, + data, QEMU_CLOCK_REALTIME); } =20 static void scsi_device_realize(SCSIDevice *s, Error **errp) --=20 2.45.2 From nobody Mon Dec 23 23:20:13 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1734691477; cv=none; d=zohomail.com; s=zohoarc; b=YuagrNcywwlzVEQuA1YrO0CT8ylqQdb2lBhIgch03Pt6ncx2Q/VCoIHtC8QIEYh7wzHQGNuOth+FblTOBSPTwc3WT4FBMR6f0sBe8xN70IgO2b+0i2Yl1TY4p0tkZPUYZDpGKpvyy/qcRXzVaQ2uBV7Me1tPHcU5Z3pIg57yoKE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734691477; 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=Wu+GL4+vvCQpuAOpV7VcZuV6PKMa6EXzctMojFuS3jU=; b=WfBG7JuN10n9vnT7uShQdKL/+PX4Y68Q0x9Xw8AyjWj0Svekbsy+nIU1xLcijfYRjU7P5WNhO0aO9+XzL2h9Bl3xQo+vTNK1DHNHuayOHh6uihKZhseDfQxnUQR3muPlS1B2SGXi7gIDsclIuNBZNlWW0seB1UG4VQ13ixPPQZc= 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 1734691477553389.76370825356094; Fri, 20 Dec 2024 02:44:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOaUf-0000Cd-L7; Fri, 20 Dec 2024 05:44:29 -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 1tOaUd-0008VK-Eq; Fri, 20 Dec 2024 05:44:27 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOaUa-0005SS-R3; Fri, 20 Dec 2024 05:44:27 -0500 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-2163dc5155fso15854415ad.0; Fri, 20 Dec 2024 02:44:24 -0800 (PST) Received: from wheely.local0.net (14-200-18-130.tpgi.com.au. [14.200.18.130]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee06dfd3sm5376942a91.32.2024.12.20.02.44.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 02:44:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734691462; x=1735296262; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Wu+GL4+vvCQpuAOpV7VcZuV6PKMa6EXzctMojFuS3jU=; b=g8nmJoopduObIxSCzsD1/+ag+d1xNQlQj9VY16XOOSqu5uPa2g3CgUXAAVSRvKtNmH DqJ4kG/rDNm+InpiSHqGKktpvzNy0EU/sWgghJ48j9D2bqfxGT5/rzs48mNWPetI2HHM 0Z7l/VuLb3/npq+3v6R5FfqePX8cSJz/QuNqfOfbrW0XssNmbN3JTpFobnPdOZ9ikwyE 33SJke5ZkjdbxzKVywdp817SzKNqHIW8EkjdAdbCvQaiM6PmQJSJrMdt1eyoCKP2QV23 MGm20yDEh6lR9le0w0nKg46ItBHrsv6MXnypNihUHAc+Pa3cHuzivulSRdA9TLhGcVJc yR2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734691462; x=1735296262; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Wu+GL4+vvCQpuAOpV7VcZuV6PKMa6EXzctMojFuS3jU=; b=p+3DnTFC0c+6G4O/f4SYCqoCEZYU3IMNmFxDxkGyLi2vtHGpXt2b7VX+pKMnjqR+4R mcDvSHLIFLx6IRr/6Vm3LycxDdJHCI4/mSUYwDwJjKOLiawooAdSEYHxE8hBcPyRsYgf FuG1LHwEnFOmLR1AmT4N7ILYD3g5ON8YrgEjVm5KrI9cOdtAF1vcvpRGETBAi1lDhPhc pYZRLT/cl5Vy+7qh0L3FD5z38S29hlMESOU2iXr3mjvhtZGWV4kzK3JBSt9Kk7NPNWpr a7reB4tkuU/0m98i7ykan6zypJjjG6r4fEhvwZ9ulqPB5aCmkoOdQ9r7TEhTEeIHddpp F94g== X-Forwarded-Encrypted: i=1; AJvYcCWoy4EloHvCbLiu8E46LU3g1QzBuok0nTgARK2o87gi1OinEJ1dJKak6P3MfTtHiDjtXImxl4Ki4WOi@nongnu.org X-Gm-Message-State: AOJu0YxubPC7pfiejFxK4YEd4pjMythhLGgJWEuMnNWsOCU39cYXScAR qU63FQINAJPGgZdEosrJjK1rFJ0AJm1Lxfr/2PlTUloY4N8MKuCXffucug== X-Gm-Gg: ASbGnctO4+TWsi6mlwKTp5Q57dt842qm8Bzl34RCYw4ktg+CK7zXd0xBF1JzAZPm/iB YIYNMPQhG+KhCudmYkdpglWYdIJPi+H8wM7uldSels0BxFXUW2AXcrcoW6oMCLrukP9PsBN/HDY CCoXxleBIbUzks42BBzxEvXk2oBdnFZ2osZbjdX/VHkjrMBVX6HUg/nm05hLI/EB4SIQabGFhJI kuyMgFwVc0OVl3Zhek/nc7fAxTM5h3jmF6E3++QvyIcFb+PwLW2g8f2Di2ALuPWsKU8SQFsopti krAHOjIkiw== X-Google-Smtp-Source: AGHT+IH8c/AWBwB0fOu47PM6NedBBLoYnyCAzWnEUS+m31wqpGtz3tPAybi9eDUQLAzIWKxjcC8uuw== X-Received: by 2002:a17:90b:53c5:b0:2ee:74a1:fb92 with SMTP id 98e67ed59e1d1-2f452dfd236mr3611190a91.6.1734691462603; Fri, 20 Dec 2024 02:44:22 -0800 (PST) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kevin Wolf , Hanna Reitz , Pavel Dovgalyuk , Paolo Bonzini , Stefan Hajnoczi , Fam Zheng , Ronnie Sahlberg , John Snow , "Michael S. Tsirkin" , Jason Wang , Vladimir Sementsov-Ogievskiy , Peter Xu , Fabiano Rosas , "Dr. David Alan Gilbert" , Markus Armbruster , Michael Roth , Wainer dos Santos Moschetta Subject: [PATCH 14/17] async: add debugging assertions for record/replay in bh APIs Date: Fri, 20 Dec 2024 20:42:16 +1000 Message-ID: <20241220104220.2007786-15-npiggin@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241220104220.2007786-1-npiggin@gmail.com> References: <20241220104220.2007786-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=npiggin@gmail.com; helo=mail-pl1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, TVD_PH_BODY_ACCOUNTS_PRE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1734691479945116600 Content-Type: text/plain; charset="utf-8" Code using old bh APIs must be updated to account for whether the bh is related to the target machine model or host QEMU operation, in order for record/replay to work properly. Add some assertions in the old APIs to catch unconverted code when record/replay is active. This caught the IDE bug when running replay_linux.py avocado test with the x86-64 q35 non-virtio machine. Signed-off-by: Nicholas Piggin Reviewed-by: Pavel Dovgalyuk --- include/block/aio.h | 2 +- replay/replay-events.c | 20 ++++++++------------ util/async.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/include/block/aio.h b/include/block/aio.h index 26859bd0b93..991aaae707d 100644 --- a/include/block/aio.h +++ b/include/block/aio.h @@ -309,7 +309,7 @@ void aio_bh_schedule_oneshot_full(AioContext *ctx, QEMU= BHFunc *cb, void *opaque, */ #define aio_bh_schedule_oneshot(ctx, cb, opaque) \ aio_bh_schedule_oneshot_full((ctx), (cb), (opaque), (stringify(cb)), \ - QEMU_CLOCK_REALTIME) + QEMU_CLOCK_MAX) =20 /** * aio_bh_new_full: Allocate a new bottom half structure. diff --git a/replay/replay-events.c b/replay/replay-events.c index 6a7c27cac1e..0b3dbfd46b9 100644 --- a/replay/replay-events.c +++ b/replay/replay-events.c @@ -123,23 +123,19 @@ void replay_add_event(ReplayAsyncEventKind event_kind, =20 void replay_bh_schedule_event(QEMUBH *bh) { - if (events_enabled) { - uint64_t id =3D replay_get_current_icount(); - replay_add_event(REPLAY_ASYNC_EVENT_BH, bh, NULL, id); - } else { - qemu_bh_schedule(bh); - } + uint64_t id; + g_assert(events_enabled); + id =3D replay_get_current_icount(); + replay_add_event(REPLAY_ASYNC_EVENT_BH, bh, NULL, id); } =20 void replay_bh_oneshot_event(AioContext *ctx, QEMUBHFunc *cb, void *opaque) { - if (events_enabled) { - uint64_t id =3D replay_get_current_icount(); - replay_add_event(REPLAY_ASYNC_EVENT_BH_ONESHOT, cb, opaque, id); - } else { - aio_bh_schedule_oneshot(ctx, cb, opaque); - } + uint64_t id; + g_assert(events_enabled); + id =3D replay_get_current_icount(); + replay_add_event(REPLAY_ASYNC_EVENT_BH_ONESHOT, cb, opaque, id); } =20 void replay_add_input_event(struct InputEvent *event) diff --git a/util/async.c b/util/async.c index 5d2c76dec08..72a9eccffbe 100644 --- a/util/async.c +++ b/util/async.c @@ -58,6 +58,9 @@ enum { =20 /* Schedule periodically when the event loop is idle */ BH_IDLE =3D (1 << 4), + + /* BH being handled by replay machinery */ + BH_REPLAY =3D (1 << 4), }; =20 struct QEMUBH { @@ -145,6 +148,17 @@ void aio_bh_schedule_oneshot_full(AioContext *ctx, QEM= UBHFunc *cb, void *opaque, const char *name, QEMUClockType clock_type) { + if (clock_type =3D=3D QEMU_CLOCK_MAX) { + /* + * aio_bh_schedule_oneshot() uses QEMU_CLOCK_MAX to say it does not + * know about clock context to use. It will not work in record/rep= lay. + * Callers should be converted to aio_bh_schedule_oneshot_event() + * then this can be removed when the old API goes away. + */ + g_assert(replay_mode =3D=3D REPLAY_MODE_NONE); + clock_type =3D QEMU_CLOCK_REALTIME; + } + switch (clock_type) { case QEMU_CLOCK_VIRTUAL: case QEMU_CLOCK_VIRTUAL_RT: @@ -178,6 +192,12 @@ void aio_bh_call(QEMUBH *bh) { bool last_engaged_in_io =3D false; =20 + if (bh->flags & BH_REPLAY) { + g_assert(!(bh->flags & BH_SCHEDULED)); + g_assert(!(bh->flags & BH_DELETED)); + g_assert(!(bh->flags & BH_PENDING)); + bh->flags &=3D ~BH_REPLAY; + } /* Make a copy of the guard-pointer as cb may free the bh */ MemReentrancyGuard *reentrancy_guard =3D bh->reentrancy_guard; if (reentrancy_guard) { @@ -252,6 +272,7 @@ void qemu_bh_schedule_event(QEMUBH *bh, QEMUClockType c= lock_type) case QEMU_CLOCK_VIRTUAL_RT: if (replay_mode !=3D REPLAY_MODE_NONE) { /* Record/replay must intercept bh events */ + qatomic_fetch_or(&bh->flags, BH_REPLAY); replay_bh_schedule_event(bh); break; } @@ -268,11 +289,15 @@ void qemu_bh_schedule_event_noreplay(QEMUBH *bh) =20 void qemu_bh_schedule_idle(QEMUBH *bh) { + /* No mechanism for scheduling idle replay-scheduled bh at the moment = */ + g_assert(replay_mode =3D=3D REPLAY_MODE_NONE); aio_bh_enqueue(bh, BH_SCHEDULED | BH_IDLE); } =20 void qemu_bh_schedule(QEMUBH *bh) { + /* Callers should be converted to use qemu_bh_schedule_event */ + g_assert(replay_mode =3D=3D REPLAY_MODE_NONE); aio_bh_enqueue(bh, BH_SCHEDULED); } =20 @@ -280,6 +305,8 @@ void qemu_bh_schedule(QEMUBH *bh) */ void qemu_bh_cancel(QEMUBH *bh) { + /* No mechanism for canceling replay-scheduled bh at the moment */ + g_assert(!(bh->flags & BH_REPLAY)); qatomic_and(&bh->flags, ~BH_SCHEDULED); } =20 @@ -288,6 +315,8 @@ void qemu_bh_cancel(QEMUBH *bh) */ void qemu_bh_delete(QEMUBH *bh) { + /* No mechanism for deleting replay-scheduled bh at the moment */ + g_assert(!(bh->flags & BH_REPLAY)); aio_bh_enqueue(bh, BH_DELETED); } =20 --=20 2.45.2 From nobody Mon Dec 23 23:20:13 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1734691499; cv=none; d=zohomail.com; s=zohoarc; b=muU7/RI5mY+0s3dymtaQHbSW6aB+FjanJerFwBV4J1ODWz69D134yI3Qpw6Ip6EgvSVJuUEw/ChcNV9gtjPbO+pwpQuBgo0f7voV9ZE44Fj+2ttU95n6SpSAfZpvoNddmIHkdTf0e/Ve147GUe/Vmc2NnCjZpTcQ3eweK8XwqgE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734691499; 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=UIpQG1unCOgp9RekffLvGrWxvtmfyUlRk2TzuIF/DCI=; b=jVlBSFG3xlKtOXfi/QzvmQLQjOGfkgqERxyRqrABjosDobvb5Qx9X4K79O7GV6QluF/9GG0r6dEGOuAB7Rm4F9qkyAFrcB5zlolFGudPfvoMUSqFqRBoAz7hBo8FkHBM+UZKoksKCHYTbufMfJC7gkSn88Xhh2Lqo05utH+WQiI= 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 1734691499864944.6402760101408; Fri, 20 Dec 2024 02:44:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOaUm-0000ny-0W; Fri, 20 Dec 2024 05:44:36 -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 1tOaUj-0000Yy-QV; Fri, 20 Dec 2024 05:44:34 -0500 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOaUi-0005W6-8g; Fri, 20 Dec 2024 05:44:33 -0500 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-725ed193c9eso1568709b3a.1; Fri, 20 Dec 2024 02:44:31 -0800 (PST) Received: from wheely.local0.net (14-200-18-130.tpgi.com.au. [14.200.18.130]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee06dfd3sm5376942a91.32.2024.12.20.02.44.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 02:44:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734691470; x=1735296270; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UIpQG1unCOgp9RekffLvGrWxvtmfyUlRk2TzuIF/DCI=; b=W2yqO0z1KdfsIrogIbg85sy2qsr/xD+dtf/50wfnuEE1ShOelD7D8zDbvN0nhYDBtc 5ERRp/JGwXSY3xPu1eoG3Pf0e1m/xifdG7RXAcZkIHlsvTEIiooNwJyViufkGg3AMhce Tt/j+EIGFue3gQIobUjXxyY15U3J0It2iuHqKnIHdzz8TyQvcUirbbUsYn0HnBGcTPLv eQnbFc41mi4N7vwH8yHt2h6Q2pOGF+RqPcV6RqZ7BWkfyG8fsLmqsYSqz1S9jrTpf2/l 7Ys7L+HASbI78OKGQ2iV9+JPPvn3/pDOrOsqu4OhxwAma9cyhFNyDJDOBQ6N6dkZEfHK 3lXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734691470; x=1735296270; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UIpQG1unCOgp9RekffLvGrWxvtmfyUlRk2TzuIF/DCI=; b=OWvXWAPyPDBXP+aQTlUcIX2s8BvbLRY+SUJsReC5MzVnCSYjAO6ieT7mmsNsT/3qZe YLW8WDff1U4WaXvChGQ76dUzuUwY7uv6dg3wpuwKtP0LSZtz0u0L8StqDGIk08Gba8Nw 5M678UnpeVljOOlStwzcn/E3apAulSXMNN3BS94bTZHkU1WiQq8uukjUIPY1rg227DJd ZqDuitrdr+O89qNB+lAgjCqAh0vcc12Ehq6GpItQ/wSGV0pZ3uI1Jskpu7QP31Y8ZuGA H+x7lSxcO8v0eW9qY+0UhX8zcSNgyH5P1xjIIj/N0JwCtWnYOsTjKqufErNesTiAADtt SqYw== X-Forwarded-Encrypted: i=1; AJvYcCUZIQGtoepyvvOxaXkdMr6sjQJouuuGCRI5TXqV59qPt/BS2qQOKrFUL2hIZI4AVdli2yyG9UP3CaY5@nongnu.org X-Gm-Message-State: AOJu0YxHJvSLlJHUnX0wfsWWsn1HRlS1fpISXVnRT3zgzfroLVNd3Ul0 bfQBkjbiqmEhJ66MWDnW5dSLdDcpy4kORBEvqnAm4sVeg122GAErg7S2IA== X-Gm-Gg: ASbGncvNEcrsVJa7r/hnPd+L7TEkBlQRZRZYSqfNbMwXFgmoKGwSIn9eJDRswTzBM3s vzxWwHohcBe19sDIAOj+whfmw28f+xE+HC7v7E3xcXGcONnJtaVFi1x6kNS88EoFx2g0D+NYUQp 0UmSsHqDmHHGLGemsb4Ijxh9l2l4A7B0tTWgO0t0Dhcri/MZFgVlRZ4hwIsUbCgkYRRwhIWnBCR 4plKSdz3qCjQ8IizzjKHNGM+83kXbXnX9BPUk1+9hi01aNEVd691xgNLpwVgs6w2/QMeugAM1wg g50LFgmlGQ== X-Google-Smtp-Source: AGHT+IF2BsaIb3W5qZ2YzV0qK1FqD4ZLAkP70GQ38x5iCnmMjifTFZUpstCNTZ7/Oky+j0U3pQIRDQ== X-Received: by 2002:a17:90b:2f0b:b0:2ea:356f:51b4 with SMTP id 98e67ed59e1d1-2f452e1b24fmr3790820a91.13.1734691470451; Fri, 20 Dec 2024 02:44:30 -0800 (PST) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kevin Wolf , Hanna Reitz , Pavel Dovgalyuk , Paolo Bonzini , Stefan Hajnoczi , Fam Zheng , Ronnie Sahlberg , John Snow , "Michael S. Tsirkin" , Jason Wang , Vladimir Sementsov-Ogievskiy , Peter Xu , Fabiano Rosas , "Dr. David Alan Gilbert" , Markus Armbruster , Michael Roth , Wainer dos Santos Moschetta Subject: [PATCH 15/17] tests/avocado/replay_linux: Fix compile error Date: Fri, 20 Dec 2024 20:42:17 +1000 Message-ID: <20241220104220.2007786-16-npiggin@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241220104220.2007786-1-npiggin@gmail.com> References: <20241220104220.2007786-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=npiggin@gmail.com; helo=mail-pf1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1734691501835116600 Content-Type: text/plain; charset="utf-8" The subprocess module was missing, the hunk got mismerged into a later patch that is required to make replay_linux work, so the broken commit was never tested in isolation. Fixes: 4926b6e6444f ("tests/avocado: excercise scripts/replay-dump.py in re= play tests") Signed-off-by: Nicholas Piggin Reviewed-by: Pavel Dovgalyuk --- tests/avocado/replay_linux.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/avocado/replay_linux.py b/tests/avocado/replay_linux.py index 59169224353..38b6f8e6652 100644 --- a/tests/avocado/replay_linux.py +++ b/tests/avocado/replay_linux.py @@ -11,6 +11,7 @@ import os import logging import time +import subprocess =20 from avocado import skipUnless from avocado_qemu import BUILD_DIR --=20 2.45.2 From nobody Mon Dec 23 23:20:13 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1734691499; cv=none; d=zohomail.com; s=zohoarc; b=dz3QOTV+ooMlK5aSD8KpUakp4TcgzwuqwTT61MpEep/seyb2xprcGHfLQkVMOCAuq+fnslexg261XmxE1IYnbASoreubMmYcc7DVWGNpjvPP+rbH87pgc50qvGGWN4IvrOV+hwuOJxEm9iBSg3Z30hHibELsUEgeRYMEsRwI+Ew= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734691499; 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=ptTgrJ3AAjPAgcSpVyralWA7dIyvJHWNmDfWV22XPFk=; b=Djo54LW88btXGDH/KR8maLvjlvft4tfjL/nYJLAKfBmyrRlH2ZfnAQu7vT66bdv8grYHgt6Uwj6aUVFeW+JtFOwXmGVK/eXoTuZn2haSyQPO0DfiWs2Km3UkdPHkFB4zno1ciwDkDVezDvNzrxMHXPOK/CnkKIaF0RmDmeBl8uE= 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 1734691499706692.7825263785942; Fri, 20 Dec 2024 02:44:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOaUy-0001O4-O3; Fri, 20 Dec 2024 05:44:52 -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 1tOaUr-0001Cv-8g; Fri, 20 Dec 2024 05:44:41 -0500 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOaUp-0005ia-SG; Fri, 20 Dec 2024 05:44:41 -0500 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-2161eb95317so16527515ad.1; Fri, 20 Dec 2024 02:44:39 -0800 (PST) Received: from wheely.local0.net (14-200-18-130.tpgi.com.au. [14.200.18.130]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee06dfd3sm5376942a91.32.2024.12.20.02.44.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 02:44:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734691478; x=1735296278; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ptTgrJ3AAjPAgcSpVyralWA7dIyvJHWNmDfWV22XPFk=; b=C2QJKjQIti8ootOiKpJws+u3bioig3hLdvI7G1J43AID3xcYg8OfkEsXiarXUhNlKQ Thbrg38oanvRpzXQ0f06UsuVVDLZuF/4ASpa5V1TBl0tqPdPbTYRb0FR9fMjIzi8FOYj RMBOOu/9EJD8pcYu/WDB79OLeipiJp1RJKAXcW+rDbgBswmKXEXpwYYwI/8V14aPFaUb ZYNiIZ+6E3awXNX1g2CxBVZVnhP+x6OfEQNeLr4QBApwFaAzya/U45A+b6QjEPXD7YZ9 aoYWWzI2AFzg2tg3icqLIQ2BhEJB246gP4EtvKI1gPviHPr50oOEFyyj5s0W/d4Fa8Kz d4TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734691478; x=1735296278; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ptTgrJ3AAjPAgcSpVyralWA7dIyvJHWNmDfWV22XPFk=; b=RD5Nip/w5D6s3rkZs8em2pxmzh9ufoxStdKU20Q69ayfR3abX3ykNrJaf6JDlWMX+6 SK+ShpHpPafY3gFN3gW7Xm3xmhKjKQ4JfebKUVRQSeSpJNyfmouvRkB1qXydqzmSAzFJ FKJP0kt7X5jBT2M0PvT17ibooyAqMvDO6UvOV8Hd6yeLdQUpfLjv/j20aVcjZTTjnAMV SBdc/BTR0PDaO2z09PJSm6lRsI9JWS68rdGWp7zQAQOiVxb+XqnclqgPGhbcDRUMpMMk 9hYilpehC1YltgeIe3WsspeOrV32fYLMFOSpQEjKWQUhziSnJvKU/0kOfpfxaZtXezui He0Q== X-Forwarded-Encrypted: i=1; AJvYcCUtuuB163RrxYMBZGm9+RRsxgdDWIbypWPSfpdfqMy8g58g7MiHUyq28292btO4E50nlltD73lp68P/@nongnu.org X-Gm-Message-State: AOJu0YyJsFILEetojO2ctJMSF4IzfiaKXNZzTYEVq2yypzYptfS9iPrf ixszL+sTgGprfN1HSRL3wADxqccdx1iRnE2XkVSd4LJxz3CInTVthXmhvg== X-Gm-Gg: ASbGncvLqxeUY2IpcjTLOiAeRmPG/jwh+GVcRJXD0Uo1jHJkok9bfM6YF/uM/tCJ1NB J4fvw73U2+8rkfOfKpMWbctZfJLxvmR52P5OgknsLv88cr73bZT2wT5sl3sQP1CP+VDn4fz/Joh SeoplLZQReQMOeZJ2uLte6dZskxQxVZNJWrcKOnXOanih4pJN1JXkNT83o8XInc7gQ2urIaM6nz KPA+W9ECZ6gEKINy4mLt7M8QEaxOV1OC6bKkbngCX+O3vV231UG4sqMnyYAcXJzDrue5rNEMRYH R/RTNHZ1bw== X-Google-Smtp-Source: AGHT+IHHFjbJJDnydvH/EeyeQ+EbHqUtfiWYhPxLLlnL+4fEaaPAKUcotO2zlojz6R7w3hCvT3m/Dg== X-Received: by 2002:a17:90b:2e10:b0:2ee:fd53:2b03 with SMTP id 98e67ed59e1d1-2f452ec6ec7mr3462445a91.25.1734691478132; Fri, 20 Dec 2024 02:44:38 -0800 (PST) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kevin Wolf , Hanna Reitz , Pavel Dovgalyuk , Paolo Bonzini , Stefan Hajnoczi , Fam Zheng , Ronnie Sahlberg , John Snow , "Michael S. Tsirkin" , Jason Wang , Vladimir Sementsov-Ogievskiy , Peter Xu , Fabiano Rosas , "Dr. David Alan Gilbert" , Markus Armbruster , Michael Roth , Wainer dos Santos Moschetta Subject: [PATCH 16/17] tests/avocado/replay_linux: Fix cdrom device setup Date: Fri, 20 Dec 2024 20:42:18 +1000 Message-ID: <20241220104220.2007786-17-npiggin@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241220104220.2007786-1-npiggin@gmail.com> References: <20241220104220.2007786-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=npiggin@gmail.com; helo=mail-pl1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1734691501812116600 Content-Type: text/plain; charset="utf-8" The cdrom device was not being added to the command line. Signed-off-by: Nicholas Piggin Reviewed-by: Pavel Dovgalyuk --- tests/avocado/replay_linux.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/avocado/replay_linux.py b/tests/avocado/replay_linux.py index 38b6f8e6652..6c08ddaaff1 100644 --- a/tests/avocado/replay_linux.py +++ b/tests/avocado/replay_linux.py @@ -57,6 +57,8 @@ def vm_add_disk(self, vm, path, id, device): =20 def vm_add_cdrom(self, vm, path, id, device): vm.add_args('-drive', 'file=3D%s,id=3Ddisk%s,if=3Dnone,media=3Dcdr= om' % (path, id)) + vm.add_args('-device', + '%s,drive=3Ddisk%s' % (device, id)) =20 def launch_and_wait(self, record, args, shift): self.require_netdev('user') --=20 2.45.2 From nobody Mon Dec 23 23:20:13 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1734691566; cv=none; d=zohomail.com; s=zohoarc; b=Ed7fQVhzF6XCw8cA/IZcZ+Fa2LGojrn/7aHUu54S4aLcZB4G88Mffhcu1ePNETNJh/RvuQ+Bf20Qu8BE0y1iflIi+SUXbM/nJIO4w16tcuMT0HJgl5BumFKq/62d5P0B8UwopqJxnjAJPJy/eog9Tu4hycSvWU1FQNB0dkLAfN4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734691566; 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=GUyed0Mv317RslXBhQnrdsiMxqOOIApYdyBw9bEw7WQ=; b=cmDLRQyZyslKzqlDNkPkhlJ1pA/4MRFf9l1N1lmJ08Gz9iZZxjuyyjnHR3+D4iXQNONTB/irKfcaKiFaeg+EBcNgAlmc0ssxHOVLVeG/zcPhDCL+IEAO4NWl/fRklkZjdBKUfS8wrl9OEBgxMCufGzRbxWRh3S2LzHkfcHP1RZY= 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 1734691566068150.45625930796302; Fri, 20 Dec 2024 02:46:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOaVQ-0001vl-5M; Fri, 20 Dec 2024 05:45:19 -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 1tOaV0-0001Uw-Ba; Fri, 20 Dec 2024 05:44:52 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOaUy-0005qx-Oo; Fri, 20 Dec 2024 05:44:50 -0500 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2ee709715d9so1259202a91.3; Fri, 20 Dec 2024 02:44:47 -0800 (PST) Received: from wheely.local0.net (14-200-18-130.tpgi.com.au. [14.200.18.130]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee06dfd3sm5376942a91.32.2024.12.20.02.44.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 02:44:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734691486; x=1735296286; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GUyed0Mv317RslXBhQnrdsiMxqOOIApYdyBw9bEw7WQ=; b=EEUx1MeuYPUTO2EtZyMY1RbJ7RrL2OD+m0tcqJoCboCOQrs1BsyyLxrtTAjpL9Y+0j 80bRUUQK8zxlgeGzFblWTjp3vqazeGlZ1f7K/Cqq3nKYik7pSJdymsTakd0ZjEQu9X/e MQ3D9JrTmQDG58cZrAxgEkEYf9FZq1g/VQOlQVe24S1llbiJF5UPmVl3aTf8Xx43kcqr pHw0sKJnMSBG4uR++/9GgG0PE4PkQzQybNJ47TLVLvbyiNepG1ipZFloTF27n/vsOt2x ip7yUR4KnVSLuX7O3pvH3sI9m9lOS9hq3YTULAYNNCdTaLUdfm5GWGGsHDEFLodItHQf uaTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734691486; x=1735296286; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GUyed0Mv317RslXBhQnrdsiMxqOOIApYdyBw9bEw7WQ=; b=r0KJhd55ttoLA199tg6Zue+eB7pcyoJJujNw0G6d07nnJSYUOmkHzRNNCr0VGgIMCl a2BRhvCs+ZsG1DFfBHPh01zI/L9Hc0YDihAyRBVPem3OPpLuxoK8+Hb4L6QnU4XsXgk2 XkZvy6vLSqC+OPV0EvjcYvWTJ7gPWi8Q1vgOhqZN373tZspxEeq4yaQmqpDzOyiTkQtj 42lqoxX7vbWMukcm5uLpDkAgXVhQ9Ef9b1LHXQshBYbiOTjFNPPNUUcndZ1V+FMo2Ihb yf4BhFeRZ0f63Q/hpHXT1Qgb2cDB7djYeNeRb1ogW7BQpsG2xYSgWQnvVFhS+60Zhaxf 42EQ== X-Forwarded-Encrypted: i=1; AJvYcCVS3sIe8VweecTrXVku77Sqy8861AzFx3+gpAsAqYDEz7Ga6l2gyxHUEUGGeXvErgArR9jzIWFrSf00@nongnu.org X-Gm-Message-State: AOJu0YyUk83u7O9mChqjbLizdNYgsTiHwfk7HNS6XC6wIjmZYWYlS5No Gji6KQgbv9kYjEvopE48odmd9q7TS4QuehhgwvXXtzWZUutWz400o+Lg0A== X-Gm-Gg: ASbGncuewSOdE2euHNECHtP5JPe8iVvus2CNZhIh3hwECT0Hj1EyOQYZ+Qex+/9v1Re KPovnxysKz3VSltarUVGDwQrr3VXb6P4l1wZkZOVTYE1C/5yzv6IfSwFebn/a9Ts/j8/tJVk5N8 7P2j83MqdUPH8PUPoRLK+wce0TBVh6CiiTQRTE94+1GghWT9IXhHG4EyxwvR9kfYyYqyWA373P0 9lE/IJa6enjuYameoUyCKL/ozMFQG0x/BxybH8b/s+QLtYugoScO1ob+CJIzguWLS8wLQJG7Wf2 8TFSE3bNcg== X-Google-Smtp-Source: AGHT+IHaJWUjKlKfFU0Xe2l8iFS7/kb2KReHUIV9zbBygCXiPtl4R3UW1nNRiM5jOFdjHacHtPp/3Q== X-Received: by 2002:a17:90b:5183:b0:2ee:5111:a54b with SMTP id 98e67ed59e1d1-2f452eec7dcmr3095432a91.31.1734691485846; Fri, 20 Dec 2024 02:44:45 -0800 (PST) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kevin Wolf , Hanna Reitz , Pavel Dovgalyuk , Paolo Bonzini , Stefan Hajnoczi , Fam Zheng , Ronnie Sahlberg , John Snow , "Michael S. Tsirkin" , Jason Wang , Vladimir Sementsov-Ogievskiy , Peter Xu , Fabiano Rosas , "Dr. David Alan Gilbert" , Markus Armbruster , Michael Roth , Wainer dos Santos Moschetta Subject: [PATCH 17/17] tests/avocado/replay_linux: remove the timeout expected guards Date: Fri, 20 Dec 2024 20:42:19 +1000 Message-ID: <20241220104220.2007786-18-npiggin@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241220104220.2007786-1-npiggin@gmail.com> References: <20241220104220.2007786-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=npiggin@gmail.com; helo=mail-pj1-x1033.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1734691568255116600 replay_linux tests on is becoming more reliable now, so remove the timeout expected tag. These tests take about 400-800 seconds each, so add the SPEED=3Dslow guard. Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Nicholas Piggin Reviewed-by: Pavel Dovgalyuk --- Note that Alex gave R-B tag for previous version which marked a few things as flaky. They are passing in gitlab CI now so hopefully it's okay to keep the review. Thanks, Nick --- tests/avocado/replay_linux.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/avocado/replay_linux.py b/tests/avocado/replay_linux.py index 6c08ddaaff1..362e35c8849 100644 --- a/tests/avocado/replay_linux.py +++ b/tests/avocado/replay_linux.py @@ -121,7 +121,7 @@ def run_replay_dump(self, replay_path): except subprocess.CalledProcessError: self.fail('replay-dump.py failed') =20 -@skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout') +@skipUnless(os.getenv('SPEED') =3D=3D 'slow', 'runtime limited') class ReplayLinuxX8664(ReplayLinux): """ :avocado: tags=3Darch:x86_64 @@ -142,7 +142,7 @@ def test_pc_q35(self): """ self.run_rr(shift=3D3) =20 -@skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout') +@skipUnless(os.getenv('SPEED') =3D=3D 'slow', 'runtime limited') class ReplayLinuxX8664Virtio(ReplayLinux): """ :avocado: tags=3Darch:x86_64 @@ -168,7 +168,7 @@ def test_pc_q35(self): """ self.run_rr(shift=3D3) =20 -@skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout') +@skipUnless(os.getenv('SPEED') =3D=3D 'slow', 'runtime limited') class ReplayLinuxAarch64(ReplayLinux): """ :avocado: tags=3Daccel:tcg --=20 2.45.2