mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dongli Zhang <dongli.zhang@oracle.com>
To: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Cc: "pbonzini@redhat.com" <pbonzini@redhat.com>,
	"seanjc@google.com" <seanjc@google.com>,
	"hao.p.peng@linux.intel.com" <hao.p.peng@linux.intel.com>,
	"Yamahata, Isaku" <isaku.yamahata@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] KVM: x86/mmu: x86: Don't overflow lpage_info when checking attributes
Date: Wed, 13 Mar 2024 14:27:35 -0700	[thread overview]
Message-ID: <d91a8363-df75-78a1-467e-878a04859ace@oracle.com> (raw)
In-Reply-To: <60d6242e12030c744ff88322b84d0aa586e2d43d.camel@intel.com>



On 3/13/24 09:25, Edgecombe, Rick P wrote:
> On Wed, 2024-03-13 at 02:49 -0700, Dongli Zhang wrote:
>> The memslot id=10 has:
>> - base_gfn=1048576
>> - npages=1024
>>
>> Therefore, "level - 1  will not contain an entry for each GFN at page
>> size
>> level". If aligned, we expect lpage_info[0] to have 512 elements.
>>
>> 1GB: lpage_info[1] has 1 element
>> 2MB: lpage_info[0] has 2 elemtnts
> 
> 1048576 GFN is 2MB aligned, 1024 pages is also 2MB aligned. There are
> 512 4k pages in a 2MB huge page, so size of 2 for npages=1024 looks
> right to me. One struct for each potential 2MB huge page in the range.
> 
> I think overall you are saying in this response that you didn't find
> any problem in the analysis or fix. Is that correct?

I do not find any problem in the analysis or fix, except the same curiosity on
KVM_LPAGE_MIXED_FLAG.

Thank you very much!

Dongli Zhang

  reply	other threads:[~2024-03-13 21:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-12 17:33 Rick Edgecombe
2024-03-13  9:49 ` Dongli Zhang
2024-03-13 16:25   ` Edgecombe, Rick P
2024-03-13 21:27     ` Dongli Zhang [this message]
2024-03-13 19:55 ` Sean Christopherson
2024-03-13 20:17   ` Edgecombe, Rick P
2024-03-13 21:11     ` Sean Christopherson
2024-03-13 21:23       ` Edgecombe, Rick P

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=d91a8363-df75-78a1-467e-878a04859ace@oracle.com \
    --to=dongli.zhang@oracle.com \
    --cc=hao.p.peng@linux.intel.com \
    --cc=isaku.yamahata@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=seanjc@google.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

all inboxes | Powered by JetHome®