From nobody Sat Nov 15 15:29:48 2025 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=1749666410; cv=none; d=zohomail.com; s=zohoarc; b=T0vccmZiYoKrnSaY8ym2/IJOiMmQUbzvMXn2j0yIEVkOUAXq4YV3W7VLpw/iTcFPfsanW3zJenna5DUzuoOO0psrIhaNWnBCmW9nmY39coKsk/pLm8ukxROQdsxjStFtZlXapCkBtrvonPsopuJYGLDdqpX+MeFLhC9grpjBIKE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749666410; 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=UQNXH4s6oZwiIt3/fk9WMce4UX8+i3+RrT8bw0pK+dY=; b=PCY/p2vbZTaR/QKqMxowm2zK26zjSR2KPj76MhOJC9JduBczL8eW18JYBaVyNT0qceG7MHDwnhd1Tqnq3MQMIIWOvECTQE/RXmBgI2TYw3eq1e4d4NGfC2SHXv6YCongRt6ix+fwN7GyvrUaNp9fR/Qkur0mfYMzr+Cytt04st4= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749666410909680.9522142007323; Wed, 11 Jun 2025 11:26:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQ9n-0001X2-3c; Wed, 11 Jun 2025 14:26:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQ9f-0001Qg-FJ for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:31 -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 1uPQ9I-0001Fz-BC for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:24 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-479-FQt9AiT3P5azAo_his_eOA-1; Wed, 11 Jun 2025 14:25:59 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3AE341800283; Wed, 11 Jun 2025 18:25:54 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 389FA18003FC; Wed, 11 Jun 2025 18:25:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UQNXH4s6oZwiIt3/fk9WMce4UX8+i3+RrT8bw0pK+dY=; b=aJPfENxZNKAaHq5beoh9bxiw7rOLZAtJlwFmww9lvRbYymGQTL7qd5wR5yatuBr+lZfyBc DobUYtI56mCuxnSlxsAt0vvGHyGf0joqkj9tnm53T3p8zZWdfdjeB46kLIbQBdN2EqYhWk 2mWs9PR1VkaaWLmjpRsjSSSLI5Pm148= X-MC-Unique: FQt9AiT3P5azAo_his_eOA-1 X-Mimecast-MFC-AGG-ID: FQt9AiT3P5azAo_his_eOA_1749666356 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 01/31] include/qemu/compiler: add QEMU_UNINITIALIZED attribute macro Date: Wed, 11 Jun 2025 14:25:03 -0400 Message-ID: <20250611182533.200590-2-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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=170.10.129.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749666416878116600 The QEMU_UNINITIALIZED macro is to be used to skip the default compiler variable initialization done by -ftrivial-auto-var-init=3Dzero. Use this in cases where there a method in the device I/O path (or other important hot paths), that has large variables on the stack. A rule of thumb is that "large" means a method with 4kb data in the local stack frame. Any variables which are KB in size, should be annotated with this attribute, to pre-emptively eliminate any potential overhead from the compiler zero'ing memory. Given that this turns off a security hardening feature, when using this to flag variables, it is important that the code is double-checked to ensure there is no possible use of uninitialized data in the method. Signed-off-by: Stefan Hajnoczi Reviewed-by: Stefan Hajnoczi Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20250610123709.835102-2-berrange@redhat.com [DB: split off patch & rewrite guidance on when to use the annotation] Signed-off-by: Daniel P. Berrang=C3=A9 Signed-off-by: Stefan Hajnoczi --- include/qemu/compiler.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index 496dac5ac1..65b89958d3 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -207,6 +207,26 @@ # define QEMU_USED #endif =20 +/* + * Disable -ftrivial-auto-var-init on a local variable. + * + * Use this in cases where there a method in the device I/O path (or other + * important hot paths), that has large variables on the stack. A rule of + * thumb is that "large" means a method with 4kb data in the local stack + * frame. Any variables which are KB in size, should be annotated with this + * attribute, to pre-emptively eliminate any potential overhead from the + * compiler's implicit zero'ing of memory. + * + * Given that this turns off a security hardening feature, when using this + * to flag variables, it is important that the code is double-checked to + * ensure there is no possible use of uninitialized data in the method. + */ +#if __has_attribute(uninitialized) +# define QEMU_UNINITIALIZED __attribute__((uninitialized)) +#else +# define QEMU_UNINITIALIZED +#endif + /* * http://clang.llvm.org/docs/ThreadSafetyAnalysis.html * --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749666410; cv=none; d=zohomail.com; s=zohoarc; b=TLWsKy7KNXmUm8l4mtnKRzMooDUqsdYQhkk3VSLBgTaWBDWzCFlWpOSJ4MQeDVY31TaJwooD26rV6lerPoKzI9dy7fFF8BAmQTBn5JR7zo0DrHdD7RR2t7QwS4b8qOAUAdyBeT0Y/thHvyvrSrbM69SCkhKAuuw9N+rpZNz1pj8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749666410; 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=xkb+GWy3WwV0UX+pp8/jWU5Gi0bbhpy85QXCop36z+U=; b=L3+blReChdjYQTYtra/oY4R9l3F26aS9gWTfdE/w55fBwPWN4Y8L3NfGHt60Waab5ruXJ62IXWkskZXO+VHl3H1035xZP4CB6McX7OdbSgLTZWSRlayeeaby5KCBNRMAGKh82pztiBOen/YGiFhsOJH7nOXizdI+ldAoTsTohWk= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749666410912480.64356414189183; Wed, 11 Jun 2025 11:26:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQ9l-0001Vy-A8; Wed, 11 Jun 2025 14:26:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQ9f-0001Qd-CG for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:31 -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 1uPQ9G-0001GR-TQ for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:11 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-281-OKcJr-I9OceoHkUS9DJXKw-1; Wed, 11 Jun 2025 14:26:03 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BFFB6180028C; Wed, 11 Jun 2025 18:25:59 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A1A9019560A3; Wed, 11 Jun 2025 18:25:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xkb+GWy3WwV0UX+pp8/jWU5Gi0bbhpy85QXCop36z+U=; b=iT3kqWgzWJsl7SF6wm70zcIO8jgDpjXB6w25i3URZnUqXDoaQSshAdnEVCECQ3BYhDW9nl NmMEsvNn4VYxb4tnhvIgZR5E2phzhFqQPph0DduyjgRLRPm6W3NcXLUYlqsy0hIQhrUjcc MqRDkZLqnODfMw6oJqdiLz5Poievik0= X-MC-Unique: OKcJr-I9OceoHkUS9DJXKw-1 X-Mimecast-MFC-AGG-ID: OKcJr-I9OceoHkUS9DJXKw_1749666360 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 02/31] hw/virtio/virtio: avoid cost of -ftrivial-auto-var-init in hot path Date: Wed, 11 Jun 2025 14:25:04 -0400 Message-ID: <20250611182533.200590-3-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 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=170.10.129.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1749666411927116600 Since commit 7ff9ff039380 ("meson: mitigate against use of uninitialize stack for exploits") the -ftrivial-auto-var-init=3Dzero compiler option is used to zero local variables. While this reduces security risks associated with uninitialized stack data, it introduced a measurable bottleneck in the virtqueue_split_pop() and virtqueue_packed_pop() functions. These virtqueue functions are in the hot path. They are called for each element (request) that is popped from a VIRTIO device's virtqueue. Using __attribute__((uninitialized)) on large stack variables in these functions improves fio randread bs=3D4k iodepth=3D64 performance from 304k to 332k IOPS (+9%). This issue was found using perf-top(1). virtqueue_split_pop() was one of the top CPU consumers and the "annotate" feature showed that the memory zeroing instructions at the beginning of the functions were hot. Fixes: 7ff9ff039380 ("meson: mitigate against use of uninitialize stack for= exploits") Cc: Daniel P. Berrang=C3=A9 Signed-off-by: Stefan Hajnoczi Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-3-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/virtio/virtio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 5534251e01..82a285a31d 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1689,8 +1689,8 @@ static void *virtqueue_split_pop(VirtQueue *vq, size_= t sz) VirtIODevice *vdev =3D vq->vdev; VirtQueueElement *elem =3D NULL; unsigned out_num, in_num, elem_entries; - hwaddr addr[VIRTQUEUE_MAX_SIZE]; - struct iovec iov[VIRTQUEUE_MAX_SIZE]; + hwaddr QEMU_UNINITIALIZED addr[VIRTQUEUE_MAX_SIZE]; + struct iovec QEMU_UNINITIALIZED iov[VIRTQUEUE_MAX_SIZE]; VRingDesc desc; int rc; =20 @@ -1836,8 +1836,8 @@ static void *virtqueue_packed_pop(VirtQueue *vq, size= _t sz) VirtIODevice *vdev =3D vq->vdev; VirtQueueElement *elem =3D NULL; unsigned out_num, in_num, elem_entries; - hwaddr addr[VIRTQUEUE_MAX_SIZE]; - struct iovec iov[VIRTQUEUE_MAX_SIZE]; + hwaddr QEMU_UNINITIALIZED addr[VIRTQUEUE_MAX_SIZE]; + struct iovec QEMU_UNINITIALIZED iov[VIRTQUEUE_MAX_SIZE]; VRingPackedDesc desc; uint16_t id; int rc; --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749667060; cv=none; d=zohomail.com; s=zohoarc; b=Dj3hdXGJcPDdWIfnScSevN03EiJ1RGb0gM0zwpFoTAGkMvuWh7CPoHp9A/Ufv4fgPupZPlJW0lq6zxewb7ep2grIbo1tvm9e9eNSzq6nZ9Pbzz/9MQmnl0a8/bbmZ6+wb1eEdcdrfR7pjshKxs/yvl77p5TsYQFs2/+fgWKtJ5o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749667060; 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=mm98qXn5IDmt3E297nVLvHl5ngbngtyzaU5/4dIyXnw=; b=XzecwfeMs6H/DLmuXMQrBuHo02Soj8Uc70myvXJbGhS6QWRcEuLNoL1bWcIdGYlnccivx/C6zu0lRzpOGNDO6D5rYEfwZoY2mUGN3hwOFMbWq5Ba61qd2LvjOsvK9hvKHT+yIrfrZFEDOxOrrMalBeLk/llf97DEoDfEirBJplM= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749667060188916.3010714913249; Wed, 11 Jun 2025 11:37:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQAo-0002qR-CQ; Wed, 11 Jun 2025 14:27:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQ9p-0001as-Tp for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:44 -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 1uPQ9g-0001Hd-OS for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:41 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-591-E9XgjjYEMhqIillSL_vM_Q-1; Wed, 11 Jun 2025 14:26:07 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0D00B195608E; Wed, 11 Jun 2025 18:26:03 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F008819560A3; Wed, 11 Jun 2025 18:26:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666370; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mm98qXn5IDmt3E297nVLvHl5ngbngtyzaU5/4dIyXnw=; b=OmRx0aR8nKs1UnbqFH55GSxG5J4cR26tz/h9u/YavUJOo8AY0hq5BUcy5PIYZKBH4yY2KE ypE1fT/MA365eSHfR1qR0ZxmSXt+xlBNyYZxRelRNUuDJJSdx2/7zBhQLOvx8JDaeem0Xg bEl78CTIfrhLH4qg2vWSR9jxZk1Hg0I= X-MC-Unique: E9XgjjYEMhqIillSL_vM_Q-1 X-Mimecast-MFC-AGG-ID: E9XgjjYEMhqIillSL_vM_Q_1749666364 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 03/31] block: skip automatic zero-init of large array in ioq_submit Date: Wed, 11 Jun 2025 14:25:05 -0400 Message-ID: <20250611182533.200590-4-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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=170.10.129.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749667062016116600 From: Daniel P. Berrang=C3=A9 The 'ioq_submit' method has a struct array that is 8k in size. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'iocbs' array will selectively initialized when processing the I/O data. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-4-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- block/linux-aio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/linux-aio.c b/block/linux-aio.c index 407369f5c9..c200e7ad20 100644 --- a/block/linux-aio.c +++ b/block/linux-aio.c @@ -291,7 +291,7 @@ static void ioq_submit(LinuxAioState *s) { int ret, len; struct qemu_laiocb *aiocb; - struct iocb *iocbs[MAX_EVENTS]; + QEMU_UNINITIALIZED struct iocb *iocbs[MAX_EVENTS]; QSIMPLEQ_HEAD(, qemu_laiocb) completed; =20 do { --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749666541; cv=none; d=zohomail.com; s=zohoarc; b=YiWt7k+BEU7tm8TRimXH1L8l/mDCHPx0poknfIyivOuyK0HBAwyA84+ivh+b9VDS/TPJ3joVHVR4ydtqHCqUJydM88NvWnhUt7kdlTdUvvH+JQ/8Ru984ZjbT8YW40V1fIXY6/P/c2xe7UDcgpH70UbsNe7w+rzxkarpp7k5jhA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749666541; 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=mt7Eev/XPLmMMdxpFyBJo5Jewpv1gUUY+0ePO6YtQ/c=; b=TcW/BptDXiBbKG2UfH+SfP7ib7M4ScnVCve4x8e4byQtKmXLv9amepork6eOws92/tqtDbK5/vdgCw6oW1nkqKFjDGeG9oTdNt4WO4S/6QCr1/IK69yCvIh4JX+wN+L1ZInZYfRBowIsTAEdR6HPR31jm1Qgz8AEHfJlyIZEgUM= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749666541560565.1376591433974; Wed, 11 Jun 2025 11:29:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQAe-0002N8-Uu; Wed, 11 Jun 2025 14:27:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQ9l-0001WU-GM for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:37 -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 1uPQ9e-0001IL-W0 for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:33 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-657-cE_DP5rNMDGSzqy0Vv7YPQ-1; Wed, 11 Jun 2025 14:26:09 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4ED6918002A4; Wed, 11 Jun 2025 18:26:05 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 254A31800284; Wed, 11 Jun 2025 18:26:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mt7Eev/XPLmMMdxpFyBJo5Jewpv1gUUY+0ePO6YtQ/c=; b=C+2jqb5jcCi16Un6BOubwJl6poL/qN51oQmEfc45UVV3Z3H0XFqQE79au7sgAX7PCWkEtV rzzohiUkCuuPdntJ5w8eOG3c35E7ex0HFE2Sb72dGUHlv8RpfFKVLc0iR3QmsA25FHn21E ZsZUGnA3X9EvfrYxGO0U8Gs30lCUAl4= X-MC-Unique: cE_DP5rNMDGSzqy0Vv7YPQ-1 X-Mimecast-MFC-AGG-ID: cE_DP5rNMDGSzqy0Vv7YPQ_1749666366 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 04/31] chardev/char-fd: skip automatic zero-init of large array Date: Wed, 11 Jun 2025 14:25:06 -0400 Message-ID: <20250611182533.200590-5-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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=170.10.129.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749666543368116600 From: Daniel P. Berrang=C3=A9 The 'fd_chr_read' method has a 4k byte array used for copying data between the socket and device. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'buf' array will be fully initialized when reading data off the network socket. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-5-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- chardev/char-fd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chardev/char-fd.c b/chardev/char-fd.c index 23bfe3c0b1..6f03adf872 100644 --- a/chardev/char-fd.c +++ b/chardev/char-fd.c @@ -50,7 +50,7 @@ static gboolean fd_chr_read(QIOChannel *chan, GIOConditio= n cond, void *opaque) Chardev *chr =3D CHARDEV(opaque); FDChardev *s =3D FD_CHARDEV(opaque); int len; - uint8_t buf[CHR_READ_BUF_LEN]; + QEMU_UNINITIALIZED uint8_t buf[CHR_READ_BUF_LEN]; ssize_t ret; =20 len =3D sizeof(buf); --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749666960; cv=none; d=zohomail.com; s=zohoarc; b=bCHfFiEB8aOmgLf7rPhjwI79ev/p2AgpKOj7tZtu5AaAVp4B7WYlNVIKXa0YrFvrR0LSd28kaBM6Bj2oeprkbZ73lPfjp97Sy8f8VJKDTKp4e7Wvm8pT+YZdeZmNa4mQ+CiEO86VZdERxBZY0VxEGAOZJfj0hC/DqpaHx24rT/4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749666960; 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=a+3IbSd15/rc8GUbCSOu3df+NumonRFcoNFm3e5bolg=; b=jB8HKfbMzYJ3GUA37a4NL42N58NeJchNgK0b+qx/RTax+qRmlhAqWD69AXUZjYiIuCyaZjLiuGkrE90G56Ek456ysFAe1dS8okgkx0EPVIsrUd0M5+cwhPpPPZ6VGYOcdVea/9eKBjXRfQkdTnu649cMDkRcvPAkAA4jeqA8j4E= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749666960808896.6387484722361; Wed, 11 Jun 2025 11:36:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQAr-0002xp-Qx; Wed, 11 Jun 2025 14:27:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQ9q-0001ay-Qy for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:44 -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 1uPQ9g-0001Ir-VL for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:42 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-622-Q6Hs_-hbPnyFGqvz5I4myw-1; Wed, 11 Jun 2025 14:26:16 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 216D1180028F; Wed, 11 Jun 2025 18:26:11 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 624F218003FC; Wed, 11 Jun 2025 18:26:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=a+3IbSd15/rc8GUbCSOu3df+NumonRFcoNFm3e5bolg=; b=IEdLxosoS1xJFxZDZ/8kB19jWXyVdCLrrV5EwxfWNV5BgNJ0NKIRgu+PTRr9zllRCStXFU ZhG8TPFEAu418p31oce9Z7pbSOeb6mE9/oXpoUoHQfJ19W0gobXuNEMF1Dm8pWTai9vVXu hOcjjtdvbyuh/2Ni3gT8GkEcIVA5thg= X-MC-Unique: Q6Hs_-hbPnyFGqvz5I4myw-1 X-Mimecast-MFC-AGG-ID: Q6Hs_-hbPnyFGqvz5I4myw_1749666372 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 05/31] chardev/char-pty: skip automatic zero-init of large array Date: Wed, 11 Jun 2025 14:25:07 -0400 Message-ID: <20250611182533.200590-6-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=170.10.133.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749666962605116600 From: Daniel P. Berrang=C3=A9 The 'pty_chr_read' method has a 4k byte array used for copying data between the PTY and device. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'buf' array will be fully initialized when reading data off the PTY. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-6-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- chardev/char-pty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chardev/char-pty.c b/chardev/char-pty.c index c28554e6e0..674e9b3f14 100644 --- a/chardev/char-pty.c +++ b/chardev/char-pty.c @@ -154,7 +154,7 @@ static gboolean pty_chr_read(QIOChannel *chan, GIOCondi= tion cond, void *opaque) Chardev *chr =3D CHARDEV(opaque); PtyChardev *s =3D PTY_CHARDEV(opaque); gsize len; - uint8_t buf[CHR_READ_BUF_LEN]; + QEMU_UNINITIALIZED uint8_t buf[CHR_READ_BUF_LEN]; ssize_t ret; =20 len =3D sizeof(buf); --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749666624; cv=none; d=zohomail.com; s=zohoarc; b=ZHRLESP58iKlXAYmLkHa/JJKNMn/cb5Ph4pKZvvaveEqUy1ZYv6cms7gCt2x/WABF9P7uxITqwyUaL/gNwLLflITxjt1YAk+4y6Q4wPQ+rX0Vdope3HO66fVfsxUBlBjEOrdea6759QGii4xpuaPqOwuU/yosXiG0a6XxGBpM30= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749666624; 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=HrDpLNUDxNjCCWyN7dPnjdzORIrSgivckyj7LOAAsYg=; b=AT4v7QiOrwYAGA78nGvExi9kb5p670RtX00ZQ2Uv3g3e7yago07pVaeU9kgnsQlEPUvorGQHgdyOKqs03Lk2AuMoxYOyRPEdf5DSveK/c2ln8X36kdy8jDF8NWYQDSz4iBW6izVUXW4FfWFwlZHDoEhDT+SJds0jG/tQ+4QfySw= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749666624676975.8765533243992; Wed, 11 Jun 2025 11:30:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQAm-0002k6-6f; Wed, 11 Jun 2025 14:27:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQ9l-0001Wc-Jy for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:38 -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 1uPQ9f-0001JU-Fu for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:34 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-61-0fmQl1_hOTK9_fyKainSSA-1; Wed, 11 Jun 2025 14:26:19 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9893418002A2; Wed, 11 Jun 2025 18:26:14 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 85D4319560A3; Wed, 11 Jun 2025 18:26:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666382; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HrDpLNUDxNjCCWyN7dPnjdzORIrSgivckyj7LOAAsYg=; b=Oeb+fjpkoPDN6fQ7KOZnf4hG4LpZzAS+enRVq/oT5nzA6ZScKAJe+rnSu1xbPVLwPw6bjh wmkM2EORwHDUf0TSUPd4w/Ait6S2v9seSRuuJ8v1ywwuPfmU4V1Tgd11YQVS4eTMaoeezk k0NYRHKQq73AE8T0tZWzGDmwQ93TErg= X-MC-Unique: 0fmQl1_hOTK9_fyKainSSA-1 X-Mimecast-MFC-AGG-ID: 0fmQl1_hOTK9_fyKainSSA_1749666375 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 06/31] chardev/char-socket: skip automatic zero-init of large array Date: Wed, 11 Jun 2025 14:25:08 -0400 Message-ID: <20250611182533.200590-7-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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=170.10.129.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749666626758116600 From: Daniel P. Berrang=C3=A9 The 'tcp_chr_read' method has a 4k byte array used for copying data between the socket and device. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'buf' array will be fully initialized when reading data off the network socket. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-7-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- chardev/char-socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index e8dd2931dc..1e8313915b 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -497,7 +497,7 @@ static gboolean tcp_chr_read(QIOChannel *chan, GIOCondi= tion cond, void *opaque) { Chardev *chr =3D CHARDEV(opaque); SocketChardev *s =3D SOCKET_CHARDEV(opaque); - uint8_t buf[CHR_READ_BUF_LEN]; + QEMU_UNINITIALIZED uint8_t buf[CHR_READ_BUF_LEN]; int len, size; =20 if ((s->state !=3D TCP_CHARDEV_STATE_CONNECTED) || --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749666630; cv=none; d=zohomail.com; s=zohoarc; b=N+gbZ/8xDW5O1kQ6MLPOgxB69P/dOzC4bMXy4V3iDBA4bxAQXNeVFMHNhR5UmE9eXQyOxXYwMT69SyaZE2lBpFqodudQ8he8YREaRmMCN5/pTJ5BmL7JbK9YrelnMpYnn4ucVRdNOApV161PrWv/eBwkrY2ynYOICsEGGEenVDE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749666630; 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=6KBxYExeSIO+wAZqDocNq5N46kWlKpuMH4htwSA8I7o=; b=Ha3KqecYxwvahTnM/GeVh2d//bQeY+KYSR/IRGIBbL+FS0jWDjxuhTrsn/7RTbZC2iLYbCBXkUFrKGuyUSqQjmGNM5Gh4BArDlGWoHKjDgS+J+8ZRQs1Zt5vqTPDni8VixraG1B9vhTnNkWZzSaEgqUC0VfYv0RPnzbup4sYsz4= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749666630792600.3369320301263; Wed, 11 Jun 2025 11:30:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQB3-0003GN-8C; Wed, 11 Jun 2025 14:27:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQ9r-0001bX-M1 for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:44 -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 1uPQ9g-0001Jo-Vh for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:43 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-423-7HAgH3vrNMOZl3uftiPVJA-1; Wed, 11 Jun 2025 14:26:21 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EB5F21955F45; Wed, 11 Jun 2025 18:26:17 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E468218003FC; Wed, 11 Jun 2025 18:26:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6KBxYExeSIO+wAZqDocNq5N46kWlKpuMH4htwSA8I7o=; b=DJ5l8iwmcSAO8c0/J2YxPvGwX0Lez2eNIsNGo0XyTZthez1LIYaTcpwabwEYCXZL6L5BjG ID1kKs39E8Ahgcf9Ga9stVjTSlzTvRcgoPdNlVWl1mw19TxOIbAqp4P+RRY5QwiWbvnWdA qt3iFpV5YhU7xRg+A+wXYQ/H2Vsz3bM= X-MC-Unique: 7HAgH3vrNMOZl3uftiPVJA-1 X-Mimecast-MFC-AGG-ID: 7HAgH3vrNMOZl3uftiPVJA_1749666378 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 07/31] hw/audio/ac97: skip automatic zero-init of large arrays Date: Wed, 11 Jun 2025 14:25:09 -0400 Message-ID: <20250611182533.200590-8-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=170.10.129.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749666632664116600 From: Daniel P. Berrang=C3=A9 The 'read_audio' & 'write_audio' methods have a 4k byte array used for copying data between the audio backend and device. Skip the automatic zero-init of these arrays to eliminate the performance overhead in the I/O hot path. The 'tmpbuf' array will be fully initialized when reading data from the audio backend and/or device memory. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-8-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/audio/ac97.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index 669a0463cc..eb7a847080 100644 --- a/hw/audio/ac97.c +++ b/hw/audio/ac97.c @@ -886,7 +886,7 @@ static void nabm_writel(void *opaque, uint32_t addr, ui= nt32_t val) static int write_audio(AC97LinkState *s, AC97BusMasterRegs *r, int max, int *stop) { - uint8_t tmpbuf[4096]; + QEMU_UNINITIALIZED uint8_t tmpbuf[4096]; uint32_t addr =3D r->bd.addr; uint32_t temp =3D r->picb << 1; uint32_t written =3D 0; @@ -959,7 +959,7 @@ static void write_bup(AC97LinkState *s, int elapsed) static int read_audio(AC97LinkState *s, AC97BusMasterRegs *r, int max, int *stop) { - uint8_t tmpbuf[4096]; + QEMU_UNINITIALIZED uint8_t tmpbuf[4096]; uint32_t addr =3D r->bd.addr; uint32_t temp =3D r->picb << 1; uint32_t nread =3D 0; --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749667122; cv=none; d=zohomail.com; s=zohoarc; b=TYB9XfN3BzFoKSZ36ymqFn5buVx5RbmQR+MFw46diqc3aPHnFNJyfrbaUjPeCLMw2DRJvovCu6y37yjYOcyriCyJwnX6sv6Q21oxzS1+bI8tTO9bBi0+KI7gdC3RUSN+VMoT3z6KY06HlfFIh085r6x10RbrDPn/9tG0wwuM8Qo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749667122; 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=O+7OFQBZxd+Nmat7sdVrdGixlbTcW+usn+WRWhkWZmc=; b=m0sI6heM9nWeZhCLmtNFx7kkJF+QlnoplC9LJ6RzoKi/Q/jVxdxHbk6X1VQcR0GD9cg8+EyUJmM0JD/o4Ylcle0RGEct7Ryu67m4fZyRwwwm0oeO+YNzQqoXsYN+lLcnxh26cifu300LFqvuXnMkn2XKo3TKSPwQwE9a3n+zW0g= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749667122194444.26569704950896; Wed, 11 Jun 2025 11:38:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQB4-0003MI-KT; Wed, 11 Jun 2025 14:27:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQ9u-0001d3-Lt for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:47 -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 1uPQ9k-0001KZ-TZ for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:46 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-468-oT-YHPVcO2Os6-8OnAC1NA-1; Wed, 11 Jun 2025 14:26:25 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 220F6195608E; Wed, 11 Jun 2025 18:26:21 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1FA1519560AF; Wed, 11 Jun 2025 18:26:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O+7OFQBZxd+Nmat7sdVrdGixlbTcW+usn+WRWhkWZmc=; b=CalUVg1mv7NBUPuv0uj+UoupDkaLTlE3Qg8vrJiO2chr/yqr01JKzlSmgYxlo8Cvvg5wf3 7ms2X5ZoCsIaAza2cJ06TXb9SvTppY5/j99BBNkbm3DQvWNmRhXjLSNdt64bSrT+XO0VC1 RFRw3ltjDVPdR11fUoq0t4Xb42xAPmE= X-MC-Unique: oT-YHPVcO2Os6-8OnAC1NA-1 X-Mimecast-MFC-AGG-ID: oT-YHPVcO2Os6-8OnAC1NA_1749666381 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 08/31] hw/audio/cs4231a: skip automatic zero-init of large arrays Date: Wed, 11 Jun 2025 14:25:10 -0400 Message-ID: <20250611182533.200590-9-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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=170.10.133.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749667122800116600 From: Daniel P. Berrang=C3=A9 The 'cs_write_audio' method has a pair of byte arrays, one 4k in size and one 8k, which are used in converting audio samples. Skip the automatic zero-init of these arrays to eliminate the performance overhead in the I/O hot path. The 'tmpbuf' array will be fully initialized when reading a block of data from the guest. The 'linbuf' array will be fully initialized when converting the audio samples. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-9-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/audio/cs4231a.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c index eb9a45805b..6dfff202ff 100644 --- a/hw/audio/cs4231a.c +++ b/hw/audio/cs4231a.c @@ -528,7 +528,7 @@ static int cs_write_audio (CSState *s, int nchan, int d= ma_pos, int dma_len, int len) { int temp, net; - uint8_t tmpbuf[4096]; + QEMU_UNINITIALIZED uint8_t tmpbuf[4096]; IsaDmaClass *k =3D ISADMA_GET_CLASS(s->isa_dma); =20 temp =3D len; @@ -547,7 +547,7 @@ static int cs_write_audio (CSState *s, int nchan, int d= ma_pos, copied =3D k->read_memory(s->isa_dma, nchan, tmpbuf, dma_pos, to_c= opy); if (s->tab) { int i; - int16_t linbuf[4096]; + QEMU_UNINITIALIZED int16_t linbuf[4096]; =20 for (i =3D 0; i < copied; ++i) linbuf[i] =3D s->tab[tmpbuf[i]]; --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749667024; cv=none; d=zohomail.com; s=zohoarc; b=m4MqzwZCDlvuv0/521xOVf/bbQFJL6r1Ya7VUw/HMqpE6Mu7Sjw2IOtsa2bqL9l9KKHS/7VwPxZIiItXnqJ++1LsIeJebC78YtoVaofcgVS+hCOgbo4GavidFozzBKj9/YRSw+31LRLQCQzDzoDtoOcaFkXUCy7r4SU5arfucJA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749667024; 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=tOmeR+7YKB0Um31qhvM3CwNMwBeIMA6XIJySMb2QpY4=; b=XEiiXarTlLScEOBI3B+TrximaHb0bE0c4qwblhR7+EepDw8ZL4hDEMEujWBLIV7P4SUe9u9TkHUeXnvlkzcAUJeEGdQgzO88JOr3JIe2U2kWqffYZVHZ5vrXdNCTHbtnoSn8JmdwuFEy3CE2j/61StAYnxYrn71PZkF15vhM6z8= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749667024425838.3095628647651; Wed, 11 Jun 2025 11:37:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQB5-0003Qo-8I; Wed, 11 Jun 2025 14:27:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQ9u-0001cy-8I for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:47 -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 1uPQ9k-0001M6-1D for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:45 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-157-u0FD2h3PP0KIDu8Q0n65Hw-1; Wed, 11 Jun 2025 14:26:32 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 66D92195608F; Wed, 11 Jun 2025 18:26:28 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8E91119560B2; Wed, 11 Jun 2025 18:26:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tOmeR+7YKB0Um31qhvM3CwNMwBeIMA6XIJySMb2QpY4=; b=IRtljaXDeT8tuqmmxJOreAGPR6K7lKLQ3PKleRX5YLaKErz3n9lAJeo8B2H0LzD4v3tJQH krtdAuYQn46yKAj0Yjmk8W3DLf5DsColCtO8WblRTtGj+yfRmc1o+55Wt3wK3YpEd2XOaJ 02HezKOz2wNWVY0gOj6c5Xrain8tjq4= X-MC-Unique: u0FD2h3PP0KIDu8Q0n65Hw-1 X-Mimecast-MFC-AGG-ID: u0FD2h3PP0KIDu8Q0n65Hw_1749666388 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 09/31] hw/audio/es1370: skip automatic zero-init of large array Date: Wed, 11 Jun 2025 14:25:11 -0400 Message-ID: <20250611182533.200590-10-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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=170.10.129.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1749667025353116600 From: Daniel P. Berrang=C3=A9 The 'es1370_transfer_audio' method has a 4k byte array used for copying data between the audio backend and device. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'tmpbuf' array will be fully initialized when reading data from the audio backend and/or device memory. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-10-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/audio/es1370.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index 8efb969212..a6a32a6348 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -604,7 +604,7 @@ static uint64_t es1370_read(void *opaque, hwaddr addr, = unsigned size) static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loo= p_sel, int max, bool *irq) { - uint8_t tmpbuf[4096]; + QEMU_UNINITIALIZED uint8_t tmpbuf[4096]; size_t to_transfer; uint32_t addr =3D d->frame_addr; int sc =3D d->scount & 0xffff; --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749666626; cv=none; d=zohomail.com; s=zohoarc; b=Qc8dKw3gWxkNUSvnlIGO7AWCWLDnp3hzA3YXf8ecl8K91v1gcYlR1FewcQx/012MULx/Wu+RnVJqd99RJyzmz5aGft7kCraQTRigfr2pDLF10Gr9iwRqzHmhL4sS24x4IoFDN3yHgh1GKb376LP34YW4MV9RzU9gjgMUNBR6BDE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749666626; 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=12JvcWeA/xERILlNpLG6k8ImP52Q27ruWL1INzcd1O0=; b=VUBkK8kRFjS2dwKghoJ5hk0wSY3gShN5Q0FqGknDBCax5eeSR2PZfUB9hkRJtnxeEbTWbcs+DxmlGIWxFR7sMZEIjbHfIf3MRD4LziDqPWMyHonAzyNFxV3DPbSKwZw2DkHPtxgdOuVD0lPmLPSz6G/PzFtK3T35CIDeZisaPL0= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749666626168725.2547674577194; Wed, 11 Jun 2025 11:30:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQB7-0003WA-JA; Wed, 11 Jun 2025 14:28:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQ9v-0001fF-US for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:48 -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 1uPQ9n-0001OU-5I for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:47 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-611-csKpKmkNMU6GEknqFbMg1w-1; Wed, 11 Jun 2025 14:26:34 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 013FE1956051; Wed, 11 Jun 2025 18:26:31 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9F58D19560A3; Wed, 11 Jun 2025 18:26:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=12JvcWeA/xERILlNpLG6k8ImP52Q27ruWL1INzcd1O0=; b=AfwGGVgPXqgi5iVa3Lg2SakSTQYCulk54omh91LHBweXgXe+R2jFZv0wO+w6jswtFHxXeS dmqh7nra9TolgflgTN3D/l5DRAGxinu5QMjNm8imYW4CGK7qLJ40Adz2+H56ywb11IZqFB mVxo8okOpCR3qKyuIIS3hnZpI+pgIto= X-MC-Unique: csKpKmkNMU6GEknqFbMg1w-1 X-Mimecast-MFC-AGG-ID: csKpKmkNMU6GEknqFbMg1w_1749666391 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 10/31] hw/audio/gus: skip automatic zero-init of large array Date: Wed, 11 Jun 2025 14:25:12 -0400 Message-ID: <20250611182533.200590-11-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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=170.10.129.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749666628493116600 From: Daniel P. Berrang=C3=A9 The 'GUS_read_DMA' method has a 4k byte array used for copying data between the audio backend and device. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'tmpbuf' array will be fully initialized when reading data from device memory. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-11-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/audio/gus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/audio/gus.c b/hw/audio/gus.c index 87e8634893..c36df0240f 100644 --- a/hw/audio/gus.c +++ b/hw/audio/gus.c @@ -183,7 +183,7 @@ static int GUS_read_DMA (void *opaque, int nchan, int d= ma_pos, int dma_len) { GUSState *s =3D opaque; IsaDmaClass *k =3D ISADMA_GET_CLASS(s->isa_dma); - char tmpbuf[4096]; + QEMU_UNINITIALIZED char tmpbuf[4096]; int pos =3D dma_pos, mode, left =3D dma_len - dma_pos; =20 ldebug ("read DMA %#x %d\n", dma_pos, dma_len); --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749666636; cv=none; d=zohomail.com; s=zohoarc; b=VqDGXJNqm34887MgzyPRtAZMdxIfMjTLLe4aaA5Ar666ertgXaZ8fre3TJK+kGt8jn2Gh05rpTEFY69e420owNM/vqqwQcU5Z6lgcNv7CqL8PmBtQ3P/spe3Io4oyyriERoEkSvkPvD4u2Z8RM7MzJyU5U2lEwcr596xwyi3l1I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749666636; 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=Go5IXU3Pe7Z7a1UScspRgPi+WTDoYjIknceMmADHQN8=; b=FHkrv+LTC283ddNBhQb6G6S7F5ZgSNuciV7QBY39/W1xyLy1gIjhZZ//+Dh1oQ8LXekJ1sMLG9/cbEHklQop46Pudt5B5rWUhpa2h56zMhDkXoXl+DLuK9lsEGLq0lvBZNlRisZRG6PtDd61s3CnztE5lEeBRJzLFdf9O0EMaq0= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749666635991168.41896817039765; Wed, 11 Jun 2025 11:30:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQBB-0003kg-IY; Wed, 11 Jun 2025 14:28:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQ9y-0001n9-IV for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:50 -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 1uPQ9p-0001Q5-LU for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:50 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-617-KxM9LR3LM2Ok0FmXGII5KQ-1; Wed, 11 Jun 2025 14:26:37 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3FB7A180029D; Wed, 11 Jun 2025 18:26:33 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 34D2019560A3; Wed, 11 Jun 2025 18:26:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Go5IXU3Pe7Z7a1UScspRgPi+WTDoYjIknceMmADHQN8=; b=Z1b99Y57EpZeQpQknjL1eFGuFsu4uYzOKH5kBL4864ZRepRl85bPfuz56afQ+m9f0JyhBD K1yjKnyZEP/UO30339nwiBXWFke3TvdTyK6nRF4u+6xwE7C6axZiamjAhdnr3lNi6RK81w lol4cnThFHa4U3PNgeNukusbferrgVE= X-MC-Unique: KxM9LR3LM2Ok0FmXGII5KQ-1 X-Mimecast-MFC-AGG-ID: KxM9LR3LM2Ok0FmXGII5KQ_1749666393 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 11/31] hw/audio/gus: skip automatic zero-init of large array Date: Wed, 11 Jun 2025 14:25:13 -0400 Message-ID: <20250611182533.200590-12-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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=170.10.129.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749666636604116600 From: Daniel P. Berrang=C3=A9 The 'mv88w8618_audio_callback' method has a 4k byte array used for copying data between the audio backend and device. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'buf' array will be fully initialized when reading data from device memory. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-12-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/audio/marvell_88w8618.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/audio/marvell_88w8618.c b/hw/audio/marvell_88w8618.c index 6d3ebbb0c8..c5c79d083a 100644 --- a/hw/audio/marvell_88w8618.c +++ b/hw/audio/marvell_88w8618.c @@ -66,7 +66,7 @@ static void mv88w8618_audio_callback(void *opaque, int fr= ee_out, int free_in) { mv88w8618_audio_state *s =3D opaque; int16_t *codec_buffer; - int8_t buf[4096]; + QEMU_UNINITIALIZED int8_t buf[4096]; int8_t *mem_buffer; int pos, block_size; =20 --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749666714; cv=none; d=zohomail.com; s=zohoarc; b=TGyjMvMo04I16yO4hY1btQ2uKAzS+/k6/2EzUZe76nVwNs5akKJseiMr5XMKkmoX7idcIlGMneUjS2eyBGyWdlNykjdinEp4w9vviLUOd2nlyjMPMiMGR+52Fxi1pdpCMGe0V/5MvFfxB94zKuiGZKFI4RYrVxp1uVoLstlPB6c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749666714; 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=UpwIHbzvu7jlclXB/9FN3lLirxVS/6Y80YtOZqhOwSU=; b=JFQI7KQ5lkvRyh6m1/zm4dm+T4b1ZDc6D2r2i2d1BLRGG3wL7Ywo0EHrSfCGI7raImvqUVB17iv1egTPJ8txwlfgqvzu7mI7bHOQfSpoxuXGEibAxT97laycF28njYT3X/orSgxoqx6Rcj1eTcIP3qh3Zl/k+2Eu7h+V/LzCrHQ= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 174966671476275.32081381066018; Wed, 11 Jun 2025 11:31:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQBE-0003zb-F0; Wed, 11 Jun 2025 14:28:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQA1-0001o6-4T for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:53 -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 1uPQ9s-0001Rj-Sq for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:51 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-21-SdR7kE7NN5KcDoOsCTUOhg-1; Wed, 11 Jun 2025 14:26:39 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1F42E18089B6; Wed, 11 Jun 2025 18:26:36 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8E0A230002C3; Wed, 11 Jun 2025 18:26:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UpwIHbzvu7jlclXB/9FN3lLirxVS/6Y80YtOZqhOwSU=; b=iTk+qMT6Q1PvdPkAkjlznBcmDGhPt0byiXNbP+PzbJkFQ3iL2jRsya3D6wmCHkfsN0TbZ3 NOcE7naJpx++Pnl9niRyloP7iTPZDNg5OPpDEt81akcp/S9E5vz+pog+PVD3738n07ovTH VZYqzSI0g5gTclGYMNU/zCoERUnwFnU= X-MC-Unique: SdR7kE7NN5KcDoOsCTUOhg-1 X-Mimecast-MFC-AGG-ID: SdR7kE7NN5KcDoOsCTUOhg_1749666396 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 12/31] hw/audio/sb16: skip automatic zero-init of large array Date: Wed, 11 Jun 2025 14:25:14 -0400 Message-ID: <20250611182533.200590-13-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.129.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749666715587116600 From: Daniel P. Berrang=C3=A9 The 'write_audio' method has a 4k byte array used for copying data between the audio backend and device. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'tmpbuf' array will be fully initialized when reading data from device memory. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-13-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/audio/sb16.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index 19fd3b9020..bac64118fe 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -1181,7 +1181,7 @@ static int write_audio (SB16State *s, int nchan, int = dma_pos, IsaDma *isa_dma =3D nchan =3D=3D s->dma ? s->isa_dma : s->isa_hdma; IsaDmaClass *k =3D ISADMA_GET_CLASS(isa_dma); int temp, net; - uint8_t tmpbuf[4096]; + QEMU_UNINITIALIZED uint8_t tmpbuf[4096]; =20 temp =3D len; net =3D 0; --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749666660; cv=none; d=zohomail.com; s=zohoarc; b=PB/J34jvonecBgw0wbyivFy+re4rnJ44HZ5wxkQge0FvxraCUmC8M6CbxFc14+LbsMTB8FGzjxWV9buDhNba5jl7q+gvS8V5aN3LkeTpXwShY+q7RpMWerT8/8q4RicuCemM4zDw2KgznI/auGaITpOd1WKcfINr4oPFD87MuPo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749666660; 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=im3waQOttvXRq21y6DO+WT6rky//dGN0HZp3WTaOmSo=; b=Z+88+4wp50EAnuXTvI2ANDgA1UF4b9ZcyGEfxqwn98Q2rzx37XXzTbX9WRRB3x0Qt7hrpxtPTsoSFKTHr1rYdHjVEf0jqJlPK1z/rQHHLySf2uukpSWfa2pT5oCHY/rCxgDrmc/x+IccYfvrvuSqcl+vhWgFc2Aq9c7XUknUl64= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749666660006979.4598612029434; Wed, 11 Jun 2025 11:31:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQBL-0004PA-2l; Wed, 11 Jun 2025 14:28:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQA1-0001oA-7K for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:53 -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 1uPQ9t-0001SV-Oa for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:52 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-267-FkF2Su1ZOYS-Chr4rc82RA-1; Wed, 11 Jun 2025 14:26:41 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5473E1955F2C; Wed, 11 Jun 2025 18:26:38 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6B2DA19560A3; Wed, 11 Jun 2025 18:26:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=im3waQOttvXRq21y6DO+WT6rky//dGN0HZp3WTaOmSo=; b=dH4UK6X5+8FRdxksYF1NUf+w9xatOOYAUj9hRKuMc3s7ZyDWF8dSJ4ev9viOQWp9X7Yv7O jcjvZJRiVclCXb3WNT3jvGQMAyjCSj5vYiQuWtjMqbYnCJ/Ol+mmMY6TQSsY+6eFfbWBUT TW8RRmo6M5+D0tsQ8G8EXxET43mrVJw= X-MC-Unique: FkF2Su1ZOYS-Chr4rc82RA-1 X-Mimecast-MFC-AGG-ID: FkF2Su1ZOYS-Chr4rc82RA_1749666398 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 13/31] hw/audio/via-ac97: skip automatic zero-init of large array Date: Wed, 11 Jun 2025 14:25:15 -0400 Message-ID: <20250611182533.200590-14-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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=170.10.129.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1749666660971116600 From: Daniel P. Berrang=C3=A9 The 'out_cb' method has a 4k byte array used for copying data between the audio backend and device. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'tmpbuf' array will be fully initialized when reading data from device memory. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-14-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/audio/via-ac97.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/audio/via-ac97.c b/hw/audio/via-ac97.c index 1e0a5c7398..d5231e1cf2 100644 --- a/hw/audio/via-ac97.c +++ b/hw/audio/via-ac97.c @@ -175,7 +175,7 @@ static void out_cb(void *opaque, int avail) ViaAC97SGDChannel *c =3D &s->aur; int temp, to_copy, copied; bool stop =3D false; - uint8_t tmpbuf[4096]; + QEMU_UNINITIALIZED uint8_t tmpbuf[4096]; =20 if (c->stat & STAT_PAUSED) { return; --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749666972; cv=none; d=zohomail.com; s=zohoarc; b=CeNP2/v21sZcQ0ViUPx8N5zABNPQ6I80moY9Cv/+qGHq/wdoJNHzW14A0CVmqoX+SA7MLADsMLE1yMpEnAF4OEYgLbN8wbMFTJPdQncGPuhBBvqFEzsa49nI3BPoHpQAIznVCkXoCdXgdyHKGsxtc4w1kqwLWB9i5lIfOMJeZtE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749666972; 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=mRFy2Ucg58TGuUkHvRrPt1Knp1WbjYx3ysY4ROiLkAw=; b=O1lG9LHotgN/4r1iYNQHQP4PnFjkBqTLbr025zo72ILIwFvFTMAdns2W3G72iaWWgpi03NJNa35LlZAYeL2D0Xer03S0NkYwr7tvC0SahzsXnNM/s5KFBs7UJXiUtV6UI+x4767Ny+aCxCCE8WpUv+72HxMhirOm+A0i2Jb5xyQ= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749666972730348.52869724891855; Wed, 11 Jun 2025 11:36:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQBt-0005XP-PE; Wed, 11 Jun 2025 14:28:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQA7-0001rZ-38 for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:01 -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 1uPQA2-0001Wc-TO for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:56 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-316-Sv3XTrdpMAeAY9szI_NyDA-1; Wed, 11 Jun 2025 14:26:51 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 79A3F1955F08; Wed, 11 Jun 2025 18:26:43 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BFF811956087; Wed, 11 Jun 2025 18:26:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mRFy2Ucg58TGuUkHvRrPt1Knp1WbjYx3ysY4ROiLkAw=; b=QPdXH1JkNlGFFI0F7Wcpr9pqpsDrkDgutIFiQ+Eavt72u052WXAlBojntNGqLqqslJAjWb tfvfJbuLqQ7nC0kfERdrJrNLFmkn3Ue+aSFBiueHjueDC5bax/c/zowuIfsurxpnjrcO/s L5wPzoyFt3aX5BEaXAnYbKd6ZFdrKm4= X-MC-Unique: Sv3XTrdpMAeAY9szI_NyDA-1 X-Mimecast-MFC-AGG-ID: Sv3XTrdpMAeAY9szI_NyDA_1749666403 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 14/31] hw/char/sclpconsole-lm: skip automatic zero-init of large array Date: Wed, 11 Jun 2025 14:25:16 -0400 Message-ID: <20250611182533.200590-15-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 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=170.10.133.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749666974964116600 From: Daniel P. Berrang=C3=A9 The 'process_mdb' method has a 4k byte array used for copying data between the guest and the chardev backend. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'buffer' array will be selectively initialized when data is converted between EBCDIC and ASCII. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-15-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/char/sclpconsole-lm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c index e9580aacba..3e40d5e434 100644 --- a/hw/char/sclpconsole-lm.c +++ b/hw/char/sclpconsole-lm.c @@ -214,7 +214,7 @@ static int process_mdb(SCLPEvent *event, MDBO *mdbo) { int rc; int len; - uint8_t buffer[SIZE_BUFFER]; + QEMU_UNINITIALIZED uint8_t buffer[SIZE_BUFFER]; =20 len =3D be16_to_cpu(mdbo->length); len -=3D sizeof(mdbo->length) + sizeof(mdbo->type) --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749666666; cv=none; d=zohomail.com; s=zohoarc; b=ZxP/I2ldmEnbSNysWfQiKu46nEXPP2OFEguKyLSrOxg2vzmfhvSpNfEXB6Z+3EV6GHhVMZDHuMAEs9Dgd49MRXZShEB5QIGKaCAh/SiW9APF3DEVpOwVC9BHZJs4CwRxt11c45IcT0W0jN9xpYo/BwDrOTu5VhCs9WZHtqkh4T0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749666666; 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=AWdb0Sqw9fzzDH4yTo03Hj/NjPCQHDhEN+9qHe2StXY=; b=TzKPOVI6ILwpO4SgG3itqNTVLraTd7KZpeL6nqd9GRwv2w3GLKNIQH3oan00mQL+bseJq++cB95yK/U+0jUzzDLO7guqcV6mAFI6+A5fuUF9IQfvHPFRMeqOkzPAUXX9G2zH0cVeeh7De+gAeBFvX/hpDH3c0SyD2kGLg8uF/bU= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749666666965461.4484750261163; Wed, 11 Jun 2025 11:31:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQBR-0004g3-Sw; Wed, 11 Jun 2025 14:28:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQA4-0001qW-1h for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:56 -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 1uPQA0-0001VQ-QV for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:26:55 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-462-dh4qVUhPNIWR5eVZoiLTEw-1; Wed, 11 Jun 2025 14:26:49 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9ED5E19560A2; Wed, 11 Jun 2025 18:26:45 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id ACEC31956094; Wed, 11 Jun 2025 18:26:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AWdb0Sqw9fzzDH4yTo03Hj/NjPCQHDhEN+9qHe2StXY=; b=VRbwYn3gDVBPXaLWxU5UbDj9TxIPHLnDU2jUXL3/QRo8yI1gtVuu+lXzeBTC5au5lMIGR1 AXmVypghxReU+2ffw+xCw5AS8mpwU6lt8BHVBstU4aszv8BB+sp3NgLaWRF4p/Z/pUCU7E UncYzS+74yUerGfc6rNfG+QdntJfTaw= X-MC-Unique: dh4qVUhPNIWR5eVZoiLTEw-1 X-Mimecast-MFC-AGG-ID: dh4qVUhPNIWR5eVZoiLTEw_1749666405 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 15/31] hw/dma/xlnx_csu_dma: skip automatic zero-init of large array Date: Wed, 11 Jun 2025 14:25:17 -0400 Message-ID: <20250611182533.200590-16-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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=170.10.133.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749666668966116600 From: Daniel P. Berrang=C3=A9 The 'xlnx_csu_dma_src_notify' method has a 4k byte array used for copying DMA data. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'buf' array will be fully initialized when data is copied. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-16-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/dma/xlnx_csu_dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/dma/xlnx_csu_dma.c b/hw/dma/xlnx_csu_dma.c index 3db3904d83..d8c7da1a50 100644 --- a/hw/dma/xlnx_csu_dma.c +++ b/hw/dma/xlnx_csu_dma.c @@ -287,7 +287,7 @@ static uint32_t xlnx_csu_dma_advance(XlnxCSUDMA *s, uin= t32_t len) static void xlnx_csu_dma_src_notify(void *opaque) { XlnxCSUDMA *s =3D XLNX_CSU_DMA(opaque); - unsigned char buf[4 * 1024]; + QEMU_UNINITIALIZED unsigned char buf[4 * 1024]; size_t rlen =3D 0; =20 ptimer_transaction_begin(s->src_timer); --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749666572; cv=none; d=zohomail.com; s=zohoarc; b=L22+1H52CJcX3yIp3ZGtz5G+eMBOZieIzFvuztZjkO2Ko0Tawwy06avy2APqZp7GPKa0TAttz+RkaH4ea/xrAPIMN3Ww3QtVs7/1Wd8d/OBtWQN+dA9tpC80nlyJw3SxGUqWXjrDklCOT61R2CWmwbE3QvAMAK9/fmXidH/c+Wk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749666572; 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=EY31iwe6lMrC3heUYVrnbfnuVcc4xslPfJSpEvuNg6o=; b=PSd0569XV8wGbwWQaATz28K3X/Ch8bgR7KDCzmZuL4u1Opqk/qlzZamxiaIYgWYnQE6A3AR3gAnW2kguYU6Cjne7CGIWP71fVnlMrAg0uhAtyzpIOH7YsytRnnVvBHezOLWKJvNHukFBmqtllzVye21r57U39ofjyoKhQ5P18dI= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749666572757170.60729932256697; Wed, 11 Jun 2025 11:29:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQBY-0004h9-Dx; Wed, 11 Jun 2025 14:28:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQAJ-0001xi-RY for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:13 -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 1uPQA7-0001YG-E8 for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:04 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-130-xO02etT5ORmRJ79kOiamwA-1; Wed, 11 Jun 2025 14:26:54 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A72D11809C80; Wed, 11 Jun 2025 18:26:48 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D1F1519560A3; Wed, 11 Jun 2025 18:26:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EY31iwe6lMrC3heUYVrnbfnuVcc4xslPfJSpEvuNg6o=; b=jEz/gnry+R3Sv0GgBelmlVEaZnKP72gGEsrt1SjTZ/mLJO9uCgGogaD1h4q0N0fUX7S8zQ XqsgH+LEv6+LUSug7TyXS2/oE3YZR52UDHaR9obNC1GnYHcxRaYAJ+KD06wRMmbid702iR hIPQbmCZFsG3zu7/2hx0jLxRDmN37HU= X-MC-Unique: xO02etT5ORmRJ79kOiamwA-1 X-Mimecast-MFC-AGG-ID: xO02etT5ORmRJ79kOiamwA_1749666408 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 16/31] hw/display/vmware_vga: skip automatic zero-init of large struct Date: Wed, 11 Jun 2025 14:25:18 -0400 Message-ID: <20250611182533.200590-17-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 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=170.10.133.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749666573695116600 From: Daniel P. Berrang=C3=A9 The 'vmsvga_fifo_run' method has a struct which is a little over 20k in size, used for holding image data for cursor changes. Skip the automatic zero-init of this struct to eliminate the performance overhead in the I/O hot path. The cursor variable will be fully initialized only when processing a cursor definition message from the guest. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-17-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/display/vmware_vga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index 544bb65320..bc1a8ed466 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -618,7 +618,7 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s) uint32_t cmd, colour; int args, len, maxloop =3D 1024; int x, y, dx, dy, width, height; - struct vmsvga_cursor_definition_s cursor; + QEMU_UNINITIALIZED struct vmsvga_cursor_definition_s cursor; uint32_t cmd_start; =20 len =3D vmsvga_fifo_length(s); --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749666643; cv=none; d=zohomail.com; s=zohoarc; b=bItX3EHrjQV00HdR9KEZiBjAPd6UsVL9wPWWfA0bX05nLyyZvQ90XO5Jwxwvc0vzq053NsrnTpHyha8o0Ug33W3w/SJ9Zb8IMfUjXrrT0QMKomJRi9qyaq81tErXk0Xdgwyr/oyY7ArpDEZNzL1Sz2Aa4NBt97p//P618U6/LU4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749666643; 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=98MBMcUSEptGVNIPVLyiue7Ww+HKRSay/z2TDY8nvFw=; b=Q4AK3C76tUokO9bXLcqxGNgacPzGSwW41tKqFkIUPIUrTqnAtyXuH8o7KQVqt+g/WVOcoD633C/vYSJqgAqAgJY/NgEgcvRU9l4ZCHW1ekzDR5YH9uZyt2aXoW1vn/43lP42ZmvXtqZfQtPECkcpm2NESQqbbLwRUjb/CVoI7a4= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17496666438211022.6726064413525; Wed, 11 Jun 2025 11:30:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQBK-0004Nz-Bm; Wed, 11 Jun 2025 14:28:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQAJ-0001xl-Rx for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:13 -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 1uPQAA-0001ZH-Pr for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:08 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-317-AELjrSb9N5yl-IVITRhf6w-1; Wed, 11 Jun 2025 14:26:56 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 76D7C18089B5; Wed, 11 Jun 2025 18:26:51 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B00EF19560AF; Wed, 11 Jun 2025 18:26:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=98MBMcUSEptGVNIPVLyiue7Ww+HKRSay/z2TDY8nvFw=; b=Xz2NS2lQhM0ooBA1AyawoB9y8KAO4xQNYB1976k5MK01UpfQ7hmu4jYuq86cM5FZitOK/+ imUXZyy0cNekwP7zLKcNqAWjXsT1+DuM3kceaFIa6+a1LgR7sjIYWhXIkghFlmEpwJscnm LBDRs1tqqK16Y5QxCCpoqutLM0pL6bk= X-MC-Unique: AELjrSb9N5yl-IVITRhf6w-1 X-Mimecast-MFC-AGG-ID: AELjrSb9N5yl-IVITRhf6w_1749666412 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 17/31] hw/hyperv/syndbg: skip automatic zero-init of large array Date: Wed, 11 Jun 2025 14:25:19 -0400 Message-ID: <20250611182533.200590-18-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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=170.10.129.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749666646648116600 From: Daniel P. Berrang=C3=A9 The 'handle_recv_msg' method has a 4k byte array used for copying data between the network socket and guest memory. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'data_buf' array will be fully initialized when data is read off the network socket. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-18-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/hyperv/syndbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/hyperv/syndbg.c b/hw/hyperv/syndbg.c index 8b8a14750d..ac7e15f6f1 100644 --- a/hw/hyperv/syndbg.c +++ b/hw/hyperv/syndbg.c @@ -192,7 +192,7 @@ static uint16_t handle_recv_msg(HvSynDbg *syndbg, uint6= 4_t outgpa, { uint16_t ret; g_assert(MSG_BUFSZ >=3D qemu_target_page_size()); - uint8_t data_buf[MSG_BUFSZ]; + QEMU_UNINITIALIZED uint8_t data_buf[MSG_BUFSZ]; hwaddr out_len; void *out_data; ssize_t recv_byte_count; --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749666692; cv=none; d=zohomail.com; s=zohoarc; b=ZQsUi9+6dsDfcgrA8i2oFKmDZl4CYhPUJ/SXsJZNL4g2SQ2VykwRXRofDjtlUph6iGsgq8MhBStROaMAD2UITMw4w5gh30necYPhMGpg7df9mkCM0z5hZkNE1gGZo12jaixGneQsXu5CKYag0+chphjtx7/FU34lPkovPrYGZr0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749666692; 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=1P7ALdUgUH3egQpJpZZh+seXhAmubgaRIgDOiJvBoJg=; b=c3szPtvfxJ67ykqtgZpZl/9L8t++FeotW6iLczR9oXU+dzK8tIvz6IlWv6T7uYGpCTCP8lHPUBFrY9JxUXssctyjWPM0gwc9EZOzrsti1dP8tCAPiJF8D831Ponj6E7lf0JE/oGGygfXR6nsB2DpFwyHxzvxdwSTjhtroSZ2drQ= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 174966669251951.609476394867784; Wed, 11 Jun 2025 11:31:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQDB-0007c0-3f; Wed, 11 Jun 2025 14:30:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQAJ-0001xj-RM for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:13 -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 1uPQAB-0001Zm-Ht for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:08 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-257-Rbp6d6JYMo-D6lC9mV6ANw-1; Wed, 11 Jun 2025 14:26:59 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 697621801BD8; Wed, 11 Jun 2025 18:26:54 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DBDD630002C3; Wed, 11 Jun 2025 18:26:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1P7ALdUgUH3egQpJpZZh+seXhAmubgaRIgDOiJvBoJg=; b=gCuC4METErBbRToif6dxPUVXA9XwDgDDsBQ6DGwuDQIm60A5m5j63L6McPWQ2XQpNnDc0f SBocvd1kxQZ2GvPoJSmD+kTAea6SHObkbmfdCZwHsSS0ZV2xulMSEl/7xgwKaSbN4kHAC1 iOSmF2h70XgTkfcusncos7reDhEGcnI= X-MC-Unique: Rbp6d6JYMo-D6lC9mV6ANw-1 X-Mimecast-MFC-AGG-ID: Rbp6d6JYMo-D6lC9mV6ANw_1749666414 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 18/31] hw/misc/aspeed_hace: skip automatic zero-init of large array Date: Wed, 11 Jun 2025 14:25:20 -0400 Message-ID: <20250611182533.200590-19-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.129.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749666693249116600 From: Daniel P. Berrang=C3=A9 The 'do_hash_operation' method has a 256 element iovec array used for holding pointers to data that is to be hashed. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'iovec' array will be selectively initialized based on data that needs to be hashed. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-19-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/misc/aspeed_hace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/aspeed_hace.c b/hw/misc/aspeed_hace.c index 8924a30eff..726368fbbc 100644 --- a/hw/misc/aspeed_hace.c +++ b/hw/misc/aspeed_hace.c @@ -419,7 +419,7 @@ static void hash_execute_acc_mode(AspeedHACEState *s, i= nt algo, static void do_hash_operation(AspeedHACEState *s, int algo, bool sg_mode, bool acc_mode) { - struct iovec iov[ASPEED_HACE_MAX_SG]; + QEMU_UNINITIALIZED struct iovec iov[ASPEED_HACE_MAX_SG]; bool acc_final_request =3D false; int iov_idx =3D -1; =20 --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749666631; cv=none; d=zohomail.com; s=zohoarc; b=koUMRUPsBFqwwGh88YKi19yNh/MivpkQzOP0YVZNLk3QMUWYSaEBg/RFx1X4hRCVAf55jPAFPq1Hy6ECuJtmxnujVzvHXkdxMTWB0Cw3NkHh6NvKb4tRrRD3qCG9znm/LYpA1mDaD5QU2NMXbnjB9V2/EaZP2IzoGdWYD/HNkME= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749666631; 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=M9LZ45V6NuLQ3B6KycXNWkn9735EaN4kZUBKCu+5+Lc=; b=Bj3iWmSWMOqOLTWmAKN2aQ6/LWal94lgIcALvUZFSZE4HKzuZZcUzihgwP+518VRhRzD+rqLJ+gwUtCw5tMKYUW4pT2x/Gpby5lT0dB+/yjBiWnenwg8QqqVUUF/HSxOKUwhwEou3XEZ+9j3sMUhZceWj5yUrhnW4kbQdL6EiA8= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749666631673778.5023132711416; Wed, 11 Jun 2025 11:30:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQDL-00081c-AM; Wed, 11 Jun 2025 14:30:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQAO-00022a-6e for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:21 -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 1uPQAJ-0001b1-Ne for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:15 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-684-QbkNV5_QN22LFuGxiASsBw-1; Wed, 11 Jun 2025 14:27:00 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 62C4C19560B2; Wed, 11 Jun 2025 18:26:56 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 746E130002C6; Wed, 11 Jun 2025 18:26:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M9LZ45V6NuLQ3B6KycXNWkn9735EaN4kZUBKCu+5+Lc=; b=Cerm+UYTnrKy2sDtF0KN+wZUZcMkeLJt3qC0x0LXUoBs75pEe5KrPaerQry8ZxOrsl6Uxy 9CBnnmS64SL7wuhI8hokSa7bgYJbMHkzjiTzS9IwOPMbMtoEsp0jtgRoBrmDgDWp+G4QMd PeIveOrCMADPWAiHTpJvfjf7lhf7muo= X-MC-Unique: QbkNV5_QN22LFuGxiASsBw-1 X-Mimecast-MFC-AGG-ID: QbkNV5_QN22LFuGxiASsBw_1749666416 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 19/31] hw/net/rtl8139: skip automatic zero-init of large array Date: Wed, 11 Jun 2025 14:25:21 -0400 Message-ID: <20250611182533.200590-20-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.133.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749666632657116600 From: Daniel P. Berrang=C3=A9 The 'rtl8139_transmit_one' method has a 8k byte array used for copying data between guest and host. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'txbuffer' will be fully initialized when reading PCI DMA buffers. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-20-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/net/rtl8139.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index 15b8f7501a..654a087d80 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -1816,7 +1816,7 @@ static int rtl8139_transmit_one(RTL8139State *s, int = descriptor) =20 PCIDevice *d =3D PCI_DEVICE(s); int txsize =3D s->TxStatus[descriptor] & 0x1fff; - uint8_t txbuffer[0x2000]; + QEMU_UNINITIALIZED uint8_t txbuffer[0x2000]; =20 DPRINTF("+++ transmit reading %d bytes from host memory at 0x%08x\n", txsize, s->TxAddr[descriptor]); --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749667004; cv=none; d=zohomail.com; s=zohoarc; b=lSE/XqNhZe9PxfUzFV5wiqAGnmfLGsPAMZ29bb9+XJW4BGe+MI4dN/iOTgwllfxJFCGim1DKmA2aiZZe51Om1F48l5MTQK1GYFFpg40q7biAz7VUgjuNMUFUD3qEYYWFez1wAEc79sPLxVi12UMAhHSvBl3DjXVQ7hXp/fln3Qo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749667004; 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=/2hmw26GO9MntDuKG4kx440hVC19OgahjebBBvbf2WA=; b=CeB2n6av3mmJkYG5BN8xcJaJgMNNZx2zQsb4v/QCdCgXg/vpCS9mSvdFQKJO6aS9v7TU/2DCyB1c4N7qJvbQGcMrJdsTQZ3cvTA6THum9hawcocVBDBcgGNDsVH5VCGUihuZt0pM9o+ZY051qTukYboo256aejRhhqyz9KbkFZA= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749667004007890.8363413457496; Wed, 11 Jun 2025 11:36:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQDO-0008RO-Ra; Wed, 11 Jun 2025 14:30:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQAP-00022o-Bk for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:22 -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 1uPQAJ-0001bS-O4 for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:16 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-43-xAiIjpovN3ysLpiLPWXrIA-1; Wed, 11 Jun 2025 14:27:04 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 839B419560AE; Wed, 11 Jun 2025 18:26:59 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C808619560AF; Wed, 11 Jun 2025 18:26:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/2hmw26GO9MntDuKG4kx440hVC19OgahjebBBvbf2WA=; b=D3XfTk6bv+9bjqVF+Px+PXwSz90+iY0oxLRAQ5/ItDHV3A9q/YcU3SsqMORMIeR1smeIux 4iBXkoAzyiy2Kc0VoJG0Uezti7JGiByHZK7/oNQlbhxBZaErt8Qte9F2jkbcz4G6XlpADo /A11wcDTy/ggm+AV37xyRiKUCvwJlgM= X-MC-Unique: xAiIjpovN3ysLpiLPWXrIA-1 X-Mimecast-MFC-AGG-ID: xAiIjpovN3ysLpiLPWXrIA_1749666419 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 20/31] hw/net/tulip: skip automatic zero-init of large array Date: Wed, 11 Jun 2025 14:25:22 -0400 Message-ID: <20250611182533.200590-21-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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=170.10.129.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749667007454116600 From: Daniel P. Berrang=C3=A9 The 'tulip_setup_frame' method has a 4k byte array used for copynig DMA data from the device. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'buf' array will be fully initialized when reading data from the device. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-21-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/net/tulip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/tulip.c b/hw/net/tulip.c index 63fe513458..319af906c8 100644 --- a/hw/net/tulip.c +++ b/hw/net/tulip.c @@ -629,7 +629,7 @@ static void tulip_setup_filter_addr(TULIPState *s, uint= 8_t *buf, int n) static void tulip_setup_frame(TULIPState *s, struct tulip_descriptor *desc) { - uint8_t buf[4096]; + QEMU_UNINITIALIZED uint8_t buf[4096]; int len =3D (desc->control >> TDES1_BUF1_SIZE_SHIFT) & TDES1_BUF1_SIZE= _MASK; int i; =20 --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749667010; cv=none; d=zohomail.com; s=zohoarc; b=jRNWXZoP+zGKNOfhf6Gdh11DJLrbVMOrozd9HkcRArgDqY6plXgJger7L9W1ZCdfL2C73+dOMrdBopmGLSko+nFzfTFUT1ekV0yxFKqwkZzmoiZbLPC+VRIw8d4qBqZsC1MXlOzWU4oRU3h0ufrTGjrZ+4T+KbGZ5f397AZeoCI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749667010; 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=DA+s4Ip/ag7ChTelqOTkfJ0xAlR4kkpE9uIMvxvue8g=; b=TK8SSC00MTqlrEzI9BKiPIt8c67mEfkXFBcNyOU7h/Hhmg5jsyNGMZvW7G6wHDnQI5sZ9MG/cOM+rtJmwpSjAwxvKWt5IymESe73j+HUnY8Cld5cJloGIwSRa0WqM6onAnqhD9IdIq7+rV+Xfgzk7o6vOPQk8cCHzFYn8LbreHo= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749667010978593.7251518581744; Wed, 11 Jun 2025 11:36:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQDZ-0000qX-0i; Wed, 11 Jun 2025 14:30:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQAP-00022n-Bt for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:22 -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 1uPQAJ-0001bi-OC for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:17 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-421-KZTdJYYaNVyTK7d4JhVIcA-1; Wed, 11 Jun 2025 14:27:06 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C5F981956048; Wed, 11 Jun 2025 18:27:02 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F07FC18003FC; Wed, 11 Jun 2025 18:27:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DA+s4Ip/ag7ChTelqOTkfJ0xAlR4kkpE9uIMvxvue8g=; b=YCPnf33WXoJjL/GJNkEbKCbqrwQ1pGM9p3HpHFaeBE7KZVqjMHMjrEN3yWzdCzVZZlJzHw l3l0YGlQObqp7utBBgKyDJGbdYBwub3b5co6j9xK3kiaTk2qN52T845Oq87ub/YSJi6dJb BtS3UuVmG5lIRV5BdaHsKHdLGK4/yok= X-MC-Unique: KZTdJYYaNVyTK7d4JhVIcA-1 X-Mimecast-MFC-AGG-ID: KZTdJYYaNVyTK7d4JhVIcA_1749666422 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 21/31] hw/net/virtio-net: skip automatic zero-init of large arrays Date: Wed, 11 Jun 2025 14:25:23 -0400 Message-ID: <20250611182533.200590-22-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=170.10.129.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749667013249116600 From: Daniel P. Berrang=C3=A9 The 'virtio_net_receive_rcu' method has three arrays with VIRTQUEUE_MAX_SIZE elements, which are apprixmately 32k in size used for copying data between guest and host. Skip the automatic zero-init of these arrays to eliminate the performance overhead in the I/O hot path. The three arrays will be selectively initialized as required when processing network buffers. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-22-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/net/virtio-net.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 221252e00a..eb93607b8c 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -1911,9 +1911,9 @@ static ssize_t virtio_net_receive_rcu(NetClientState = *nc, const uint8_t *buf, VirtIONet *n =3D qemu_get_nic_opaque(nc); VirtIONetQueue *q; VirtIODevice *vdev =3D VIRTIO_DEVICE(n); - VirtQueueElement *elems[VIRTQUEUE_MAX_SIZE]; - size_t lens[VIRTQUEUE_MAX_SIZE]; - struct iovec mhdr_sg[VIRTQUEUE_MAX_SIZE]; + QEMU_UNINITIALIZED VirtQueueElement *elems[VIRTQUEUE_MAX_SIZE]; + QEMU_UNINITIALIZED size_t lens[VIRTQUEUE_MAX_SIZE]; + QEMU_UNINITIALIZED struct iovec mhdr_sg[VIRTQUEUE_MAX_SIZE]; struct virtio_net_hdr_v1_hash extra_hdr; unsigned mhdr_cnt =3D 0; size_t offset, i, guest_offset, j; --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749667090; cv=none; d=zohomail.com; s=zohoarc; b=Tl7lz5BAg3EiGPso1biEJW05JKFb4S/wSy4ti/f56MqjIDSTGVKp9dpRooZdnRm20h0mb9UokmhhIlN6C+97c9FzCN5FTaY6sMBNEO3xGj+jLAti+4/FKDtPE1Gkl7wIqBT3RyhKaloBSCOevOy+65pbYK3EPuuh9UG5Th7S5Gk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749667090; 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=GRUOwrPa9aDe+BByn7DHtlAgJL5D74m+C48N+bMyyao=; b=JAyrO/+s4ztooRzzEUot6M/ZrQwUw1Ec9ZNiW1bbwX/S4P4LgqSZ2+w4jeJTzqdk67/FsFH6ytvrLC6j5VAtv439vIdKu0LW+mFYxzk+dH92S21kiIRl9Lp7sigsDEPVcSN2m4LZBWEJhLme9+rIEqZbnreommLyvC7L05M04bU= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749667090889922.0449599203238; Wed, 11 Jun 2025 11:38:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQEA-0002nV-2c; Wed, 11 Jun 2025 14:31:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQAS-000269-1E for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:22 -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 1uPQAN-0001eJ-5t for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:18 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-455-7oaliND1OX6iyJ8Ymqxw2Q-1; Wed, 11 Jun 2025 14:27:08 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DCA1B195605C; Wed, 11 Jun 2025 18:27:04 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 262AE30002C3; Wed, 11 Jun 2025 18:27:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GRUOwrPa9aDe+BByn7DHtlAgJL5D74m+C48N+bMyyao=; b=RRVj8uWVmSqsULVhxxO9oobIFAcjH3W/UM9zXvY0kPy2vV4zErY6JMPckGhKCpT4oiImto WmrjKaK+e/sDCxJ6wkVUaicEezXVvltfF6NR0XL2AoqLeLlkYrA6UGI7H1I0vfAGCEFCj5 VbZSXbAVAjbDKk1mdYIYlvOeguSBFlo= X-MC-Unique: 7oaliND1OX6iyJ8Ymqxw2Q-1 X-Mimecast-MFC-AGG-ID: 7oaliND1OX6iyJ8Ymqxw2Q_1749666425 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 22/31] hw/net/xgamc: skip automatic zero-init of large array Date: Wed, 11 Jun 2025 14:25:24 -0400 Message-ID: <20250611182533.200590-23-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.129.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749667092389116600 From: Daniel P. Berrang=C3=A9 The 'xgmac_enet_send' method has a 8k byte array used for copying data between guest and host. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'frame' buffer will be fully initialized when reading guest memory to fetch the data to send. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-23-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/net/xgmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/xgmac.c b/hw/net/xgmac.c index 9c87c4e70f..d45f872467 100644 --- a/hw/net/xgmac.c +++ b/hw/net/xgmac.c @@ -207,7 +207,7 @@ static void xgmac_enet_send(XgmacState *s) struct desc bd; int frame_size; int len; - uint8_t frame[8192]; + QEMU_UNINITIALIZED uint8_t frame[8192]; uint8_t *ptr; =20 ptr =3D frame; --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749667031; cv=none; d=zohomail.com; s=zohoarc; b=Zx89EcI9dHAtOG4BhHi3QyrOV389H6tjWCYgyhszRw/Etq/IKTzn79MzfVlYskHiniVdHMMNEx+r9FGTw+SU5/MmQoYf+Y/+2sJgl0O6D/pwfqJdpOs6JHlTzYPF46BhEQerVpQxLej5eWtrmk7q9xXhbpva5pkOrjcwNT9/HP4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749667031; 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=e+4l0naTET+aaMWzQ/pVz9X7Jz1w04ke4T2Xq1wrDPY=; b=S3CNt2M+VXaSv7RBrr7wlEQDy9951cT+/s7cRnfGFHY6ffNHArqFVI/V+g/UoScVeBSKdUSSbDMWlI/pChGOw5qfOa2oEqINBg0v2wa/5cb3edyL0+b06D60MxgoZuQr+oTZi8BTP5IgVOZj61OjRjBmK3+Y2QUZZZn8Vp/SBkU= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 174966703125976.80797475305633; Wed, 11 Jun 2025 11:37:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQDy-0001yb-SX; Wed, 11 Jun 2025 14:30:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQAS-00026G-IV for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:22 -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 1uPQAP-0001fo-Lq for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:19 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-78-yx9W_04IMmyJ0cqeGcc-ow-1; Wed, 11 Jun 2025 14:27:13 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 770501955F69; Wed, 11 Jun 2025 18:27:08 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4DB291956087; Wed, 11 Jun 2025 18:27:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e+4l0naTET+aaMWzQ/pVz9X7Jz1w04ke4T2Xq1wrDPY=; b=YsQS/4tCgygRepM+Nzg/x2osM7KuZmSWwKJv0J9/t6tgwcqR/PV8+sOqzWjqpbNI+p3fuK 4ANLlSxc3gSR1YZBGGSreLHjFoH9+y6z8Pxxdi1CHW8Yd7Qu5cXtkmCMtDEyiIDy/C2I5F vvHzmdka71rS29hJC/fNpRvOecbdfKw= X-MC-Unique: yx9W_04IMmyJ0cqeGcc-ow-1 X-Mimecast-MFC-AGG-ID: yx9W_04IMmyJ0cqeGcc-ow_1749666428 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Klaus Jensen Subject: [PULL 23/31] hw/nvme/ctrl: skip automatic zero-init of large arrays Date: Wed, 11 Jun 2025 14:25:25 -0400 Message-ID: <20250611182533.200590-24-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 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=170.10.133.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1749667033471116600 From: Daniel P. Berrang=C3=A9 The 'nvme_map_sgl' method has a 256 element array used for copying data from the device. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'segment' array will be fully initialized when reading data from the device. The 'nme_changed_nslist' method has a 4k byte array that is manually initialized with memset(). The compiler ought to be intelligent enough to turn the memset() into a static initialization operation, and thus not duplicate the automatic zero-init. Replacing memset() with '{}' makes it unambiguous that the array is statically initialized. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Reviewed-by: Klaus Jensen Message-id: 20250610123709.835102-24-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/nvme/ctrl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index fd935507bc..220002830d 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -1057,7 +1057,8 @@ static uint16_t nvme_map_sgl(NvmeCtrl *n, NvmeSg *sg,= NvmeSglDescriptor sgl, */ #define SEG_CHUNK_SIZE 256 =20 - NvmeSglDescriptor segment[SEG_CHUNK_SIZE], *sgld, *last_sgld; + QEMU_UNINITIALIZED NvmeSglDescriptor segment[SEG_CHUNK_SIZE]; + NvmeSglDescriptor *sgld, *last_sgld; uint64_t nsgld; uint32_t seg_len; uint16_t status; @@ -5128,7 +5129,7 @@ static uint16_t nvme_error_info(NvmeCtrl *n, uint8_t = rae, uint32_t buf_len, static uint16_t nvme_changed_nslist(NvmeCtrl *n, uint8_t rae, uint32_t buf= _len, uint64_t off, NvmeRequest *req) { - uint32_t nslist[1024]; + uint32_t nslist[1024] =3D {}; uint32_t trans_len; int i =3D 0; uint32_t nsid; @@ -5138,7 +5139,6 @@ static uint16_t nvme_changed_nslist(NvmeCtrl *n, uint= 8_t rae, uint32_t buf_len, return NVME_INVALID_FIELD | NVME_DNR; } =20 - memset(nslist, 0x0, sizeof(nslist)); trans_len =3D MIN(sizeof(nslist) - off, buf_len); =20 while ((nsid =3D find_first_bit(n->changed_nsids, NVME_CHANGED_NSID_SI= ZE)) !=3D --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749667091; cv=none; d=zohomail.com; s=zohoarc; b=k5vfoM23VgRw9tPxxqYeD4++tSyJvR2ewlUBfovRlJUOvhEW5M3YgbMQ163tnaRHZaMzU/UJ6kbWCdUu97oSKx+l8ad0m0KyLszCI5K5r6VQA1GuYEfOtHs2VfJwCZ/fGmj+vFoGmOotUBu/QxvA/OIpWH7Dt0rn0EZ/PwVq0OY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749667091; 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=p1SjgeEm1cCSQpMWJ1zjwqMu3sNMaHNBwc1JeIdOkvs=; b=N8MwyAGChYOr+/E3gwiXjzkEXcHaq3SfxiX3eXmn4kti+uJZaUpp5yIaCT8U9B2EmH5ETMQuWGkRqndEroi+jlA8+TQ3MHmGQAn5NA+g7vBbyiMjdhOKdwtk8XAqerAbt3hKnmLItP5bX+1yiJmw9i48FM3mFvh63oXHPbj8eEM= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749667091101601.7245736190166; Wed, 11 Jun 2025 11:38:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQE4-0002Nd-VV; Wed, 11 Jun 2025 14:31:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQAc-0002K8-Cq for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:31 -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 1uPQAW-0001hJ-OH for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:29 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-280-4wV7N0SwMw-Ternp8fqqqA-1; Wed, 11 Jun 2025 14:27:17 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BE99319560BA; Wed, 11 Jun 2025 18:27:11 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C8B6E19560AF; Wed, 11 Jun 2025 18:27:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p1SjgeEm1cCSQpMWJ1zjwqMu3sNMaHNBwc1JeIdOkvs=; b=V5/N0E7jVdlOUQyX2Ed0+czjcBbYVET0MDbyUBWx2D9qVepj/qsnrxvbj0DRgw8vOcxwaQ VMBM0xhJsAqX8/aq3gMKHNn6GDoySvJe11hpqk6CSNvhxfQjzGbURu6oyfnWxf520XKdN0 /u1efZotGboCdAqAGEEiMZJrm79ZLeE= X-MC-Unique: 4wV7N0SwMw-Ternp8fqqqA-1 X-Mimecast-MFC-AGG-ID: 4wV7N0SwMw-Ternp8fqqqA_1749666431 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Klaus Jensen Subject: [PULL 24/31] hw/ppc/pnv_occ: skip automatic zero-init of large struct Date: Wed, 11 Jun 2025 14:25:26 -0400 Message-ID: <20250611182533.200590-25-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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=170.10.133.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749667094398116600 From: Daniel P. Berrang=C3=A9 The 'occ_model_tick' method has a 12k struct used for copying data between guest and host. Skip the automatic zero-init of this struct to eliminate the performance overhead in the I/O hot path. The 'dynamic_data' buffer will be fully initialized when reading data from the guest. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Reviewed-by: Klaus Jensen Reviewed-by: Harsh Prateek Bora Message-id: 20250610123709.835102-25-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/ppc/pnv_occ.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/pnv_occ.c b/hw/ppc/pnv_occ.c index fa6f31cb8d..24b789c191 100644 --- a/hw/ppc/pnv_occ.c +++ b/hw/ppc/pnv_occ.c @@ -789,7 +789,7 @@ static bool occ_opal_process_command(PnvOCC *occ, =20 static bool occ_model_tick(PnvOCC *occ) { - struct occ_dynamic_data dynamic_data; + QEMU_UNINITIALIZED struct occ_dynamic_data dynamic_data; =20 if (!occ_read_dynamic_data(occ, &dynamic_data, NULL)) { /* Can't move OCC state field to safe because we can't map it! */ --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749667016; cv=none; d=zohomail.com; s=zohoarc; b=D6UmCwVQl4dNFOkOkSnYJH+tBE/CefzZGmfsMccUjlXtYxa4Bh59d7l6mdb+/b99iw3mLOTn2uj8IHVf+wV96W8PAJvddPdwYFPvwfid/6Lps015EFXxoe6cQ3I5Q8p9kI2rqFqGLI7rlU1aNAyXJMklcUOatc896LRojN619VY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749667016; 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=zUBueujoaF3SY5nslIqDYxh56xsOS9uQEUGXk8GVXVA=; b=GO4kV3pGUpMjgzIh1K61T99OjzxIJu3GM1gwf9aIlTbt/Fpo9gBRmKoj3TdOmT8JW8zxf4CBEBRgq/8cmBb32fgQ736evUYxlDpYfVoRi7UqXKgz/nalC+ZItuMPg2ROl84sUpwo/GeJZozglCC8B/+tn9G+OejAwfg3o0q+1I8= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749667016409292.1061603667365; Wed, 11 Jun 2025 11:36:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQGd-0006pz-Kc; Wed, 11 Jun 2025 14:33:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQAi-0002bT-6J for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:36 -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 1uPQAb-0001jH-DD for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:35 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-449-1rVyhgshO_qYMZhU75p1IQ-1; Wed, 11 Jun 2025 14:27:18 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C71401956058; Wed, 11 Jun 2025 18:27:13 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id ED68519560A2; Wed, 11 Jun 2025 18:27:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zUBueujoaF3SY5nslIqDYxh56xsOS9uQEUGXk8GVXVA=; b=bx0v06bramV3NYLIXUuBEE4gPbMWsDSCFQz84bGqiP1f9N9vLrpnARqtnO1ogLjd32pdV9 tDx8freINt9lAvqmzpwA8t//9A8AeiFiCLOMqgW0jSyYR9xdo8YKMdZ5P57HdzDgUx25ud tMMn1ktuzEjj/RTYFPi8j37qQZcKnc8= X-MC-Unique: 1rVyhgshO_qYMZhU75p1IQ-1 X-Mimecast-MFC-AGG-ID: 1rVyhgshO_qYMZhU75p1IQ_1749666434 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Klaus Jensen Subject: [PULL 25/31] hw/ppc/spapr_tpm_proxy: skip automatic zero-init of large arrays Date: Wed, 11 Jun 2025 14:25:27 -0400 Message-ID: <20250611182533.200590-26-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 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=170.10.129.124; envelope-from=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 @redhat.com) X-ZM-MESSAGEID: 1749667017320116600 From: Daniel P. Berrang=C3=A9 The 'tpm_execute' method has a pair of 4k arrays used for copying data between guest and host. Skip the automatic zero-init of these arrays to eliminate the performance overhead in the I/O hot path. The two arrays will be fully initialized when reading data from guest memory or reading data from the proxy FD. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Reviewed-by: Klaus Jensen Reviewed-by: Harsh Prateek Bora Message-id: 20250610123709.835102-26-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/ppc/spapr_tpm_proxy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr_tpm_proxy.c b/hw/ppc/spapr_tpm_proxy.c index 862eeaa50a..1297b3ad56 100644 --- a/hw/ppc/spapr_tpm_proxy.c +++ b/hw/ppc/spapr_tpm_proxy.c @@ -41,8 +41,8 @@ static ssize_t tpm_execute(SpaprTpmProxy *tpm_proxy, targ= et_ulong *args) target_ulong data_in_size =3D args[2]; uint64_t data_out =3D ppc64_phys_to_real(args[3]); target_ulong data_out_size =3D args[4]; - uint8_t buf_in[TPM_SPAPR_BUFSIZE]; - uint8_t buf_out[TPM_SPAPR_BUFSIZE]; + QEMU_UNINITIALIZED uint8_t buf_in[TPM_SPAPR_BUFSIZE]; + QEMU_UNINITIALIZED uint8_t buf_out[TPM_SPAPR_BUFSIZE]; ssize_t ret; =20 trace_spapr_tpm_execute(data_in, data_in_size, data_out, data_out_size= ); --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749666867; cv=none; d=zohomail.com; s=zohoarc; b=DRLTN+H+PoJ+CEbalQVhtP1aL/nd9/XM091yiThg7jyZ5/+Kv+oE7/yBkjMCELsp3y+JoZSC4HY/Y4efBaQnP6EH3TQcNc+s+sTMfav8MmM0sLCm+ojd5+cdEyGOgsVISEG8i3XdArbYLkq8Cs8KGQhXHJaE3RAneIU85ZSEM/s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749666867; 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=f128TMvyALcEvw2Q1PgUkPtT2l4n4rQQAsIOgSwd6Bw=; b=l0AKFF16GFzT5syFcGnpSnts9QQrCbIl6YvI+BrqNDhu3HQfqouf1tFBgsbtZ66omi8p5JjKe+n+pz7oE1kh5xm3xderqb8Bsdz6mskpT29DjN06smBdg9UBLuAEAewKmZ4uuegLzk9iwf1OkkePery15I7iGlHfZQB48t5cPgI= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749666867131289.8303902557874; Wed, 11 Jun 2025 11:34:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQFb-00059j-Rd; Wed, 11 Jun 2025 14:32:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQAa-0002Cy-Hg for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:30 -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 1uPQAW-0001hm-5M for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:26 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-98-mSrFx_MUMsimIImP4xTVHA-1; Wed, 11 Jun 2025 14:27:20 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D1B0119560B6; Wed, 11 Jun 2025 18:27:15 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1B8CB195609D; Wed, 11 Jun 2025 18:27:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f128TMvyALcEvw2Q1PgUkPtT2l4n4rQQAsIOgSwd6Bw=; b=fqFUhuZZBSIJamGAslmNAYvmzABGkME81L8a5IJ1pOybcqhdrZAbKxxwujTStmosDZkmBQ kLDxYmLUI7wp+GoifCDNan52kUFKzDr0Ud1BR9ZKXMbOEdrg22Z4mJvGHt6cT1ihn3c+ME iO6dnAnevXZO/Ufk+Fe+ymSED6C/kPU= X-MC-Unique: mSrFx_MUMsimIImP4xTVHA-1 X-Mimecast-MFC-AGG-ID: mSrFx_MUMsimIImP4xTVHA_1749666436 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Klaus Jensen Subject: [PULL 26/31] hw/usb/hcd-ohci: skip automatic zero-init of large array Date: Wed, 11 Jun 2025 14:25:28 -0400 Message-ID: <20250611182533.200590-27-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 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=170.10.133.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749666869654116600 From: Daniel P. Berrang=C3=A9 The 'ohci_service_iso_td' method has a 8k byte array used for copying data between guest and host. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'buf' array will be fully initialized when reading data from guest memory. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Reviewed-by: Klaus Jensen Reviewed-by: Harsh Prateek Bora Message-id: 20250610123709.835102-27-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/usb/hcd-ohci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index 71b54914d3..72a9f9f474 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd-ohci.c @@ -577,7 +577,7 @@ static int ohci_service_iso_td(OHCIState *ohci, struct = ohci_ed *ed) USBDevice *dev; USBEndpoint *ep; USBPacket *pkt; - uint8_t buf[8192]; + QEMU_UNINITIALIZED uint8_t buf[8192]; bool int_req; struct ohci_iso_td iso_td; uint32_t addr; --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749666890; cv=none; d=zohomail.com; s=zohoarc; b=XT01Odnejs0Mix5dWWzaZ0RPIGv8+Y4YjW+zKQ2NZKqnBhqi5WecntLKca1aNchrAdc6qdyk7WkON4IxEQoKyq4ENhL9WaDADHG2gb/ZyeIMk/LcN7RFtlNsmHHbh3vDMVbOSZgNV/r86syVxyoGcQSbfMTaBTwisUni8JZkDro= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749666890; 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=GkQJxxqIb7abXJVfUSauncS5q94lB96LQMTClKO0AaU=; b=Sq6833xdj7XhWN4ejQeUbgT3WmdhWGItHkdQz9gYDuwPt7nN83kkoY3WGj7EcY6e4Ghnqd+ycV1qIIaaci5w6df1UlGQzhU5vw5NFhHNJMQJ/vXDlub8hGaXDokjSsyyeH22BB/Ppcuu/C56s+JUA/v/KNARe1u6DWcvLaUkGLI= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749666890226128.78015194831812; Wed, 11 Jun 2025 11:34:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQFN-0004Xa-7a; Wed, 11 Jun 2025 14:32:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQAh-0002Zy-VQ for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:36 -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 1uPQAc-0001l4-2d for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:35 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-617-EuRogx8FOqqC9-X06jtGCw-1; Wed, 11 Jun 2025 14:27:23 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E92BA1955F4A; Wed, 11 Jun 2025 18:27:18 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2781818002B7; Wed, 11 Jun 2025 18:27:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GkQJxxqIb7abXJVfUSauncS5q94lB96LQMTClKO0AaU=; b=LqpEn7Ga/6p+yn/yletyS1VWhlT4fxfDQed44HhaGMAIQyIJHjL4iXKKRxUh31jEW0amUX w3XbBYkBmBEgA54Fa84d+ZQ+4TLBvkcpaStRr0dIuQVXbGTFoQRylIbsM2Dd/hpivsa2Dr GV5cm57XSrLvLDhyfjjziCif7h2sHBo= X-MC-Unique: EuRogx8FOqqC9-X06jtGCw-1 X-Mimecast-MFC-AGG-ID: EuRogx8FOqqC9-X06jtGCw_1749666439 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Klaus Jensen Subject: [PULL 27/31] hw/scsi/lsi53c895a: skip automatic zero-init of large array Date: Wed, 11 Jun 2025 14:25:29 -0400 Message-ID: <20250611182533.200590-28-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=170.10.129.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749666891569116600 From: Daniel P. Berrang=C3=A9 The 'lsi_memcpy' method has a 4k byte array used for copying data to/from the device. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'buf' array will be fully initialized when data is copied. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Reviewed-by: Klaus Jensen Reviewed-by: Harsh Prateek Bora Message-id: 20250610123709.835102-28-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/scsi/lsi53c895a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index f4f2ef321e..9ea4aa0a85 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -1112,7 +1112,7 @@ bad: static void lsi_memcpy(LSIState *s, uint32_t dest, uint32_t src, int count) { int n; - uint8_t buf[LSI_BUF_SIZE]; + QEMU_UNINITIALIZED uint8_t buf[LSI_BUF_SIZE]; =20 trace_lsi_memcpy(dest, src, count); while (count) { --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749667011; cv=none; d=zohomail.com; s=zohoarc; b=ayeAmwZpIvBoZ5DQr9ZVn86wEBnR5ZQ31/k0gHE7o3J4vfq9Pbba1Yk4OaEJj4BMovqFyjTVDUtwGAoZsOkYBqBGLT6YhhLvNAmUcXBxBBKIwsn4mmzEcPVlEoLmxFjQmM9HuecGiC1FapeJGNgrA+dF1vvnTeBT6LqXpXvFPUE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749667011; 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=lJ0vZgBOtVyV/kxbsVrweB7URiKy+WNZJU2nYcVkU88=; b=BOSHjQg62UKEPEokLt7NaIjafXGamPy+JsP9db0s1lSLLFDh5rll5cueFkFqhYsQZHS0gya+dGCwWAs/E9aSZf4ce2Z42Tw+0t43VVHl30MXuy+0oBMJ7SIWtAHE6EMZQ922LiGKiJ8wt4yHOYNIIqR2sgc3NWAILW4yOVgkyOM= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749667011426148.50611974652713; Wed, 11 Jun 2025 11:36:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQFB-0003uc-16; Wed, 11 Jun 2025 14:32:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQAh-0002Zz-Vm for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:36 -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 1uPQAc-0001mP-2X for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:35 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-538-Q0_R4qAbOxyb2Wxe-FzFjA-1; Wed, 11 Jun 2025 14:27:26 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F403819560A7; Wed, 11 Jun 2025 18:27:21 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3B0091956094; Wed, 11 Jun 2025 18:27:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666449; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lJ0vZgBOtVyV/kxbsVrweB7URiKy+WNZJU2nYcVkU88=; b=ez+/NvcIRWouQudZdo+LWJb7nRNDp+yuZgM3n9SilMLzgrLwIK9h+EIxdRhSPIpTOzrN9d Bfc4ZjA5qclGGtr+/gBj5OSZsbZOCH24moJ7h1B2VXwKWDQaga/Kw7asK46n3NOZvNNBpK SidoUnWZNF6i4jUuekLND8+8JxWC0xg= X-MC-Unique: Q0_R4qAbOxyb2Wxe-FzFjA-1 X-Mimecast-MFC-AGG-ID: Q0_R4qAbOxyb2Wxe-FzFjA_1749666442 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Klaus Jensen Subject: [PULL 28/31] hw/scsi/megasas: skip automatic zero-init of large arrays Date: Wed, 11 Jun 2025 14:25:30 -0400 Message-ID: <20250611182533.200590-29-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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=170.10.133.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749667013266116600 From: Daniel P. Berrang=C3=A9 The 'megasas_dcmd_pd_get_list' and 'megasas_dcmd_get_properties' methods have 4k structs used for copying data from the device. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'info' structs are manually initialized with memset(). The compiler ought to be intelligent enough to turn the memset() into a static initialization operation, and thus not duplicate the automatic zero-init. Replacing memset() with '{}' makes it unambiguous that the arrays are statically initialized. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Reviewed-by: Klaus Jensen Reviewed-by: Harsh Prateek Bora Message-id: 20250610123709.835102-29-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/scsi/megasas.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index 55cd188bd5..844643d916 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -981,13 +981,11 @@ static int megasas_event_wait(MegasasState *s, Megasa= sCmd *cmd) =20 static int megasas_dcmd_pd_get_list(MegasasState *s, MegasasCmd *cmd) { - struct mfi_pd_list info; - size_t dcmd_size =3D sizeof(info); + struct mfi_pd_list info =3D {}; BusChild *kid; uint32_t offset, dcmd_limit, num_pd_disks =3D 0, max_pd_disks; dma_addr_t residual; =20 - memset(&info, 0, dcmd_size); offset =3D 8; dcmd_limit =3D offset + sizeof(struct mfi_pd_address); if (cmd->iov_size < dcmd_limit) { @@ -1429,11 +1427,10 @@ static int megasas_dcmd_cfg_read(MegasasState *s, M= egasasCmd *cmd) =20 static int megasas_dcmd_get_properties(MegasasState *s, MegasasCmd *cmd) { - struct mfi_ctrl_props info; + struct mfi_ctrl_props info =3D {}; size_t dcmd_size =3D sizeof(info); dma_addr_t residual; =20 - memset(&info, 0x0, dcmd_size); if (cmd->iov_size < dcmd_size) { trace_megasas_dcmd_invalid_xfer_len(cmd->index, cmd->iov_size, dcmd_size); --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749667173; cv=none; d=zohomail.com; s=zohoarc; b=QhI2Mz18VTwayrMDDvxHBiBdWgKUnnXg+9C1dpJyTOtfl2nStGA3jtmEzyDkUi4hRbiVSKe+aYrbrf+4zPyS8/t6U1PjbH6XXqgpEDiLzhTIRR5UWsiB6AK6y+UXkjoIu46GQ4ozQKvMREMC8yZBmC3GnPJwGJKmfkUr0x5mygg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749667173; 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=TKCERI53LuMk8TuYkm/wkoeKkMg0tToLNccvF0Tm5YY=; b=WTMNeSrfGU6V+DIWNDYVSsklYOi8lHKgBqsIZwuCkybidvee6A/XylZX2PvoKmEwEq4rKM5WXno4G5lTQ4tqQE7WhZVWS9QyQXAPoD/HGIaWSpPgXD6AE/OOXAOakY+69ykamZV6iGsrLnksBKg/milgnApTWxl5QPeIpgtN5a8= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749667173508355.423117646571; Wed, 11 Jun 2025 11:39:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQG1-0006H2-SJ; Wed, 11 Jun 2025 14:33:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQAl-0002ib-17 for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:39 -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 1uPQAf-0001nV-4w for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:38 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-135-GFsYugu_M6SpL27G8L--Yw-1; Wed, 11 Jun 2025 14:27:28 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 49F531809C82; Wed, 11 Jun 2025 18:27:24 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 65B6618002B6; Wed, 11 Jun 2025 18:27:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666451; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TKCERI53LuMk8TuYkm/wkoeKkMg0tToLNccvF0Tm5YY=; b=Nro1EOPw5YmilNT6CfynIpnTZxwc5VRJpAcLWK45rB63JiKuJmTWyXKBb5g7iGEWnUWQFB HHQMvAf7UrKePl2iiqh3pRP5m3bo7BhF9Oz1Uf/e4QLGR3aQJbVVKhuyLZB19+uyzjM+BA xbhS26DYcqoSmbpAT4rrsOyv+G9WaNw= X-MC-Unique: GFsYugu_M6SpL27G8L--Yw-1 X-Mimecast-MFC-AGG-ID: GFsYugu_M6SpL27G8L--Yw_1749666444 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Klaus Jensen Subject: [PULL 29/31] hw/ufs/lu: skip automatic zero-init of large array Date: Wed, 11 Jun 2025 14:25:31 -0400 Message-ID: <20250611182533.200590-30-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=170.10.129.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749667175431116600 From: Daniel P. Berrang=C3=A9 The 'ufs_emulate_scsi_cmd' method has a 4k byte array used for copying data from the device. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'outbuf' array will be fully initialized when data is copied from the guest. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Reviewed-by: Klaus Jensen Reviewed-by: Harsh Prateek Bora Message-id: 20250610123709.835102-30-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/ufs/lu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ufs/lu.c b/hw/ufs/lu.c index 57b307ea56..2d8ffd72c5 100644 --- a/hw/ufs/lu.c +++ b/hw/ufs/lu.c @@ -194,7 +194,7 @@ static int ufs_emulate_wlun_inquiry(UfsRequest *req, ui= nt8_t *outbuf, static UfsReqResult ufs_emulate_scsi_cmd(UfsLu *lu, UfsRequest *req) { uint8_t lun =3D lu->lun; - uint8_t outbuf[4096]; + QEMU_UNINITIALIZED uint8_t outbuf[4096]; uint8_t sense_buf[UFS_SENSE_SIZE]; uint8_t scsi_status; int len =3D 0; --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749667120; cv=none; d=zohomail.com; s=zohoarc; b=RHCIgkQn22+y4zANWirfuTjfJSOV4ajIBDzBQy7Z7zmlU7aZ6cBnPaWFN/pZlwnDqYapTWPODRRedYG03U+yISrq5F6op4PZlFeS8CRgaDQETg+4piNM9gFNSxXc+hXkgDLe6NWwQ0wksvymxUt1gvUz9BRY+lQ+GUwCRJ3w39E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749667120; 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=FU8wL7XxDJ9uyH0nMB1l6aLZjdzSp7OBD7R4cqOfBZU=; b=MO3IwLCUDYZIP4p12CkqvYxZbHsTQElOCqRqSic2jW8mnd/cQn97ck2Km1WXwT8YEu9+BDXo9dspHAVWaZ+mTVHPc7/Le8nsaExcFRLxCA8K9LMjH9TyLRP7XVA2SRhriI60aNIJJ6H43nRy/QUC/8SuxYwpBW3ltj298Ewo4VE= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749667120180238.91284470713015; Wed, 11 Jun 2025 11:38:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQFT-0004uC-LX; Wed, 11 Jun 2025 14:32:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQAn-0002oG-4p for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:41 -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 1uPQAi-0001ph-Bs for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:40 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-626-BRevhgz1MY-FqReGZ6l7FQ-1; Wed, 11 Jun 2025 14:27:30 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6243E195608B; Wed, 11 Jun 2025 18:27:26 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A198518002B5; Wed, 11 Jun 2025 18:27:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FU8wL7XxDJ9uyH0nMB1l6aLZjdzSp7OBD7R4cqOfBZU=; b=Bmh3m3wtB0sMiCGPvlFqHAEYdR15doX0Tzd1wLf6pHDQZK1qMRPs+tyw6N7xyhaF0uGrep T97Cmnr8z4uPvP/zlUkW7p4FTeRTU4aNdJ1HdKSevZLJGNXuEGx/buIe74Wfe8Fb5+YOEC NjSHnw2XoWpNESTeEWIBUpGreir0DOQ= X-MC-Unique: BRevhgz1MY-FqReGZ6l7FQ-1 X-Mimecast-MFC-AGG-ID: BRevhgz1MY-FqReGZ6l7FQ_1749666446 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Klaus Jensen Subject: [PULL 30/31] net/socket: skip automatic zero-init of large array Date: Wed, 11 Jun 2025 14:25:32 -0400 Message-ID: <20250611182533.200590-31-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=170.10.133.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749667120789116600 From: Daniel P. Berrang=C3=A9 The 'net_socket_send' method has a 68k byte array used for copying data between guest and host. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'buf1' array will be fully initialized when reading data off the network socket. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Reviewed-by: Klaus Jensen Reviewed-by: Harsh Prateek Bora Message-id: 20250610123709.835102-31-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- net/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/socket.c b/net/socket.c index 8e3702e1f3..784dda686f 100644 --- a/net/socket.c +++ b/net/socket.c @@ -157,7 +157,7 @@ static void net_socket_send(void *opaque) NetSocketState *s =3D opaque; int size; int ret; - uint8_t buf1[NET_BUFSIZE]; + QEMU_UNINITIALIZED uint8_t buf1[NET_BUFSIZE]; const uint8_t *buf; =20 size =3D recv(s->fd, buf1, sizeof(buf1), 0); --=20 2.49.0 From nobody Sat Nov 15 15:29:48 2025 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=1749666883; cv=none; d=zohomail.com; s=zohoarc; b=jg20TGP7jrjFz4NV52QLIN6Tqqaqs+9hbt1RzSgxOX87GU4PaKI7LPb4Cnc4mUrK+Bgu7mTkho9ObZWdcsZ3lzx/VOhZ9lfeH/CIKsBHwzU8Ctv7dWjck3UYp00nnjcLbWH4b8CH7K8B2wp/GIfdi/+gpH8oQ+T1hUA+k/3qu7E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749666883; 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=GuZNk0F1bodSwirhOG/JBltWIHXjauSG+o14JA3+usQ=; b=D3wgLnLkUntrzAlXxfAoRPcptOr5asyUVoP6q5Ocm0UEHgcolNli+GT1OcgvzTaNdElwu5dj8HW+Ls23E99DXtVAWHfeCNFbDiLp3LwFfov473h1eNt98qT+g7eaHB53tIFjENnejA2BcItwamhHvCuGRSRDY9bkGpiPX7jKSFU= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749666883521458.45043758124086; Wed, 11 Jun 2025 11:34:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPQFq-0005j2-P2; Wed, 11 Jun 2025 14:32:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPQAo-0002rt-Nk for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:43 -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 1uPQAl-0001rd-2u for qemu-devel@nongnu.org; Wed, 11 Jun 2025 14:27:42 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-119-IlUTyrPmOYmn9OcCGGCdvw-1; Wed, 11 Jun 2025 14:27:33 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F35F919560B4; Wed, 11 Jun 2025 18:27:29 +0000 (UTC) Received: from localhost (unknown [10.2.16.122]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 964ED18003FC; Wed, 11 Jun 2025 18:27:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749666458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GuZNk0F1bodSwirhOG/JBltWIHXjauSG+o14JA3+usQ=; b=EEFzaF2OYIthOClB3AUjp4CxcX8783PXf69ReNCXbwuEHYYJaKD3+ZacD8qONwAe0HhSO0 KXiLx4zhCB42bkUQkkH10tw6C8QnvcnkqvPZO/i/cjVXsPPuvJIdYXDdN+J6K/gz6XHytF hQIkCsg28lxxxc0vubOru1ks7waN8AQ= X-MC-Unique: IlUTyrPmOYmn9OcCGGCdvw-1 X-Mimecast-MFC-AGG-ID: IlUTyrPmOYmn9OcCGGCdvw_1749666450 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Jesper Devantier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Troy Lee , Paolo Bonzini , Hanna Reitz , qemu-s390x@nongnu.org, Halil Pasic , Kevin Wolf , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Dmitry Fleytman , Jason Wang , Keith Busch , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Fam Zheng , Sven Schnelle , Stefan Hajnoczi , Joel Stanley , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Hannes Reinecke , Klaus Jensen , Jeuk Kim , Andrew Jeffery , Alistair Francis , Thomas Huth , Michael Tokarev , Laurent Vivier , Rob Herring , Steven Lee , Jamin Lin , Christian Borntraeger , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Klaus Jensen Subject: [PULL 31/31] net/stream: skip automatic zero-init of large array Date: Wed, 11 Jun 2025 14:25:33 -0400 Message-ID: <20250611182533.200590-32-stefanha@redhat.com> In-Reply-To: <20250611182533.200590-1-stefanha@redhat.com> References: <20250611182533.200590-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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=170.10.129.124; envelope-from=stefanha@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1749666885518116600 From: Daniel P. Berrang=C3=A9 The 'net_stream_send' method has a 68k byte array used for copying data between guest and host. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'buf1' array will be fully initialized when reading data off the network socket. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Reviewed-by: Klaus Jensen Reviewed-by: Harsh Prateek Bora Message-id: 20250610123709.835102-32-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- net/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/stream.c b/net/stream.c index 4de5613844..6152d2a05e 100644 --- a/net/stream.c +++ b/net/stream.c @@ -148,7 +148,7 @@ static gboolean net_stream_send(QIOChannel *ioc, NetStreamState *s =3D data; int size; int ret; - char buf1[NET_BUFSIZE]; + QEMU_UNINITIALIZED char buf1[NET_BUFSIZE]; const char *buf; =20 size =3D qio_channel_read(s->ioc, buf1, sizeof(buf1), NULL); --=20 2.49.0