From nobody Mon Feb 9 16:19:22 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1639843764; cv=none; d=zohomail.com; s=zohoarc; b=Br3NzyygY+3lO2vhcffRsaBtMp/IzsH7dBz6nPYsRolMcfxi+nK3incB2Fx1stAtTM5iqfSYRqQV0UjIL/zVfV9zSxSjQnwYx6h9LUskvmHwCy03koIC1jC9oANegJ+auFtCNo1zdQQI0FImqFwJ5F/vQ+OiLZ8S4+wCAw8HaKw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639843764; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=KHvhFoJYpxrKY7F/gSTUJxZZxv0vnELqns4DeM0yqMI=; b=eVOz/+XDsgkGajXYxATuxv9UTDQsmVlVp6py17ZZQ2NLwhIiMJNFutPq6o0jx2VoAjSoMJljxiaH8g53YEOs0ldLIt/uXkduoTPCe1utiBFaCCt7yeGFjb86IagSS2NbYlc9+CbNIzR8Z/KnuyM67rw4OUvun6sOObGzH8GBu/g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1639843764258705.3099936100903; Sat, 18 Dec 2021 08:09:24 -0800 (PST) Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-378-YR6nXLIuMr6eA9BvFEvclw-1; Sat, 18 Dec 2021 11:09:21 -0500 Received: by mail-wm1-f70.google.com with SMTP id bg20-20020a05600c3c9400b0033a9300b44bso2531448wmb.2 for ; Sat, 18 Dec 2021 08:09:21 -0800 (PST) Return-Path: Return-Path: Received: from x1w.. (174.red-83-50-185.dynamicip.rima-tde.net. [83.50.185.174]) by smtp.gmail.com with ESMTPSA id s8sm12307770wra.9.2021.12.18.08.09.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Dec 2021 08:09:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639843763; 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=KHvhFoJYpxrKY7F/gSTUJxZZxv0vnELqns4DeM0yqMI=; b=JaMhW8UyP0eD62o6ws6n6RJreIpWNj+eR2Tb0oxmPrNG6VP9OLrVI9spgz5cvkI+bzq4Vr wON+EWU3ync9gMBdSlCNoxafhdCRBep/koBd1z7fEXTYK7+t//Dv0CQQ3iZdfmWqKSIVnX adD16YTRZbDHj1OuM919Fan8B8cTeWI= X-MC-Unique: YR6nXLIuMr6eA9BvFEvclw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KHvhFoJYpxrKY7F/gSTUJxZZxv0vnELqns4DeM0yqMI=; b=WyMIesA4DPi28KiyA/+Y+QNBzcK49cxrMfJ3ud4mbW+XM0JXPmGn6ifUdeQjX7TDaa /B9/dwDfeGJ7uGvUvxrBSH40URKoL1meEhndNLITWNJrkslUSyOG3Nr2VffZN8Q3bNNE DbHGqHZwH/Hd6DmNQ/sJOMDqdXsCu+uecbm56y/wSUF2b8AQnCCBdCRV1AUMwIRgjSEW b6L46larujXXHay02sMkc1BmG32JpxG1M3mWZiP3aJBZ7PH9W4scnZUIrZVaeiwHhQEz O05j+tmXZRsA5ZgdrPrHMPxsVuFBxwQwFP1d4lU1bjnUtXVp8GGEDr7I/RTuQ+KnuqKj 5HOg== X-Gm-Message-State: AOAM532zE2vXfdCWyMFh2hPsuby0ne9ns+jzLMn5pvwGFiw8+rIoXHat DWKTz/imoFCuH9hCHamSI8x08NKGP32Wwb0jDCoa9gGyRxgFdzqIku+m7bJY9I5TIAyulCZciER BZIDR+0V8zRAQtg== X-Received: by 2002:a5d:6702:: with SMTP id o2mr6263886wru.292.1639843760712; Sat, 18 Dec 2021 08:09:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJydhNuSyoNSHMqg9Xpi8ZPhL+v2vvtPFjLa7od9ARzn9n8KLsxEvmZM7tTMqyTTG/YKDBkoVg== X-Received: by 2002:a5d:6702:: with SMTP id o2mr6263877wru.292.1639843760492; Sat, 18 Dec 2021 08:09:20 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Volker=20R=C3=BCmelin?= , Laurent Vivier , Jon Maloy , crazybyte@protonmail.com, Thomas Huth , Gianluca Gabruelli , Mauro Matteo Cascella , Matt Parker , Alexander Bulekov , Paolo Bonzini , Qiuhao Li , Gerd Hoffmann , Martin Schrodt , Li Qiang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 1/3] hw/audio/intel-hda: Do not ignore DMA overrun errors Date: Sat, 18 Dec 2021 17:09:10 +0100 Message-Id: <20211218160912.1591633-2-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211218160912.1591633-1-philmd@redhat.com> References: <20211218160912.1591633-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1639843766125100001 Per the "High Definition Audio Specification" manual (rev. 1.0a), section "3.3.30 Offset 5Dh: RIRBSTS - RIRB Status": Response Overrun Interrupt Status (RIRBOIS): Hardware sets this bit to a 1 when an overrun occurs in the RIRB. An interrupt may be generated if the Response Overrun Interrupt Control bit is set. This bit will be set if the RIRB DMA engine is not able to write the incoming responses to memory before additional incoming responses overrun the internal FIFO. When hardware detects an overrun, it will drop the responses which overrun the buffer and set the RIRBOIS status bit to indicate the error condition. Optionally, if the RIRBOIC is set, the hardware will also generate an error to alert software to the problem. QEMU emulates the DMA engine with the stl_le_pci_dma() calls. This function returns a MemTxResult indicating whether the DMA access was successful. Handle any MemTxResult error as "DMA engine is not able to write the incoming responses to memory" and raise the Overrun Interrupt flag when this case occurs. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/audio/intel-hda.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index 2b55d521503..0c1017edbbf 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -350,6 +350,7 @@ static void intel_hda_response(HDACodecDevice *dev, boo= l solicited, uint32_t res IntelHDAState *d =3D container_of(bus, IntelHDAState, codecs); hwaddr addr; uint32_t wp, ex; + MemTxResult res =3D MEMTX_OK; =20 if (d->ics & ICH6_IRS_BUSY) { dprint(d, 2, "%s: [irr] response 0x%x, cad 0x%x\n", @@ -368,8 +369,12 @@ static void intel_hda_response(HDACodecDevice *dev, bo= ol solicited, uint32_t res ex =3D (solicited ? 0 : (1 << 4)) | dev->cad; wp =3D (d->rirb_wp + 1) & 0xff; addr =3D intel_hda_addr(d->rirb_lbase, d->rirb_ubase); - stl_le_pci_dma(&d->pci, addr + 8 * wp, response, attrs); - stl_le_pci_dma(&d->pci, addr + 8 * wp + 4, ex, attrs); + res |=3D stl_le_pci_dma(&d->pci, addr + 8 * wp, response, attrs); + res |=3D stl_le_pci_dma(&d->pci, addr + 8 * wp + 4, ex, attrs); + if (res !=3D MEMTX_OK && (d->rirb_ctl & ICH6_RBCTL_OVERRUN_EN)) { + d->rirb_sts |=3D ICH6_RBSTS_OVERRUN; + intel_hda_update_irq(d); + } d->rirb_wp =3D wp; =20 dprint(d, 2, "%s: [wp 0x%x] response 0x%x, extra 0x%x\n", --=20 2.33.1