From nobody Sun Nov 24 06:57:28 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1726004150; cv=none; d=zohomail.com; s=zohoarc; b=TTGgUxGfGm7C8YJYpEQ6KuGYP7RO1mykmdhTdkZcCD0NwsEn5UkXAfBARn3TeMfFdi3SIeaJz+wRDmM0vxnYMl77/GfWgv8knc4l6J4+sKnj70CNPs9MOhEY6vL6Kl5ErdDFb3EaefAGkiDF/rE2ncVN7HM9FD9dc0DlokfXV3U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1726004150; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jGi+lHOpgT/ylVqXhI7nLVR4vBTcqPZgS5ONhF4/Ujg=; b=DUtvmSLnxrd1hL1Yc+5sxaQLbAwWUZB7ME/4UXLGgEWYJ2cBJu1QXbHZ9L9m9uf2Pi7oA2R6NK5QrpFIAu0N807cNcEVwar+QFw+uyx03ckkxrYbseslBPPtP6ck16fh8cQGkG1s4IHbPgGCazMXwY43/zyWyHBt3kz/AT0G30Y= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1726004150047674.6617540098625; Tue, 10 Sep 2024 14:35:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so8WO-0004a8-CM; Tue, 10 Sep 2024 17:35:36 -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 1so8WM-0004Up-Sl for qemu-devel@nongnu.org; Tue, 10 Sep 2024 17:35:34 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1so8WK-00036f-M0 for qemu-devel@nongnu.org; Tue, 10 Sep 2024 17:35:34 -0400 Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-7cd967d8234so3909889a12.2 for ; Tue, 10 Sep 2024 14:35:32 -0700 (PDT) Received: from mnissler.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-719090b029csm1842451b3a.173.2024.09.10.14.35.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 14:35:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1726004130; x=1726608930; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=jGi+lHOpgT/ylVqXhI7nLVR4vBTcqPZgS5ONhF4/Ujg=; b=mihkPUVoON3Ukrq8Sq4iPZ0yUfolex073zfbr65yO7UDnknSxrYSgYf+M0eVjmEVAE Srg0ZZBcTKKdeFDXs6j9mInAFeanhzN/sJnuJMyfu4IepjjuBnKKiLXYPsWsvULxHK0q T+pucaIrRLbP7l3zjUErUN6jByLXpl0d6305ViP3gBiUP7WF9nrckxuW9Ie6ezAkCLd9 hExuIT4cAv5BTDUTdR50IFpay8razKVtFkD3gKAhHuIBVeGc/ZLIJyqX9V8hyKwWdukR N+j+bWgYI9/VQio+a1AgVe3GdiBI76SItQHMmao6Z2qr4e1+AB20UJDl4HhG5YzHC33a p6vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726004130; x=1726608930; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jGi+lHOpgT/ylVqXhI7nLVR4vBTcqPZgS5ONhF4/Ujg=; b=OiD4sE8FAbC7pL3L+2dzuuXEO5ja/TqJ4OkwG46nzvTu7RVIVwVscriom4fhGpczkV cbPnJkQK7Zi4Z2l0lnNjkRQKfio91bN4uAQN5NP0vlFKd2FRiDYHq+8X7gq6tZ/KT9zi yB/Jh0LzkVNOxElUaitoPTUrvasgZhtzlJxmOxfBG9pM6j9jJRwXCF8BWohNq1f6f1i9 lONybrdcOGM+e9sP1Q2X2jd95h9h8ygT8K9a40M2I/HqTvWf5Uer4yIvbDM5L8oLHme9 kr2vjk+siU9He4LUSpK6T0NwW2BEnalSUeeWeWtRv5GA3YWSivqp5CNlHyZb5qp2vmui oYIQ== X-Gm-Message-State: AOJu0YzgVNT72X0hJv+tb01Mc4vS1Te2mnyBFVHkMbcro2WSkO6VLrv0 0OJ6JRsJzuD2rsuF/ZM6XT9TSox2OdbyLlQ6bo3a1b4xHCLvzqDt+Zm00d3kT1kjkGj7jV7iGV5 v X-Google-Smtp-Source: AGHT+IGBNqA3K7WJPDRSXFKY8dE+GL3RpCg80n+V9lRoTbwDgNeEEQdzIiqziqFVG5wf+YgtL1CXmw== X-Received: by 2002:a05:6a20:c888:b0:1cf:122b:37d1 with SMTP id adf61e73a8af0-1cf5e114436mr3384247637.30.1726004130293; Tue, 10 Sep 2024 14:35:30 -0700 (PDT) From: Mattias Nissler To: qemu-devel@nongnu.org Cc: Paolo Bonzini , David Hildenbrand , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Peter Xu , Mattias Nissler Subject: [PATCH] softmmu: Expand comments describing max_bounce_buffer_size Date: Tue, 10 Sep 2024 14:35:12 -0700 Message-Id: <20240910213512.843130-1-mnissler@rivosinc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=mnissler@rivosinc.com; helo=mail-pg1-x52e.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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 @rivosinc-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1726004151321116600 Content-Type: text/plain; charset="utf-8" Clarify how the parameter gets configured and how it is used when servicing DMA mapping requests targeting indirect memory regions. Signed-off-by: Mattias Nissler Acked-by: Peter Xu --- include/exec/memory.h | 9 ++++++++- include/hw/pci/pci_device.h | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index e5e865d1a9..9458e2801d 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1104,7 +1104,14 @@ struct AddressSpace { QTAILQ_HEAD(, MemoryListener) listeners; QTAILQ_ENTRY(AddressSpace) address_spaces_link; =20 - /* Maximum DMA bounce buffer size used for indirect memory map request= s */ + /* + * Maximum DMA bounce buffer size used for indirect memory map request= s. + * This limits the total size of bounce buffer allocations made for + * DMA requests to indirect memory regions within this AddressSpace. D= MA + * requests that exceed the limit (e.g. due to overly large requested = size + * or concurrent DMA requests having claimed too much buffer space) wi= ll be + * rejected and left to the caller to handle. + */ size_t max_bounce_buffer_size; /* Total size of bounce buffers currently allocated, atomically access= ed */ size_t bounce_buffer_size; diff --git a/include/hw/pci/pci_device.h b/include/hw/pci/pci_device.h index 91df40f989..8eaf0d58bb 100644 --- a/include/hw/pci/pci_device.h +++ b/include/hw/pci/pci_device.h @@ -168,7 +168,11 @@ struct PCIDevice { char *failover_pair_id; uint32_t acpi_index; =20 - /* Maximum DMA bounce buffer size used for indirect memory map request= s */ + /* + * Indirect DMA region bounce buffer size as configured for the device= . This + * is a configuration parameter that is reflected into bus_master_as w= hen + * realizing the device. + */ uint32_t max_bounce_buffer_size; }; =20 --=20 2.34.1