From nobody Sat May 4 23:00:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522784169917845.7692535879727; Tue, 3 Apr 2018 12:36:09 -0700 (PDT) Received: from localhost ([::1]:59039 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3Riu-0007ou-Nz for importer@patchew.org; Tue, 03 Apr 2018 15:36:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3RhT-0006t7-1s for qemu-devel@nongnu.org; Tue, 03 Apr 2018 15:34:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3RhR-0002at-Vl for qemu-devel@nongnu.org; Tue, 03 Apr 2018 15:34:35 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:45756 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3RhR-0002ak-Pi for qemu-devel@nongnu.org; Tue, 03 Apr 2018 15:34:33 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5E1C5402314E for ; Tue, 3 Apr 2018 19:34:33 +0000 (UTC) Received: from red.redhat.com (ovpn-123-104.rdu2.redhat.com [10.10.123.104]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7810A10FFE73; Tue, 3 Apr 2018 19:34:25 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Tue, 3 Apr 2018 14:34:18 -0500 Message-Id: <20180403193420.2065215-2-eblake@redhat.com> In-Reply-To: <20180403193420.2065215-1-eblake@redhat.com> References: <20180403193420.2065215-1-eblake@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 03 Apr 2018 19:34:33 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 03 Apr 2018 19:34:33 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'eblake@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 1/3] monitor: bind dispatch bh to iohandler context X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Stefan Hajnoczi , Markus Armbruster , Peter Xu , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Xu Eric Auger reported the problem days ago that OOB broke ARM when running with libvirt: http://lists.gnu.org/archive/html/qemu-devel/2018-03/msg06231.html This patch fixes the problem. It's not really needed now since we have turned OOB off now, but it's still a bug fix, and it'll start to work when we turn OOB on for ARM. The problem was that the monitor dispatcher bottom half was bound to qemu_aio_context, but that context seems to be for block only. For the rest of the QEMU world we should be using iohandler context. So assign the monitor dispatcher bottom half to that context. Without this change, the QMP dispatcher might be run even before reaching the main loop in a block IO path, for example, in a stack like: #0 qmp_cont () #1 0x00000000006bd210 in qmp_marshal_cont () #2 0x0000000000ac05c4 in do_qmp_dispatch () #3 0x0000000000ac07a0 in qmp_dispatch () #4 0x0000000000472d60 in monitor_qmp_dispatch_one () #5 0x000000000047302c in monitor_qmp_bh_dispatcher () #6 0x0000000000acf374 in aio_bh_call () #7 0x0000000000acf428 in aio_bh_poll () #8 0x0000000000ad5110 in aio_poll () #9 0x0000000000a08ab8 in blk_prw () #10 0x0000000000a091c4 in blk_pread () #11 0x0000000000734f94 in pflash_cfi01_realize () #12 0x000000000075a3a4 in device_set_realized () #13 0x00000000009a26cc in property_set_bool () #14 0x00000000009a0a40 in object_property_set () #15 0x00000000009a3a08 in object_property_set_qobject () #16 0x00000000009a0c8c in object_property_set_bool () #17 0x0000000000758f94 in qdev_init_nofail () #18 0x000000000058e190 in create_one_flash () #19 0x000000000058e2f4 in create_flash () #20 0x00000000005902f0 in machvirt_init () #21 0x00000000007635cc in machine_run_board_init () #22 0x00000000006b135c in main () This can cause ARM to crash when used with both OOB capability enabled and libvirt as upper layer, since libvirt will start QEMU with "-S" and the first "cont" command will arrive very early if the context is not correct (which is what above stack shows). Then, the vcpu threads will start to run right after the qmp_cont() call, even when GICs have not been setup correctly yet (which is done in kvm_arm_machine_init_done()). My sincere thanks to Eric Auger who offered great help during both debugging and verifying the problem. The ARM test was carried out by applying this patch upon QEMU 2.12.0-rc0 and problem is gone after the patch. A quick test of mine shows that after this patch is applied we can pass all raw iotests even with OOB on by default. CC: Eric Blake CC: Markus Armbruster CC: Stefan Hajnoczi CC: Fam Zheng Reported-by: Eric Auger Tested-by: Eric Auger Signed-off-by: Peter Xu Message-Id: <20180403050115.6037-1-peterx@redhat.com> Reviewed-by: Fam Zheng Signed-off-by: Eric Blake --- monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor.c b/monitor.c index 51f4cf480f8..39f8ee17ba7 100644 --- a/monitor.c +++ b/monitor.c @@ -4467,7 +4467,7 @@ static void monitor_iothread_init(void) * have assumption to be run on main loop thread. It would be * nice that one day we can remove this assumption in the future. */ - mon_global.qmp_dispatcher_bh =3D aio_bh_new(qemu_get_aio_context(), + mon_global.qmp_dispatcher_bh =3D aio_bh_new(iohandler_get_aio_context(= ), monitor_qmp_bh_dispatcher, NULL); --=20 2.14.3 From nobody Sat May 4 23:00:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522784260619288.4376952696638; Tue, 3 Apr 2018 12:37:40 -0700 (PDT) Received: from localhost ([::1]:59125 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3RkR-0000TQ-TB for importer@patchew.org; Tue, 03 Apr 2018 15:37:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3RhV-0006vA-KE for qemu-devel@nongnu.org; Tue, 03 Apr 2018 15:34:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3RhS-0002b1-9C for qemu-devel@nongnu.org; Tue, 03 Apr 2018 15:34:37 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36094 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3RhS-0002ap-4X for qemu-devel@nongnu.org; Tue, 03 Apr 2018 15:34:34 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BAEE74067EF0 for ; Tue, 3 Apr 2018 19:34:33 +0000 (UTC) Received: from red.redhat.com (ovpn-123-104.rdu2.redhat.com [10.10.123.104]) by smtp.corp.redhat.com (Postfix) with ESMTP id 82543100727E for ; Tue, 3 Apr 2018 19:34:33 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Tue, 3 Apr 2018 14:34:19 -0500 Message-Id: <20180403193420.2065215-3-eblake@redhat.com> In-Reply-To: <20180403193420.2065215-1-eblake@redhat.com> References: <20180403193420.2065215-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 03 Apr 2018 19:34:33 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 03 Apr 2018 19:34:33 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'eblake@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 2/3] maint: Add .mailmap entries for patches claiming list authorship X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The list did not author any patches, but it does rewrite the 'From:' header of messages sent from any domain with restrictive SPF policies that would otherwise prevent the message from reaching all list recipients. If a maintainer is not careful to undo the list header rewrite, and the author did not include a manual 'From:' line in the body to fix the munged header, then 'git am' happily attributes the patch to the list. Add some mailmap entries to correct the few that have escaped our attention; while we also work on improving the tooling to catch the problem in the future before a merge is even made. Also improve the comments occurring in the file, including line length improvements. Signed-off-by: Eric Blake Message-Id: <20180326184147.1565719-1-eblake@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- .mailmap | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.mailmap b/.mailmap index cf689b9ec99..778a4d4e2c7 100644 --- a/.mailmap +++ b/.mailmap @@ -1,6 +1,7 @@ -# This mailmap just translates the weird addresses from the original impor= t into git -# into proper addresses so that they are counted properly in git shortlog = output. -# +# This mailmap fixes up author names/addresses. + +# The first section translates weird addresses from the original git import +# into proper addresses so that they are counted properly by git shortlog. Andrzej Zaborowski balrog Anthony Liguori aliguori Anthony Liguori Anthony Liguori @@ -15,10 +16,19 @@ Paul Burton Paul Burton Thiemo Seufer ths malc malc + # There is also a: # (no author) <(no author)@c046a42c-6fe2-441c-8c8c-71466251a162> # for the cvs2svn initialization commit e63c3dc74bf. -# + +# Next, translate a few commits where mailman rewrote the From: line due +# to strict SPF, although we prefer to avoid adding more entries like that. +Ed Swierk Ed Swierk via Qemu-devel +Ian McKellar Ian McKellar via Qemu-devel +Julia Suvorova Julia Suvorova via Qemu-devel +Justin Terry (VM) Justin Terry (VM) via Qemu-devel= + + # Also list preferred name forms where people have changed their # git author config Daniel P. Berrang=C3=A9 --=20 2.14.3 From nobody Sat May 4 23:00:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522784342324610.8584419803819; Tue, 3 Apr 2018 12:39:02 -0700 (PDT) Received: from localhost ([::1]:59176 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3Rli-0001C4-BD for importer@patchew.org; Tue, 03 Apr 2018 15:38:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39650) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3RhY-0006xW-6b for qemu-devel@nongnu.org; Tue, 03 Apr 2018 15:34:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3RhV-0002by-3J for qemu-devel@nongnu.org; Tue, 03 Apr 2018 15:34:40 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50826 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3RhU-0002bt-Ve for qemu-devel@nongnu.org; Tue, 03 Apr 2018 15:34:37 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9034F8151D46 for ; Tue, 3 Apr 2018 19:34:36 +0000 (UTC) Received: from red.redhat.com (ovpn-123-104.rdu2.redhat.com [10.10.123.104]) by smtp.corp.redhat.com (Postfix) with ESMTP id E14FE10E60DA; Tue, 3 Apr 2018 19:34:33 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Tue, 3 Apr 2018 14:34:20 -0500 Message-Id: <20180403193420.2065215-4-eblake@redhat.com> In-Reply-To: <20180403193420.2065215-1-eblake@redhat.com> References: <20180403193420.2065215-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 03 Apr 2018 19:34:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 03 Apr 2018 19:34:36 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'eblake@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 3/3] dump: Fix build with newer gcc X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" gcc 8 on rawhide is picky enough to complain: /home/dummy/qemu/dump.c: In function 'create_header32': /home/dummy/qemu/dump.c:817:5: error: 'strncpy' output truncated before ter= minating nul copying 8 bytes from a string of the same length [-Werror=3Dst= ringop-truncation] strncpy(dh->signature, KDUMP_SIGNATURE, strlen(KDUMP_SIGNATURE)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ But we already have SIG_LEN defined as the right length without needing to do a strlen(), and memcpy() is better than strncpy() when we know we do not want a trailing NUL byte. Signed-off-by: Eric Blake Message-Id: <20180327202152.1799131-1-eblake@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- dump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dump.c b/dump.c index 669f715274d..b54cd42b217 100644 --- a/dump.c +++ b/dump.c @@ -814,7 +814,7 @@ static void create_header32(DumpState *s, Error **errp) size =3D sizeof(DiskDumpHeader32); dh =3D g_malloc0(size); - strncpy(dh->signature, KDUMP_SIGNATURE, strlen(KDUMP_SIGNATURE)); + memcpy(dh->signature, KDUMP_SIGNATURE, SIG_LEN); dh->header_version =3D cpu_to_dump32(s, 6); block_size =3D s->dump_info.page_size; dh->block_size =3D cpu_to_dump32(s, block_size); @@ -926,7 +926,7 @@ static void create_header64(DumpState *s, Error **errp) size =3D sizeof(DiskDumpHeader64); dh =3D g_malloc0(size); - strncpy(dh->signature, KDUMP_SIGNATURE, strlen(KDUMP_SIGNATURE)); + memcpy(dh->signature, KDUMP_SIGNATURE, SIG_LEN); dh->header_version =3D cpu_to_dump32(s, 6); block_size =3D s->dump_info.page_size; dh->block_size =3D cpu_to_dump32(s, block_size); --=20 2.14.3