From patchwork Mon Nov 20 21:32:37 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: 745382 Delivered-To: patch@linaro.org Received: by 2002:a5d:5052:0:b0:32d:baff:b0ca with SMTP id h18csp1533134wrt; Mon, 20 Nov 2023 13:35:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IFn7X00f9kuN2aBAmyI0pXSThkJoxPvZtHaG7EeyX6yL4cAJYBZ5f/l9E3Wab5vs+asImtK X-Received: by 2002:a05:6358:7248:b0:16b:c487:7028 with SMTP id i8-20020a056358724800b0016bc4877028mr7920414rwa.29.1700516136007; Mon, 20 Nov 2023 13:35:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700516135; cv=none; d=google.com; s=arc-20160816; b=wVpVp8PWlYfxwU6FoxElK2dhXzvoBQYI+gI19y0nbQ9NHZnMPNjNawF0NQpsT2+eqO FnrJmZqaG8CfJOHHt7+Rs91FoYBjxUpT4Mgrzn0RFWQi1Nln78fFlUfsiRYu4jw+uVwW QwaKVl6WEiIruruqZZZC5IK/U8z/57FBbR+KTk1xCvWQjN3c59YXnMtnzTNDa99N+miT qJ0FUVGdRvOj0H7GQofwSrqPSOmB0EILKawR5vGlG0dbYbsxGILjcqORWkL//IfRwrgT ni9lR1fYaG2ImRkk+6ESDaLDOHNPcXzzomN28W9w106KMZa/1JS6DzUqh32Lp4uMcrNf rrYA== 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=LbDA9YGRe7qNIe50oT0Ny26RZPp0o8gVGjIEnbyILZM=; fh=toXMQ9nuJ3L4CLQ8EKaTQ8L/ltDlD3GauRZSJpgYVzU=; b=HUz6HpD8Lh2G+U/oB2z0vddEuAacowXD5lydBv8xt6NBfs+4Gc6ztCK70TWA0pwfSP fn4oey4WreCf2RmRqONIs9ZSuWt4arRa7s+VPm/ucKW405mXhmMtiV4+xTV2ZpVaBj3p Q1Febn4q48E4wcHjwbwEVdm6Ncg15zPwDftngNpyjedMM/PYJ6bdnmRmNfwuUJxmtJsP cA28/mJVfQNX+vjDnNroQggDgSC9mxnW029ITYOZwsBgZ/RMZ+aYSi8FGi7qnl67wu7V 6rpcPETm0wEiTqe9opQ1eXrQQi2/duHlywPrrp011UFAhzGX1iOwVtDdUSOoBE/YXyqT Q4NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cAxnqNxG; 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 f16-20020a05620a409000b00773b364bd64si7959346qko.391.2023.11.20.13.35.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Nov 2023 13:35:35 -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=cAxnqNxG; 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 1r5Btq-00018c-GU; Mon, 20 Nov 2023 16:33:46 -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 1r5Bto-00016F-S7 for qemu-devel@nongnu.org; Mon, 20 Nov 2023 16:33:44 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r5Btm-0003BQ-AZ for qemu-devel@nongnu.org; Mon, 20 Nov 2023 16:33:44 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4083f61312eso22408275e9.3 for ; Mon, 20 Nov 2023 13:33:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700516021; x=1701120821; 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=LbDA9YGRe7qNIe50oT0Ny26RZPp0o8gVGjIEnbyILZM=; b=cAxnqNxGWqekkN92GLQ8zKXsAL5t26rbEEO/cjQITi6I/0iv2iMR0CCdu6mTHnApur 7/bppD+qcmdr58agvZ27FQMBH8ot648OuHSjwlHSXnrDfgyFDDaDdTxP9kQtT5b3e9r6 c364UHE/lPI9C1jbs9TlF9HAkMQQHFrpozOd9mIn8kz/rphv90aUL0LYJzOnyrLshkBR xmdEP+INbq+jiHPFGZweskQOrCD4ivCfkIbvKIZ4t9UwXV2n2WqOynxRtCS8/I2GkJ0R Rsx28Sr6PGMUPPzzWeKLqBwmyHaOvCt24S5rHVqGCx7d91t3+sRA/fvja+BxsPyVkGG/ mIuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700516021; x=1701120821; 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=LbDA9YGRe7qNIe50oT0Ny26RZPp0o8gVGjIEnbyILZM=; b=ChlJx/sfcH2zFnTi6483RnlilYAXqdt61onBnuMOA2Sdz1LH8zvcDM35BVhVRONU+3 aedLFTc42VlYYnbbbl2AdwLe74VGurXvCQQwqX1+sgu17iQg91koHUBj6t+uO7FmtxG6 znSaF1o7diu4vvB3rJyKCa5fuMNIfKqNxLFU56OnZRPkTtN6zySLdnUIsgK8UtpOoAZn 3a49tIn1zJEG81045oadhey3c5fzsHjJpjM0k0u9qEdO6o3uQLyQMVxpkSnupqEPT9dM GArsU/Zw3N0Zic9DvYadKJsuxuTmmY+s/XHxHd2avc/M9xihy8r0bPmJAD4vNBLnBdsQ /RQw== X-Gm-Message-State: AOJu0YwhdyJRR5xZqPuQ6zMaDTxSeGVsgcrPoTAR8/WUU/vOZ5pCi7RO AweZA1/2lQnwnN+Ol6dhxODkqKuG1vdAog4VfMc= X-Received: by 2002:a05:600c:1994:b0:405:40ec:415d with SMTP id t20-20020a05600c199400b0040540ec415dmr6998432wmq.39.1700516020706; Mon, 20 Nov 2023 13:33:40 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.190]) by smtp.gmail.com with ESMTPSA id j32-20020a05600c1c2000b004094c5d929asm14891734wms.10.2023.11.20.13.33.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Nov 2023 13:33:40 -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 03/25] memory: Have memory_region_init_rom_nomigrate() handler return a boolean Date: Mon, 20 Nov 2023 22:32:37 +0100 Message-ID: <20231120213301.24349-4-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::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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: Gavin Shan --- include/exec/memory.h | 4 +++- system/memory.c | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 4140eb0c95..8e6fb55f59 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1498,8 +1498,10 @@ void memory_region_init_alias(MemoryRegion *mr, * must be unique within any device * @size: size of the region. * @errp: pointer to Error*, to store an error if it happens. + * + * Return: true on success, else false setting @errp with error. */ -void memory_region_init_rom_nomigrate(MemoryRegion *mr, +bool memory_region_init_rom_nomigrate(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, diff --git a/system/memory.c b/system/memory.c index 337b12a674..bfe0b62d59 100644 --- a/system/memory.c +++ b/system/memory.c @@ -1729,14 +1729,18 @@ void memory_region_init_alias(MemoryRegion *mr, mr->alias_offset = offset; } -void memory_region_init_rom_nomigrate(MemoryRegion *mr, +bool memory_region_init_rom_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); + bool rv; + + rv = memory_region_init_ram_flags_nomigrate(mr, owner, name, size, 0, errp); mr->readonly = true; + + return rv; } void memory_region_init_rom_device_nomigrate(MemoryRegion *mr,