From nobody Sat Jul 25 11:02:33 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1784559581; cv=none; d=zohomail.com; s=zohoarc; b=VVEeyT45BE9/VvE6wc0hEz/o4zHXRDPOeDpAYVb/PWuPGfCxuVmu6bhwrV/yfWY/ysWj06Y7NUDND5xNUhytnhdqlMWLGMZTnPLkDARm7emDfkNzrER4ZCPdnR4ImOT26hiyqrb9ruk3SONLJthXlU2zcSnHO1JuAeHx+gwZNLU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784559581; 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=tT37CVdZFUfdLwzI+RtDkemwBSJZNYZtp/hv39esPxs=; b=NTeVh2bUGwgW+flNH3ZtZHlOLkya7G0CgftajusbivJKhRxTylvE8cDLMYJtSBYap1aPBhSIbD/cHTXoC9x22heJQx3WCrXxu6wnd8otxV6Asi86IwL60Z12+mzcTPxiIL55UrRCwIFfrUWg584Kfkks7dwySy+9yJAHr0Qtes4= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784559581727265.8643229667804; Mon, 20 Jul 2026 07:59:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wlpSZ-0007Ij-LN; Mon, 20 Jul 2026 10:59:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wlpSS-0007HU-JY for qemu-devel@nongnu.org; Mon, 20 Jul 2026 10:59:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wlpSQ-0006kN-V7 for qemu-devel@nongnu.org; Mon, 20 Jul 2026 10:59:04 -0400 Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-251-Y80jMTXpMSuWcK3N6ApO1g-1; Mon, 20 Jul 2026 10:58:59 -0400 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-51bff5c7035so94462971cf.2 for ; Mon, 20 Jul 2026 07:58:59 -0700 (PDT) Received: from x1.com ([174.91.117.74]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-521502b9d5bsm75640391cf.31.2026.07.20.07.58.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2026 07:58:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1784559542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tT37CVdZFUfdLwzI+RtDkemwBSJZNYZtp/hv39esPxs=; b=KiecJeEuAJLDS+WfSqWzudvM3o6WpAwEvQANLnBCLPXYDUEhKXPTEa9oX9Co0OSGwkZQA+ ZkFz99EEa+kV4DgZFny2j7uixBkQb35dhwjh8mF1RT5MEXI8BQlJLUI1W4m57A3Wdocu2/ 6ulWo9buP7XyhLoLrtplnH9DfOuopeU= X-MC-Unique: Y80jMTXpMSuWcK3N6ApO1g-1 X-Mimecast-MFC-AGG-ID: Y80jMTXpMSuWcK3N6ApO1g_1784559539 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1784559539; x=1785164339; 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:content-type; bh=tT37CVdZFUfdLwzI+RtDkemwBSJZNYZtp/hv39esPxs=; b=JWMeCUg4nCk4/D+dhfYLDi8ppxzj8DDHnK+Fb3OCCS2HcBia2eDbONEOV4qHZk4njK vKHgVTZq9feuEUzikJqAx0aVMUK9fYCgOfdcM5A1ShTJ5eFTReJpxDBnJ2otd2uho9tt 6Lho5QFowyBx3MYnzjZjPnZAhb+WIj8htLn9sa13hIl41PphW9jY5AyC5r49teJfbSTp Vp28e1hNT6z6/k49RyE3DH8HEY041YjPfG5OuaC9M4UHBOQpM/3WU+etBd6MxwGOFXdm 1GgsfwHsIsXvktndNg30QfZC6OwydC+lWIQ62DoFES+tEtTJKOdks7YVbRpT4NRAmvo1 ljnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784559539; x=1785164339; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=tT37CVdZFUfdLwzI+RtDkemwBSJZNYZtp/hv39esPxs=; b=lMgEosVeDZcMexMlCHC1rKPjC/BWboGBMb+pLmkSjVO+ghjt80gY9/wjH3Y+lAl0X/ HBPMjdtQDdNBSZ5ijkKn11wdaLmhtbHhpmfSHb0irWc+HawpP/y1j+uQQdcxQLBfOYT7 WCnr8Nulyxvavd3ZNEBbzIkqEU+TJwb/5Gx9ODt3++l48z06mLOrjjgy0GfYBJ4fCOKl Uc52rFaAQ7HrTLk8SPsgk4gW08DztlvJnc1o9soZvwjeB3ti+JPIPvjCZcWibgFtuzYu BRstfU8F/A+sl2FHgKO8iTogu/LCX77iPk3frhjouj08dCCcpEqSZ6WVuSkcwIAEC4mi OFaA== X-Gm-Message-State: AOJu0YzdtqGOjaT6nhvwZk9KRh8oPM8AhrAUbOKbtf4RJTcDujrijNUF 8TiByrOfYtMm/LB5rkSN9SjOhl7ruoi6/o1B1I1AiviZ/1qAFrmHCZb5buKH/V+GR6/1ZcQq/01 qdL9J4TQBOjAQFKKyj8cD+Q8eRoJmGLzee8XUkhJbBoF0J38rfGfjfxWyrbfGzJA/Ed/N7dzlaB CuYojLHo9BvWS5daIhvfD+rpi1iJgAjJmel5UKdg== X-Gm-Gg: AfdE7clOUTM0nPkJhhrlVpNawO/gcTSpwMh0wsCJNmhWLgUsDEdoQAGoejtbIYgkqsW mQzOE6BT4LHrwyc5ItuI5SeSESWv94ePF4Nt6g7L2FgBT9dhttGSKMpu09rOpAesclOzElReJsC UK9x9GZylVGOuzUKJXcago1Ma/Btc7Zj5bid6Pbc92bKUkXNkYo8kMJ9dbtc6Kl/1fzwvkIqYon 4YZD1Lft+BtsdxGZwx2QXR9ZCgOVZNEkO4eMtYLb02QkuDApiEHUoREPzTpXWAFwFDNKogviyMZ pq8wtfRkIJ0c4Cy36r35ahccOOem2jzqtkFtEVQc6n9sEJWZS5X6//pEpPy1Fu3ywA== X-Received: by 2002:a05:622a:181f:b0:51a:8c86:bd3c with SMTP id d75a77b69052e-5213c9d9a01mr147396581cf.57.1784559539191; Mon, 20 Jul 2026 07:58:59 -0700 (PDT) X-Received: by 2002:a05:622a:181f:b0:51a:8c86:bd3c with SMTP id d75a77b69052e-5213c9d9a01mr147396131cf.57.1784559538664; Mon, 20 Jul 2026 07:58:58 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Stefan Hajnoczi , Peter Xu , yujun Subject: [PULL 1/3] migration: Fix invalid %ud format and trace arg typo Date: Mon, 20 Jul 2026 10:58:51 -0400 Message-ID: <20260720145853.1483307-2-peterx@redhat.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260720145853.1483307-1-peterx@redhat.com> References: <20260720145853.1483307-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: permerror client-ip=170.10.129.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.01, SPF_HELO_PASS=-0.001, T_SPF_PERMERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1784559583372158500 Content-Type: text/plain; charset="utf-8" From: yujun Standard printf has no %ud conversion; glibc treats it as %u followed by a literal 'd', so postcopy userfaultfd error messages printed event values like "5d" instead of "5". The same typo existed in two postcopy discard trace format strings. Also rename the misspelled ram_save_iterate_big_wait() trace argument milliconds to milliseconds. Fixes: 00fa4fc85b ("postcopy: Allow registering of fd handler") Signed-off-by: yujun Reviewed-by: Fabiano Rosas Link: https://lore.kernel.org/r/20260630031324.43453-1-yujun@kylinos.cn Signed-off-by: Peter Xu --- migration/postcopy-ram.c | 4 ++-- migration/trace-events | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index f5ef93f193..980b938a4c 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -1368,7 +1368,7 @@ static void *postcopy_ram_fault_thread(void *opaque) } } if (msg.event !=3D UFFD_EVENT_PAGEFAULT) { - error_report("%s: Read unexpected event %ud from userfault= fd", + error_report("%s: Read unexpected event %u from userfaultf= d", __func__, msg.event); continue; /* It's not a page fault, shouldn't happen */ } @@ -1443,7 +1443,7 @@ retry: } } if (msg.event !=3D UFFD_EVENT_PAGEFAULT) { - error_report("%s: Read unexpected event %ud " + error_report("%s: Read unexpected event %u " "from userfaultfd (shared)", __func__, msg.event); continue; /* It's not a page fault, shouldn't happen */ diff --git a/migration/trace-events b/migration/trace-events index de99d976ab..3b1258c3bf 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -21,14 +21,14 @@ loadvm_postcopy_handle_run(void) "" loadvm_postcopy_handle_resume(void) "" loadvm_postcopy_ram_handle_discard(void) "" loadvm_postcopy_ram_handle_discard_end(void) "" -loadvm_postcopy_ram_handle_discard_header(const char *ramid, uint16_t len)= "%s: %ud" +loadvm_postcopy_ram_handle_discard_header(const char *ramid, uint16_t len)= "%s: %u" loadvm_process_command(const char *s, uint16_t len) "com=3D%s len=3D%d" loadvm_process_command_ping(uint32_t val) "0x%x" loadvm_approve_switchover(unsigned int switchover_ack_pending_num) "Switch= over ack pending num=3D%u" postcopy_ram_listen_thread_exit(void) "" postcopy_ram_listen_thread_start(void) "" qemu_savevm_send_postcopy_advise(void) "" -qemu_savevm_send_postcopy_ram_discard(const char *id, uint16_t len) "%s: %= ud" +qemu_savevm_send_postcopy_ram_discard(const char *id, uint16_t len) "%s: %= u" savevm_command_send(uint16_t command, uint16_t len) "com=3D0x%x len=3D%d" savevm_section_start(const char *id, unsigned int section_id) "%s, section= _id %u" savevm_section_end(const char *id, unsigned int section_id, int ret) "%s, = section_id %u -> %d" @@ -119,7 +119,7 @@ colo_flush_ram_cache_begin(uint64_t dirty_pages) "dirty= _pages %" PRIu64 colo_flush_ram_cache_end(void) "" save_xbzrle_page_skipping(void) "" save_xbzrle_page_overflow(void) "" -ram_save_iterate_big_wait(uint64_t milliconds, int iterations) "big wait: = %" PRIu64 " milliseconds, %d iterations" +ram_save_iterate_big_wait(uint64_t milliseconds, int iterations) "big wait= : %" PRIu64 " milliseconds, %d iterations" ram_load_start(void) "" ram_load_complete(int ret, uint64_t seq_iter) "exit_code %d seq iteration = %" PRIu64 ram_write_tracking_ramblock_start(const char *block_id, size_t page_size, = void *addr, size_t length) "%s: page_size: %zu addr: %p length: %zu" --=20 2.54.0 From nobody Sat Jul 25 11:02:33 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1784559593; cv=none; d=zohomail.com; s=zohoarc; b=f8CF27qOt4LqFb8+XQP5uVSxVVXvCDYLr2PFWOW9yiGwnMXPdK9qF+Hr8J3aI4PGlviYBW1xGnIBJ8FnVSTDJwBA3DjTdD05IP4TUvCFU8zvLZip4CVyoe6jbXVjK2vCEppMYVCqNUvTefOOyFd0/vWMLmtk6S+DD/hyj6S34tI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784559593; 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=1HeOrZ3kheAnQ2xd1pogDdp9y6fqeqok2+BTnc0fWCE=; b=MFuePmxNHf9MDSZezFL4eS40iQQ3Ble0lpQpOfjBpcQqGl6py15fpqE0GJxzDcl/K1bXwc32WBYHEw3LOcSHMKHYwXYBOp18El4dKA2hPo7YmkRRQBrOC6HS+PLlFRM7WzMpvHW/5lypEkVa1yfiTglmc+vwveYkYVKtIsHlouI= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784559593613298.863807358483; Mon, 20 Jul 2026 07:59:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wlpSZ-0007Ik-LN; Mon, 20 Jul 2026 10:59:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wlpST-0007Hm-53 for qemu-devel@nongnu.org; Mon, 20 Jul 2026 10:59:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wlpSR-0006kV-OM for qemu-devel@nongnu.org; Mon, 20 Jul 2026 10:59:04 -0400 Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-590-k2SWkQdsMDi3dL6hEd_ltg-1; Mon, 20 Jul 2026 10:59:01 -0400 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-51c01ff996dso76591561cf.2 for ; Mon, 20 Jul 2026 07:59:01 -0700 (PDT) Received: from x1.com ([174.91.117.74]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-521502b9d5bsm75640391cf.31.2026.07.20.07.58.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2026 07:58:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1784559543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1HeOrZ3kheAnQ2xd1pogDdp9y6fqeqok2+BTnc0fWCE=; b=d4L5e2ILG2b9X3YGLW5Kh3OVEHnKoYeRzthDJjMJrrYtMoZbfWa1ii+wUaZVXjvkC0SxH0 lFwgstQ1ip40PIMxImoOtNDMDCYSLk7oPExKhfe5Ko5piP/+OfchCeGcb3rBIgT9gnvo+Q 919GEqv1nN+oXFIp9xp2ajTgLIBmooU= X-MC-Unique: k2SWkQdsMDi3dL6hEd_ltg-1 X-Mimecast-MFC-AGG-ID: k2SWkQdsMDi3dL6hEd_ltg_1784559541 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1784559541; x=1785164341; 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:content-type; bh=1HeOrZ3kheAnQ2xd1pogDdp9y6fqeqok2+BTnc0fWCE=; b=Z1j93MNH22ao3bMUHnhYh5RWSbchgF2Tw5+9Dm6PMhwfUCrejdeu/KPPawEqXMvq6m T2CIwwjDT20PSk+cu3FNWIJt2bGvpcfEGY9yYeXBdYtheAwg7O1jUgpT6R7simcpXtPs P9vmIOa6M8SZWNNjs/zmUPUywMRq+8Sl/xLKxF74VtSWLuwkcBI3X6tblThu6TGmA2W2 MDxJFXs0KcA5OZG/pvizFCcJfqsQxUCkTahLQVDIPcjLe30TcQE21Z7qGpzSQYxyxvml MQE5EpPGAAvGWjap2ZOOGN8eB/woiuAkhS7H+I+6asSh947w3OVh49qVczri3qKoYsxB J92Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784559541; x=1785164341; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=1HeOrZ3kheAnQ2xd1pogDdp9y6fqeqok2+BTnc0fWCE=; b=iPs7/8hE7xKgnV1JHMYAE3BKRtMinvxsKg4oHce83WmQC5sz+wwnwjs4NMKMgj9UzL YZ4YOsh3fvAfMcT88hT/4TxCnjDX2Zs6O9Ld6ehIyz3rcXS/zxgXW4mhfz75W2OB7SlT T5GMd06QgMbG6LaUneP/5njyfNlTZhhYKcbUHl9of8iQU6qkNLdpxjQGstcuS7ekfKuQ WEV4dP6VRqOBdnn63yTNEU4jnGkUVNvVtBG1LO/hXcmRczIrPa83vhH+ZcahCREhPk5l i2oTke8eXrFy6yoafQo61LIvyVydBz6TeBmivoD7QD3vpxSvxDbUY5i79LcPRAr3C3ji Ap/Q== X-Gm-Message-State: AOJu0YzvR3U6qh1a4x0Bt7UtSRS4exzMy1bzA5UElfaOUqOilZxDWwhT mWkXlIXwdU+pXwgZS2436bEnnx2hNWxz8JChr+p3RoWcGSZLvSc5pmwjfW6GyYd/wVNIQ5BTrvi jhQRGuf/YwOQO6+XDg/5p9Fwf+mxb5p2v61nctZe+XJNd5D/roTUSXQ/NGvDP4bXWgi8sX4Pfwb Nrl7MWyJzqw9rPcunxtr0l7DvMtpKJzXrBcW97hA== X-Gm-Gg: AfdE7clh0v7vflzvy9dGLO3YkFTDwu/PRSMVXXtD0ruGG798EY1poi0O8F9i+xbn30Y qn15WX+fJLti/wwF7zwuQgzATpU4id0us7cBKwWbEanjyW36IVYlAYlXsAiXqPwxJcYvjpNcthA 2OqoppXErQV6Wqth+iiK31O4mULdVnQvpOLXgUCoOG00FgE7LXuaRddQz8Hk4btgANZoK1qGR0x vFAv8OazF7MjW2vgGV03zpbr3i5oyxoTUpntBd4Poh+5VDO78vLpKLnvs+DgvtfuFBq5/WIzLXd 3jaD8zCUyRkGI5mdALs1+g87HbXsXIauUB8y1Cv89lclSVkd8fhlPQiAL8A63pmuQA== X-Received: by 2002:ac8:570f:0:b0:51c:1c2c:a8c9 with SMTP id d75a77b69052e-5213e48ba34mr120036631cf.43.1784559541155; Mon, 20 Jul 2026 07:59:01 -0700 (PDT) X-Received: by 2002:ac8:570f:0:b0:51c:1c2c:a8c9 with SMTP id d75a77b69052e-5213e48ba34mr120036171cf.43.1784559540418; Mon, 20 Jul 2026 07:59:00 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Stefan Hajnoczi , Peter Xu , Bin Guo Subject: [PULL 2/3] migration: fix ineffective overflow assert in postcopy blocktime Date: Mon, 20 Jul 2026 10:58:52 -0400 Message-ID: <20260720145853.1483307-3-peterx@redhat.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260720145853.1483307-1-peterx@redhat.com> References: <20260720145853.1483307-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: permerror client-ip=170.10.133.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, T_SPF_PERMERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1784559595206158500 Content-Type: text/plain; charset="utf-8" From: Bin Guo vcpu_faults_current[] is uint8_t. The overflow assert was checked after the post-increment, so 255 would wrap to 0 and the assert would pass silently. Move the check before the increment and use < 255. Signed-off-by: Bin Guo Link: https://lore.kernel.org/r/20260716101952.65329-2-guobin@linux.alibaba= .com Signed-off-by: Peter Xu --- migration/postcopy-ram.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 980b938a4c..b0828edb3e 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -1093,7 +1093,11 @@ void mark_postcopy_blocktime_begin(uintptr_t addr, u= int32_t ptid, /* * Account how many concurrent faults on this vCPU we trapped. See * comments above vcpu_faults_current[] on why it can be more than= one. + * + * vcpu_faults_current[] is uint8_t, so assert before incrementing= to + * catch overflow before it wraps. */ + assert(dc->vcpu_faults_current[cpu] < 255); if (dc->vcpu_faults_current[cpu]++ =3D=3D 0) { dc->smp_cpus_down++; /* @@ -1103,9 +1107,6 @@ void mark_postcopy_blocktime_begin(uintptr_t addr, ui= nt32_t ptid, */ dc->last_begin =3D current; } - - /* Making sure it won't overflow - it really should never! */ - assert(dc->vcpu_faults_current[cpu] <=3D 255); } else { /* * For non-vCPU thread faults, we don't care about tid or cpu index --=20 2.54.0 From nobody Sat Jul 25 11:02:33 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1784559579; cv=none; d=zohomail.com; s=zohoarc; b=EF4v6TmjOYD0+WGM24CnX71l5r7bB+cLq3YCkvdnHnvwybPtklnrylYJfvYHTZ/IuhiDXRbYDlaYIIU61pNKP4TzCbEBNU75j/l6RlxO7GDZdL1izWW8ZN25XDDN+jFL6460yh/4Im9tAiXHLjGnHJa5ZGpA4QPB76LwFgq9OZ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784559579; 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=DVIFGkukln+xod9bmAynQS13TngsQVCJPxsTIasZjQE=; b=LY9jJUNFjOLufHbXDIxILHhdU5orx96MfojB7UyNjO6ZvSpjcUt5rfnqAKQkQh1X8Rcurkyqnhb1jFa16cGmagUCQXd1AHzClVXbOhJMmIZvgBZluZVWwpshYnOhqQL6gLixHBNMdyLbaQO1FEIIeEbawhbrPLfLtAZ8SNCvgpY= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784559579853712.4560655190196; Mon, 20 Jul 2026 07:59:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wlpSf-0007Jr-NK; Mon, 20 Jul 2026 10:59:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wlpSU-0007I3-U2 for qemu-devel@nongnu.org; Mon, 20 Jul 2026 10:59:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wlpST-0006km-FD for qemu-devel@nongnu.org; Mon, 20 Jul 2026 10:59:06 -0400 Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-39-rgL7yAUrOkCJOQYGlwE-eg-1; Mon, 20 Jul 2026 10:59:03 -0400 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-51c1eb52e1fso86000131cf.0 for ; Mon, 20 Jul 2026 07:59:03 -0700 (PDT) Received: from x1.com ([174.91.117.74]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-521502b9d5bsm75640391cf.31.2026.07.20.07.59.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2026 07:59:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1784559544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DVIFGkukln+xod9bmAynQS13TngsQVCJPxsTIasZjQE=; b=cFcppElYjM7r+VPvj6F0Ojt4HsBgV+5HSQiUzftlxL7/U505hFXEc/DpHY5sNo5kVqW7eu wIpNNhka017BrUNX953ESQBXgBYrUJU5HF5yRRHaSnjYjfupROoBFIcb87tofHnRH890ip wcdG2mPx6lVw3KkrDkfjEvfAgm+VUQA= X-MC-Unique: rgL7yAUrOkCJOQYGlwE-eg-1 X-Mimecast-MFC-AGG-ID: rgL7yAUrOkCJOQYGlwE-eg_1784559543 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1784559543; x=1785164343; 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:content-type; bh=DVIFGkukln+xod9bmAynQS13TngsQVCJPxsTIasZjQE=; b=uGU55JXm5/6nSD6vaUcxNJlrm6gQ/sX7bIUZ/wQx9ppfNpoGHvLew42h48PZ+9vZwJ fGcBFhmjHIbWIRrTMEPnJAHh+rMQPH9O9kQA84mTINoYfzwNZ7NyNoYcnHmUWLzL0C+f fJHnnt6eKsitfcGDFtjPm9VEpoRjcbAk1QBKhhy/jxqJPU29Hrg48S5Sei0J80WwxSh/ 0u53kyFw9EwIZiRz0SCE4w0w2pzzv1DeAM2XTtsUORGMsYP2ycKQyG5lBVM69uTWKnvr MxTrnzOasq6WgjAnvGQOftQywjH1iaoFXSECUp+OL+nw1xwWc8qE75wbUWYUjmDCSGU/ l8cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784559543; x=1785164343; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=DVIFGkukln+xod9bmAynQS13TngsQVCJPxsTIasZjQE=; b=Mg7ouTFu/y2raeEBpUebRz4ckaZnJxanxrSDaIjYRx54DvYnYmX284DTI13ldnM2PB iM9MjZ2lVA73DWCpyq+urafdLUVVVHKPYUbo0Tg5nnJYeV/xjlbf2vzpzlThw3f6z9p1 YGwBQRDBX+ad5Nv0c6AgH9k+ebRERdSN67HA0eL9FxHMOrH6BK6jGGWMb2eK97IbcUaB I7BU33SsFu9saYy1YHIOfP5RdARs5EoiBDpRTVWq0iCGi5oqIeWCa2rcsMJrBgsHjLt7 hEToA91UvbwaduXHwA736pr/ouYG30U55oE9h2pDjov6Z6tUWkKUqJi+JApw07EofO8P d6QA== X-Gm-Message-State: AOJu0YwOn8ErpZRHO9qtbzdUdcIGXkWKVToIht8eZJh3/xD1/30gMHxX VVHfrWi2VbI7oGForByH6WhtEFR0KkEhHtOHj73FwpZXJG0WLWG2ZubrauGsQEwX3KPbW1YyNqU F1S/evSW3hB4EDvcxHOrR+fKVKbM0MISvw8U1rqsWNBv84qoFOm+6z59WZ4NXVOplkeQOASbiwQ ugvLElHg4vCPv90gLb4tGS5bCDznKp6RcigyNlcw== X-Gm-Gg: AfdE7ckyH+cG9UuaxGw/x68/ShDaBFf+D2pimQA6349nm7eMZ4G2AEXxbDCmym2HIZI +Y2yz95tKqWD6+wVWaasbxoVs29I93sIwxG8K9xzk52JD6pYaKRiuRatk+0PiB/Mdn5LAMXEoDb WaTXi2uN5RjUzetXhHLPaadthQ1Q90bGa03a+GUD9IhO+91yTjvdiXpR6GeMq/KQzt2Q2EGCmfL /+DITE5HciOpAhpPKKkO+T3DXSCP8DVIqBPS4VRB5D52rJO86NgQOcmIugJe5wiVi+eJCiqIk/q vS0mupdFeSNeQ3nKgAmd0NhHiD+x9zalT5dplAoqDnRWenlZboDkd/5fpA2CMBFvuQ== X-Received: by 2002:ac8:58d6:0:b0:51c:7b12:5fdc with SMTP id d75a77b69052e-5213d4b3a56mr137087031cf.88.1784559542653; Mon, 20 Jul 2026 07:59:02 -0700 (PDT) X-Received: by 2002:ac8:58d6:0:b0:51c:7b12:5fdc with SMTP id d75a77b69052e-5213d4b3a56mr137086581cf.88.1784559541925; Mon, 20 Jul 2026 07:59:01 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Stefan Hajnoczi , Peter Xu , Bin Guo Subject: [PULL 3/3] migration: clean up postcopy blocktime presentation Date: Mon, 20 Jul 2026 10:58:53 -0400 Message-ID: <20260720145853.1483307-4-peterx@redhat.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260720145853.1483307-1-peterx@redhat.com> References: <20260720145853.1483307-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: permerror client-ip=170.10.129.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.01, SPF_HELO_PASS=-0.001, T_SPF_PERMERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1784559581345158500 Content-Type: text/plain; charset="utf-8" From: Bin Guo Small cleanups for the postcopy blocktime fine-grained tracking feature: * Remove a redundant memset() on latency_buckets after g_new0(). * Use singular "Latency" in the HMP label for postcopy non-vCPU latency, consistent with other single-value labels. Signed-off-by: Bin Guo Link: https://lore.kernel.org/r/20260716101952.65329-4-guobin@linux.alibaba= .com Signed-off-by: Peter Xu --- migration/migration-hmp-cmds.c | 2 +- migration/postcopy-ram.c | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index 8b385f560e..7ec010fd05 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -95,7 +95,7 @@ static void migration_dump_blocktime(Monitor *mon, Migrat= ionInfo *info) } =20 if (info->has_postcopy_non_vcpu_latency) { - monitor_printf(mon, "Postcopy non-vCPU Latencies (ns): %" PRIu64 "= \n", + monitor_printf(mon, "Postcopy non-vCPU Latency (ns): %" PRIu64 "\n= ", info->postcopy_non_vcpu_latency); } =20 diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index b0828edb3e..a3314d3180 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -297,9 +297,6 @@ static struct PostcopyBlocktimeContext *blocktime_conte= xt_new(void) unsigned int smp_cpus =3D ms->smp.cpus; PostcopyBlocktimeContext *ctx =3D g_new0(PostcopyBlocktimeContext, 1); =20 - /* Initialize all counters to be zeros */ - memset(ctx->latency_buckets, 0, sizeof(ctx->latency_buckets)); - ctx->vcpu_blocktime_total =3D g_new0(uint64_t, smp_cpus); ctx->vcpu_faults_count =3D g_new0(uint64_t, smp_cpus); ctx->vcpu_faults_current =3D g_new0(uint8_t, smp_cpus); --=20 2.54.0