public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Shaokun Zhang <zhangshaokun@hisilicon.com>
Cc: x86@kernel.org, kvm@vger.kernel.org,
	Ben Gardon <bgardon@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH] KVM: x86/mmu: Remove the repeated declaration
Date: Tue, 25 May 2021 16:09:33 +0000	[thread overview]
Message-ID: <YK0hPadppDR1sPaD@google.com> (raw)
In-Reply-To: <1621910615-29985-1-git-send-email-zhangshaokun@hisilicon.com>

On Tue, May 25, 2021, Shaokun Zhang wrote:
> Function 'is_nx_huge_page_enabled' is declared twice, remove the
> repeated declaration.
> 
> Cc: Ben Gardon <bgardon@google.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
> ---
>  arch/x86/kvm/mmu/mmu_internal.h | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/arch/x86/kvm/mmu/mmu_internal.h b/arch/x86/kvm/mmu/mmu_internal.h
> index d64ccb417c60..54c6e6193ff2 100644
> --- a/arch/x86/kvm/mmu/mmu_internal.h
> +++ b/arch/x86/kvm/mmu/mmu_internal.h
> @@ -158,8 +158,6 @@ int kvm_mmu_hugepage_adjust(struct kvm_vcpu *vcpu, gfn_t gfn,
>  void disallowed_hugepage_adjust(u64 spte, gfn_t gfn, int cur_level,
>  				kvm_pfn_t *pfnp, int *goal_levelp);
>  
> -bool is_nx_huge_page_enabled(void);

Rather than simply delete the extra declaration, what about converting this to
static inline and opportunistically deleting the duplicate?  The implementation
is a single operation and this is MMU-internal, i.e. there's no need to export
and limited exposure of nx_huge_pages to other code.

> -
>  void *mmu_memory_cache_alloc(struct kvm_mmu_memory_cache *mc);
>  
>  void account_huge_nx_page(struct kvm *kvm, struct kvm_mmu_page *sp);
> -- 
> 2.7.4
> 

  reply	other threads:[~2021-05-25 16:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25  2:43 [PATCH] KVM: x86/mmu: Remove the repeated declaration Shaokun Zhang
2021-05-25 16:09 ` Sean Christopherson [this message]
2021-05-26  6:09   ` Shaokun Zhang
2021-05-26 14:45     ` Sean Christopherson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YK0hPadppDR1sPaD@google.com \
    --to=seanjc@google.com \
    --cc=bgardon@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=x86@kernel.org \
    --cc=zhangshaokun@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox