From patchwork Mon Nov 20 21:32:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 745386 Delivered-To: patch@linaro.org Received: by 2002:a5d:5052:0:b0:32d:baff:b0ca with SMTP id h18csp1533431wrt; Mon, 20 Nov 2023 13:36:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IH7DwFIxYk1oNMp4jJnTP94IQk8gQW6vO2p1pvUcbQwSKzE6+Tm0fYwK1nBxfLIFuBkuUmI X-Received: by 2002:a05:6830:1302:b0:6d7:daa5:3ec2 with SMTP id p2-20020a056830130200b006d7daa53ec2mr2964127otq.12.1700516178388; Mon, 20 Nov 2023 13:36:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700516178; cv=none; d=google.com; s=arc-20160816; b=wriFrKQ+zxhCqJyCm9gNR3dFW2drWSPohsYoS/elrDLOYOr/Ny6b49qcvhq7Draqy1 lnO5H2TL7LKAhxslSxiMcqreJp7jJSGYgzxgfDdkUNiugvjJK97mh9IcEqBb8KSxJJmD gOIAaqVoQdPGHuAud51sJ2+8UEwOTgkKzYW8bq7+IE0Gbp0yVVgjSR+IMZW78eE0SSmf XOV5diF7ddd6BIn3lsla+KO3kG4kxFzhm3DyX6mx/BX2LhNhxYDt8hQJMjcNumXUVqPl QFFzIzWdkdvP2o6NThRoXf6jUlfsn8N1797irSC9mnJC3V+Livq/2b7Thz6yWWbc+BL9 j4WA== 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=a3R2bk2+TIy0U91qpyefgUOXYaNCg17GUPUMA/PpOZ0=; fh=toXMQ9nuJ3L4CLQ8EKaTQ8L/ltDlD3GauRZSJpgYVzU=; b=E09nlwWyJaJvTkWhkP1MEcN3BA4Q8mjjRb0yfKzp0z4d+zyKihZcEzw4lotZa3Gm7v Pp7rrOPQ2UxAsT8pjw9ALo1Ro+JoN77Z5QMSccAro80gqvy1qDQjCXyud5kgV5OUtjwf vklpN/Pj0Xlf/B9m7hKtSBN5hwFR+gaTOf9tnapqK7RqYrt+ZGXnNHCEHk7nUy3h7n+x hEjNt3bpGrhVCUwPbruJIhg0sI3XQpb7jYXtO9LiSLfZD2ZxKd9tIoDAXiUyobfX3xUJ h51y5LiUNEWoSUT6DImpKrollYhT7Txx9unRQT9VxacLTVyK4KxGuqktStoKR2fj9shK 89Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wjdo8LXT; 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 pv17-20020ad45491000000b00679df339975si2019885qvb.426.2023.11.20.13.36.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Nov 2023 13:36:18 -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=Wjdo8LXT; 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 1r5Btf-0000vv-QO; Mon, 20 Nov 2023 16:33:35 -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 1r5Bte-0000ve-Da for qemu-devel@nongnu.org; Mon, 20 Nov 2023 16:33:34 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r5Btb-000396-Tb for qemu-devel@nongnu.org; Mon, 20 Nov 2023 16:33:34 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40b27b498c3so1308845e9.0 for ; Mon, 20 Nov 2023 13:33:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700516010; x=1701120810; 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=a3R2bk2+TIy0U91qpyefgUOXYaNCg17GUPUMA/PpOZ0=; b=Wjdo8LXTJVtWVNM7cf4DD3DmNfX1hWErdwZCCu9PccWQm3yMMHmUFkW+buausZipmQ Cks/JK2/bl1sAvsbfBdpn0RBD51tgagCvxHP4NbcAGiqXB1FZmz5iTuUI7vS+jVhRbFm jMUvhOK+/kzz1sS+POgnZWRZD4S5IP09pC1sFgzpI7u37K6IkIaDbbma1aF2RzXjjqH4 tUwGp72RGhA5apPitaoq4dRWJV/BsJiPKxTIf5pl8HUsobeFrU1w5ZmlxqsZr7g9EKLt l4UcFHIBTqO23kxZ2tNQmTcXrlYPV9BgSn1D3GT8BD2lDDOMmsuhe+tOQgv3/Sb++5pf C/oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700516010; x=1701120810; 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=a3R2bk2+TIy0U91qpyefgUOXYaNCg17GUPUMA/PpOZ0=; b=UCEs/dGkA9NYid079cXY0cG3dzJkUJsXBsnPhLYYt8ZFEOe3lyNyBH7dFcZB+tvq/h WaGrjgt6ZhyYw3s0NGU3EPS1FTVD/rIdMmG0Ga1X2xOZlyB83o51/65JrqZPrujgP6e7 wfe/qaavHILyzRAhp2HJdfNnY6Bgyq6rNw0NZz5Vf587DvFGBmR5fh5jeKzah9yVljlA +tGd45e3SkFGmpepmpiAzq0plo5wbHe36nzpbyFj+W2QgmRiZIuTxY9CVBboK0tM9kdz vE9uvGSrI5u3L/hrEFMLxu4KwiowJAZdOrRVIbp115x5A+uT7b4nsKagAn2w7cltWPP6 iqTw== X-Gm-Message-State: AOJu0YyQTpSyL7QRjWUGa/pGUMBEYu2sVEl4WW/2+uB3ObGwyAmlkChf di3xgytRwQYDg553QpLaFwE0aoMa9CnemToYkuk= X-Received: by 2002:a05:600c:1ca4:b0:405:359a:c965 with SMTP id k36-20020a05600c1ca400b00405359ac965mr6739626wms.4.1700516009941; Mon, 20 Nov 2023 13:33:29 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.190]) by smtp.gmail.com with ESMTPSA id n18-20020a05600c3b9200b00407efbc4361sm19623645wms.9.2023.11.20.13.33.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Nov 2023 13:33:29 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Hildenbrand , Peter Maydell , "Michael S. Tsirkin" , qemu-arm@nongnu.org, Mark Cave-Ayland , Markus Armbruster , Paolo Bonzini , Igor Mammedov , qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9?= =?utf-8?q?dric_Le_Goater?= , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Peter Xu Subject: [PATCH-for-9.0 02/25] memory: Have memory_region_init_ram_nomigrate() handler return a boolean Date: Mon, 20 Nov 2023 22:32:36 +0100 Message-ID: <20231120213301.24349-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231120213301.24349-1-philmd@linaro.org> References: <20231120213301.24349-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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=unavailable 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 Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have cpu_exec_realizefn() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Manos Pitsidianakis Reviewed-by: Gavin Shan --- include/exec/memory.h | 4 +++- system/memory.c | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index f038a7e5cf..4140eb0c95 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1288,8 +1288,10 @@ void memory_region_init_io(MemoryRegion *mr, * * Note that this function does not do anything to cause the data in the * RAM memory region to be migrated; that is the responsibility of the caller. + * + * Return: true on success, else false setting @errp with error. */ -void memory_region_init_ram_nomigrate(MemoryRegion *mr, +bool memory_region_init_ram_nomigrate(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, diff --git a/system/memory.c b/system/memory.c index 313dbb2544..337b12a674 100644 --- a/system/memory.c +++ b/system/memory.c @@ -1574,13 +1574,14 @@ void memory_region_init_io(MemoryRegion *mr, mr->terminates = true; } -void memory_region_init_ram_nomigrate(MemoryRegion *mr, +bool memory_region_init_ram_nomigrate(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, Error **errp) { - memory_region_init_ram_flags_nomigrate(mr, owner, name, size, 0, errp); + return memory_region_init_ram_flags_nomigrate(mr, owner, name, + size, 0, errp); } bool memory_region_init_ram_flags_nomigrate(MemoryRegion *mr,