Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1965951rwd; Mon, 15 May 2023 05:43:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4NDPomN0MuSSlewES7xF8JYmUbvifWyXLTy2t8EBmwahqfaCnKMBME36n6PGbtvk/RaFnE X-Received: by 2002:a17:902:dad2:b0:1ac:859a:5b5a with SMTP id q18-20020a170902dad200b001ac859a5b5amr33651385plx.0.1684154580142; Mon, 15 May 2023 05:43:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684154580; cv=none; d=google.com; s=arc-20160816; b=gTxRFie4XS2UN8vA1pfZhU2GtFxuRGhSv0g54Fq6roDj0HXhqS2DsDLqcDlueQbLqL C+pWFox9wbFS0sviEEbABXF0Mwr1Q5MmAiU137T+LrHcUHCH+G3nO2poV5awEyOg4T0c edl62GY5DLvngZ6qGYIKqIXjp9NGvpdtIIjc17OUv8ZaEOsP3SiAix3YRZZ+R52HTjKE sG2q7ArR8G6ZUJQRqqRQOTNzs+j65my2JU3Bm/Mk+7O+F7fFNkWRH/OevdWtvc8iTn4f 3aofkBS1JhzZjOO06LaBxfDjUhB7Hymc9aZo24+Z9j3MdLUUyGujRkF77L/s2TfBN+RM F8Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=WMtD+3TPOVKROqZDKhc/Bx9BTg7/ClmWhrq19hAxZNY=; b=lUcScgZK8IQ0WAUZfZl+WjXl0eN2A+PAvA97hLHxTPOQxBvaBDdUPn8TZitHpJmdmS n61mhDDP89iWw6O6zaP5OwVhEQ5Noao0R3sQUv1QylrYIO/aAHeiujZULlDNPF9XvA7Z 6AdSIrjXtiUGVGgUkrq5zMkR1p+trscvgiUKJ9aKLHJkxls4sYCvxlx8K/ZNgvPsIkVU MHc9tjJlO6h9RdkziIuFB/THW22Z3IP6dBUChzIr27GsWUYKwAmK3Mfbk3AnElczacgb OrhkxU8IGPuVy3lZZ6eqP54HZ6GUmOVizoww+5tvkGdCrviYk7rQBGQR+T3wZCncECJ+ w4IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=hTHvzpVb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y20-20020a170902b49400b001a6a636eb6dsi15452234plr.215.2023.05.15.05.42.44; Mon, 15 May 2023 05:43:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=hTHvzpVb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241894AbjEOMcq (ORCPT + 99 others); Mon, 15 May 2023 08:32:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241845AbjEOMcb (ORCPT ); Mon, 15 May 2023 08:32:31 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E38CE44; Mon, 15 May 2023 05:32:27 -0700 (PDT) Received: from [IPV6:2a0c:5a83:9203:ad00:2382:dff5:d060:ac62] (unknown [IPv6:2a0c:5a83:9203:ad00:2382:dff5:d060:ac62]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: rcn) by madras.collabora.co.uk (Postfix) with ESMTPSA id 7E05166031DA; Mon, 15 May 2023 13:32:25 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1684153946; bh=8UJkKw6fGhISejBa/aG9A4bSXYVrTYUy3Vsdf1Iq5rs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=hTHvzpVbPOz1xFZalZetFz981HIplYGOgbxRyKqF4AiUwVeCYaEddJ8IdMQPXPmIW NEvuo39IlSlBPn/nnV4/UH/MBTHiuUIYLcETERWpVrFI7emgotYZsP5BxjJEoUdfLu +2aaLEAG9DK5nfSWPtRRbz45D52t8IoNlOv2m9SCQCnvHru279C4jtAG7ZA1Oua1jB 6+m1n+ZaOyWv+5VgS2vUhreR/M4n7dIE3whYwTwWxzm7phsxBFAm2nUAf51CQhVQd3 LOUveiWlJaK6kzyMKR6XLnt//0PKmcEfaLdttlXdVg7uKKJ57Iu+Y8nbIKMImuIY/K 9o0y6BrYey0Bw== Message-ID: Date: Mon, 15 May 2023 14:32:22 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: selftests: mincore: mincore_selftest fails only on qemu-armv7 To: Dan Carpenter , Naresh Kamboju Cc: open list , "open list:KERNEL SELFTEST FRAMEWORK" , lkft-triage@lists.linaro.org, Andrew Morton , Linus Torvalds , Arnd Bergmann , Ard Biesheuvel , Shuah Khan , Anders Roxell References: Content-Language: en-US From: =?UTF-8?Q?Ricardo_Ca=c3=b1uelo?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, On 15/5/23 13:51, Dan Carpenter wrote: > The test is wrong. It doesn't accept -EINVAL as a valid failure. > > tools/testing/selftests/mincore/mincore_selftest.c > 139 TEST(check_huge_pages) > 140 { > 141 unsigned char vec[1]; > 142 char *addr; > 143 int retval; > 144 int page_size; > 145 > 146 page_size = sysconf(_SC_PAGESIZE); > 147 > 148 errno = 0; > 149 addr = mmap(NULL, page_size, PROT_READ | PROT_WRITE, > 150 MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB, > 151 -1, 0); > 152 if (addr == MAP_FAILED) { > 153 if (errno == ENOMEM) > > On Armv7 is a 32bit machine so HUGETLB isn't enabled and the errno can > be -EINVAL. It's has returned this for 10 years. > > 154 SKIP(return, "No huge pages available."); > 155 else > 156 TH_LOG("mmap error: %s", strerror(errno)); > 157 } > 158 retval = mincore(addr, page_size, vec); > 159 ASSERT_EQ(0, retval); > > mm/mmap.c > 1405 } > 1406 } else if (flags & MAP_HUGETLB) { > 1407 struct hstate *hs; > 1408 > 1409 hs = hstate_sizelog((flags >> MAP_HUGE_SHIFT) & MAP_HUGE_MASK); > 1410 if (!hs) > 1411 return -EINVAL; > ^^^^^^^^^^^^^^^ > hstate_sizelog() return NULL when CONFIG_HUGETLB_PAGE is disabled. > > 1412 > 1413 len = ALIGN(len, huge_page_size(hs)); > > regards, > dan carpenter > Thanks for the tip, Dan. I'll send a patch for it asap. Cheers, Ricardo