From nobody Thu Nov 13 23:25:56 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=de.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1583484682; cv=none; d=zohomail.com; s=zohoarc; b=h12brch13F4BY7V68AxyDmLhE0do0MezoNxUT1T7x+g2NJMrUXtKXSlH4rPd+ymzaDUy2G9BSQ0d+oPRZWO+JP0dFud4sBP65BDtB1iRV3rDf6flXprj/skkL8u9aur41nQd8CTs0aDLxFCOxb3X53Fx5xxFHCBLql01/HI6WrE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583484682; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=hEYOkNF6GnH678GxL4TzcWy5tgkQWC5xQw0/jRZ91u4=; b=d0Igy5J0HATwjsDUB0fn8ee7IARyqCcS0tEG6pLwMRRRG9Lae71k4haOpP1TEyVGqPQUkQG6/aPh1gwZyzTE2TvMjz4RhCkdEQknkdy/4smUwU+p5+SDzuo2hPsVWVtAgG6o7grc4xJcVpfR0eWd4Q9ODdp7VxKOh0cJ0lhEqw8= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15834846820841011.4075733141199; Fri, 6 Mar 2020 00:51:22 -0800 (PST) Received: from localhost ([::1]:32962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jA8hU-0006wv-TS for importer@patchew.org; Fri, 06 Mar 2020 03:51:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34350) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jA8gW-00065A-Q1 for qemu-devel@nongnu.org; Fri, 06 Mar 2020 03:50:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jA8gV-0003La-LL for qemu-devel@nongnu.org; Fri, 06 Mar 2020 03:50:20 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:7722 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jA8gV-0003HC-Fi; Fri, 06 Mar 2020 03:50:19 -0500 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0268o9AT138928; Fri, 6 Mar 2020 03:50:18 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2yj6nmhm2a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 06 Mar 2020 03:50:18 -0500 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0268oHLI139629; Fri, 6 Mar 2020 03:50:18 -0500 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 2yj6nmhm0s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 06 Mar 2020 03:50:17 -0500 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 0268o7ZW009005; Fri, 6 Mar 2020 08:50:16 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma04dal.us.ibm.com with ESMTP id 2yffk7pkwa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 06 Mar 2020 08:50:16 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0268oG7i14942816 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 6 Mar 2020 08:50:16 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F1C2E112067; Fri, 6 Mar 2020 08:50:15 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DB54D112064; Fri, 6 Mar 2020 08:50:15 +0000 (GMT) Received: from localhost.localdomain (unknown [9.114.17.106]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 6 Mar 2020 08:50:15 +0000 (GMT) From: Christian Borntraeger To: qemu-devel Subject: [PATCH] mem-prealloc: initialize cond and mutex Date: Fri, 6 Mar 2020 03:50:14 -0500 Message-Id: <20200306085014.120669-1-borntraeger@de.ibm.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-03-06_02:2020-03-05, 2020-03-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxlogscore=910 suspectscore=0 impostorscore=0 priorityscore=1501 bulkscore=0 phishscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2003060063 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , qemu-s390x , Marc Hartmayer , bauerchen , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Guests with mem-prealloc do fail with qemu-system-s390x: /home/cborntra/REPOS/qemu/util/qemu-thread-posix.c:76: q= emu_mutex_lock_impl: Assertion `mutex->initialized' failed. qemu-system-s390x: /home/cborntra/REPOS/qemu/util/qemu-thread-posix.c:161: = qemu_cond_broadcast: Assertion `cond->initialized' failed. Let us initialize cond and mutex. Cc: bauerchen Cc: Paolo Bonzini Reported-by: Marc Hartmayer Fixes: 037fb5eb3941 ("mem-prealloc: optimize large guest startup") Signed-off-by: Christian Borntraeger --- util/oslib-posix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 897e8f3ba6..52650183d3 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -470,6 +470,8 @@ static bool touch_all_pages(char *area, size_t hpagesiz= e, size_t numpages, char *addr =3D area; int i =3D 0; =20 + qemu_cond_init(&page_cond); + qemu_mutex_init(&page_mutex); memset_thread_failed =3D false; threads_created_flag =3D false; memset_num_threads =3D get_memset_num_threads(smp_cpus); --=20 2.25.0