Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp414185rwi; Mon, 10 Oct 2022 02:09:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM51J9jhzAcFg1PbdONnm4IZxjI3Pz6bJhq8NkJWlo1cm+XJoA1GA5BPjSV0VeSWdobegS5i X-Received: by 2002:a05:6402:350b:b0:459:72ef:cf6b with SMTP id b11-20020a056402350b00b0045972efcf6bmr17155720edd.19.1665392967754; Mon, 10 Oct 2022 02:09:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665392967; cv=none; d=google.com; s=arc-20160816; b=wYGqgDmXZtsIPxfWFzZDN3KrEAnQ0wwcAR9DNFXYJ5xmqo4Dcby3u4HT4VYiWDP1Ad vWKT7WswExtIfaz72L4cRoy6HEXDhhlFe2zgoGIzmZyIaJRWa4syeezl2KOjYuikh/4w vEsrO/mc3fqyOUnXC1017s31HoO/uWA5hOTz9ymufs8NDhb+kyOorx7PBWp/ZXurlwE0 Q0mAcBIIckSWT4AVkIVqRhOZkPYFTOPbmijF6LsHxa5EjHCSZ4wRVK1Svzu8Q7dRh77X 3IoExKQPR9qne27C1Q7kFJJL6WhgKjb+tyNuos3DPNx+OhFyRduJb96zFCRTMIQSki7B BpPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=8emri8Asj7tFaAxi8GZjkBCsueg7rhR3Q6m0FKrNej4=; b=C1tXuxyL6In49FNDLlSA9jn26hwfQFsZtNZqjy4VWH8OgX0l0faXWu9zAO6qeguu2r EMRbgJ8BJ4DonADUkVcHL6k4UpjAyAjZmZAkSnUNBxcL1Pi3lZ9piZ8WS5A1NZjhJb0g KtsRrzwhmuTnSZqqVryAvo8tq0UKfsc0N0VQ4sbM2Mn4akTVI+JCmiXjHSvvm2j0Oy1M MI2R6+uDntUgA84JnUD1N+xvA8do+Zofwu5VXqi/aK/dBFgRcH1nKzpDA7aaDEz8hKDR OXntWPMqr9uC+jRx3TG5K6Rw+e8jBIJ0W835WRPI8yy62ZCRFm8QYTe33rnnj0IxDdWQ QPfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NcHaVrVC; 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=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d24-20020aa7c1d8000000b0044e9f8ecd96si8113182edp.609.2022.10.10.02.08.46; Mon, 10 Oct 2022 02:09:27 -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=@intel.com header.s=Intel header.b=NcHaVrVC; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231337AbiJJIfv (ORCPT + 99 others); Mon, 10 Oct 2022 04:35:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230366AbiJJIft (ORCPT ); Mon, 10 Oct 2022 04:35:49 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34BC565808; Mon, 10 Oct 2022 01:35:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665390948; x=1696926948; h=date:from:to:cc:subject:message-id:reply-to:references: mime-version:in-reply-to; bh=RGybB6W0aj8JXJpoXUjKNcVo6czdIa5pC/Wiclkx0F8=; b=NcHaVrVCqmzfIMb7eG3okL8I+r+vT94TC7ksfWaPmCsfBdv3wG1rOBP1 zWl+yzjfx7ijk0Vbz7mHMZxthjsnooBTaRIJy0Cfd3EIsv8OolJnT+4Of PJtvZ7CiTqC+Elv5zgXojlmu6rICjO/PDw062a39UtG1IY4PUzlFDysHE grksZAvok95k1Q91/y7pFmPAVYyLV+c2OTn43OqZUxHF7TapXF83Nh5tH /PGsx2CCluVud+66jeK3HS9pdv6OHYyvYVFpDutthD1HX3+sPfnw8a82S ol8kLZIR6e7YEMc7idIYsPEg9+mQ+v+fm6zLxz6QwwA9RRRuaqt0aiNdL g==; X-IronPort-AV: E=McAfee;i="6500,9779,10495"; a="330638854" X-IronPort-AV: E=Sophos;i="5.95,173,1661842800"; d="scan'208";a="330638854" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2022 01:35:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10495"; a="656854721" X-IronPort-AV: E=Sophos;i="5.95,173,1661842800"; d="scan'208";a="656854721" Received: from chaop.bj.intel.com (HELO localhost) ([10.240.193.75]) by orsmga008.jf.intel.com with ESMTP; 10 Oct 2022 01:35:37 -0700 Date: Mon, 10 Oct 2022 16:31:04 +0800 From: Chao Peng To: Jarkko Sakkinen Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-doc@vger.kernel.org, qemu-devel@nongnu.org, Paolo Bonzini , Jonathan Corbet , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" , Hugh Dickins , Jeff Layton , "J . Bruce Fields" , Andrew Morton , Shuah Khan , Mike Rapoport , Steven Price , "Maciej S . Szmigiero" , Vlastimil Babka , Vishal Annapurve , Yu Zhang , "Kirill A . Shutemov" , luto@kernel.org, jun.nakajima@intel.com, dave.hansen@intel.com, ak@linux.intel.com, david@redhat.com, aarcange@redhat.com, ddutile@redhat.com, dhildenb@redhat.com, Quentin Perret , Michael Roth , mhocko@suse.com, Muchun Song , wei.w.wang@intel.com Subject: Re: [PATCH v8 8/8] KVM: Enable and expose KVM_MEM_PRIVATE Message-ID: <20221010083104.GA3145236@chaop.bj.intel.com> Reply-To: Chao Peng References: <20220915142913.2213336-1-chao.p.peng@linux.intel.com> <20220915142913.2213336-9-chao.p.peng@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 Tue, Oct 04, 2022 at 05:55:28PM +0300, Jarkko Sakkinen wrote: > On Thu, Sep 15, 2022 at 10:29:13PM +0800, Chao Peng wrote: > > Expose KVM_MEM_PRIVATE and memslot fields private_fd/offset to > > userspace. KVM will register/unregister private memslot to fd-based > > memory backing store and response to invalidation event from > > inaccessible_notifier to zap the existing memory mappings in the > > secondary page table. > > > > Whether KVM_MEM_PRIVATE is actually exposed to userspace is determined > > by architecture code which can turn on it by overriding the default > > kvm_arch_has_private_mem(). > > > > A 'kvm' reference is added in memslot structure since in > > inaccessible_notifier callback we can only obtain a memslot reference > > but 'kvm' is needed to do the zapping. > > > > Co-developed-by: Yu Zhang > > Signed-off-by: Yu Zhang > > Signed-off-by: Chao Peng > > ld: arch/x86/../../virt/kvm/kvm_main.o: in function `kvm_free_memslot': > kvm_main.c:(.text+0x1385): undefined reference to `inaccessible_unregister_notifier' > ld: arch/x86/../../virt/kvm/kvm_main.o: in function `kvm_set_memslot': > kvm_main.c:(.text+0x1b86): undefined reference to `inaccessible_register_notifier' > ld: kvm_main.c:(.text+0x1c85): undefined reference to `inaccessible_unregister_notifier' > ld: arch/x86/kvm/mmu/mmu.o: in function `kvm_faultin_pfn': > mmu.c:(.text+0x1e38): undefined reference to `inaccessible_get_pfn' > ld: arch/x86/kvm/mmu/mmu.o: in function `direct_page_fault': > mmu.c:(.text+0x67ca): undefined reference to `inaccessible_put_pfn' > make: *** [Makefile:1169: vmlinux] Error 1 > > I attached kernel config for reproduction. > > The problem is that CONFIG_MEMFD_CREATE does not get enabled: > > mm/Makefile:obj-$(CONFIG_MEMFD_CREATE) += memfd.o memfd_inaccessible.o Thanks for reporting. Yes there is a dependency issue needs to fix. Chao