From patchwork Thu Mar 7 18:11:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 778509 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:47:b0:33e:474f:8c56 with SMTP id k7csp944120wrx; Thu, 7 Mar 2024 10:11:49 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU1Ln2ckY3MC1t+S2JrYDQPVThLlaxxB8DHSjnkqiRJSaAvO16uEWY/qK2UIcaA6zKCBiisSqwOt9VxvyfQp83c X-Google-Smtp-Source: AGHT+IFqqGFx347SAgWeZaMmtwrh42FRCrC/eE3Ue8oygi6D7CY8rSgKchLFYPB/+XcGDX/LLp/u X-Received: by 2002:a0c:bf46:0:b0:690:5dcc:31e7 with SMTP id b6-20020a0cbf46000000b006905dcc31e7mr9093838qvj.25.1709835109137; Thu, 07 Mar 2024 10:11:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709835109; cv=none; d=google.com; s=arc-20160816; b=Wf53JWoSQFJBzzJ3CKstJPMxp/pmwMx7rGbN+Jh5qJWXHThJEFNTvr2UU86pr8QbRG NbS4v/v57zzm763PXXwPwNAp+V/5F6ioXqMil7O3v5UTtOM1vV0TIO1DJ6smoh1lAfev ljlARoXYm6qby7FkfS/NT3I0AdJnCB+M2kvQ8Ln05+Gv/SV6hABvboW3NtpIf2KlVWU+ WdBaHIKSJmiiO1xQyuYp9c5ZyecnCaHgMTW0kxPSQDlCM5HjLDl28SJcB9AInu0AJ/jb WrahxK3k/xI7rf7Aq8sfrlHzE8gX12j5mhknaLeBNpi47XHy/1ZZpVDZU7+jJ1JkIDkT 3zpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mZ/K3PBuLzDgapFrWwRRkSM6VPt2uSmyXpXI8zQY5GY=; fh=58GrqNPmWxcKasqIC/eaOBnUs8d0lJZe3QlwbsxpY5w=; b=EPjGva9lvrZ4r4P9+GpQ0e6KlC22TelxzQTi05Hi/g/PtvJlQluNwvSVzRzZ55BcdD oaBVFaLhX48iV+L089UGXkT7KCphe7PSgjmmnzMyVkb8dl/Wz4hKuMDxA0wI04I+pguw 2viMKC36KyIhblPJZ6lXUjIYd8XZmK6m7GylS3Yn+zgDLnB3W9ceUbltoSb6HEYXEene 8BUJB9F/3EXwa0xXu63EaqH/TK6PuEfEp7t0+ctVdKyiHpXYdUrbDjo1Y2810AdgyPz9 ZPskEAOlK3M9AorK8tOPnZJKmDhSaiQQj4wxC2gWhjuvpz6dtVMwTe/tRQG4HTHlGDSE ThmA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Df+asfrA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ow2-20020a0562143f8200b006903ca3f5b3si17209990qvb.129.2024.03.07.10.11.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Mar 2024 10:11:49 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Df+asfrA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1riID7-0002U4-9p; Thu, 07 Mar 2024 13:11:17 -0500 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 1riID2-0002Rp-IL for qemu-devel@nongnu.org; Thu, 07 Mar 2024 13:11:12 -0500 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1riICy-0004Rs-Q6 for qemu-devel@nongnu.org; Thu, 07 Mar 2024 13:11:12 -0500 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-51336ab1fb7so34595e87.1 for ; Thu, 07 Mar 2024 10:11:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709835067; x=1710439867; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mZ/K3PBuLzDgapFrWwRRkSM6VPt2uSmyXpXI8zQY5GY=; b=Df+asfrAa+JCIwaLmhJZx67qTcFJ/1ZLqlUfcKKmTJ3x9BcWMHFd7nR0i0Yangw+4v cio2PAW4lnJFWoUguZ2pY2uGpf0Ac8BjyFYDFj0oINBUNrFsi676jIg3rrq4iIdpKx1Q FPd7B8OE9W749wfX9MC5oRx2/HSEeKeh52rwdAx2IwFWLo6ld8lpeO2tEqHLNS7dwkPh G7bwgI0qcEFSyzdjo13211cHFHY9SrWOUydW00YoHGd4wJMzXjOOyoeXyLGcLf+y+nS4 7BmzGA2cKPh6nHeLVjK+lLPs1RedCSQTU3eBNN73lCa1NBNOCrbqE2Wtz9OVJDHqQ0ga cehg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709835067; x=1710439867; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mZ/K3PBuLzDgapFrWwRRkSM6VPt2uSmyXpXI8zQY5GY=; b=AURzWtTPMBhl4A9jb37ir1r4tQs97nnlwnM4/zrKT7yuleA8XM01Y24b7MTZvyN3wF vKbiNtsGZtVCwTegaf2t1iDuq9U1NkhTT0KIM4ycuTHGjiQR6mQXsau4P+vuyC4RSpFf YR9xdthxPwfVz8ml/OG1FVkBxhWrverZEbIZrt9cnQw2WbwSmcIMqo0SCuyvwlbVjHKH MWQf6NkbsngYtfCFOqglE8oa6/bXUrNaJiVTmizqTUWHsCSGfS7AvvuxJmOi2URiH/FQ AQYZZS9cMcKOCGgBiiSisURBGtt8aySHGnP5L/u572o+Cahwbl2xRvsGPRnI1M0XpT4H X3vw== X-Gm-Message-State: AOJu0YzzbmUUbBMHvP4acwz5sEMPxv/qAVDg2vkEHtxlQEuCmtxs37QH 1g74RV2YoFdfUy1tm/wWX7qlPhtGm+9W604xfX3xtC2jCLwtYm3FaXEGDZ2O+CA= X-Received: by 2002:a19:ca4c:0:b0:512:b696:e312 with SMTP id h12-20020a19ca4c000000b00512b696e312mr1839900lfj.46.1709835066664; Thu, 07 Mar 2024 10:11:06 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id fs23-20020a05600c3f9700b00412f195426dsm3343613wmb.15.2024.03.07.10.11.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 10:11:06 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id C8A745F954; Thu, 7 Mar 2024 18:11:05 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Elena Ufimtseva , John G Johnson , Jagannathan Raman , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= , Paolo Bonzini , Alexandre Iooss , Peter Xu , Manos Pitsidianakis , Markus Armbruster , Eduardo Habkost , Juan Quintela , Thomas Huth , Richard Henderson , peter.maydell@linaro.org, David Hildenbrand Subject: [PATCH 4/5] include/exec: annotate all the MemoryRegion fields Date: Thu, 7 Mar 2024 18:11:04 +0000 Message-Id: <20240307181105.4081793-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240307181105.4081793-1-alex.bennee@linaro.org> References: <20240307181105.4081793-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::129; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x129.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Alex Bennée --- include/exec/memory.h | 47 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 17b741bc4f5..312ed564dbe 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -778,9 +778,48 @@ bool memory_get_xlat_addr(IOMMUTLBEntry *iotlb, void **vaddr, typedef struct CoalescedMemoryRange CoalescedMemoryRange; typedef struct MemoryRegionIoeventfd MemoryRegionIoeventfd; -/** MemoryRegion: - * - * A struct representing a memory region. +/** + * struct MemoryRegion - represents a memory region + * @parent_obj: parent QOM object for the region + * @romd_mode: if true ROM devices accessed directly rather than with @ops + * @ram: true if a RAM-type device with a @ram_block + * @subpage: true if region covers a subpage + * @readonly: true for RAM-type devices that are readonly + * @nonvolatile: true for nonvolatile RAM-type devices (e.g. NVDIMM) + * @rom_device: true for a ROM device, see also @romd_mode + * @flush_coalesced_mmio: true to flush any queued coalesced MMIO + * operations before access + * @unmergeable: this section should not get merged with adjacent + * sections + * @dirty_log_mask: dirty events region cares about (see DIRTY_ flags) + * @is_iommu: true if part of an IOMMU device + * @ram_block: backing @RamBlock if @ram is true + * @owner: base QOM object that owns this region + * @dev: base Device that owns this region + * @ops: access operations for MMIO or @romd_mode devices + * @opaque: @dev specific data, passed with @ops + * @container: parent `MemoryRegion` + * @mapped_via_alias: number of times mapped via @alias, container + * might be NULL + * @size: size of @MemoryRegion + * @addr: physical hwaddr of @MemoryRegion + * @destructor: cleanup function when @MemoryRegion finalized + * @align: alignment requirements for any physical backing store + * @terminates: true if this @MemoryRegion is a leaf node + * @ram_device: true if @ram device should use @ops to access + * @enabled: true once initialised, false once finalized + * @vga_logging_count: count of memory logging clients + * @alias: link to aliased @MemoryRegion + * @alias_offset: offset into aliased region + * @priority: priority when resolving overlapping regions + * @subregions: list of subregions in this region + * @subregions_link: next subregion in the chain + * @coalesced: list of coalesced memory ranges + * @name: name of memory region + * @ioeventfd_nb: count of @ioeventfds for region + * @ioeventfds: ioevent notifiers for region + * @rdm: if exists see #RamDiscardManager + * @disable_reentrancy_guard: if true don't error if device accesses itself */ struct MemoryRegion { Object parent_obj; @@ -806,7 +845,7 @@ struct MemoryRegion { const MemoryRegionOps *ops; void *opaque; MemoryRegion *container; - int mapped_via_alias; /* Mapped via an alias, container might be NULL */ + int mapped_via_alias; Int128 size; hwaddr addr; void (*destructor)(MemoryRegion *mr);