Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4722851pxv; Tue, 6 Jul 2021 07:41:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKawOVFI2/Lza84f+P6hpzoZb8pm6jz+0cnU8YQoLN/YqQ2ZfMk4BCE2meDjIQ+9GKVHdX X-Received: by 2002:a17:907:608b:: with SMTP id ht11mr19118957ejc.351.1625582510883; Tue, 06 Jul 2021 07:41:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625582510; cv=none; d=google.com; s=arc-20160816; b=W5FhqlqYVKlWh/ZGLjhFOOHzG2glmwFEaubZjWrmc5Yy79PNr03guvu67XKB8ChKOH fp0GIb8eA1e7MxOH1K2XLoA+8v2cgkw+tFyCIUk/k+FvocI5ZtiH9n/dnpyDqLF3l/DK qAkqPDkF0qtLUhSUxK+DqMlA8nhTzoAlnZQf5ndCphMZ7UEgZ5Sx3PpXWpLvmSebGxEh dF/ailLNQpA52EuKj69dnV2OrhYJJwb/U5kZoLeI3+q6+HuBdMJ4BiucmFvOTsRCvhdK L30k2qwWGaHC8gdhTjqZO+/+ag4G66GqDyOPCE2rM1IQ5Z84u6Dp6lckej7x/TnRYxcs ABew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to:dkim-signature; bh=t1DoKVHI9FzjI4Qx1LUCOepoQK98RB9H5U9MBViyCTM=; b=LQXwNfm/QnwI+61cNO/hikIHKjR7W/vhzXmpz4b0IuxT6rUbXLnuZEWLr4fzOqe7Ru 8HnHX5OSAZJ5ZH++Lsz8QJ5PXQkIHATuAz6mNp2yx0yGY//+BTXvjA2XOi9s/UrfdvPn TYhzA5eEKrClozm7Qpwk73yTix8bQPO3B803a5I4goQp21DhmWKHdKIQhqLxPHqCclwi 7gkWd6h6eR6j4h9mWW4PlhnG/XtEjzbCh+PVJ4ooGhtKx8U/XWRDJ/S6BvnYhjON/CT5 1BZ8VBC4Is7MCzfMCFbSaeEvgsntmNR+dyQqgjWDY2AO/rTRIy7+tCVPNYazG1zBhL0c NeIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Z3qhg3SR; 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 i20si14932622edc.238.2021.07.06.07.41.27; Tue, 06 Jul 2021 07:41:50 -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=Z3qhg3SR; 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 S231755AbhGFOgo (ORCPT + 99 others); Tue, 6 Jul 2021 10:36:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:21516 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231614AbhGFOgn (ORCPT ); Tue, 6 Jul 2021 10:36:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625582044; 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=t1DoKVHI9FzjI4Qx1LUCOepoQK98RB9H5U9MBViyCTM=; b=Z3qhg3SR/sounjiVlk6NXB2P8siSxaj52Rw6R49WvmY81U/A220bNmcRECd8BZRcA90Rdh /ZLOGp4ZRTUPzuJ9qnExPKOptTgH5p53CXHjzYrw3WktoonUVIiZA8vBbUOqUwau/NkEZc KovnApKLgebOl5EKis1U6e2yHUWKRNU= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-586-x1sqpFFTN0GeFx_t9Lrp6g-1; Tue, 06 Jul 2021 10:32:57 -0400 X-MC-Unique: x1sqpFFTN0GeFx_t9Lrp6g-1 Received: by mail-wr1-f71.google.com with SMTP id h15-20020adffd4f0000b0290137e68ed637so483803wrs.22 for ; Tue, 06 Jul 2021 07:32:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=t1DoKVHI9FzjI4Qx1LUCOepoQK98RB9H5U9MBViyCTM=; b=aitZ3KmAAsVKApz9jyBwR4ywIXNQcY8hArX2Vu2rRis8ICpeNIkHL3mNu3QDFl+Sbv HBmGcsO+Y96/gRj/7v6dy07ipd2KIlmGF96xe9yIEJdno7erxWKsqueuSJjLtmMHRuk+ VxQhzfg+VXCVazQmabHN5cLunUha1vBUKZTIi9zBfsbFuoA9iRGYPvgdJbDLV47vvO6m bUmi5f1xWlL0wcXuowFtzO+zDODOMhPOzZOLsiQyFhmhI8phwgUWq/DVTiT7uz5bll5D AcHKR8ZcQXTs6Po4bW8wK07AqEDyeEqqRlwHw8Pqsq+I3Gmo0h1ETnERCp1tHjOVCYx/ VmMw== X-Gm-Message-State: AOAM533W37PuWrzkpzaIl9EHMcvOBMacV8GE7dbnRPfx8t9VpsxbHID3 pDvUDIt3hJuz4jF9eqc1F2gkqDoN7xPAd5LPPecRvj4g+VhykwnLylUiBi5QYsQAyvxQBYmSXL/ WQW1aX4TeqSgASBbnXPA7X6qg X-Received: by 2002:a7b:c248:: with SMTP id b8mr1141339wmj.115.1625581976561; Tue, 06 Jul 2021 07:32:56 -0700 (PDT) X-Received: by 2002:a7b:c248:: with SMTP id b8mr1141322wmj.115.1625581976372; Tue, 06 Jul 2021 07:32:56 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u2sm10592604wmc.42.2021.07.06.07.32.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 06 Jul 2021 07:32:55 -0700 (PDT) To: isaku.yamahata@intel.com, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , erdemaktas@google.com, Connor Kuehl , Sean Christopherson , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: isaku.yamahata@gmail.com, Sean Christopherson References: <1ef40d74af89c4e347e46412a5d07f6e7eebf839.1625186503.git.isaku.yamahata@intel.com> From: Paolo Bonzini Subject: Re: [RFC PATCH v2 40/69] KVM: Export kvm_is_reserved_pfn() for use by TDX Message-ID: <8bfa2859-1d6e-858a-85f9-2e61b4f74f32@redhat.com> Date: Tue, 6 Jul 2021 16:32:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <1ef40d74af89c4e347e46412a5d07f6e7eebf839.1625186503.git.isaku.yamahata@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/07/21 00:04, isaku.yamahata@intel.com wrote: > From: Sean Christopherson > > TDX will use kvm_is_reserved_pfn() to prevent installing a reserved PFN > int SEPT. Or rather, to prevent such an attempt, as reserved PFNs are > not covered by TDMRs. > > Signed-off-by: Sean Christopherson > Signed-off-by: Isaku Yamahata > --- > virt/kvm/kvm_main.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index 8b075b5e7303..dd6492b526c9 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -188,6 +188,7 @@ bool kvm_is_reserved_pfn(kvm_pfn_t pfn) > > return true; > } > +EXPORT_SYMBOL_GPL(kvm_is_reserved_pfn); > > bool kvm_is_transparent_hugepage(kvm_pfn_t pfn) > { > As before, there's no problem in squashing this in the patch that introduces the use of kvm_is_reserved_pfn. You could also move kvm_is_reserved_pfn and kvm_is_zone_device_pfn to a .h file. Paolo