Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2455882rwd; Fri, 2 Jun 2023 09:36:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5zESisadoGRXjaEkahgtYStnTbbEQsirC+JChcLFmT06RDdd0M4OSABabTQnmtMDSn6kaU X-Received: by 2002:a17:90a:aa08:b0:24b:52cb:9a31 with SMTP id k8-20020a17090aaa0800b0024b52cb9a31mr314190pjq.22.1685723788643; Fri, 02 Jun 2023 09:36:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685723788; cv=none; d=google.com; s=arc-20160816; b=wuCE5ZZyBeVyQEt3bxy9a29hvZlDqSOC7uNdQWcMyj7Y0gCxw0eahe0TItWe81Bxk6 8IAVqtrewJV+QyiV3a6LPxycWM3Vgv/DJceeTaidW86nWGAOKv6RPyrZwZ0SWdRm7tf7 E2avL+cE6hgNq/l6qDzC+FXNKVVqZ2TFQPpjuQfQcepjeeMmaSWOuTBhMC1QdgkIHBZS vkztoBWUv49hxQgQUamZAseJDzjY1hBJZ6QlZUnpehUJYiJvnlZsBeE2hOJrKgWMpz+p owDxvebMop2bKxIugTo/OQ1UaTeyKOCoL+qS0U4AXpV1v+F9DaxaAl944ChQQOgY+4lK 93qg== 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 :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=WC8fJiwfrhgV3fWPVoTW4PIrVWHAfqFDSvODe0h7umM=; b=Vpw8WQIDr04JEI1f9QsJSh206+d7F9O3LrUa/u3ChjfAwAMTWmULWchQUBBET+16WL 2rtoyKzKsyZtVreMytC+P5xRWArmCpwMJ3qTrSuTpo3+CCiymKRKNBcoBJ2bU1nFzCPJ bIiBL++j+0guirGeFgdkl94JZGiyWAIbrkrt+NjVTLmQAZuTpejsUXHJdH9w6vBjW7jC nnm9IQwwT3tIYFBnBUxNGaQQx9aeJCblySuMqr6a8DT+8vqN3+RtnoAG1YwHFdNj/apG 7C+GiU1F8fPYUioPjd6JAdpGNTsS6OIiZb0WVKLLZMfeG/vE2TeapmxLR5ZMuTWA5M8u rN7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=d5Sfx7KG; 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 o25-20020a637e59000000b0053fb50702e9si1190099pgn.407.2023.06.02.09.36.16; Fri, 02 Jun 2023 09:36:28 -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=d5Sfx7KG; 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 S236847AbjFBQZp (ORCPT + 99 others); Fri, 2 Jun 2023 12:25:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236850AbjFBQZi (ORCPT ); Fri, 2 Jun 2023 12:25:38 -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 A02CBE44; Fri, 2 Jun 2023 09:25:24 -0700 (PDT) Received: from [192.168.10.48] (unknown [119.152.150.198]) (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: usama.anjum) by madras.collabora.co.uk (Postfix) with ESMTPSA id A69526603219; Fri, 2 Jun 2023 17:25:20 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1685723123; bh=C47gbnaLE3FpJnFXLSuBsIZ0ri3JV8UzEv6qEz546uE=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=d5Sfx7KGHO1wZ3AQtdiU3MWsx4Y1GYIBZWGc8oAf1N/Pfu5FOzaAvY9D3oWWG6bAa 4FYzQoNqEfGJOVifEUx3cX+kyYgcI1JfKlPPgO34CbwELpMjCAaM/7iopfwcRk/Pcs N5YVsmFHt1agKn2NLRz9TQAw8T9HWSEfiP4RoPWYQl0WTCmbREcocVvYCECa6+QFq7 DuQ9wv2/6vuA40K09aycN+oGyy+LLtZf8hqmebLoBNwLsNypZYNMD8VA0E/uvmfh/i 2jS1DUoKs5tfUYtvLnzqMuwnwgYvsr0jcIXfia8ft2iujVq/nikpW6GNBpoSFTXK92 fAj+ZTaTUKm7A== Message-ID: Date: Fri, 2 Jun 2023 21:25:15 +0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Cc: Muhammad Usama Anjum , Peter Xu , Shuah Khan , Nathan Chancellor , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, LKML , Andrew Morton Subject: Re: [PATCH 11/12] selftests/mm: fix missing UFFDIO_CONTINUE_MODE_WP and similar build failures Content-Language: en-US To: John Hubbard , David Hildenbrand References: <20230602013358.900637-1-jhubbard@nvidia.com> <20230602013358.900637-12-jhubbard@nvidia.com> From: Muhammad Usama Anjum In-Reply-To: <20230602013358.900637-12-jhubbard@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 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,URIBL_BLOCKED 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 On 6/2/23 6:33 AM, John Hubbard wrote: > UFFDIO_CONTINUE_MODE_WP, UFFD_FEATURE_WP_UNPOPULATED, USERFAULTFD_IOC, > and USERFAULTFD_IOC_NEW are needed lately, but they are not in my host > (Arch Linux) distro's userfaultfd.h yet. So put them in here. Selftests are never supposed to build with native header files. Build the headers in kernel source first. Then building the selftests picks up these newly built headers by itself. The method to build header files has changed to `make headers`. The following command builds the mm selftests successfully every time for me. make headers && make -C tools/testing/selftests/mm Please let me know if this doesn't work for you. I'll try to reproduce and fix. > > A better approach would be to include the uapi version of userfaultfd.h > from the kernel tree, but that currently fails with rather difficult > linker problems (__packed is defined multiple times, ugg), so defer that > to another day and just fix the build for now. > > Signed-off-by: John Hubbard > --- > tools/testing/selftests/mm/uffd-common.h | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/tools/testing/selftests/mm/uffd-common.h b/tools/testing/selftests/mm/uffd-common.h > index a1cdb78c0762..98847e41ecf9 100644 > --- a/tools/testing/selftests/mm/uffd-common.h > +++ b/tools/testing/selftests/mm/uffd-common.h > @@ -36,6 +36,23 @@ > > #define UFFD_FLAGS (O_CLOEXEC | O_NONBLOCK | UFFD_USER_MODE_ONLY) > > +#ifndef UFFDIO_CONTINUE_MODE_WP > +#define UFFDIO_CONTINUE_MODE_WP ((__u64)1<<1) > +#endif > + > +#ifndef UFFD_FEATURE_WP_UNPOPULATED > +#define UFFD_FEATURE_WP_UNPOPULATED (1<<13) > +#endif > + > +/* ioctls for /dev/userfaultfd */ > +#ifndef USERFAULTFD_IOC > +#define USERFAULTFD_IOC 0xAA > +#endif > + > +#ifndef USERFAULTFD_IOC_NEW > +#define USERFAULTFD_IOC_NEW _IO(USERFAULTFD_IOC, 0x00) > +#endif > + > #define _err(fmt, ...) \ > do { \ > int ret = errno; \ -- BR, Muhammad Usama Anjum