kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sheng Yang <sheng@linux.intel.com>
To: kvm@vger.kernel.org
Cc: Avi Kivity <avi@redhat.com>
Subject: Re: [PATCH 0/6] MTRR/PAT support for EPT (v3)
Date: Fri, 10 Oct 2008 10:46:48 +0800	[thread overview]
Message-ID: <200810101046.48480.sheng@linux.intel.com> (raw)
In-Reply-To: <48EDD8F6.7060101@redhat.com>

On Thursday 09 October 2008 18:12:06 Avi Kivity wrote:
> Sheng Yang wrote:
> > On Thursday 09 October 2008 17:03:24 Avi Kivity wrote:
> >> Sheng Yang wrote:
> >>> Hi, Avi
> >>>
> >>> Here is the latest update of MTRR/PAT support.
> >>>
> >>> Change from v2:
> >>> Discard the using of MSR bitmap, add MSR_IA32_CR_PAT to save/restore,
> >>> as well as rebase on latest upstream.
> >>
> >> Applied all; my comments about shadow can be addressed later.
> >>
> >> There is also the danger of the guest setting the wrong MTRR type for
> >> RAM, thus introducing incompatible memory types (between qemu and the
> >> guest).  If this is a problem, we should ignore the guest's mtrr (and
> >> pat) for RAM and use write-back instead.
> >
> > Do you mean host(qemu) would access this memory and if we set it to guest
> > MTRR, host access would be broken? We would cover this in our shadow MTRR
> > patch, for we encountered this in video ram when doing some experiment
> > with VGA assignment.
>
> No, I think that the cpu requires that all accesses to a page be done
> using the same memory type.  We are allowing the guest to break that,
> since qemu mappings will use writeback and guest mapping will use guest
> specified memory types.

Yeah, I think the condition I mentioned is a example of yours. But in fact 
it's difficult to get a optimize value... I think it's possible that qemu may 
access all memory it owned, if so, no guest mtrr would affect. But how can we 
tell qemu would access which region of memory? We know it for vram, but any 
other cases? Seems it's indeed a big potential problem... If we want to do 
this, maybe we can hack something into host cache consistent check, though 
it's pretty dirty and got limit usage... 

--
regards
Yang, Sheng

  reply	other threads:[~2008-10-10  2:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-09  8:01 [PATCH 0/6] MTRR/PAT support for EPT (v3) Sheng Yang
2008-10-09  8:01 ` [PATCH 1/6] x86: Rename mtrr_state struct and macro names Sheng Yang
2008-10-09  8:01 ` [PATCH 2/6] x86: Export some definition of MTRR Sheng Yang
2008-10-09  8:01 ` [PATCH 3/6] KVM: Improve MTRR structure Sheng Yang
2008-10-09  8:01 ` [PATCH 4/6] KVM: VMX: Add PAT support for EPT Sheng Yang
2008-10-09  8:01 ` [PATCH 5/6] Add local get_mtrr_type() to support MTRR Sheng Yang
2008-10-09  8:01 ` [PATCH 6/6] Enable MTRR for EPT Sheng Yang
2008-10-09  8:44   ` Avi Kivity
2008-10-09  8:49     ` Sheng Yang
2008-10-09  9:03 ` [PATCH 0/6] MTRR/PAT support for EPT (v3) Avi Kivity
2008-10-09  9:26   ` Sheng Yang
2008-10-09 10:12     ` Avi Kivity
2008-10-10  2:46       ` Sheng Yang [this message]
2008-10-10  6:49         ` Avi Kivity
2008-10-10  7:16           ` Sheng Yang
2008-10-12  9:47             ` 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=200810101046.48480.sheng@linux.intel.com \
    --to=sheng@linux.intel.com \
    --cc=avi@redhat.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;
as well as URLs for NNTP newsgroup(s).