public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: "Dong, Eddie" <eddie.dong@intel.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: RFC: Add reserved bits check
Date: Sun, 29 Mar 2009 13:23:23 +0300	[thread overview]
Message-ID: <49CF4C1B.3010404@redhat.com> (raw)
In-Reply-To: <9832F13BD22FB94A829F798DA4A8280501A21071B0@pdsmsx503.ccr.corp.intel.com>

Dong, Eddie wrote:
>  
> +static bool is_rsvd_bits_set(struct kvm_vcpu *vcpu, u64 gpte, int level)
> +{
> +	int ps = 0;
> +
> +	if (level == PT_DIRECTORY_LEVEL)
> +		ps = !!(gpte & PT_PAGE_SIZE_MASK);
>   

No need for this.  If you set rsvd_bits_mask[1][0] == 
rsvd_bits_mask[0][0], then you get the same behaviour.  The first index 
is not the page size, it's just bit 7.

You'll need to fill all the indexes for bit 7 == 1, but it's worth it, 
with the 1GB pages patch.

> +	return (gpte & vcpu->arch.mmu.rsvd_bits_mask[ps][level-1]) != 0;
> +}
> +
>  #define PTTYPE 64
>  #include "paging_tmpl.h"
>  #undef PTTYPE
>  
> +int cpuid_maxphyaddr(struct kvm_vcpu *vcpu)
> +{
> +	struct kvm_cpuid_entry2 *best;
> +
> +	best = kvm_find_cpuid_entry(vcpu, 0x80000008, 0);
> +	if (best)
> +		return best->eax & 0xff;
> +	return 32;
> +}
> +
>   

Best to return 36 if the cpu doesn't support cpuid 80000008 but does 
support pae.


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


  reply	other threads:[~2009-03-29 10:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <9832F13BD22FB94A829F798DA4A8280501A21068EF@pdsmsx503.ccr.corp.intel.com>
2009-03-27  4:19 ` RFC: Add reserved bits check Dong, Eddie
2009-03-27  9:34   ` Avi Kivity
2009-03-27 13:46     ` Dong, Eddie
2009-03-27 13:59       ` Dong, Eddie
2009-03-27 14:28       ` Avi Kivity
2009-03-27 14:42         ` Dong, Eddie
2009-03-29 10:23           ` Avi Kivity [this message]
2009-03-30  1:53             ` Dong, Eddie
2009-03-30  2:38               ` Cleanup to reuse is_long_mode() Dong, Eddie
2009-03-30  7:43                 ` Avi Kivity
2009-03-30  8:24                   ` Dong, Eddie
2009-03-30 11:46                     ` Avi Kivity
2009-03-30  2:49               ` Use rsvd_bits_mask in load_pdptrs for cleanup and considing EXB bit Dong, Eddie
2009-03-30  8:27                 ` Dong, Eddie
2009-03-30 12:13                   ` Avi Kivity
2009-03-30 13:46                     ` Dong, Eddie
2009-03-30  5:12               ` RFC: Add reserved bits check Avi Kivity
2009-03-30  8:21                 ` Dong, Eddie
2009-03-30 12:05                   ` Avi Kivity
2009-03-31  8:40                   ` Avi Kivity

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=49CF4C1B.3010404@redhat.com \
    --to=avi@redhat.com \
    --cc=eddie.dong@intel.com \
    --cc=kvm@vger.kernel.org \
    /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