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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, USER_AGENT_SANE_1 autolearn=no 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 6C914C4727D for ; Sat, 26 Sep 2020 00:05:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1172621D91 for ; Sat, 26 Sep 2020 00:04:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OLqbmHSI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729549AbgIZAE6 (ORCPT ); Fri, 25 Sep 2020 20:04:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:23089 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729336AbgIZAE6 (ORCPT ); Fri, 25 Sep 2020 20:04:58 -0400 Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601078696; 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=g/jVyKCHdiUdwT2omZ/si8Q+ldjywRkoeikE7XbBhZc=; b=OLqbmHSI04JA4+EfbYL4y/xFlN6ycwYbpUP5twsgnZJoSMWwPBwelq13oLQKWiEUOXDUXx iuF0D97sGla5C8FOKJjTHvSwH3eRNmbsdwAuQ2dOVhIPdK2w1yLu0cR2VmIG7pbpnGM+ex gVUbaD+/MPQDu7ccThgracyRA/ymqx0= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-325-JxM3_kvdPzqc9vIePwwZBw-1; Fri, 25 Sep 2020 20:04:52 -0400 X-MC-Unique: JxM3_kvdPzqc9vIePwwZBw-1 Received: by mail-wr1-f70.google.com with SMTP id d13so1690429wrr.23 for ; Fri, 25 Sep 2020 17:04:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=g/jVyKCHdiUdwT2omZ/si8Q+ldjywRkoeikE7XbBhZc=; b=kFNDmYUgcjoQIlFWW3/WU7s+CK1Ou8phANXSdi8ODph3g8szOGVeAC+eX1dc+nK/Na 8GDFVgT6mSp0xl3q9EMujHTvDz836oypdU5bARJSgB2HFWbzUj0ei7fztG1lH8OyRm8T ddiVXMxFHFhh6gz72yIB8LIxy5FfON07tm1nLoWiuDhgLhqexXlPDmndLnzIT1DVPLJd /0yVMGJUwA3LbJ2fu3twGZFIuRdRkA89I/ETQBi+yf8Lb0LtgX767qQy0Dw1zGaY3u90 tlG3H1wvZ65mRcRfy/jQnfFGF2c8WuFB2VOFgyx7CNhxU1I7vPWhL9dMT4nfVp7atDPh LMfQ== X-Gm-Message-State: AOAM533JMT1T/Ppt+Ab/ReDC1HAsz42bM/gG3KE5ecNq4rAiNYoc590p P/ktseI1WqrWv3Ce7lidMtIrHgRdbaeshICDaU0NKGBrpszemwsCHhbJRfnC+h8exJ3vLAaZS4c tBSh/EaYhggTGRlVrvX2FExPD X-Received: by 2002:a7b:c76d:: with SMTP id x13mr92199wmk.10.1601078691401; Fri, 25 Sep 2020 17:04:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGBAvaCNQErNJYTzJQEmRHf/xK2hlpdhyCQ11FDFXNkdVOeTXhZO7tNGmZibFBSirqsyw3DA== X-Received: by 2002:a7b:c76d:: with SMTP id x13mr92180wmk.10.1601078691197; Fri, 25 Sep 2020 17:04:51 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:ec9b:111a:97e3:4baf? ([2001:b07:6468:f312:ec9b:111a:97e3:4baf]) by smtp.gmail.com with ESMTPSA id v4sm590254wml.46.2020.09.25.17.04.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Sep 2020 17:04:50 -0700 (PDT) Subject: Re: [PATCH 02/22] kvm: mmu: Introduce tdp_iter To: Ben Gardon , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Cannon Matthews , Peter Xu , Sean Christopherson , Peter Shier , Peter Feiner , Junaid Shahid , Jim Mattson , Yulei Zhang , Wanpeng Li , Vitaly Kuznetsov , Xiao Guangrong References: <20200925212302.3979661-1-bgardon@google.com> <20200925212302.3979661-3-bgardon@google.com> From: Paolo Bonzini Message-ID: <9ebecd06-950c-e7ee-c991-94e63ecec4a2@redhat.com> Date: Sat, 26 Sep 2020 02:04:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200925212302.3979661-3-bgardon@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/09/20 23:22, Ben Gardon wrote: > EXPORT_SYMBOL_GPL(kvm_mmu_set_mmio_spte_mask); > > -static bool is_mmio_spte(u64 spte) > +bool is_mmio_spte(u64 spte) > { > return (spte & SPTE_SPECIAL_MASK) == SPTE_MMIO_MASK; > } > @@ -623,7 +612,7 @@ static int is_nx(struct kvm_vcpu *vcpu) > return vcpu->arch.efer & EFER_NX; > } > > -static int is_shadow_present_pte(u64 pte) > +int is_shadow_present_pte(u64 pte) > { > return (pte != 0) && !is_mmio_spte(pte); > } > @@ -633,7 +622,7 @@ static int is_large_pte(u64 pte) > return pte & PT_PAGE_SIZE_MASK; > } > > -static int is_last_spte(u64 pte, int level) > +int is_last_spte(u64 pte, int level) > { > if (level == PG_LEVEL_4K) > return 1; > @@ -647,7 +636,7 @@ static bool is_executable_pte(u64 spte) > return (spte & (shadow_x_mask | shadow_nx_mask)) == shadow_x_mask; > } > > -static kvm_pfn_t spte_to_pfn(u64 pte) > +kvm_pfn_t spte_to_pfn(u64 pte) > { > return (pte & PT64_BASE_ADDR_MASK) >> PAGE_SHIFT; > } Should these be inlines in mmu_internal.h instead? Paolo