From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D30FEC433FE for ; Sat, 12 Dec 2020 06:16:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 628F923333 for ; Sat, 12 Dec 2020 06:16:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 628F923333 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9802D6B0036; Sat, 12 Dec 2020 01:16:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 931756B005C; Sat, 12 Dec 2020 01:16:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 846406B005D; Sat, 12 Dec 2020 01:16:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0211.hostedemail.com [216.40.44.211]) by kanga.kvack.org (Postfix) with ESMTP id 6C7286B0036 for ; Sat, 12 Dec 2020 01:16:35 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 23403181AF5D3 for ; Sat, 12 Dec 2020 06:16:35 +0000 (UTC) X-FDA: 77583621150.10.smell29_530129e27407 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 03AEF169F9A for ; Sat, 12 Dec 2020 06:16:34 +0000 (UTC) X-HE-Tag: smell29_530129e27407 X-Filterd-Recvd-Size: 5015 Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Sat, 12 Dec 2020 06:16:34 +0000 (UTC) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Fri, 11 Dec 2020 22:16:29 -0800 Received: from [10.2.58.108] (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sat, 12 Dec 2020 06:16:23 +0000 Subject: Re: [PATCH v14 10/10] secretmem: test: add basic selftest for memfd_secret(2) To: Mike Rapoport , Andrew Morton CC: Alexander Viro , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Catalin Marinas , "Christopher Lameter" , Dan Williams , Dave Hansen , David Hildenbrand , "Elena Reshetova" , "H. Peter Anvin" , Ingo Molnar , James Bottomley , "Kirill A. Shutemov" , Matthew Wilcox , Mark Rutland , Mike Rapoport , Michael Kerrisk , Palmer Dabbelt , Paul Walmsley , "Peter Zijlstra" , Rick Edgecombe , Roman Gushchin , Shakeel Butt , Shuah Khan , Thomas Gleixner , Tycho Andersen , Will Deacon , , , , , , , , , , References: <20201203062949.5484-1-rppt@kernel.org> <20201203062949.5484-11-rppt@kernel.org> From: John Hubbard Message-ID: <248f928b-1383-48ea-8584-ec10146e60c9@nvidia.com> Date: Fri, 11 Dec 2020 22:16:23 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Thunderbird/84.0 MIME-Version: 1.0 In-Reply-To: <20201203062949.5484-11-rppt@kernel.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1607753789; bh=ofgMBZd16EADbvAo0gykil1HQ3WXinWEQXFsF7eWzJ0=; h=Subject:To:CC:References:From:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type:Content-Language: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy; b=nHiMzIuFi9yGg9dtEXBRDsgSZmIDOiTwrsl4IkhMy6fFmjAA+d/AS9GK73/GrEl8c L2wFofk2X8mSJW/vLEAbgA9QPMoBNfjJd8BWsCI0rrp+bj6/xYZKQSgViVMLkLSYK1 k66ZGlnQfrIIuas55l4diL4Iaoyoywisz15vCenxZUMAMyAtm2LyPLwxbz991YbWg8 nRt0uF/HuZ34WhsfN3HMzjfJx7L8KMpuqwwkCn0Y66dd5OlXb+xyLmZkRBWZVKoHt4 QQtiTloYRW+10TrH/r0jzw36mCIbK7syoQlFnk7px83Aq1dj4ALMG1TaKaeUNQMmQk OnZsyXYjTgO+g== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 12/2/20 10:29 PM, Mike Rapoport wrote: > From: Mike Rapoport ... > +#include "../kselftest.h" > + > +#define fail(fmt, ...) ksft_test_result_fail(fmt, ##__VA_ARGS__) > +#define pass(fmt, ...) ksft_test_result_pass(fmt, ##__VA_ARGS__) > +#define skip(fmt, ...) ksft_test_result_skip(fmt, ##__VA_ARGS__) > + > +#ifdef __NR_memfd_secret > + > +#include Hi Mike, Say, when I tried this out from today's linux-next, I had to delete the above line. In other words, the following was required in order to build: diff --git a/tools/testing/selftests/vm/memfd_secret.c b/tools/testing/selftests/vm/memfd_secret.c index 79578dfd13e6..c878c2b841fc 100644 --- a/tools/testing/selftests/vm/memfd_secret.c +++ b/tools/testing/selftests/vm/memfd_secret.c @@ -29,8 +29,6 @@ #ifdef __NR_memfd_secret -#include - #define PATTERN 0x55 static const int prot = PROT_READ | PROT_WRITE; ...and that makes sense to me, because: a) secretmem.h is not in the uapi, which this selftests/vm build system expects (it runs "make headers_install" for us, which is *not* going to pick up items in the kernel include dirs), and b) There is nothing in secretmem.h that this test uses, anyway! Just these: bool vma_is_secretmem(struct vm_area_struct *vma); bool page_is_secretmem(struct page *page); bool secretmem_active(void); ...or am I just Doing It Wrong? :) thanks, -- John Hubbard NVIDIA