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=-18.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 458B2C07E96 for ; Tue, 6 Jul 2021 14:34:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E47B61A2D for ; Tue, 6 Jul 2021 14:34:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231783AbhGFOgt (ORCPT ); Tue, 6 Jul 2021 10:36:49 -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-Google-Smtp-Source: ABdhPJy1ToTtXKHTosfl36uXa29rvALiXcYLSBcVGdpLtuve1nqhKP3e+Nn+/0k8Io8yuaN1JFjp3w== 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