From: Ian Campbell <Ian.Campbell@citrix.com>
To: Mukesh Rathor <mukesh.rathor@oracle.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
"Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH V2 3/7]: PVH: mmu related changes.
Date: Fri, 12 Oct 2012 09:57:56 +0100 [thread overview]
Message-ID: <1350032276.14806.53.camel@zakaz.uk.xensource.com> (raw)
In-Reply-To: <20121011145817.0d744c99@mantra.us.oracle.com>
On Thu, 2012-10-11 at 22:58 +0100, Mukesh Rathor wrote:
> @@ -2177,8 +2210,19 @@ static const struct pv_mmu_ops xen_mmu_ops __initconst = {
>
> void __init xen_init_mmu_ops(void)
> {
> - x86_init.mapping.pagetable_reserve = xen_mapping_pagetable_reserve;
> x86_init.paging.pagetable_init = xen_pagetable_init;
> +
> + if (xen_feature(XENFEAT_auto_translated_physmap)) {
> + pv_mmu_ops.flush_tlb_others = xen_flush_tlb_others;
> +
> + /* For PCI devices to map iomem. */
> + if (xen_initial_domain()) {
> + pv_mmu_ops.set_pte = native_set_pte;
> + pv_mmu_ops.set_pte_at = native_set_pte_at;
What do these end up being for the !xen_initial_domain case? I'd have
expected native_FOO.
> +int xen_unmap_domain_mfn_range(struct vm_area_struct *vma)
> +{
> + int numpgs = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
> + struct page **pages = vma ? vma->vm_private_data : NULL;
I thought we agreed to keep uses of vm_private_data in the privcmd
driver?
I think you should just add pages and nr as direct parameters to this
function, which is symmetric with the map call.
> +
> + if (!pages || !xen_feature(XENFEAT_auto_translated_physmap))
> + return 0;
> +
> + while (numpgs--) {
> +
> + /* the mmu has already cleaned up the process mmu resources at
> + * this point (lookup_address will return NULL). */
> + unsigned long pfn = page_to_pfn(pages[numpgs]);
> +
> + pvh_rem_xen_p2m(pfn, 1);
> + }
> + /* We don't need to flush tlbs because as part of pvh_rem_xen_p2m(),
> + * the hypervisor will do tlb flushes after removing the p2m entries
> + * from the EPT/NPT */
> + return 0;
> +}
> +EXPORT_SYMBOL_GPL(xen_unmap_domain_mfn_range);
[...]
> diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
> index ef63895..63d9ee8 100644
> --- a/drivers/xen/privcmd.c
> +++ b/drivers/xen/privcmd.c
> @@ -178,7 +178,7 @@ static int mmap_mfn_range(void *data, void *state)
> msg->va & PAGE_MASK,
> msg->mfn, msg->npages,
> vma->vm_page_prot,
> - st->domain);
> + st->domain, NULL);
Might it be useful to BUG_ON(!pages) in pvh_remap_gmfn_range?
Ian.
next prev parent reply other threads:[~2012-10-12 8:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-11 21:58 Mukesh Rathor
2012-10-12 8:57 ` Ian Campbell [this message]
2012-10-12 22:36 ` [Xen-devel] " Mukesh Rathor
2012-10-16 16:27 ` Ian Campbell
2012-10-16 17:46 ` Mukesh Rathor
2012-10-16 19:43 ` Ian Campbell
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=1350032276.14806.53.camel@zakaz.uk.xensource.com \
--to=ian.campbell@citrix.com \
--cc=Xen-devel@lists.xensource.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mukesh.rathor@oracle.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
all inboxes | Powered by JetHome®