kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Cc: kvm@vger.kernel.org, pbonzini@redhat.com, jmattson@google.com
Subject: Re: [PATCH 1/5 v6] KVM: SVM: Define actual size of IOPM and MSRPM tables
Date: Fri, 2 Apr 2021 17:52:35 +0000	[thread overview]
Message-ID: <YGdZ454tDZToq2pk@google.com> (raw)
In-Reply-To: <20210402004331.91658-2-krish.sadhukhan@oracle.com>

On Thu, Apr 01, 2021, Krish Sadhukhan wrote:
> Define the actual size of the IOPM and MSRPM tables so that the actual size
> can be used when initializing them and when checking the consistency of the
> physical addresses. These #defines are placed in svm.h so that they can be
> shared.
>  static void svm_prepare_guest_switch(struct kvm_vcpu *vcpu)
> diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h
> index 39e071fdab0c..d0a4d7ce8445 100644
> --- a/arch/x86/kvm/svm/svm.h
> +++ b/arch/x86/kvm/svm/svm.h
> @@ -28,6 +28,9 @@ static const u32 host_save_user_msrs[] = {
>  };
>  #define NR_HOST_SAVE_USER_MSRS ARRAY_SIZE(host_save_user_msrs)
>  
> +#define IOPM_ALLOC_SIZE PAGE_SIZE * 3
> +#define MSRPM_ALLOC_SIZE PAGE_SIZE * 2

Drop the "ALLOC", this is the architectural size, not the size that's allocated.

It'd also be nice to align the values.  My personal preference would be to have
the number of pages come first, i.e. "3 pages" versus "4096 3-byte chunks", but
that's definitely getting deep into nitpick territory. :-)

#define IOPM_ALLOC_SIZE  3 * PAGE_SIZE
#define MSRPM_ALLOC_SIZE 2 * PAGE_SIZE
> +
>  #define MAX_DIRECT_ACCESS_MSRS	18
>  #define MSRPM_OFFSETS	16
>  extern u32 msrpm_offsets[MSRPM_OFFSETS] __read_mostly;
> -- 
> 2.27.0
> 

  reply	other threads:[~2021-04-02 17:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-02  0:43 [PATCH 0/5 v6] KVM: nSVM: Check addresses of MSR bitmap and IO bitmap tables on vmrun of nested guests Krish Sadhukhan
2021-04-02  0:43 ` [PATCH 1/5 v6] KVM: SVM: Define actual size of IOPM and MSRPM tables Krish Sadhukhan
2021-04-02 17:52   ` Sean Christopherson [this message]
2021-04-02  0:43 ` [PATCH 2/5 v6] nSVM: Check addresses of MSR and IO permission maps Krish Sadhukhan
2021-04-02 17:45   ` Sean Christopherson
2021-04-02  0:43 ` [PATCH 3/5 v6] KVM: nSVM: Cleanup in nested_svm_vmrun() Krish Sadhukhan
2021-04-02  0:43 ` [PATCH 4/5 v6] nSVM: Test addresses of MSR and IO permissions maps Krish Sadhukhan
2021-04-02  0:43 ` [PATCH 5/5 v6] SVM: Use ALIGN macro when aligning 'io_bitmap_area' Krish Sadhukhan
2021-04-02 17:38 ` [PATCH 0/5 v6] KVM: nSVM: Check addresses of MSR bitmap and IO bitmap tables on vmrun of nested guests Sean Christopherson
2021-04-02 17:39   ` Paolo Bonzini

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=YGdZ454tDZToq2pk@google.com \
    --to=seanjc@google.com \
    --cc=jmattson@google.com \
    --cc=krish.sadhukhan@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.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;
as well as URLs for NNTP newsgroup(s).