From patchwork Fri Aug 23 06:13:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1975873 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=LaS6mr/2; 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 4WqqYs69Rkz1yNm for ; Fri, 23 Aug 2024 16:15:29 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1shNYb-0002bZ-8W; Fri, 23 Aug 2024 02:13:57 -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 1shNYZ-0002UK-Ju for qemu-ppc@nongnu.org; Fri, 23 Aug 2024 02:13:55 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1shNYT-00038o-FX for qemu-ppc@nongnu.org; Fri, 23 Aug 2024 02:13:55 -0400 Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-2d3da6d3f22so1231708a91.0 for ; Thu, 22 Aug 2024 23:13:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1724393628; x=1724998428; 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=YdHplAffMcXcyi9egxfeqIrbdnUVPw/pDkvqxXIV6Fk=; b=LaS6mr/2/L0gqc4ZRA57xV55f1UmRP6c6jbfJrKzTDCN2dM3B335HRL7OVN0aX0Qtw 02Gggpk/mHEU3+7rHeSHSeXW6qDX6084O/Ekce7kr9eBvOVhoC2chGaNIDKtZbveC8/m gMgzrCAzqzwX1bqqowkcdDg0mYs20zka/lxo4C+1yFNbRWRJ5yEMWBpKvz7rooDmTTVY yC//gPqh1olto06HGuaKyjtdLPOdQmwi97FI4VYwYbyqp4rxM3cTfz5R2ZL4csNYoh1b B7m2ow13hCCT2UyZ3zNCTbPe3JprtbeR9lNS4KHuOrChehOgN6MEZxxUxwmNdEkmLQ2W HHtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724393628; x=1724998428; 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=YdHplAffMcXcyi9egxfeqIrbdnUVPw/pDkvqxXIV6Fk=; b=Z2AUrbSsTWago+GBdWxSXD5S/0HF+KeFRkAsE5gUXJUNuu6cDZRbjGsEKAdRIV9oCX n+kgf/c1nuY5PElEOVkWDpNKLuFG8/H35afXpsDtHEKRSHedzody4P4PGfcMO0FaX5Xs V7sTX854E3X5purtyBoL8Bddk/rij/T0QGV0+bptpIThiP5cj71ac58KV2qg9BImLPKD R3MX2bX9BTcc0mhM6Pron8QJ2qTftvMiUeXx9NCHs3HjfcgkhKKof1N006QeZ9o9YVty gW4+Rs3/1517Xu+HqdeXYb3xRZ2B2ResR8eithFHhxpQ9q82OsFpTMU1DOm7xTRPcAxt +iwg== X-Forwarded-Encrypted: i=1; AJvYcCWC586F3liWe31R4/BKrTv+g3kYMOYw/Kn0EnJ8n12xmdeP/B+HHe35ikkH6fy9VSkcbSu7nT3nXA==@nongnu.org X-Gm-Message-State: AOJu0Yx8FDgQne1zgS5DG/r9TWn8BwE96vcYYeTOz6tS4urY4X3HjuE3 WlkL9znTiaUWZ/p+D29dNxsIXIeHAwUOrziZNdEaTjIo8PoQ/GJzToBlqAojl98= X-Google-Smtp-Source: AGHT+IFzJ10oTRUyLJrWB5ipu7tvGZB9L6IX1t4YpN1zznxvJDoxVqCckhwL5Q+Xwak+DQuAoYo6Pg== X-Received: by 2002:a17:90a:c002:b0:2cb:e429:f525 with SMTP id 98e67ed59e1d1-2d646d2bbdfmr1123154a91.33.1724393628209; Thu, 22 Aug 2024 23:13:48 -0700 (PDT) Received: from localhost ([157.82.207.23]) by smtp.gmail.com with UTF8SMTPSA id 98e67ed59e1d1-2d61393fbcbsm3057579a91.22.2024.08.22.23.13.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Aug 2024 23:13:48 -0700 (PDT) From: Akihiko Odaki Date: Fri, 23 Aug 2024 15:13:09 +0900 Subject: [PATCH v4 4/7] memory: Clarify that owner may be missing MIME-Version: 1.0 Message-Id: <20240823-san-v4-4-a24c6dfa4ceb@daynix.com> References: <20240823-san-v4-0-a24c6dfa4ceb@daynix.com> In-Reply-To: <20240823-san-v4-0-a24c6dfa4ceb@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 , Peter Maydell 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::1035; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x1035.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 461e42d03491..d79415a3b159 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1219,7 +1219,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 @@ -1229,8 +1229,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 */