From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from integral2.. (unknown [180.245.197.13]) by gnuweeb.org (Postfix) with ESMTPSA id 383367FC83; Wed, 29 Jun 2022 00:28:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1656462500; bh=9EOHqqHpHFrcRI3qCFB5ehouMVS1GD7Rg5Ue47izIqM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cNUES0/9C3ryep2qXQRP1ZZRfjfm6gdBKZDVy+KqY9KmuabqwQ8ACQq38+XCVGE8h tuKgKA/EoZ87LXKdhpuhG85rRUcy1lAJRMmeE3iTZiyHru2BGYTtCGNIwgLEkJie9U dCUdawaQEhWC8Zd/cn2PJQ1YgWexyjZPYXDloqxZISyLQaUz6Kz1vkvQSsdTXTN4Kr 1iLeC3CIxv3GhghvQdGkaiDQeKq8zdU/wECCcRFhLObrKBsiNKK3mrG7bho6wXsEUg Z5b1ChEr2CRkOpLGpgwGuhA5vflln13ALsaJ/neLm/GFzTCNgn+SFz02QITS0+gg4M v76/uvSvv2R7A== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Alviro Iskandar Setiawan , Fernanda Ma'rouf , Pavel Begunkov , Hao Xu , io-uring Mailing List , GNU/Weeb Mailing List Subject: [PATCH liburing v1 2/9] setup: Handle `get_page_size()` failure (for aarch64 nolibc support) Date: Wed, 29 Jun 2022 07:27:46 +0700 Message-Id: <20220629002028.1232579-3-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220629002028.1232579-1-ammar.faizi@intel.com> References: <20220629002028.1232579-1-ammar.faizi@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: From: Ammar Faizi This is a preparation patch to add aarch64 nolibc support. aarch64 supports three values of page size: 4K, 16K, and 64K which are selected at kernel compilation time. Therefore, we can't hard code the page size for this arch. We will utilize open(), read() and close() syscall to find the page size from /proc/self/auxv. Since syscall may fail, we may also fail to get the page size here. Handle the failure. Signed-off-by: Ammar Faizi --- src/setup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/setup.c b/src/setup.c index d2adc7f..ca9d30d 100644 --- a/src/setup.c +++ b/src/setup.c @@ -336,6 +336,9 @@ ssize_t io_uring_mlock_size_params(unsigned entries, struct io_uring_params *p) } page_size = get_page_size(); + if (page_size < 0) + return page_size; + return rings_size(p, entries, cq_entries, page_size); } -- Ammar Faizi