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=-16.1 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,SPF_HELO_NONE,SPF_PASS 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 0DBC0C433F5 for ; Sun, 5 Sep 2021 07:13:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E3ED060F9F for ; Sun, 5 Sep 2021 07:13:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235327AbhIEHOU (ORCPT ); Sun, 5 Sep 2021 03:14:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26491 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230313AbhIEHOH (ORCPT ); Sun, 5 Sep 2021 03:14:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630825983; 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=5NXjMtIKegV5Bnld7xmlh2BI3wqQcMyh0+qVZHk8Jl4=; b=fVh0N3WShcKfjvDyiXBdjJHAOD/zPL1ogyvhORVwC1poOXAzCmqGbuX3un7dLHC5mNVDJO 59uOK+Ljr6OMjaTk6lUqYrvVLI5kb4KEcL/mxtHGxhGoW7BbzOASrNEgFwF2CQ9tejykPm bIy1Xx/fIuZ0Nu76/VNh0uC7cwn+W28= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-217-erxbHYjoOxuNhJcYFlDhCA-1; Sun, 05 Sep 2021 03:13:00 -0400 X-MC-Unique: erxbHYjoOxuNhJcYFlDhCA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B6322180FD8C; Sun, 5 Sep 2021 07:12:59 +0000 (UTC) Received: from starship (unknown [10.35.206.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7955669CAD; Sun, 5 Sep 2021 07:12:58 +0000 (UTC) Message-ID: Subject: Re: [PATCH] KVM: Remove unnecessary export of kvm_{inc,dec}_notifier_count() From: Maxim Levitsky To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sun, 05 Sep 2021 10:12:57 +0300 In-Reply-To: <20210902175951.1387989-1-seanjc@google.com> References: <20210902175951.1387989-1-seanjc@google.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2021-09-02 at 10:59 -0700, Sean Christopherson wrote: > Don't export KVM's MMU notifier count helpers, under no circumstance > should any downstream module, including x86's vendor code, have a > legitimate reason to piggyback KVM's MMU notifier logic. E.g in the x86 > case, only KVM's MMU should be elevating the notifier count, and that > code is always built into the core kvm.ko module. > > Fixes: edb298c663fc ("KVM: x86/mmu: bump mmu notifier count in kvm_zap_gfn_range") > Cc: Maxim Levitsky > Signed-off-by: Sean Christopherson > --- > virt/kvm/kvm_main.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index 3e67c93ca403..140c7d311021 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -638,7 +638,6 @@ void kvm_inc_notifier_count(struct kvm *kvm, unsigned long start, > max(kvm->mmu_notifier_range_end, end); > } > } > -EXPORT_SYMBOL_GPL(kvm_inc_notifier_count); > > static int kvm_mmu_notifier_invalidate_range_start(struct mmu_notifier *mn, > const struct mmu_notifier_range *range) > @@ -690,8 +689,6 @@ void kvm_dec_notifier_count(struct kvm *kvm, unsigned long start, > */ > kvm->mmu_notifier_count--; > } > -EXPORT_SYMBOL_GPL(kvm_dec_notifier_count); > - > > static void kvm_mmu_notifier_invalidate_range_end(struct mmu_notifier *mn, > const struct mmu_notifier_range *range) Ah, I somehow thought when I wrote this that those two will be used by kvm_amd. Reviewed-by: Maxim Levitsky Best regards, Maxim Levitsky