From: Daniel P. Berrangé Date: Tue, 10 Jun 2025 12:36:52 +0000 (+0100) Subject: hw/char/sclpconsole-lm: skip automatic zero-init of large array X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8b1dac1ad57082611419b0e2f347acd96115d25f;p=thirdparty%2Fqemu.git hw/char/sclpconsole-lm: skip automatic zero-init of large array 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é Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-15-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- 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]; len = be16_to_cpu(mdbo->length); len -= sizeof(mdbo->length) + sizeof(mdbo->type)