From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [RFC PATCH 3/8]: PVH: memory manager and paging related changes
Date: Fri, 17 Aug 2012 16:49:30 -0700 [thread overview]
Message-ID: <20120817164930.78c0abd7@mantra.us.oracle.com> (raw)
In-Reply-To: <1345195575.30865.128.camel@zakaz.uk.xensource.com>
On Fri, 17 Aug 2012 10:26:15 +0100
Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Thu, 2012-08-16 at 02:02 +0100, Mukesh Rathor wrote:
> > +
> > if (HYPERVISOR_update_va_mapping((unsigned long)addr, pte,
> > 0)) BUG();
> > }
> > @@ -1745,6 +1785,7 @@ static void convert_pfn_mfn(void *v)
> > * but that's enough to get __va working. We need to fill in the
> > rest
> > * of the physical mapping once some sort of allocator has been set
> > * up.
> > + * NOTE: for PVH, the page tables are native with HAP required.
>
> OOI does this mean shadow doesn't work?
Most likely now. Will need to explore that. Later.
> > +
> > + if (xen_pvh_domain()) {
> > + pv_mmu_ops.flush_tlb_others = xen_flush_tlb_others;
> > +
> > + /* set_pte* for PCI devices to map iomem. */
> > + if (xen_initial_domain()) {
> > + pv_mmu_ops.set_pte = xen_dom0pvh_set_pte;
> > + pv_mmu_ops.set_pte_at =
> > xen_dom0pvh_set_pte_at;
>
> Is this wrong for domU or have you just not tried/implemented
> passthrough support yet?
No, passthrough is phase II/III. Too big a project for one person to do in
a single shot as it is ;)..
> > + * exported function, so no need to export this.
> > + */
> > +static int pvh_add_to_xen_p2m(unsigned long lpfn, unsigned long
> > fgmfn,
> > + unsigned int domid)
> > +{
> > + int rc;
> > + struct xen_add_to_physmap pmb = {.foreign_domid = domid};
>
> I'm not sure but I think CodingStyle would want spaces inside the {}s.
>
> What is the b in pmb? Phys Map B??? (every other user of this
> interface says xatp, FWIW)
because originally it was a batch function but got changed after the
code review earlier. I will rename it.
> > HYPERVISOR_memory_op(XENMEM_remove_from_physmap, &xrp);
> > + if (rc) {
> > + pr_warn("Failed to unmap pfn:%lx rc:%d
> > done:%d\n",
> > + spfn+i, rc, i);
> > + return 1;
> > + }
> > + }
> > + return 0;
> > +}
> > +EXPORT_SYMBOL_GPL(pvh_rem_xen_p2m);
>
> What is the external/modular user of this?
privcmd.
> I guess this is why you noted that pvh_add_to_xen_p2m didn't need
> exporting, which struck me as unnecessary at the time.
>
> pvh_add_to_xen_p2m seems to have an exported a wrapper, why not rem
> too? e.g. xen_unmap_domain_mfn_range?
I believe unmapping happens thru native code. So, we just need to remove
the entries from the ept. Ok, I mean, hap.
> > +
> > + native_set_pte(ptep, pteval);
> > + if (pvh_add_to_xen_p2m(pfn, pvhp->fgmfn, pvhp->domid))
> > + return -EFAULT;
>
> Is there a little window here where we've setup the page table entry
> but the p2m entry behind it is uninitialised?
>
> I suppose even if an interrupt occurred we can rely on the virtual
> address not having been "exposed" anywhere yet and therefore there is
> no chance of anyone dereferencing it. But is there any harm in just
> flipping the ordering here?
Should be ok flippiong the order.
> Why EFAULT? Seems a bit random, I think HYPERVISOR_memory_op returns a
> -ve errno which you could propagate.
Ok, sounds good.
next prev parent reply other threads:[~2012-08-17 23:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-16 1:02 [RFC PATCH 3/8]: PVH: memory manager and paging related changes Mukesh Rathor
2012-08-16 14:10 ` Stefano Stabellini
2012-08-16 14:15 ` Ian Campbell
2012-08-17 23:40 ` Mukesh Rathor
2012-08-17 9:26 ` Ian Campbell
2012-08-17 23:49 ` Mukesh Rathor [this message]
2012-09-14 16:20 ` 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=20120817164930.78c0abd7@mantra.us.oracle.com \
--to=mukesh.rathor@oracle.com \
--cc=Ian.Campbell@citrix.com \
--cc=Xen-devel@lists.xensource.com \
--cc=konrad.wilk@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;
as well as URLs for NNTP newsgroup(s).