From patchwork Fri Jul 7 20:40:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 700041 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp4065312wrs; Fri, 7 Jul 2023 13:42:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlGY+AlitwdPRDY8rmN9uV7QdtclkxdvPXi5BXroOTwxskzz1W5kePf6gjAwTjDA7aTBO7x2 X-Received: by 2002:a05:6358:9184:b0:132:ce1f:6793 with SMTP id j4-20020a056358918400b00132ce1f6793mr7501298rwa.21.1688762532035; Fri, 07 Jul 2023 13:42:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688762532; cv=none; d=google.com; s=arc-20160816; b=whkQGTOuPFVigY+5cOFKqtNyhm4oXuY1jsHlFc09Jax3UZrS6n8Hvk4wh3NP+ZUtl1 6QcMey4biVGjGZIXo7wjkyFLwmIsdgMQnFGQ+4nYfWXuIz3KRwtG4XKd8Mnc7kM3dh26 IQ9bql06MEjhAvgmgO/lL63Tqd8dcS6vtCxJPy2dj8rskImsJmHOvwhgYNGbcKaZ1b80 BkOWb0TKTWmlAHP+Rg0sO9iw8otSQb+sQkUyIM2nEM/FVWuU2dIuCgRcyaJTBAwKQUYA wHjxThBvL2NPis8cAJjVfscMrharoUJuFYrRk2n2SJHf9KZOPUkmgVvV97vus06t2pac tlYA== 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=Xqq6acmDez25lx55OCz0HM5T/6u0RG73b+x1AtLg/sQ=; fh=1lFznT7T8SaB6qvJwL+l8YZVr291z45CfOlDlCUV7JU=; b=hqBLeaROI4waDEmPCD1JYyCGWhmhjWjaZr2F8fYgjdWS8LtnbgN5ncIBy4YWpBY7aq toPoIZfdTsXTStuEcafHYHZHSEFR531ISxv6s8n+TVHLReZVc396gxVH5hZPZ/WGgnCQ eY6vHx4vYZrus6Yr53O8+mYUcAbYorMEYt3Ri4zI99eVxkFmw1ifnI7GsgLPZXKqgU8a Rgb4HPx0fo6/XKgrGcmM3tS9p6CLDpi2KDKHcRG9v+ycI/9L0Jza0dcgsWiMxNkYawny 1LcT+9/Ju8vVIHX+vZoP7Fhg4n3cGilSfdGg6mEHJ9EXhZ3dJTMe+Xv22ZLqFLyG0Gnq 8DBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="UuH/qllR"; 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 p8-20020a0ccb88000000b006300b838254si3191424qvk.38.2023.07.07.13.42.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Jul 2023 13:42:12 -0700 (PDT) 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="UuH/qllR"; 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 1qHsGF-0004ig-FN; Fri, 07 Jul 2023 16:41:03 -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 1qHsGC-0004hs-RA for qemu-devel@nongnu.org; Fri, 07 Jul 2023 16:41:00 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qHsGB-0004ZM-1f for qemu-devel@nongnu.org; Fri, 07 Jul 2023 16:41:00 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3143b88faebso2555863f8f.3 for ; Fri, 07 Jul 2023 13:40:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688762457; x=1691354457; 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=Xqq6acmDez25lx55OCz0HM5T/6u0RG73b+x1AtLg/sQ=; b=UuH/qllR8Dd8ye4FXvsFtMOb9GOU+QIKw4+jmEs5gmtpkNBsX6Y93mhSJ3itwH7Hjj KH5VYeVKa/HPrbZnmRMW44fG2BR5gg83UvnpkqyhZO88mJPsBATb4/isRu+FxwiHtfCj nwoJjulL16xpbRkrXT0gZZZb31EBXGruKCUrH1ESiR+jxzxNHz8rm7t9+lBTc+7ls6nM Ih65hHCCD5brO+sCWQX6BQZFmJzkIOVf/DqppuIRh9r3zZy7AV0I0BOsmV/pj7/O70ho Rtq1sOACnfpuqwWFrut1oaTmqKkJzeRY3q1ZmuwY6fRzhwWLzAJp0Aw3+boLinkkKs/v ToGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688762457; x=1691354457; 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=Xqq6acmDez25lx55OCz0HM5T/6u0RG73b+x1AtLg/sQ=; b=GPoAWDbkITIWRsGcH10yZF7lEDwxR4+LpE2gkzq3GYu5+KgRP9LTgK0aKID5x1kDAT 4NUlxkDlkAtsPNj8fOts+PfSXr4vKgLVfRS7HfAmsju6Dw1gOr9VDGlaRZWtKtdjj6Zd +/qPJEbnpsclK07wFB13StSn2OnycAfJfH9DLDY7f6plLP2Rffee20b9gGCULdMOIMNn pZWImpeDH5NaPY4ll5SlLb0GRcLkha4kA18m6UMPc3ZxiyNqmtODApwlwhsr9OH3nX2c N2NIhcJ47SXpXuI3HZDqxgeu7pHkmi4aevibxatWxaqCfxlDGnp2/lEZlnGfdIc4PpSm FqGw== X-Gm-Message-State: ABy/qLa3GcsmK0VieIFlp9oOrFNbqo6EYbKpP6QKcG1+OIkDhOygJgiL OUb4qfr4OgkZlmVAlanCOCg1ukwmhfuQb7jctthW0w== X-Received: by 2002:a05:600c:2102:b0:3fa:9538:963e with SMTP id u2-20020a05600c210200b003fa9538963emr4995728wml.36.1688762457686; Fri, 07 Jul 2023 13:40:57 -0700 (PDT) Received: from localhost.localdomain (host-92-23-208-66.as13285.net. [92.23.208.66]) by smtp.gmail.com with ESMTPSA id q10-20020a1ce90a000000b003fbb25da65bsm3337736wmc.30.2023.07.07.13.40.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jul 2023 13:40:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: laurent@vivier.eu, mjt@tls.msk.ru, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PATCH v2 01/24] linux-user: Use assert in mmap_fork_start Date: Fri, 7 Jul 2023 21:40:30 +0100 Message-Id: <20230707204054.8792-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230707204054.8792-1-richard.henderson@linaro.org> References: <20230707204054.8792-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x433.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 Assert is preferred over if+abort for the error message. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/mmap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 2692936773..bae3dcdc27 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -49,8 +49,7 @@ bool have_mmap_lock(void) /* Grab lock to make sure things are in a consistent state after fork(). */ void mmap_fork_start(void) { - if (mmap_lock_count) - abort(); + assert(mmap_lock_count == 0); pthread_mutex_lock(&mmap_mutex); }