From: Avi Kivity <avi@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>,
LKML <linux-kernel@vger.kernel.org>, KVM <kvm@vger.kernel.org>
Subject: Re: [PATCH] KVM: fix async page fault working for readonly mapping
Date: Tue, 22 May 2012 17:27:47 +0300 [thread overview]
Message-ID: <4FBBA263.6070600@redhat.com> (raw)
In-Reply-To: <20120522053110.GT10209@redhat.com>
On 05/22/2012 08:31 AM, Gleb Natapov wrote:
> On Mon, May 21, 2012 at 04:30:41PM -0300, Marcelo Tosatti wrote:
>> On Mon, May 21, 2012 at 04:15:50PM +0800, Xiao Guangrong wrote:
>> > On 05/21/2012 04:08 PM, Gleb Natapov wrote:
>> >
>> > > On Mon, May 21, 2012 at 02:45:45PM +0800, Xiao Guangrong wrote:
>> > >> If we map a readonly memory space from host to guest and the page is
>> > >> not currently mapped in the host, we will get a fault-pfn and async
>> > >> is not allowed, then the vm will crash
>> > >>
>> > > Why would we want to map a readonly memory space from host to guest?
>> > > We may want to do it to support memory semantics on read and mmio on
>> > > write, but do not right now unless something changed while I was not
>> > > looking.
>> >
>> >
>> > Some test cases in kvm-unit-tests and the benchmark i am writing for KVM
>> > need map the function on host to guest.
>>
>> Or ROM. Or read-only mappings of IVSHMEM (which don't exist yet).
> True. KVM should ignore writes to such areas, not kill a guest. Is this
> how the code works today?
>
Right now qemu maps ROM as RAM. There is no way to tell kvm that
something is ROM (or ROMD).
There are two options for that:
- mprotect() the ROM, and teach kvm about read-only areas (this patch);
but that doesn't work if we have a read-only and a writable alias of the
same area
- add a flag indicating that an area is ROM or ROMD
I prefer the latter, because of the alias issue.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-05-22 14:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-21 6:45 [PATCH] KVM: fix async page fault working for readonly mapping Xiao Guangrong
2012-05-21 8:08 ` Gleb Natapov
2012-05-21 8:15 ` Xiao Guangrong
2012-05-21 19:30 ` Marcelo Tosatti
2012-05-22 5:31 ` Gleb Natapov
2012-05-22 14:27 ` Avi Kivity [this message]
2012-05-23 3:09 ` Xiao Guangrong
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=4FBBA263.6070600@redhat.com \
--to=avi@redhat.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mtosatti@redhat.com \
--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