Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1669856pxb; Sat, 16 Oct 2021 16:33:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuEh1hM2GyPR7ws+qk7OYgoztsP3hatNIZlDSY7/B+Pt8uL1ZI/vimUvMcJOJQoZi2yHHI X-Received: by 2002:a17:90a:af93:: with SMTP id w19mr38436672pjq.10.1634427222623; Sat, 16 Oct 2021 16:33:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634427222; cv=none; d=google.com; s=arc-20160816; b=esgFMiq21ULjClB6fU7le3nEi5vhCZYqvB6O1u/OVHNJdq9qfQuEHDeyV+/M3rLl3T 0PuAHGl+QecPMnc8n/QVlMq78ACOUpzjAudU0g5pT584ozyu56TldxLYHfhuHD2uSaAt OFELSziRVQUHu9BX2Gqb/6D2cH3aC8QiqgokLb8rURQWj/jLt26Akpnz+anesaT3Zvll RAWqGWqo0XtoJfpr4DNIdG5fDsDFk6b0CIWcUMYKeJ+KDKAhBjTicuBK58vnbeXWEeGv TPNfn2InmyTdhmiC/1hEbpiSbFJHzqMiyDN9Ii3nb/VRqRzOTlv7My/CgkmmAytC468l lQ4g== 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 :organization:references:cc:to:from:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=rrC9q6JDbWDVZCJPKvI06rgViOu2XQgIlwKssWrd25I=; b=RUcYX6Gh2+wTITo9DluEVeJMsKLS+49p+LCX6ZDz48PfuCEx5zo96HcXcJFer5w8cP OG+JPf4/akwh1c0HiP4DMSWepVwWyy6v0M4gBDv7TJM+l63INmrjWrUhJxQuE3xuS9vs J6UM0vfmIRFj9fGVVmwPH+X1C96lfCTT3aobiC9z1sMNWS0DhhIkjZjbq3V0Afj7652a 51f9q6XBniu342c3oC9KWQugLloRtUbC8TPxVbPfOZC1czRU+ob5YWfZS5SswA26UP5I 0wP8Y4Cchdhxu/kJKUYTxyzx0bWrRp4HI+MTF+8dMQhzRuww6praJa13+FiWBoD+577T rdSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VarrhiNW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pi10si27870908pjb.133.2021.10.16.16.33.28; Sat, 16 Oct 2021 16:33:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VarrhiNW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241084AbhJOQIZ (ORCPT + 99 others); Fri, 15 Oct 2021 12:08:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:34383 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236447AbhJOQIY (ORCPT ); Fri, 15 Oct 2021 12:08:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634313977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rrC9q6JDbWDVZCJPKvI06rgViOu2XQgIlwKssWrd25I=; b=VarrhiNW/8rNCXoSFAX7QT3grPXNRN2f0tcY0VDijAVj4aVWWEXer3MMd23f0X8FPrscXB LunBUkaZc4P/NJD3SKpF+9DkaIl1wlCOR7Z7ZGPpwHlCGqpP7w6w+RIwxm1ZNUNBeVLqoA R1zHXTe2DvyKUc6v5xXmdjUm0E9Op6A= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-262-GKY_z4OhNKiW-XzcUg4R7g-1; Fri, 15 Oct 2021 12:06:16 -0400 X-MC-Unique: GKY_z4OhNKiW-XzcUg4R7g-1 Received: by mail-wm1-f72.google.com with SMTP id s25-20020a7bc399000000b0030da0f36afeso954923wmj.1 for ; Fri, 15 Oct 2021 09:06:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:from:to:cc:references:organization:in-reply-to :content-transfer-encoding; bh=rrC9q6JDbWDVZCJPKvI06rgViOu2XQgIlwKssWrd25I=; b=47GqNXk0GJt+4I1xCA5T/d+FbAfwJE7Md/YHZfIdVmu8M+cezvYfa8Nc7I/vZ3zz2L 8mVphOjeW/5jgy/gY9NcbKSR3iBHQrUbiWYkFHuASH7GS31hFZ7zWqLAh5QypDMHuZhZ 1h4sJFkKQfW2VMgKQvhTG41VR3+bq6Mg3HPD+gZxt9eDPHcC0YEiJYXww6plHI5r+TNp KzgrQEbDQGixrHa70as9OU0igOjVHH2ghD75niA+G28RzB2wvUL7je9afu+N8r3EsPwd ZU+4kbHiZTg9k0bsXGyFfB3r4ci/r0HuGzP0cu9IfMLYDB/ofI89TqZVe9eL7lO6oxUX l1NA== X-Gm-Message-State: AOAM532Ac8ITFI/uYuBfsYCPJhlL6zeXHzDoIJo7HpQ8e/YJSAEM5MuI Nb2I07Bb74dTXRjpmqBuH7B+Zjw894iGUdrLsoHKnX5eyECvQYidpR8bTAXwA5D4aRSnio7FDEa 2wqabeidPiguAU+QAi09G9ufl X-Received: by 2002:adf:bbc3:: with SMTP id z3mr15712011wrg.10.1634313975080; Fri, 15 Oct 2021 09:06:15 -0700 (PDT) X-Received: by 2002:adf:bbc3:: with SMTP id z3mr15711977wrg.10.1634313974878; Fri, 15 Oct 2021 09:06:14 -0700 (PDT) Received: from [192.168.3.132] (p5b0c6a01.dip0.t-ipconnect.de. [91.12.106.1]) by smtp.gmail.com with ESMTPSA id z2sm5273335wrn.89.2021.10.15.09.06.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Oct 2021 09:06:14 -0700 (PDT) Message-ID: <77f4c6a9-141d-e103-7339-0055cc00f752@redhat.com> Date: Fri, 15 Oct 2021 18:06:13 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: selftests/vm madv_populate.c test Content-Language: en-US From: David Hildenbrand To: Shuah Khan Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org References: <0a20f6b6-5985-8b3e-a577-7495dcf7d2b8@redhat.com> <3a06d58e-7301-6fbc-a305-d9f7c7220843@linuxfoundation.org> Organization: Red Hat In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15.10.21 17:47, David Hildenbrand wrote: > On 15.10.21 17:45, Shuah Khan wrote: >> On 9/18/21 1:41 AM, David Hildenbrand wrote: >>> On 18.09.21 00:45, Shuah Khan wrote: >>>> Hi David, >>>> >>>> I am running into the following warning when try to build this test: >>>> >>>> madv_populate.c:334:2: warning: #warning "missing MADV_POPULATE_READ or MADV_POPULATE_WRITE definition" [-Wcpp] >>>>     334 | #warning "missing MADV_POPULATE_READ or MADV_POPULATE_WRITE definition" >>>>         |  ^~~~~~~ >>>> >>>> >>>> I see that the following handling is in place. However there is no >>>> other information to explain why the check is necessary. >>>> >>>> #if defined(MADV_POPULATE_READ) && defined(MADV_POPULATE_WRITE) >>>> >>>> #else /* defined(MADV_POPULATE_READ) && defined(MADV_POPULATE_WRITE) */ >>>> >>>> #warning "missing MADV_POPULATE_READ or MADV_POPULATE_WRITE definition" >>>> >>>> I do see these defined in: >>>> >>>> include/uapi/asm-generic/mman-common.h:#define MADV_POPULATE_READ       22 >>>> include/uapi/asm-generic/mman-common.h:#define MADV_POPULATE_WRITE      23 >>>> >>>> Is this the case of missing include from madv_populate.c? >>> >>> Hi Shuan, >>> >>> note that we're including "#include ", which in my >>> understanding maps to the version installed on your system instead >>> of the one in our build environment.ing. >>> >>> So as soon as you have a proper kernel + the proper headers installed >>> and try to build, it would pick up MADV_POPULATE_READ and >>> MADV_POPULATE_WRITE from the updated headers. That makes sense: you >>> annot run any MADV_POPULATE_READ/MADV_POPULATE_WRITE tests on a kernel >>> that doesn't support it. >>> >>> See vm/userfaultfd.c where we do something similar. >>> >> >> Kselftest is for testing the kernel with kernel headers. That is the >> reason why there is the dependency on header install. >> >>> >>> As soon as we have a proper environment, it seems to work just fine: >>> >>> Linux vm-0 5.15.0-0.rc1.20210915git3ca706c189db.13.fc36.x86_64 #1 SMP Thu Sep 16 11:32:54 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux >>> [root@vm-0 linux]# cat /etc/redhat-release >>> Fedora release 36 (Rawhide) >> >> This is a distro release. We don't want to have dependency on headers >> from the distro to run selftests. Hope this makes sense. >> >> I still see this on my test system running Linux 5.15-rc5. > > Did you also install Linux headers? I assume no, correct? > What happens in your environment when compiling and running the memfd_secret test? If assume you'll see a "skip" when executing, because it might also refer to the local version of linux headers and although it builds, it really cannot build something "functional". It just doesn't add a "#warning" to make that obvious. -- Thanks, David / dhildenb