From: Avi Kivity <avi@qumranet.com>
To: Muli Ben-Yehuda <muli@il.ibm.com>
Cc: kvm-devel@lists.sourceforge.net, allen.m.kay@intel.com,
andrea@qumranet.com, Ben-Ami Yassour1 <BENAMI@il.ibm.com>
Subject: Re: [PATCH 1/1] Enble a guest to access a device's memory mapped I/O regions directly.
Date: Sun, 20 Apr 2008 13:29:39 +0300 [thread overview]
Message-ID: <480B1B13.3060608@qumranet.com> (raw)
In-Reply-To: <20080419143505.GS28181@il.ibm.com>
Muli Ben-Yehuda wrote:
>>>
>>>
>> Why avoid rmap on mmio pages? Sure it's unnecessary work, but
>> having less cases improves overall reliability.
>>
>
> The rmap functions already have a check to bail out if the pte is not
> an rmap pte, so in that sense, we aren't adding a new case for the
> code to handle, just adding direct MMIO ptes to the existing list of
> non-rmap ptes.
>
>
I'm worried about the huge chain of direct_mmio parameters passed to
functions, impact on the audit code (at the end of mmu.c, and the poor
souls who debug the mmu.
>> You can use pfn_valid() in gfn_to_pfn() and kvm_release_pfn_*() to
>> conditionally update the page refcounts.
>>
>
> Since rmap isn't useful for direct MMIO ptes, doesn't it make more
> sense to "bail out" early rather than in the bowls of the rmap code?
>
It does, from a purist point of view (which also favors explicit
parameters a la direct_mmio rather than indirect parameters like
pfn_valid()), but I'm looking from the practical point of view now.
With mmu notifiers, we don't need to hold the refcount at all. So
presuming we drop the refcounting code completely, are any changes
actually necessary here?
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
next prev parent reply other threads:[~2008-04-20 10:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-16 13:25 direct mmio for passthrough - kernel part benami
2008-04-16 13:25 ` [PATCH 1/1] Enble a guest to access a device's memory mapped I/O regions directly benami
2008-04-16 13:25 ` benami
2008-04-18 15:50 ` Avi Kivity
2008-04-19 14:35 ` Muli Ben-Yehuda
2008-04-20 10:29 ` Avi Kivity [this message]
2008-04-18 16:02 ` direct mmio for passthrough - kernel part Avi Kivity
-- strict thread matches above, loose matches on Subject: below --
2008-04-16 13:26 [PATCH 1/1] Enble a guest to access a device's memory mapped I/O regions directly benami
2008-04-16 13:26 ` benami
2008-04-18 15:56 ` Avi Kivity
2008-04-19 14:56 ` Muli Ben-Yehuda
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=480B1B13.3060608@qumranet.com \
--to=avi@qumranet.com \
--cc=BENAMI@il.ibm.com \
--cc=allen.m.kay@intel.com \
--cc=andrea@qumranet.com \
--cc=kvm-devel@lists.sourceforge.net \
--cc=muli@il.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