From: Wei Wang2 <wei.wang2@amd.com>
To: Keir Fraser <keir@xen.org>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH] amd iommu: Do not adjust paging mode for dom0 devices
Date: Mon, 7 Feb 2011 11:33:01 +0100 [thread overview]
Message-ID: <201102071133.01239.wei.wang2@amd.com> (raw)
In-Reply-To: <C9757584.2ACBA%keir@xen.org>
On Monday 07 February 2011 11:10:12 Keir Fraser wrote:
> On 07/02/2011 09:58, "Wei Wang2" <wei.wang2@amd.com> wrote:
> > On Sunday 06 February 2011 17:58:18 Keir Fraser wrote:
> >> On 01/02/2011 17:34, "Wei Wang2" <wei.wang2@amd.com> wrote:
> >
> > amd_iommu_domain_init() is called very early, where get_paging_mode()
> > cannot use domU->max_pages to setup proper io page level for domU.
> > Instead, paging mode of domU has to be initialized as 4 for safety. That
> > is why I want to adjust hd->paging_mode in reassign_device() using
> > domU->max_pages. Since most domU use 2-3 level page tables, always using
> > 4 level might be a waste.
> >
> > But I had a wrong assumption of dom0->max_pages, and consequently when
> > return passthru device back to dom0, following lines in c/s 22825
> >
> > + if ( target->max_pages > 0 )
> > + t->paging_mode = get_paging_mode(target->max_pages);
> >
> > will change hd->paging_mode of dom0 from 3 (in most case) to 4 (using
> > get_paging_mode(dom0->max_pages)).
>
> And that's wrong is it? How do you know that dom0 doesn't have a whole load
> of memory assigned to it?
>
> The correct thing to do would be to adjust the table depth according to the
> largest page number currently mapped in the table. Or just stick with four
> levels always if you can't do the optimisation job properly.
>
> -- Keir
Keir,
I was a little confused, are you suggesting that max_page does not represent
the last pfn of dom0? I was assuming max_pdx is the index number... Or are
you referring memory hot plug? If so, we might also need 4 level for dom0.
Thanks,
Wei
next prev parent reply other threads:[~2011-02-07 10:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-01 17:34 [PATCH] amd iommu: Do not adjust paging mode for dom0 devices Wei Wang2
2011-02-06 16:58 ` Keir Fraser
2011-02-07 9:58 ` Wei Wang2
2011-02-07 10:10 ` Keir Fraser
2011-02-07 10:33 ` Wei Wang2 [this message]
2011-02-07 10:47 ` Keir Fraser
2011-02-07 13:30 ` Wei Wang2
2011-02-07 15:00 ` Keir Fraser
2011-02-08 18:02 ` Wei Wang2
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=201102071133.01239.wei.wang2@amd.com \
--to=wei.wang2@amd.com \
--cc=keir@xen.org \
--cc=xen-devel@lists.xensource.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.