|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] ARM fixes for my improved privcmd patch.
New patch attached.I haven't done the relevant spelling fixes etc, as I had a little mishap with git, and need to fix up a few things. Thought you may want to have a look over the ARM side meanwhile, and if this is OK, I will post an "official" V5 patch to the list. Further comments below. -- Mats On 19/12/12 10:59, Ian Campbell wrote: Yes, I'm sure it is. I would prefer to do that AFTER my x86 patch has gone in, if that's possible. (Or that someone who can actually understands the ARM architecture and can test it on actual ARM does it...)On Tue, 2012-12-18 at 19:34 +0000, Mats Petersson wrote:I think I'll do the minimal patch first, then, if I find some spare time, work on the "batching" variant.OK. The batching is IMHO just using the multicall variant.The XENMEM_add_to_physmap_range is itself batched (it contains ranges of mfns etc), so we don't just want to batch the actual hypercalls we really want to make sure each hypercall processes a batch, this will lets us optimise the flushes in the hypervisor. I don't know if they mutlicall infrastructure allows for that but it would be pretty trivial to do it explicitly Yes, that is certainly my plan. I just made two patches for ease of "what is ARM and what isn't" - but final submit should be as one patch.I expect these patches will need to be folded into one to avoid a bisecability hazard? Yes, could do. As I stated in the commentary text, I tried to keep the code similar in structure to x86. [Actually, one iteration of my code had two API functions, one of which called the other, but it was considered a better solution to make one common function, and have the two x86 functions call that one].xen-privcmd-remap-array-arm.patch:diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index 7a32976..dc50a53 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c @@ -73,7 +73,7 @@ static int map_foreign_page(unsigned long lpfn, unsigned long fgmfn, }struct remap_data { I don't know if it's useful or not. I'm sure removing it will make little difference, but since the VM flags are set by the calling code, the privcmd.c or higher level code would have to be correct for whatever architecture they are on. Not sure if it is "helpful" to allow certain combinations in one arch, when it's not in another. My choice would be to keep the restriction until there is a good reason to remove it, but if you feel it is beneficial to remove it, feel free to say so. [Perhaps the ARM code should have a comment to the effect of "not needed on PVH or ARM, kept for compatibility with PVOPS on x86" - so when PVOPS is "retired" in some years time, it can be removed]
Fixed. Yes, but since that exits on error with EFAULT, the calling code won't "accept" the errors, and thus the whole house of cards fall apart at this point.+ only likely to return EFAULT or some other "things are very + bad" error code, which the rest of the calling code won't + be able to fix up. So we just exit with the error we got.It expect it is more important to accumulate the individual errors from remap_pte_fn into err_ptr. There should probably be a task to fix this up properly, hence the comment. But right now, any error besides ENOENT is "unacceptable" by the callers of this code. If you want me to add this to the comment, I'm happy to. But as long as remap_pte_fn returns EFAULT on error, nothing will work after an error. + */ + if (err) + return err; + + nr--; + addr += range; + }This while loop (and therefore this change) is unnecessary. The single call to apply_to_page_range is sufficient and as your TODO notes any batching should happen in remap_pte_fn (which can handle both accumulation and flushing when the batch is large enough). Ah, I see how you mean. I have updated the code accordingly. Virtual, at least if we assume that in " st->va & PAGE_MASK," 'va' actually means virtual address - it would be rather devious to keep use the name va as a physical address - although I have seen such things in the past.+ return 0; +} + +/* xen_remap_domain_mfn_array() - Used to map an array of foreign pages + * @vma: the vma for the pages to be mapped into + * @addr: the address at which to map the pagesphysical address, right? I shall amend the comments to say such "virtual address" to be more clear. [Not done in the attached patch, just realized this when re-reading my comments that I probably should...] + * @mfn: pointer to array of MFNs to map + * @nr: the number entries in the MFN array + * @err_ptr: pointer to array of integers, one per MFN, for an error + * value for each page. The err_ptr must not be NULL.Nothing seems to be filling this in? As discussed above (and below). + * @prot: page protection mask + * @domid: id of the domain that we are mapping from + * @pages: page information (for PVH, not used currently)No such thing as PVH on ARM. Also pages is used by this code. Removed part in ().
Thanks...
Do you prefer the "not used" comment moved up a bit? -- Mats
Attachment:
0001-Fixed-up-after-IanC-s-comments.patch _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |