From patchwork Mon Nov 20 13:31:11 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: 745357 Delivered-To: patch@linaro.org Received: by 2002:a5d:5052:0:b0:32d:baff:b0ca with SMTP id h18csp1283759wrt; Mon, 20 Nov 2023 05:31:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IEhFlcTZ2zI4m0yGuj+Y+gKIdqrhja7Cu+KS7IDjfFVHfMstmoRo8vwiTlWGxqVLh44MmSk X-Received: by 2002:a05:6102:2044:b0:462:7e6e:c103 with SMTP id q4-20020a056102204400b004627e6ec103mr6329402vsr.5.1700487106384; Mon, 20 Nov 2023 05:31:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700487106; cv=none; d=google.com; s=arc-20160816; b=Uq0UMlckt3lNCgEcMb2/q/84ngFeJJrZTL1WDKRaWBFnQE/u147oWTMf2SKRLEdLJE ZgrA5ZV1sBo8Nh46wSLdAyShriFGsReMhpyn1zoieR8R01uTeGEKS8salEHmpcby9xe2 kKZ2ZuVAMH5tY0rp+BD9ibC94U6uRChVve5Uks2LolHzMS2J8me61IpNfAgytRYnfw4J zC7dG6Kj2m6PrhsP3iylREGZNAHvtEB2QFuzxYdVBJ/m7aDNTSz4a3848XRLMWpSJd7W Z3tFtjGVRv3IhR1fVolH3kgVn/ImoZurh99J0xzrXOcm1T+YsA996yoW40ylkaOCHSUO wVLw== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=mfC3l79DWpuZ90eQhFhTtFylDgZoM5JZUYr7UxSsrVs=; fh=kBz9k0YPGIyxq1Jp6C2mwwq8tgOBTL/WY4x0dpjfq5w=; b=jN7KlNBOhb+FT4qkO3buVruRtStqAn6IDezNEDrpcU1pT8jQ0VkNDjylJ8fRB47fI7 RI/coITR9HjxPRKR4P+BzNqHwxUgd1cKdJx1VEgRkQ8J866BGFpDIwC1mxfRTd4fGZ2U H8qBNUEtXrY7MnhOoMGNF5Gyb+nrVkrOklqjcg5R3BTROj3X1gUWVffmo7yWq7cYJIsM t17GpSyMAO0sES3oHIa1O5+BqZ9z/dpbDxb13bhGpsk3Qtgrs4pf7oGyAZwMADLWNaNO OjYj/TqSRUtO94koOHYPbAEqoBA5+2okJmaY/52MwSCweP+YKaBNhUc9rCcGPkux6HgW hO8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sO6zfui6; 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 h20-20020a056102215400b00452723da6absi1246084vsg.817.2023.11.20.05.31.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Nov 2023 05:31:46 -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=sO6zfui6; 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 1r54NC-0002M2-Pl; Mon, 20 Nov 2023 08:31:36 -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 1r54Mz-0002Au-AO for qemu-devel@nongnu.org; Mon, 20 Nov 2023 08:31:27 -0500 Received: from mail-ej1-x635.google.com ([2a00:1450: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 1r54Mx-0002Dl-Kq for qemu-devel@nongnu.org; Mon, 20 Nov 2023 08:31:21 -0500 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a00191363c1so63737566b.0 for ; Mon, 20 Nov 2023 05:31:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700487076; x=1701091876; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=mfC3l79DWpuZ90eQhFhTtFylDgZoM5JZUYr7UxSsrVs=; b=sO6zfui6dwJ6djVRAPJuB7SGOK1vmYUmSa+RF7HXmWbuqvoQAH70CALaMYqkzcuMMK loxV4malG4EIJg/AMn81g5ddChJnnp8GH0Zt5VHmppxHsnUmovRiwtliJZ0g5t/v4zn0 E2ocRqIJlFoyz0q+FsTNRV8xAUAq3UtswXgsXMjJil4TtejC1fYAjd5VekwnpFcLS+rB wpiWYDB3iCU/55JePRpr0ir0OS/ghFxUFn+IdJfNXLce7X6trRd+xRtxaJX0OF2Tc1lg ltJ/FxuBJnFViMzr4NJLVVIR936+XEU6br4217Q38+zn8NwUSAJFpl2omUm91nXbein1 e7vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700487076; x=1701091876; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mfC3l79DWpuZ90eQhFhTtFylDgZoM5JZUYr7UxSsrVs=; b=HqXJxjLIpgVn0LlRLVU9CSgDBprtKKE94D/ylTCc/mUjgLyB+mymb+2Zw8oIBmlchm 2s8xUM+zw7CecYFoA1THOc+Rr+cfWflfRwCh/CtKuq3NYcaLaEGXFchASmKngtCtfFN6 db8W8Z2felzwgUZIxHwjNwUCNQKAvO8hLytcwXF0XQk9Pk2Q6lqQw6uxCV/XkyTL69iM hk/DYckTHvsOTAOq2jaxWeFrYbmNry0++Vo3GZjrFNDjZ8bu/aGKo5UjaApT2SsrTzBT vucrev0uLwGrrZZ9wNQ5aR0OlE15WA3TwNh+9NNLbTT/9RF5qSEIjLT/iKrujiSFB61U OhRQ== X-Gm-Message-State: AOJu0YyEdACzcRATcyN2O827r51mvRpcjFQHUdc4nE0xtHwkA6++qRUc 92hD7dP2ddzf1Nt6861sRE4i9MtCZDFhdRBPhEc= X-Received: by 2002:a17:906:3986:b0:9d5:ecf9:e6b5 with SMTP id h6-20020a170906398600b009d5ecf9e6b5mr5056721eje.59.1700487075801; Mon, 20 Nov 2023 05:31:15 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.190]) by smtp.gmail.com with ESMTPSA id sd22-20020a170906ce3600b009fbf15cee7fsm2087892ejb.69.2023.11.20.05.31.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Nov 2023 05:31:15 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , Peter Xu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Hildenbrand Subject: [PATCH] system: Use &error_abort in memory_region_init_ram_[device_]ptr() Date: Mon, 20 Nov 2023 14:31:11 +0100 Message-ID: <20231120133112.82447-1-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=philmd@linaro.org; helo=mail-ej1-x635.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 If an unexpected error condition happens, we have to abort (&fatal_error is meant for expected errors). Suggested-by: Paolo Bonzini Suggested-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Hildenbrand Reviewed-by: Markus Armbruster --- system/memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/memory.c b/system/memory.c index 304fa843ea..4d9cb0a7ff 100644 --- a/system/memory.c +++ b/system/memory.c @@ -1692,7 +1692,7 @@ void memory_region_init_ram_ptr(MemoryRegion *mr, /* qemu_ram_alloc_from_ptr cannot fail with ptr != NULL. */ assert(ptr != NULL); - mr->ram_block = qemu_ram_alloc_from_ptr(size, ptr, mr, &error_fatal); + mr->ram_block = qemu_ram_alloc_from_ptr(size, ptr, mr, &error_abort); } void memory_region_init_ram_device_ptr(MemoryRegion *mr, @@ -1711,7 +1711,7 @@ void memory_region_init_ram_device_ptr(MemoryRegion *mr, /* qemu_ram_alloc_from_ptr cannot fail with ptr != NULL. */ assert(ptr != NULL); - mr->ram_block = qemu_ram_alloc_from_ptr(size, ptr, mr, &error_fatal); + mr->ram_block = qemu_ram_alloc_from_ptr(size, ptr, mr, &error_abort); } void memory_region_init_alias(MemoryRegion *mr,