All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Wei Wang <wei.wang2@amd.com>
Cc: tim@xen.org, xiantao.zhang@intel.com,
	Santosh Jodh <santosh.jodh@citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] dump_p2m_table: For IOMMU
Date: Fri, 10 Aug 2012 13:52:33 +0100	[thread overview]
Message-ID: <50252031020000780009427B@nat28.tlf.novell.com> (raw)
In-Reply-To: <5024E788.80300@amd.com>

>>> On 10.08.12 at 12:50, Wei Wang <wei.wang2@amd.com> wrote:
> On 08/09/2012 09:26 AM, Jan Beulich wrote:
> 
>> Wei - here I'm particularly worried about the use of "level - 1"
>> instead of "next_level", which would similarly apply to the
>> original function. If the way this is currently done is okay, then
>> why is next_level being computed in the first place?
> 
> I think that recalculation is to guarantee that this recursive function 
> returns. It should run at most "paging_mode" times no matter what 
> "next_level" says. But if we could assume that next level field in every 
> pde is correct, then using next level is fine to me.

Especially in the dumping function we shouldn't assume too
much. However, wasn't it that one can skip levels in your
IOMMU implementation? That can't be handled correctly if
always subtracting 1.

>> (And similar
>> to the issue Santosh has already fixed here - the original
>> function pointlessly maps/unmaps the page when "level<= 1".
>> Furthermore, iommu_map.c has nice helper functions
>> iommu_next_level() and amd_iommu_is_pte_present() - why
>> aren't they in a header instead, so they could be used here,
>> avoiding the open coding of them?)
> 
> Maybe those helps appears after the original function. I could sent a 
> patch to clean up these:
> * do not map/unmap if level <= 1
> * move amd_iommu_is_pte_present() and iommu_next_level() to a header 
> file. and use them in deallocate_next_page_table.
> * Using next_level instead of recalculation (if requested)

Yes, please. As to using next_level - it depends, besides the above,
 on how bad it is if this is really wrong; an ASSERT() or BUG_ON()
might be on order here.

Jan

  reply	other threads:[~2012-08-10 12:52 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-08 17:17 [PATCH] dump_p2m_table: For IOMMU Santosh Jodh
2012-08-09  7:26 ` Jan Beulich
2012-08-10  1:41   ` Santosh Jodh
2012-08-10 10:50   ` Wei Wang
2012-08-10 12:52     ` Jan Beulich [this message]
2012-08-10 13:41       ` Wei Wang
2012-08-10 14:24         ` Jan Beulich
  -- strict thread matches above, loose matches on Subject: below --
2012-08-10 19:14 Santosh Jodh
2012-08-13  8:59 ` Jan Beulich
2012-08-14 19:34   ` Santosh Jodh
2012-08-13 10:31 ` Wei Wang
2012-08-10  1:43 Santosh Jodh
2012-08-10  7:49 ` Jan Beulich
2012-08-10 12:31 ` Wei Wang
2012-08-10 13:02   ` Jan Beulich
2012-08-10 15:02   ` Santosh Jodh
2012-08-08 15:56 Santosh Jodh
2012-08-08 16:21 ` Jan Beulich
2012-08-08 17:17   ` Santosh Jodh
2012-08-07 14:49 Santosh Jodh
2012-08-07 15:52 ` Jan Beulich
2012-08-07 16:16   ` Santosh Jodh
2012-08-08  7:31 ` Jan Beulich
2012-08-08 15:32   ` Santosh Jodh

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=50252031020000780009427B@nat28.tlf.novell.com \
    --to=jbeulich@suse.com \
    --cc=santosh.jodh@citrix.com \
    --cc=tim@xen.org \
    --cc=wei.wang2@amd.com \
    --cc=xen-devel@lists.xen.org \
    --cc=xiantao.zhang@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.