kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Joerg Roedel <joerg.roedel@amd.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/6] kvm/x86/mmu: include PT_PAGE_SIZE_MASK in PT64_PERM_MASK
Date: Sun, 08 Mar 2009 14:32:35 +0200	[thread overview]
Message-ID: <49B3BAE3.1070903@redhat.com> (raw)
In-Reply-To: <1236255153-4432-7-git-send-email-joerg.roedel@amd.com>

Joerg Roedel wrote:
> We also need to do a remote tlb flush if the PSE bit changes. The
> pte_pfn should also change if this bit changes but we can't rely on
> that. So check this bit too to be on the save side.
>
> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
> ---
>  arch/x86/kvm/mmu.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
> index 2a36f7f..055b181 100644
> --- a/arch/x86/kvm/mmu.c
> +++ b/arch/x86/kvm/mmu.c
> @@ -121,7 +121,7 @@ module_param(oos_shadow, bool, 0644);
>  	(PAGE_MASK & ~((1ULL << (PAGE_SHIFT + PT32_LEVEL_BITS)) - 1))
>  
>  #define PT64_PERM_MASK (PT_PRESENT_MASK | PT_WRITABLE_MASK | PT_USER_MASK \
> -			| PT64_NX_MASK)
> +			| PT64_NX_MASK | PT_PAGE_SIZE_MASK)
>  
>   

PT64_PERM_MASK is used in this way:

static bool need_remote_flush(u64 old, u64 new)
{
    if (!is_shadow_present_pte(old))
        return false;
    if (!is_shadow_present_pte(new))
        return true;
    if ((old ^ new) & PT64_BASE_ADDR_MASK)
        return true;
    old ^= PT64_NX_MASK;
    new ^= PT64_NX_MASK;
    return (old & ~new & PT64_PERM_MASK) != 0;
}

We don't check whether a bit changes, rather we check if a bit is turned 
off (or on in the case of nx).  But I think we need a tlb flush even if 
we change PSE from 0 to 1.

Thinking a bit more, this will never trigger, since an spte at a 
particular level cannot have its pse bit changed (at least in 
kvm_mmu_pte_write).

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2009-03-08 12:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-05 12:12 [PATCH 0/6] various x86 kvm fixes Joerg Roedel
2009-03-05 12:12 ` [PATCH 1/6] kvm/x86/svm: force new asid on vcpu migration Joerg Roedel
2009-03-05 17:53   ` Marcelo Tosatti
2009-07-26 15:23   ` Avi Kivity
2009-03-05 12:12 ` [PATCH 2/6] kvm/x86/mmu: remove call to kvm_mmu_pte_write from walk_addr Joerg Roedel
2009-03-05 12:12 ` [PATCH 3/6] kvm/x86/mmu: don't unnecessarily recalculate table_gfn in *fetch Joerg Roedel
2009-03-05 14:36   ` Joerg Roedel
2009-03-05 12:12 ` [PATCH 4/6] kvm/x86/mmu: handle invlpg on large pages Joerg Roedel
2009-03-05 21:11   ` Marcelo Tosatti
2009-03-06 13:06     ` Joerg Roedel
2009-03-05 12:12 ` [PATCH 5/6] kvm/x86: call kvm_lapic_sync_from_vapic with preemption disabled Joerg Roedel
2009-03-05 21:39   ` Marcelo Tosatti
2009-03-05 12:12 ` [PATCH 6/6] kvm/x86/mmu: include PT_PAGE_SIZE_MASK in PT64_PERM_MASK Joerg Roedel
2009-03-08 12:32   ` Avi Kivity [this message]
2009-03-05 21:50 ` [PATCH 0/6] various x86 kvm fixes Marcelo Tosatti
2009-03-06 13:04   ` 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=49B3BAE3.1070903@redhat.com \
    --to=avi@redhat.com \
    --cc=joerg.roedel@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).