From patchwork Mon Jul 8 06:55:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1957826 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=TSL/ASzM; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WHZhk4F2wz1xpd for ; Mon, 8 Jul 2024 16:58:30 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQiIi-0001WZ-1K; Mon, 08 Jul 2024 02:56:40 -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 1sQiIc-0001Ml-VS for qemu-ppc@nongnu.org; Mon, 08 Jul 2024 02:56:35 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sQiIW-0001uv-Vs for qemu-ppc@nongnu.org; Mon, 08 Jul 2024 02:56:34 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1f65a3abd01so24858965ad.3 for ; Sun, 07 Jul 2024 23:56:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1720421788; x=1721026588; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=RbcvfQTicnHYs0Rl8hdXG4yng/OPRtHTnYekAJzWw5c=; b=TSL/ASzMfySzCdwkGj+k0PF/nYjATDQ7OrzcqaH4avIcejerekELQ/8B+A39YkvZei xuSKgJXfZ7iWRb9sF4YPQpCa9pjCthOVegb98HNIOrznew/UhJnh4OUNslXx++ou6kuR tVhEElipNaoQY/5kDVQ0EevmqUTTOAxzhwW+p9gg+Uu4izJJrJ5gX2pdjU3yKXvB11vW Scv7zLLi/TqpkE9mlYm2ScpY3RrSq7NO7ozpi+Snsdq+jp+3m45iQJv2XallwicjM2MB 5yTVlQVUg/EQ+GuR6kAS+v5HpsGEQd+UFXvpgD3PGVlR6hpzfgM/Wozw6FKoWKCqJ1Pp wtSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720421788; x=1721026588; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RbcvfQTicnHYs0Rl8hdXG4yng/OPRtHTnYekAJzWw5c=; b=nu6NUk4MfiPiFpy12LkV3AFUpOvaJMR6VMSIWhWoyRnWt2Adf804dws1z+ywVqjqC3 vR0KkSEJkQr3yQUy555xOQELIYvSxC9zo344s8gEBG6yxtSswXG6LagrkQ0ovPP052FO Vvn6OAwRZ+fUOog3pG33KPUX+gDjS2x74lHrsbnawstmk4gNw6Myu+VBnNBCX8qlFbZv hlQKhnxPdf0DJ0ZKMtfXYvJxUf3wDGCbANoWTrXl74M9jDvYvWOXFtz/Yy1H+on9EwrF bZmQ0CqXcK/2IKgzquEV7jGGtTKU5FJaCWUafLZK5UR4G4xCAyr2WhvHrNEHssUOHN1u s79A== X-Forwarded-Encrypted: i=1; AJvYcCWKL+b/GJ6L+j3qf7QlmrSUjpnkZq8pJwoM9B5FFYZkH9YnNAW3BRLpu0aXI/b0wplWxsuOOv0II1p9WhGUpAst59ja X-Gm-Message-State: AOJu0YyqZZIC7O5OBSdUfoV3HczdS1RmIll4/uL/pEum/Xe+lGEQd6+4 fluX5Aq8bNdnhubxP9iY0l3glEmrdhNeHheLdNhMrzF6H8h0yzBrw6kudbco21w= X-Google-Smtp-Source: AGHT+IF224MSkQyCWG97UaqlAKurNwMnUliBvemXdWNeaeRytihyIwE176LqgTxQEVJaVP5Ugh784g== X-Received: by 2002:a17:902:e743:b0:1fb:7978:6b3 with SMTP id d9443c01a7336-1fb79780b8amr47259865ad.25.1720421787844; Sun, 07 Jul 2024 23:56:27 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-1fb48c6a5c3sm53740695ad.13.2024.07.07.23.56.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 07 Jul 2024 23:56:27 -0700 (PDT) From: Akihiko Odaki Date: Mon, 08 Jul 2024 15:55:17 +0900 Subject: [PATCH v3 6/9] memory: Clarify that owner may be missing MIME-Version: 1.0 Message-Id: <20240708-san-v3-6-b03f671c40c6@daynix.com> References: <20240708-san-v3-0-b03f671c40c6@daynix.com> In-Reply-To: <20240708-san-v3-0-b03f671c40c6@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::635; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x635.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_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org A memory region may not have an owner, and memory_region_ref() and memory_region_unref() do nothing for such. Signed-off-by: Akihiko Odaki --- include/exec/memory.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index e1bd29550c15..847c84c86db0 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1245,7 +1245,7 @@ void memory_region_init(MemoryRegion *mr, /** * memory_region_ref: Add a reference to a memory region * - * This function adds a reference to the owner. + * This function adds a reference to the owner if present. * See docs/devel/memory.rst to know about owner. * * @mr: the #MemoryRegion @@ -1255,8 +1255,8 @@ void memory_region_ref(MemoryRegion *mr); /** * memory_region_unref: Remove a reference to a memory region * - * This function removes a reference to the owner and possibly destroys it. - * See docs/devel/memory.rst to know about owner. + * This function removes a reference to the owner and possibly destroys it if + * present. See docs/devel/memory.rst to know about owner. * * @mr: the #MemoryRegion */