From: David Vrabel <david.vrabel@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: xen-devel@lists.xenproject.org,
Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCHv6 2/3] xen: unify foreign GFN map/unmap for auto-xlated physmap guests
Date: Fri, 6 Mar 2015 17:58:04 +0000 [thread overview]
Message-ID: <54F9EAAC.5020702@citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1503061747410.9880@kaball.uk.xensource.com>
On 06/03/15 17:51, Stefano Stabellini wrote:
> On Fri, 6 Mar 2015, David Vrabel wrote:
>> Auto-translated physmap guests (arm, arm64 and x86 PVHVM/PVH) map and
>> unmap foreign GFNs using the same method (updating the physmap).
>> Unify the two arm and x86 implementations into one commont one.
>>
>> Note that on arm and arm64, the correct error code will be returned
>> (instead of always -EFAULT) and map/unmap failure warnings are no
>> longer printed. These changes are required if the foreign domain is
>> paging (-ENOENT failures are expected and must be propagated up to the
>> caller).
>>
[...]
>> --- a/drivers/xen/Kconfig
>> +++ b/drivers/xen/Kconfig
>> @@ -253,4 +253,10 @@ config XEN_EFI
>> def_bool y
>> depends on X86_64 && EFI
>>
>> +config XEN_AUTO_XLATE
>> + def_bool y
>> + depends on ARM || ARM64 || XEN_PVHVM
>> + help
>> + Support for auto-translated physmap guests.
>> +
>> endmenu
>
> I think the dependency chain is inverted: in order to enable XEN on ARM
> and ARM64 or to enable XEN_PVHVM, one needs XEN_AUTO_XLATE.
> I think that config XEN should select XEN_AUTO_XLATE on ARM and ARM64
> and config XEN_PVHVM should select XEN_AUTO_XLATE on x86.
This is a non-visible option that is automatically enabled if required,
so I'm not sure what you mean here.
>> +int xen_xlate_unmap_gfn_range(struct vm_area_struct *vma,
>> + int nr, struct page **pages)
>> +{
>> + int i;
>> +
>> + for (i = 0; i < nr; i++) {
>> + struct xen_remove_from_physmap xrp;
>> + unsigned long pfn;
>> +
>> + pfn = page_to_pfn(pages[i]);
>> +
>> + xrp.domid = DOMID_SELF;
>> + xrp.gpfn = pfn;
>> + (void)HYPERVISOR_memory_op(XENMEM_remove_from_physmap, &xrp);
>
> Why drop the warning we had before?
Because map failures (and hence) unmap failures are expected and would
result in log spam (particularly with an x86 HVM guest).
>> --- a/include/xen/xen-ops.h
>> +++ b/include/xen/xen-ops.h
>> @@ -34,6 +34,16 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
>> struct page **pages);
>> int xen_unmap_domain_mfn_range(struct vm_area_struct *vma,
>> int numpgs, struct page **pages);
>> +#ifdef CONFIG_XEN_AUTO_XLATE
>> +int xen_xlate_remap_gfn_range(struct vm_area_struct *vma,
>> + unsigned long addr,
>> + xen_pfn_t gfn, int nr,
>> + pgprot_t prot,
>> + unsigned domid,
>> + struct page **pages);
>> +int xen_xlate_unmap_gfn_range(struct vm_area_struct *vma,
>> + int nr, struct page **pages);
>> +#endif
>
> I don't think we actually need the #ifdef in the header file?
It serves as useful documentation if nothing else.
David
next prev parent reply other threads:[~2015-03-06 17:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-06 12:58 [PATCHv6 0/3] xen: improve migration performance David Vrabel
2015-03-06 12:58 ` [PATCHv6 1/3] arm: make __get_user() work for 8 byte values David Vrabel
2015-03-06 12:58 ` David Vrabel
2015-03-09 19:04 ` Russell King - ARM Linux
2015-03-09 19:04 ` Russell King - ARM Linux
2015-03-06 12:58 ` [PATCHv6 2/3] xen: unify foreign GFN map/unmap for auto-xlated physmap guests David Vrabel
2015-03-06 15:51 ` Konrad Rzeszutek Wilk
2015-03-06 17:37 ` David Vrabel
2015-03-06 17:51 ` Stefano Stabellini
2015-03-06 17:58 ` David Vrabel [this message]
2015-03-09 11:16 ` Stefano Stabellini
2015-03-06 12:58 ` [PATCHv6 3/3] xen/privcmd: improve performance of MMAPBATCH_V2 David Vrabel
2015-03-09 12:25 ` Stefano Stabellini
2015-03-09 13:18 ` David Vrabel
2015-03-09 15:53 ` Stefano Stabellini
2015-03-09 15:25 ` David Vrabel
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=54F9EAAC.5020702@citrix.com \
--to=david.vrabel@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xenproject.org \
/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.