kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Matlack <dmatlack@google.com>
To: Wanpeng Li <wanpeng.li@linux.intel.com>
Cc: Gleb Natapov <gleb@kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>,
	kvm@vger.kernel.org, x86@kernel.org,
	Eric Northup <digitaleric@google.com>
Subject: Re: [PATCH v2] kvm: x86: fix stale mmio cache bug
Date: Tue, 5 Aug 2014 11:56:41 -0700	[thread overview]
Message-ID: <CALzav=c6mo+SWbTocidKQCD7bN2xgx-04Pt0wbLran0CG0arUg@mail.gmail.com> (raw)
In-Reply-To: <20140805003113.GA14438@kernel>

On Mon, Aug 4, 2014 at 5:31 PM, Wanpeng Li <wanpeng.li@linux.intel.com> wrote:
> Hi David,
> On Mon, Aug 04, 2014 at 02:10:20PM -0700, David Matlack wrote:
>>The following events can lead to an incorrect KVM_EXIT_MMIO bubbling
>>up to userspace:
>>
>>(1) Guest accesses gpa X without a memory slot. The gfn is cached in
>>struct kvm_vcpu_arch (mmio_gfn). On Intel EPT-enabled hosts, KVM sets
>>the SPTE write-execute-noread so that future accesses cause
>>EPT_MISCONFIGs.
>>
>>(2) Host userspace creates a memory slot via KVM_SET_USER_MEMORY_REGION
>>covering the page just accessed.
>>
>
> One question:
>
> Who trigger host userspace creates a mmio memslot? It will be created
> just after first mmio #PF?

Devices such as vga can be in modes where their memory behaves
like ram and using a memslot to back the memory makes sense. In
other modes, reading and writing to vga memory has side-effects
and so mmio makes sense (delete memslot). Switching between these
modes is a guest initiated event.

  reply	other threads:[~2014-08-05 18:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-04 21:10 [PATCH v2] kvm: x86: fix stale mmio cache bug David Matlack
2014-08-05  0:31 ` Wanpeng Li
2014-08-05 18:56   ` David Matlack [this message]
2014-08-05  3:36 ` Xiao Guangrong
2014-08-05 22:39   ` David Matlack
2014-08-06  3:26     ` Xiao Guangrong
2014-08-07  4:20       ` David Matlack

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='CALzav=c6mo+SWbTocidKQCD7bN2xgx-04Pt0wbLran0CG0arUg@mail.gmail.com' \
    --to=dmatlack@google.com \
    --cc=digitaleric@google.com \
    --cc=gleb@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=wanpeng.li@linux.intel.com \
    --cc=x86@kernel.org \
    --cc=xiaoguangrong@linux.vnet.ibm.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).