Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1881066pxu; Sun, 13 Dec 2020 06:25:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJxSlmjs40J+Dtc0tD/zG5jqSpadzDIC0+ixPS0dqkfLCaYX+xy4PJRK23MAH/+oR6vnY2oF X-Received: by 2002:a17:906:1294:: with SMTP id k20mr18557065ejb.404.1607869544893; Sun, 13 Dec 2020 06:25:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607869544; cv=none; d=google.com; s=arc-20160816; b=C4v3zQNXX/lXxudjOivT22/kAD4o/m7rbiX7O81zjsxav2xTKVGl5vZ4OJLvkh1gVg W6IvhXFnEbHoFsvWmAVcj3CWBZp6s8wuowMYw/FIb6ZXM5gIgsBMFlQZsWkFnM2N0CYn 0nJrMw801OSndwheN/+s0ol9pcwRYOmRQCJob+8zOzKAgrrj5JsAQDOUNQ2pXJXQWfVu 5RXZe778EZAPrT24ppWuhfsfSwH7P119iw4DJZBJYr06dXONsIA+l4W//7gpdaZXgmL/ 93O5/CWWK3MCdJKZ7zC0kJ60vdFO2h+92muSelczYesXSE1vybeTi6KHvfzvnKAkfib+ XYog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=ofgMBZd16EADbvAo0gykil1HQ3WXinWEQXFsF7eWzJ0=; b=ReHFCxfLAx+naL11HPUWQnnETJo8mbM+dbNvTGYD3u9JD8l5NMaBaH4fxIOweppbXq UfSeiUzJWmyhWGeK98wLx4hQorTI8zzItbcNHvCsLfTavU61XKlPQcg0hu8EoXRoG+jK mVOilaUgGfKdfisiBoRRWFmmiT5wwa3DZ9SN1r+F28OVl/b6mUmWaY1j8TC2SzmpQU9s /q5pJ9xhtSJNCvTRIgeWVcBCGP8FINWoTMZiCZDZpTSZi7nRFByv2o6GDikYBTdl1E+G zGRA9ay9qcN/yiewzjNgnaQ0zb9NG5e8hRag4StnCjSfRYq8XaVFewBH2gvb5tyan7gB Mukw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=nHiMzIuF; 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=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n11si7680786ejc.684.2020.12.13.06.25.20; Sun, 13 Dec 2020 06:25:44 -0800 (PST) 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=@nvidia.com header.s=n1 header.b=nHiMzIuF; 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438461AbgLLGRX (ORCPT + 99 others); Sat, 12 Dec 2020 01:17:23 -0500 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:2794 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436746AbgLLGRK (ORCPT ); Sat, 12 Dec 2020 01:17:10 -0500 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== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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