From patchwork Fri Jun 30 13:21:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 697927 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp449592wrs; Fri, 30 Jun 2023 06:22:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlEnqFtg5uYleZHGnU2lENHUwPrPU7Zc8k9BU8Q1ORQA880YbDOKi6PzB9Yu2WSwPhIsJF/X X-Received: by 2002:a1f:de82:0:b0:471:5110:49e8 with SMTP id v124-20020a1fde82000000b00471511049e8mr1726324vkg.4.1688131352844; Fri, 30 Jun 2023 06:22:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688131352; cv=none; d=google.com; s=arc-20160816; b=LBDfMuXUUmOQt+mk1YjFFnv60C68JcnieZcXWFE2uHxc8Ey7BvJNT+XmyBmzu0Ib8G jTdYEbe1t/+dwdNQWV5P7BMux1WXMnAU/5fsOUNqf5FvQRZvHm92JiJrZCdxCJQMqxzQ a4BqHJNNkzABeBTZNhGxKRIHA6VcjHUseUDWMGw40Cbv9f43h5jWpHDutmRdaW3rmW85 OcpmkMfHL53RuAWXZO06iI3DECJR+ZVnLL/QMJyViffrsz4X6DigIBRpPEZxn9k7jqOY FyhKi/xLboiZ/ZYXh3RBGC5qJ4Z7FURcalPzlvZeXPiuul9u813uT7CyjOjGEkvfWY6H Bnlw== 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=WCk4vvC6feJ5EFGebo8RId3A7LSTmPdZSonDHzt4Yf8=; fh=6bnXD+ip8BuPvzTWf97csbR5QVhpZvBV1AID0n9STS8=; b=VUFry7QGXp7KcHCXg4xBoYAZ6tUiVDLU/gXkTxlYpqRq1uH4uwUYFNzQR8t86if8hT JYxW+PfWksErUWZbz0ogY0QdxBO9w5yokXq7tiVk3ilIF0qJRYeqTEUzAE4eXTD6MNlz yV842g67C5LC8Wtcm2pXXkPC6n0KFru7fxVSa3O8UDyP4tE8zg8QI7RU24xaHoCtGlDO oeIVOzTpPpbJev/OeEVVLPuMgcYpY/Gv3460IQH1LJrSSAVjJBUudZppsXSyD56ttGGS lRcWPfWWsb/5UIrZUIAsOAqczdcmgKi1Flzu/IREaNJ9fNM2h7xdanECIK3zgp27L7Ww RrNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CVWFnHbs; 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 q1-20020a056214194100b006215ee4da59si7681597qvk.117.2023.06.30.06.22.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 06:22:32 -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=CVWFnHbs; 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 1qFE4f-0007aw-8t; Fri, 30 Jun 2023 09:22:09 -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 1qFE4c-0007aK-Ei for qemu-devel@nongnu.org; Fri, 30 Jun 2023 09:22:06 -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 1qFE4a-0003JP-De for qemu-devel@nongnu.org; Fri, 30 Jun 2023 09:22:05 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-311099fac92so2216391f8f.0 for ; Fri, 30 Jun 2023 06:22:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688131322; x=1690723322; 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=WCk4vvC6feJ5EFGebo8RId3A7LSTmPdZSonDHzt4Yf8=; b=CVWFnHbsVL7MM6NcZy0kv7Dp0gaqrqAy0Zwn2rtPPhI8Obq/LTFhYUazYMtxnrdO4a rep9vjz61rTt//5G0jwV/UMSICjzpPBLb8ac7i942N3xB5oMujq59w3MVJXC7O59Lrah MoJLm61z2/xnDlA1ggXmQFRI1eR6JxSjrdvl2KhCXLmC3ABX/+iqTzsK+sfdCk80RwZm 3EetIYjlpS3B1vNjVF9LYD49vDW1i1Eha4izsgmeC4xGd29lgQTlEcvWGU047KD0giQ4 FW7cBE/cRSTo40Oc+17KY8MdHY4PzpcUfxNIhrN3u9gGC8X7w5hpAUgHly+JyZKrMih5 MW/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688131322; x=1690723322; 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=WCk4vvC6feJ5EFGebo8RId3A7LSTmPdZSonDHzt4Yf8=; b=e7I4PYp1CfJT6GngHkXljaeke4OWoLu518RkxsaNK7q0UJ4x/f01RCDyw3TRgPLHxQ pj/cpSBsuL3WYT2zP4IlfKsTPAun2qv8IYj0/UQMETDFrSE5vUINaUKpEfsNKyk4h6f/ GsRBjaQjOkSnaJrIX2vjrdOnNKeIkjf00XUMjiK1sWJ6zkfxVmZjs9OQHjStGvVfMBBw pmb/d+vez735iyoEjVAOc5/qaR/aVqODCUh0Jwwf/2S9P6p3SpIU0NOOxJn9eVtRopbO 5QJlZoWxVVhI+s7CAHw0wwEY9k3JFc4xF+msihz2kPoRBVKCJIbDCgZr8bgHVX/xlv23 D1eA== X-Gm-Message-State: ABy/qLbzH4ROVmQOMow88wycZeW+sFsmL0UQls4AvI1M0/3rvThLssFy AskKvso3uXqX/d/57TX87XNF4RWFk3lrFZvZmphiAg== X-Received: by 2002:a5d:660b:0:b0:314:37a:4d2 with SMTP id n11-20020a5d660b000000b00314037a04d2mr2219281wru.60.1688131322094; Fri, 30 Jun 2023 06:22:02 -0700 (PDT) Received: from localhost.localdomain ([139.47.41.96]) by smtp.gmail.com with ESMTPSA id a16-20020adfdd10000000b00313ef2150dcsm14571092wrm.45.2023.06.30.06.22.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 06:22:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mjt@tls.msk.ru, laurent@vivier.eu Subject: [PATCH 01/24] linux-user: Use assert in mmap_fork_start Date: Fri, 30 Jun 2023 15:21:36 +0200 Message-Id: <20230630132159.376995-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230630132159.376995-1-richard.henderson@linaro.org> References: <20230630132159.376995-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. Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- 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 0aa8ae7356..83cbcce769 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); }