From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v2 1/3] x86/p2m-pt: simplify p2m_next_level()
Date: Thu, 27 Jul 2017 17:19:19 +0100 [thread overview]
Message-ID: <CAFLBxZb9PSkpqs9tsovZOYxyth-QgmhdOe7=9X9LnCOLLAM4RQ@mail.gmail.com> (raw)
In-Reply-To: <595CD6040200007800168AF2@prv-mh.provo.novell.com>
On Wed, Jul 5, 2017 at 11:05 AM, Jan Beulich <JBeulich@suse.com> wrote:
> Calculate entry PFN and flags just once. Convert the two successive
> main if()-s to and if/elf-if chain. Restrict variable scope where
> reasonable. Take the opportunity and also make the induction variable
> unsigned.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> v2: Re-do mostly from scratch following review feedback.
> Note: I have trouble seeing how the old code worked, when the 2M page
> shattering path specified neither read nor write permission for
> the IOMMU. Am I overlooking a reason why this was (and should
> remain) so?
Hmm -- given that in all other circumstances, a 4k page which is
ram_rw gets RW, then I think the old code must certainly be buggy.
But is your code correct? It looks like you unconditionally give it
RW, when for ram_ro, for example it should be R (not W). It seems
like we should either call p2m_get_iommu_flags(), or ASSERT() that the
resulting flags would be RW.
Everything else looks good, thanks.
-George
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-07-27 16:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-05 10:02 [PATCH v2 0/3] x86/p2m: some code simplification Jan Beulich
2017-07-05 10:05 ` [PATCH v2 1/3] x86/p2m-pt: simplify p2m_next_level() Jan Beulich
2017-07-27 16:19 ` George Dunlap [this message]
2017-08-11 11:53 ` Jan Beulich
2017-08-11 12:28 ` Jan Beulich
2017-07-05 10:05 ` [PATCH v2 2/3] x86/p2m: make p2m_alloc_ptp() return an MFN Jan Beulich
2017-07-05 10:06 ` [PATCH v2 3/3] x86/p2m-pt: pass level instead of page type to p2m_next_level() Jan Beulich
2017-07-27 16:50 ` George Dunlap
2017-08-11 13:07 ` Jan Beulich
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='CAFLBxZb9PSkpqs9tsovZOYxyth-QgmhdOe7=9X9LnCOLLAM4RQ@mail.gmail.com' \
--to=george.dunlap@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=xen-devel@lists.xenproject.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).