From nobody Fri Oct 3 03:18:40 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1572366481; cv=none; d=zoho.com; s=zohoarc; b=gvKZRSjCo6BfQHBtApfmfnr3zgTjr9sPQMdJGzVRhZ/Xnais3YjDH7zlnmZy7klA2qISK88QH/PHzjW0jE7BhssQV1KmpX7KPMoOVmbS7sWWGNJmnLDNE5EC+QDJN7drFctbrdtEpN5rPGgHICSrgqwAeKInl/7Js9ZkGUlbhSc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572366481; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JLypjmRTb08Qb0V0OoJj2WZu63pj51rP4Zc4f/igiag=; b=LX7loGz9kY4RpFtqa4bj7UyLEY/taAhFbjPeXYyHxxUgPgWd9Z4QPf0vwfaz+thhoclVNNnGCGic0uhStJ8+DASZctk19+x1xEu7biDtvsLex6+G4iC/VBEWsvvtXu/Ayxt/GB2YFgIR4/aH3UQ3hGWWmJgIxEueAEYOxLmRNCA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157236648143440.08080132240798; Tue, 29 Oct 2019 09:28:01 -0700 (PDT) Received: from localhost ([::1]:59666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPULf-0008IE-T8 for importer@patchew.org; Tue, 29 Oct 2019 12:27:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50719) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPUGp-00027m-Dn for qemu-devel@nongnu.org; Tue, 29 Oct 2019 12:23:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iPUGn-0004xa-CJ for qemu-devel@nongnu.org; Tue, 29 Oct 2019 12:22:59 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:45054) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iPUGn-0004wH-5C for qemu-devel@nongnu.org; Tue, 29 Oct 2019 12:22:57 -0400 Received: by mail-wr1-x442.google.com with SMTP id z11so14298232wro.11 for ; Tue, 29 Oct 2019 09:22:57 -0700 (PDT) Received: from donizetti.metropole.lan (94.222.26.109.rev.sfr.net. [109.26.222.94]) by smtp.gmail.com with ESMTPSA id q12sm9285661wrw.91.2019.10.29.09.22.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 09:22:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JLypjmRTb08Qb0V0OoJj2WZu63pj51rP4Zc4f/igiag=; b=gtn4D5MDqbMuLY8udXoxMGtWyR8wRlsZ+vJjWwKNcHX8ZV4ksnRsIDTa81jVYeDw1M g3UA2lWZf2JApEpH7P61s0gJFP36o8NNUBVYEDc93JLPyRMFza0rfonWPJFMqXsgfjYG y3Su6WYfHcgJ8sOXA3fyMvzRL076AVA+lWvVYBLgInbbULUN+mGlwphBu88JuQpseKr7 flaMnkjkG/kO5N6Mz37KIEJCtsGVnTc/3rW6b2+q3oeXKNALL0DFyO/q42gjSe4kXmJE FMHStU11EaO8NT2/qGzwo34CgOgrJ32e88/Iq7DXObdx48FGfyNKaDWFz5qVlwLFJEc5 SIAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=JLypjmRTb08Qb0V0OoJj2WZu63pj51rP4Zc4f/igiag=; b=OBM/ZvQUTyrUM+wXh0osaVmuiJt/GSNvYBXBKC/ZbDaUDquD2NPWopAXo5BFaeWunK msy+WKNU9X856y+AGDEsZqDct36DJT4eierkSu5FJ/vur4S+wne7tqtt9Nwatky0svPn UJGxAHTx3RsaaUUZ+GW41Zdu0V5nEEVpSsgIFGqYY1LD0AQtTnTTfCk57JK/+UBZgIkC ZPW3cZWzEDSR/5A0rQ5NHk7uqz8cPyNeToIk+n8J3Rcp9Pg36qGIeF+FtzrEcXocK52x sf3hayolzlVf2AaZIbSTpd8VdV8rzkqYTGY32rEOgslRGU/rosDS2SRWyTRq7xBgiuR7 XRdQ== X-Gm-Message-State: APjAAAVmq1M7bt+gY0KVMB3erLI1aolWyegCUK1iPIqO8/t99VjH9uJF mL8OP2eZPpBCHA5Eiuqvj6cwvzpI/eo= X-Google-Smtp-Source: APXvYqz3CotIYvIP4v/XmrS+zlqmN9lPwUZ9J5AzfpfcDfEJspSMKkM/MoJzw03QP43dEW7SzmZCYg== X-Received: by 2002:adf:cd84:: with SMTP id q4mr20440845wrj.153.1572366175669; Tue, 29 Oct 2019 09:22:55 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 6/6] memory: include MemoryListener documentation and some missing function parameters Date: Tue, 29 Oct 2019 17:22:48 +0100 Message-Id: <20191029162248.13383-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191029162248.13383-1-pbonzini@redhat.com> References: <20191029162248.13383-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" These cover the remaining warnings from kernel-doc. Signed-off-by: Paolo Bonzini --- include/exec/memory.h | 211 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 209 insertions(+), 2 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 1e875996ec..c84fde75fa 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -423,30 +423,232 @@ struct IOMMUMemoryRegion { * Use with memory_listener_register() and memory_listener_unregister(). */ struct MemoryListener { + /** + * @begin: + * + * Called at the beginning of an address space update transaction. + * Followed by calls to #MemoryListener.region_add(), + * #MemoryListener.region_del(), #MemoryListener.region_nop(), + * #MemoryListener.log_start() and #MemoryListener.log_stop() in + * increasing address order. + * + * @listener: The #MemoryListener. + */ void (*begin)(MemoryListener *listener); + + /** + * @commit: + * + * Called at the end of an address space update transaction, + * after the last call to #MemoryListener.region_add(), + * #MemoryListener.region_del() or #MemoryListener.region_nop(), + * #MemoryListener.log_start() and #MemoryListener.log_stop(). + * + * @listener: The #MemoryListener. + */ void (*commit)(MemoryListener *listener); + + /** + * @region_add: + * + * Called during an address space update transaction, + * for a section of the address space that is new in this address space + * space since the last transaction. + * + * @listener: The #MemoryListener. + * @section: The new #MemoryRegionSection. + */ void (*region_add)(MemoryListener *listener, MemoryRegionSection *sect= ion); + + /** + * @region_del: + * + * Called during an address space update transaction, + * for a section of the address space that has disappeared in the addr= ess + * space since the last transaction. + * + * @listener: The #MemoryListener. + * @section: The old #MemoryRegionSection. + */ void (*region_del)(MemoryListener *listener, MemoryRegionSection *sect= ion); + + /** + * @region_nop: + * + * Called during an address space update transaction, + * for a section of the address space that is in the same place in the= address + * space as in the last transaction. + * + * @listener: The #MemoryListener. + * @section: The #MemoryRegionSection. + */ void (*region_nop)(MemoryListener *listener, MemoryRegionSection *sect= ion); + + /** + * @log_start: + * + * Called during an address space update transaction, after + * one of #MemoryListener.region_add(),#MemoryListener.region_del() or + * #MemoryListener.region_nop(), if dirty memory logging clients have + * become active since the last transaction. + * + * @listener: The #MemoryListener. + * @section: The #MemoryRegionSection. + * @old: A bitmap of dirty memory logging clients that were active in + * the previous transaction. + * @new: A bitmap of dirty memory logging clients that are active in + * the current transaction. + */ void (*log_start)(MemoryListener *listener, MemoryRegionSection *secti= on, int old, int new); + + /** + * @log_stop: + * + * Called during an address space update transaction, after + * one of #MemoryListener.region_add(), #MemoryListener.region_del() or + * #MemoryListener.region_nop() and possibly after + * #MemoryListener.log_start(), if dirty memory logging clients have + * become inactive since the last transaction. + * + * @listener: The #MemoryListener. + * @section: The #MemoryRegionSection. + * @old: A bitmap of dirty memory logging clients that were active in + * the previous transaction. + * @new: A bitmap of dirty memory logging clients that are active in + * the current transaction. + */ void (*log_stop)(MemoryListener *listener, MemoryRegionSection *sectio= n, int old, int new); + + /** + * @log_sync: + * + * Called by memory_region_snapshot_and_clear_dirty() and + * memory_global_dirty_log_sync(), before accessing QEMU's "official" + * copy of the dirty memory bitmap for a #MemoryRegionSection. + * + * @listener: The #MemoryListener. + * @section: The #MemoryRegionSection. + */ void (*log_sync)(MemoryListener *listener, MemoryRegionSection *sectio= n); + + /** + * @log_clear: + * + * Called before reading the dirty memory bitmap for a + * #MemoryRegionSection. + * + * @listener: The #MemoryListener. + * @section: The #MemoryRegionSection. + */ void (*log_clear)(MemoryListener *listener, MemoryRegionSection *secti= on); + + /** + * @log_global_start: + * + * Called by memory_global_dirty_log_start(), which + * enables the %DIRTY_LOG_MIGRATION client on all memory regions in + * the address space. #MemoryListener.log_global_start() is also + * called when a #MemoryListener is added, if global dirty logging is + * active at that time. + * + * @listener: The #MemoryListener. + */ void (*log_global_start)(MemoryListener *listener); + + /** + * @log_global_stop: + * + * Called by memory_global_dirty_log_stop(), which + * disables the %DIRTY_LOG_MIGRATION client on all memory regions in + * the address space. + * + * @listener: The #MemoryListener. + */ void (*log_global_stop)(MemoryListener *listener); + + /** + * @log_global_after_sync: + * + * Called after reading the dirty memory bitmap + * for any #MemoryRegionSection. + * + * @listener: The #MemoryListener. + */ void (*log_global_after_sync)(MemoryListener *listener); + + /** + * @eventfd_add: + * + * Called during an address space update transaction, + * for a section of the address space that has had a new ioeventfd + * registration since the last transaction. + * + * @listener: The #MemoryListener. + * @section: The new #MemoryRegionSection. + * @match_data: The @match_data parameter for the new ioeventfd. + * @data: The @data parameter for the new ioeventfd. + * @e: The #EventNotifier parameter for the new ioeventfd. + */ void (*eventfd_add)(MemoryListener *listener, MemoryRegionSection *sec= tion, bool match_data, uint64_t data, EventNotifier *e); + + /** + * @eventfd_del: + * + * Called during an address space update transaction, + * for a section of the address space that has dropped an ioeventfd + * registration since the last transaction. + * + * @listener: The #MemoryListener. + * @section: The new #MemoryRegionSection. + * @match_data: The @match_data parameter for the dropped ioeventfd. + * @data: The @data parameter for the dropped ioeventfd. + * @e: The #EventNotifier parameter for the dropped ioeventfd. + */ void (*eventfd_del)(MemoryListener *listener, MemoryRegionSection *sec= tion, bool match_data, uint64_t data, EventNotifier *e); + + /** + * @coalesced_io_add: + * + * Called during an address space update transaction, + * for a section of the address space that has had a new coalesced + * MMIO range registration since the last transaction. + * + * @listener: The #MemoryListener. + * @section: The new #MemoryRegionSection. + * @addr: The starting address for the coalesced MMIO range. + * @len: The length of the coalesced MMIO range. + */ void (*coalesced_io_add)(MemoryListener *listener, MemoryRegionSection= *section, hwaddr addr, hwaddr len); + + /** + * @coalesced_io_del: + * + * Called during an address space update transaction, + * for a section of the address space that has dropped a coalesced + * MMIO range since the last transaction. + * + * @listener: The #MemoryListener. + * @section: The new #MemoryRegionSection. + * @addr: The starting address for the coalesced MMIO range. + * @len: The length of the coalesced MMIO range. + */ void (*coalesced_io_del)(MemoryListener *listener, MemoryRegionSection= *section, hwaddr addr, hwaddr len); - /* Lower =3D earlier (during add), later (during del) */ + /** + * @priority: + * + * Govern the order in which memory listeners are invoked. Lower prior= ities + * are invoked earlier for "add" or "start" callbacks, and later for "= delete" + * or "stop" callbacks. + */ unsigned priority; + + /* private: */ AddressSpace *address_space; QTAILQ_ENTRY(MemoryListener) link; QTAILQ_ENTRY(MemoryListener) link_as; @@ -940,6 +1142,7 @@ void memory_region_init_rom(MemoryRegion *mr, * @mr: the #MemoryRegion to be initialized. * @owner: the object that tracks the region's reference count * @ops: callbacks for write access handling (must not be NULL). + * @opaque: passed to the read and write callbacks of the @ops structure. * @name: Region name, becomes part of RAMBlock name used in migration str= eam * must be unique within any device * @size: size of the region. @@ -1028,7 +1231,7 @@ static inline IOMMUMemoryRegion *memory_region_get_io= mmu(MemoryRegion *mr) * Returns pointer to IOMMUMemoryRegionClass if a memory region is an iomm= u, * otherwise NULL. This is fast path avoiding QOM checking, use with cauti= on. * - * @mr: the memory region being queried + * @iommu_mr: the memory region being queried */ static inline IOMMUMemoryRegionClass *memory_region_get_iommu_class_nochec= k( IOMMUMemoryRegion *iommu_mr) @@ -1098,6 +1301,7 @@ void memory_region_notify_one(IOMMUNotifier *notifier, * @n: the IOMMUNotifier to be added; the notify callback receives a * pointer to an #IOMMUTLBEntry as the opaque value; the pointer * ceases to be valid on exit from the notifier. + * @errp: pointer to Error*, to store an error if it happens. */ int memory_region_register_iommu_notifier(MemoryRegion *mr, IOMMUNotifier *n, Error **errp); @@ -1585,6 +1789,8 @@ void memory_region_add_subregion_overlap(MemoryRegion= *mr, /** * memory_region_get_ram_addr: Get the ram address associated with a memory * region + * + * @mr: the region to be queried */ ram_addr_t memory_region_get_ram_addr(MemoryRegion *mr); =20 @@ -2155,6 +2361,7 @@ static inline bool memory_access_is_direct(MemoryRegi= on *mr, bool is_write) * @addr: address within that address space * @attrs: memory transaction attributes * @buf: buffer with the data transferred + * @len: length of the data transferred */ static inline __attribute__((__always_inline__)) MemTxResult address_space_read(AddressSpace *as, hwaddr addr, --=20 2.21.0