Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2312172pxp; Mon, 21 Mar 2022 16:37:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTreQb98qNHWzSWy/ZUILKoaMsnAq+2fR8UK6mElUjYRJ1ggwb07GmJx+jM9dsB3vM5mJQ X-Received: by 2002:a17:90a:5d8d:b0:1c6:46ec:f2f4 with SMTP id t13-20020a17090a5d8d00b001c646ecf2f4mr1633768pji.234.1647905876493; Mon, 21 Mar 2022 16:37:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647905876; cv=none; d=google.com; s=arc-20160816; b=LDzLQz8GDSmVEDmAfHnWAG5M6wLgdIYtQj/Bhk10Tw+y/9ystdmXKL0dIkuy7HNa3B RqhslA4MCSSxXzI5pJgP/I9eKy77+hQ7h5rYJ5LhxYCizBFVXqbVOIRs00/4qMuJ+Zl+ opsJ9ohiywNfFxti07Yf3dQVeSQDgl9oKczbbT6QfRkqQ7PK0L2DkUcewoArjDoFwFpd vXMZrvVG/rgcAKZxIoHXM17orZKhETolPvqjJi6uQSDSKzUlv7fXT0UOJkmeX4bRCOPY lh6mO97/pLVitJJ4oNVnmAg7QxLZHCTD6+sFcIDAp49Ok0VL3P67M2FQCocAmu0QCWBI vdcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=ZLPE95jpMe8lV+T0TCTfToINWj+s4+K7bgD6GOm8guA=; b=W803Q6lZ4+pMiWmwsuU96E4OaqAqbBva0T5cQwM1XHbV9Pux1ag1a2Xs4YV0m2kK/K v5s3s0gWBwS48sWh+x7S6pERy9NjZWvbhAQBC6TkCLB0xWzFSXqeAAAQF87DYpxZY8r2 iMPfuQVOGwMyjoIUtJgPPY3QmLLRjcn4N7sfHfh6yPFpymUw2FiEBrMFr8vTZahMHl3a PYCwmRc61RUmUW22i9xJdvuMxA+RTKI35YQS8Ht4nokOvkAPLSKybcWtCb+nVPa4yLe7 dvJI+ZpvhsqXwXA7VOgrYNS+84zdHPWAjeduJe2wW+42Y9KwDeob4M27DAu0MuWmCItz R5vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=CajaE6dl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 10-20020a170902c10a00b00153b4bc544bsi11083011pli.312.2022.03.21.16.37.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 16:37:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=CajaE6dl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 85DA53A6BD4; Mon, 21 Mar 2022 15:48:08 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229816AbiCUWtK (ORCPT + 99 others); Mon, 21 Mar 2022 18:49:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229995AbiCUWsv (ORCPT ); Mon, 21 Mar 2022 18:48:51 -0400 Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 806653DE8C8 for ; Mon, 21 Mar 2022 15:44:22 -0700 (PDT) Received: by mail-pj1-x1049.google.com with SMTP id oj16-20020a17090b4d9000b001c7552b7546so330260pjb.8 for ; Mon, 21 Mar 2022 15:44:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=ZLPE95jpMe8lV+T0TCTfToINWj+s4+K7bgD6GOm8guA=; b=CajaE6dlLX8Yr8WIk2KWXbrjn53KC91j1SdU00qweOisaskCK3aHgMjE1CRdyXzLHZ C5fKlRw9g7ow1hrQ3B4/846IJpwUt4SSvFLkn+TgoJ+23GpNU3R09NAccrh38bLASLTs 3V/Hgcx9TMY4ZuMziFaD1v5ypRe4VVHA/yy+7aBDikhuEKgExP6hMjh2Ja7ua/TmVe4q f19e/dhTvg9tc52yHUU20EsiLLmcSRgflIDx9skeIvJzqRydezTEy6qRBWrA8hdPjXey Swr4Hc6pa0cHv9jXCLFWH6ffZaEIDHDGXPjLtLFofGzs05REbJTpHmLqPDrWZeJfrsNB Wpgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=ZLPE95jpMe8lV+T0TCTfToINWj+s4+K7bgD6GOm8guA=; b=6LGMg4m4Z8Hxt9bqePAfEKtNFXGPj/2SmxeDeOizr1D7U54zZlFDny2wgJ9314wDir 4x8YPGTGho4dwh4apJe4s4wzOc72oPUpi3IhnL8s8Ydy3q+FwT3n+zNoJPkhyE0SBYxR RUgOhXb2rQl2CQcPpqVSAwkVt/iJu82m+b3rWQHk7qZQ1sIH2Y5V3NdjdOnZCPwcJsc3 0YtJyRbSCmg1PQOMGD1OlIUsxAywbRB9JwrvPkcfuu+qWcQweiD+Rrt5G67ji1zo3Y5Z b0u+QSMn+PM0rMDAdHok0Q2CMFVxq476Ij0ApfSmoBOXwcYG1d0iT7il2YkXGL5UxjN4 I8GQ== X-Gm-Message-State: AOAM530Q2zyJhPDvyH/ld6rKaICwVCWBy9vBZSFW75t6rNCqX7JCYnH9 7dtVo+wkInj5VHxRcutCOGVHCgdRgR8/UPTKWZYWUDlkETsmlJmv/0LF+8YTwZzXdrkc3gB4okC eARQgjIIjR+xZYB7IVYW1PsGl1vewjuz8d/vca1MC0nU/rzEKXfOPtaNGypl7RnlIqMUAPzOQ X-Received: from bgardon.sea.corp.google.com ([2620:15c:100:202:b76a:f152:cb5e:5cd2]) (user=bgardon job=sendgmr) by 2002:a17:90b:4f92:b0:1bf:25e2:f6af with SMTP id qe18-20020a17090b4f9200b001bf25e2f6afmr1480613pjb.98.1647902661983; Mon, 21 Mar 2022 15:44:21 -0700 (PDT) Date: Mon, 21 Mar 2022 15:43:57 -0700 In-Reply-To: <20220321224358.1305530-1-bgardon@google.com> Message-Id: <20220321224358.1305530-9-bgardon@google.com> Mime-Version: 1.0 References: <20220321224358.1305530-1-bgardon@google.com> X-Mailer: git-send-email 2.35.1.894.gb6a874cedc-goog Subject: [PATCH v2 8/9] KVM: x86/mmu: Make kvm_is_mmio_pfn usable outside of spte.c From: Ben Gardon To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Paolo Bonzini , Peter Xu , Sean Christopherson , David Matlack , Jim Mattson , David Dunn , Jing Zhang , Junaid Shahid , Ben Gardon Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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 Export kvm_is_mmio_pfn from spte.c. It will be used in a subsequent commit for in-place lpage promotion when disabling dirty logging. Signed-off-by: Ben Gardon --- arch/x86/kvm/mmu/spte.c | 2 +- arch/x86/kvm/mmu/spte.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/mmu/spte.c b/arch/x86/kvm/mmu/spte.c index 45e9c0c3932e..8e9b827c4ed5 100644 --- a/arch/x86/kvm/mmu/spte.c +++ b/arch/x86/kvm/mmu/spte.c @@ -69,7 +69,7 @@ u64 make_mmio_spte(struct kvm_vcpu *vcpu, u64 gfn, unsigned int access) return spte; } -static bool kvm_is_mmio_pfn(kvm_pfn_t pfn) +bool kvm_is_mmio_pfn(kvm_pfn_t pfn) { if (pfn_valid(pfn)) return !is_zero_pfn(pfn) && PageReserved(pfn_to_page(pfn)) && diff --git a/arch/x86/kvm/mmu/spte.h b/arch/x86/kvm/mmu/spte.h index cee02fe63429..e058a85e6c66 100644 --- a/arch/x86/kvm/mmu/spte.h +++ b/arch/x86/kvm/mmu/spte.h @@ -443,4 +443,5 @@ u64 kvm_mmu_changed_pte_notifier_make_spte(u64 old_spte, kvm_pfn_t new_pfn); void kvm_mmu_reset_all_pte_masks(void); +bool kvm_is_mmio_pfn(kvm_pfn_t pfn); #endif -- 2.35.1.894.gb6a874cedc-goog