public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joerg.roedel@amd.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Avi Kivity <avi@redhat.com>, Marcelo Tosatti <marcelo@kvack.org>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/8] kvm/mmu: make direct mapping paths aware of mapping levels
Date: Tue, 23 Jun 2009 19:10:22 +0200	[thread overview]
Message-ID: <20090623171022.GI5139@amd.com> (raw)
In-Reply-To: <20090623164728.GB3651@amt.cnet>

On Tue, Jun 23, 2009 at 01:47:28PM -0300, Marcelo Tosatti wrote:
> On Fri, Jun 19, 2009 at 03:16:26PM +0200, Joerg Roedel wrote:
> > @@ -254,7 +254,7 @@ static int is_last_spte(u64 pte, int level)
> >  {
> >  	if (level == PT_PAGE_TABLE_LEVEL)
> >  		return 1;
> > -	if (level == PT_DIRECTORY_LEVEL && is_large_pte(pte))
> > +	if (is_large_pte(pte))
> >  		return 1;
> 
> Wouldnt it be safer to check for bit 7 only on the levels
> we're sure it means large page?

If we are not on PT_PAGE_TABLE_LEVEL and this bit does not mean "large page"
then bit 7 is MBZ and harware would fault. So it should be safe to just check
for bit 7 here.


> >  	kvm_get_pfn(pfn);
> >  	mmu_set_spte(vcpu, spte, page->role.access, pte_access, 0, 0,
> > -		     gpte & PT_DIRTY_MASK, NULL, largepage,
> > +		     gpte & PT_DIRTY_MASK, NULL, level,
> >  		     gpte_to_gfn(gpte), pfn, true);
> 
> It would be better to just turn off updates to large sptes via          
> update_pte path, so just nuke them and let the pagefault path
> handle.

Yeah true. Thats in the shadow paging patch. Maybe I can get it into a state to
be postable again ;-)

Thanks,

	Joerg

-- 
           | Advanced Micro Devices GmbH
 Operating | Karl-Hammerschmidt-Str. 34, 85609 Dornach bei München
 System    | 
 Research  | Geschäftsführer: Thomas M. McCoy, Giuliano Meroni
 Center    | Sitz: Dornach, Gemeinde Aschheim, Landkreis München
           | Registergericht München, HRB Nr. 43632


  reply	other threads:[~2009-06-23 17:10 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-19 13:16 [PATCH 0/8 v3] KVM support for 1GB pages Joerg Roedel
2009-06-19 13:16 ` [PATCH 1/8] hugetlbfs: export vma_kernel_pagsize to modules Joerg Roedel
2009-06-19 13:16 ` [PATCH 2/8] kvm: change memslot data structures for multiple hugepage sizes Joerg Roedel
2009-06-23 16:49   ` Marcelo Tosatti
2009-06-19 13:16 ` [PATCH 3/8] kvm/mmu: rename is_largepage_backed to mapping_level Joerg Roedel
2009-06-23 15:59   ` Marcelo Tosatti
2009-06-23 17:00     ` Joerg Roedel
2009-06-19 13:16 ` [PATCH 4/8] kvm/mmu: make rmap code aware of mapping levels Joerg Roedel
2009-06-19 13:16 ` [PATCH 5/8] kvm/mmu: make direct mapping paths " Joerg Roedel
2009-06-23 16:47   ` Marcelo Tosatti
2009-06-23 17:10     ` Joerg Roedel [this message]
2009-06-19 13:16 ` [PATCH 6/8] kvm/mmu: add support for another level to page walker Joerg Roedel
2009-06-20 11:19   ` Avi Kivity
2009-06-22  9:38     ` Joerg Roedel
2009-06-19 13:16 ` [PATCH 7/8] kvm/mmu: enable gbpages by increasing nr of pagesizes Joerg Roedel
2009-06-19 13:16 ` [PATCH 8/8] kvm x86: report 1GB page support to userspace Joerg Roedel
2009-06-20 11:03 ` [PATCH 0/8 v3] KVM support for 1GB pages Avi Kivity
2009-06-22  9:40   ` Joerg Roedel
2009-06-22  9:43     ` Avi Kivity
2009-06-22  9:49       ` Joerg Roedel
2009-06-22  9:55         ` Avi Kivity
2009-06-24  8:43 ` Avi Kivity
2009-06-29 13:17   ` Joerg Roedel

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=20090623171022.GI5139@amd.com \
    --to=joerg.roedel@amd.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@kvack.org \
    --cc=mtosatti@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