All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Julien Grall <julien.grall@citrix.com>, xen-devel@lists.xenproject.org
Cc: ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com,
	tim@xen.org, linux-kernel@vger.kernel.org,
	David Vrabel <david.vrabel@citrix.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC 22/23] xen/privcmd: Add support for Linux 64KB page granularity
Date: Tue, 19 May 2015 16:39:31 +0100	[thread overview]
Message-ID: <555B5933.9040405__16119.5697416135$1432050129$gmane$org@citrix.com> (raw)
In-Reply-To: <1431622863-28575-23-git-send-email-julien.grall@citrix.com>

On 14/05/15 18:01, Julien Grall wrote:
> The hypercall interface (as well as the toolstack) is always using 4KB
> page granularity. When the toolstack is asking for mapping a series of
> guest PFN in a batch, it expects to have the page map contiguously in
> its virtual memory.
> 
> When Linux is using 64KB page granularity, the privcmd driver will have
> to map multiple Xen PFN in a single Linux page.
> 
> Note that this solution works on page granularity which is a multiple of
> 4KB.
[...]
> --- a/drivers/xen/xlate_mmu.c
> +++ b/drivers/xen/xlate_mmu.c
> @@ -63,6 +63,7 @@ static int map_foreign_page(unsigned long lpfn, unsigned long fgmfn,
>  
>  struct remap_data {
>  	xen_pfn_t *fgmfn; /* foreign domain's gmfn */
> +	xen_pfn_t *egmfn; /* end foreign domain's gmfn */

I don't know what you mean by "end foreign domain".

>  	pgprot_t prot;
>  	domid_t  domid;
>  	struct vm_area_struct *vma;
> @@ -78,17 +79,23 @@ static int remap_pte_fn(pte_t *ptep, pgtable_t token, unsigned long addr,
>  {
>  	struct remap_data *info = data;
>  	struct page *page = info->pages[info->index++];
> -	unsigned long pfn = page_to_pfn(page);
> -	pte_t pte = pte_mkspecial(pfn_pte(pfn, info->prot));
> +	unsigned long pfn = xen_page_to_pfn(page);
> +	pte_t pte = pte_mkspecial(pfn_pte(page_to_pfn(page), info->prot));
>  	int rc;
> -
> -	rc = map_foreign_page(pfn, *info->fgmfn, info->domid);
> -	*info->err_ptr++ = rc;
> -	if (!rc) {
> -		set_pte_at(info->vma->vm_mm, addr, ptep, pte);
> -		info->mapped++;
> +	uint32_t i;
> +
> +	for (i = 0; i < XEN_PFN_PER_PAGE; i++) {
> +		if (info->fgmfn == info->egmfn)
> +			break;
> +
> +		rc = map_foreign_page(pfn++, *info->fgmfn, info->domid);
> +		*info->err_ptr++ = rc;
> +		if (!rc) {
> +			set_pte_at(info->vma->vm_mm, addr, ptep, pte);
> +			info->mapped++;
> +		}
> +		info->fgmfn++;

This doesn't make any sense to me.  Don't you need to gather the foreign
GFNs into batches of PAGE_SIZE / XEN_PAGE_SIZE and map these all at once
into a 64 KiB page?  I don't see how you can have a set_pte_at() for
each foreign GFN.

David

  reply	other threads:[~2015-05-19 15:40 UTC|newest]

Thread overview: 200+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14 17:00 [RFC 00/23] arm64: Add support for 64KB page granularity in Xen guest Julien Grall
2015-05-14 17:00 ` Julien Grall
2015-05-14 17:00 ` [RFC 01/23] xen: Include xen/page.h rather than asm/xen/page.h Julien Grall
2015-05-14 17:00 ` Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-19 13:50   ` [Xen-devel] " David Vrabel
2015-05-19 13:50     ` David Vrabel
2015-05-19 13:50   ` David Vrabel
2015-05-14 17:00 ` [RFC 02/23] xen/xenbus: client: Fix call of virt_to_mfn in xenbus_grant_ring Julien Grall
2015-05-14 17:00 ` Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-19 13:51   ` David Vrabel
2015-05-19 13:51   ` [Xen-devel] " David Vrabel
2015-05-19 13:51     ` David Vrabel
2015-05-19 14:12     ` Julien Grall
2015-05-19 14:12     ` [Xen-devel] " Julien Grall
2015-05-19 14:12       ` Julien Grall
2015-05-14 17:00 ` [RFC 03/23] xen/grant-table: Remove unused macro SPP Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-19 13:52   ` [Xen-devel] " David Vrabel
2015-05-19 13:52     ` David Vrabel
2015-05-19 13:52   ` David Vrabel
2015-05-14 17:00 ` [RFC 04/23] block/xen-blkfront: Remove unused macro MAXIMUM_OUTSTANDING_BLOCK_REQS Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-20 14:36   ` Roger Pau Monné
2015-05-20 14:36   ` Roger Pau Monné
2015-05-20 14:36     ` Roger Pau Monné
2015-05-14 17:00 ` Julien Grall
2015-05-14 17:00 ` [RFC 05/23] block/xen-blkfront: Remove invalid comment Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-20 14:42   ` Roger Pau Monné
2015-05-20 14:42     ` Roger Pau Monné
2015-05-20 14:42     ` Roger Pau Monné
2015-05-14 17:00 ` [RFC 06/23] block/xen-blkback: s/nr_pages/nr_segs/ Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-20 14:54   ` Roger Pau Monné
2015-05-20 14:54     ` Roger Pau Monné
2015-05-20 14:54   ` Roger Pau Monné
2015-05-14 17:00 ` [RFC 07/23] net/xen-netfront: Correct printf format in xennet_get_responses Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-19 13:53   ` [Xen-devel] " David Vrabel
2015-05-19 13:53     ` David Vrabel
2015-05-19 13:53   ` David Vrabel
2015-05-14 17:00 ` [RFC 08/23] net/xen-netback: Remove unused code in xenvif_rx_action Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-15  0:26   ` Wei Liu
2015-05-15  0:26   ` Wei Liu
2015-05-15  0:26     ` Wei Liu
2015-05-14 17:00 ` Julien Grall
2015-05-14 17:00 ` [RFC 09/23] arm/xen: Drop duplicate define mfn_to_virt Julien Grall
2015-05-14 17:00 ` Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-06-23 13:25   ` Stefano Stabellini
2015-06-23 13:25   ` Stefano Stabellini
2015-06-23 13:25     ` Stefano Stabellini
2015-06-23 13:53     ` Julien Grall
2015-06-23 13:53     ` [Xen-devel] " Julien Grall
2015-06-23 13:53       ` Julien Grall
2015-05-14 17:00 ` [RFC 10/23] xen/biomerge: WORKAROUND always says the biovec are not mergeable Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-15 15:54   ` Boris Ostrovsky
2015-05-15 15:54   ` Boris Ostrovsky
2015-05-15 15:54     ` Boris Ostrovsky
2015-05-19 14:16     ` Julien Grall
2015-05-19 14:16       ` Julien Grall
2015-05-19 14:16     ` Julien Grall
2015-05-14 17:00 ` [RFC 11/23] xen: Add Xen specific page definition Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-14 17:00 ` [RFC 12/23] xen: Extend page_to_mfn to take an offset in the page Julien Grall
2015-05-14 17:00 ` Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-19 13:57   ` David Vrabel
2015-05-19 13:57   ` [Xen-devel] " David Vrabel
2015-05-19 13:57     ` David Vrabel
2015-05-19 14:18     ` Julien Grall
2015-05-19 14:18       ` Julien Grall
2015-05-19 14:18     ` Julien Grall
2015-05-14 17:00 ` [RFC 13/23] xen/xenbus: Use Xen page definition Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-19 13:59   ` David Vrabel
2015-05-19 13:59   ` [Xen-devel] " David Vrabel
2015-05-19 13:59     ` David Vrabel
2015-05-19 14:19     ` Julien Grall
2015-05-19 14:19     ` [Xen-devel] " Julien Grall
2015-05-19 14:19       ` Julien Grall
2015-05-14 17:00 ` [RFC 14/23] tty/hvc: xen: Use xen " Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-14 17:00 ` [RFC 15/23] xen/balloon: Don't rely on the page granularity is the same for Xen and Linux Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-19 15:23   ` [Xen-devel] " David Vrabel
2015-05-19 15:23     ` David Vrabel
2015-05-19 15:23   ` David Vrabel
2015-05-14 17:00 ` Julien Grall
2015-05-14 17:00 ` [RFC 16/23] xen/events: fifo: Make it running on 64KB granularity Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-19 15:25   ` David Vrabel
2015-05-19 15:25   ` [Xen-devel] " David Vrabel
2015-05-19 15:25     ` David Vrabel
2015-05-14 17:00 ` [RFC 17/23] xen/grant-table: " Julien Grall
2015-05-14 17:00 ` Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-19 15:27   ` [Xen-devel] " David Vrabel
2015-05-19 15:27     ` David Vrabel
2015-05-19 15:27   ` David Vrabel
2015-05-14 17:00 ` [RFC 18/23] block/xen-blkfront: Make it running on 64KB page granularity Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-14 17:00 ` [RFC 19/23] block/xen-blkback: " Julien Grall
2015-05-14 17:00 ` Julien Grall
2015-05-14 17:00   ` Julien Grall
2015-05-14 17:01 ` [RFC 20/23] net/xen-netfront: " Julien Grall
2015-05-14 17:01 ` Julien Grall
2015-05-14 17:01   ` Julien Grall
2015-05-14 17:01 ` [RFC 21/23] net/xen-netback: " Julien Grall
2015-05-14 17:01   ` Julien Grall
2015-05-14 17:01   ` Julien Grall
2015-05-14 17:01   ` Julien Grall
2015-05-15  2:35   ` Wei Liu
2015-05-15  2:35     ` Wei Liu
2015-05-15 12:35     ` [Xen-devel] " Julien Grall
2015-05-15 12:35       ` Julien Grall
2015-05-15 15:31       ` Wei Liu
2015-05-15 15:31         ` Wei Liu
2015-05-15 15:41         ` Ian Campbell
2015-05-15 15:41           ` Ian Campbell
2015-05-15 15:41         ` Ian Campbell
2015-05-18 12:11         ` [Xen-devel] " Julien Grall
2015-05-18 12:11           ` Julien Grall
2015-05-18 12:54           ` Wei Liu
2015-05-18 12:54           ` [Xen-devel] " Wei Liu
2015-05-18 12:54             ` Wei Liu
2015-05-19 22:56             ` Julien Grall
2015-05-19 22:56             ` [Xen-devel] " Julien Grall
2015-05-19 22:56               ` Julien Grall
2015-05-20  8:26               ` Wei Liu
2015-05-20  8:26               ` [Xen-devel] " Wei Liu
2015-05-20  8:26                 ` Wei Liu
2015-05-20 14:26                 ` Julien Grall
2015-05-20 14:26                   ` Julien Grall
2015-05-20 14:26                 ` Julien Grall
2015-05-20 14:29               ` Julien Grall
2015-05-20 14:29               ` [Xen-devel] " Julien Grall
2015-05-20 14:29                 ` Julien Grall
2015-05-18 12:11         ` Julien Grall
2015-05-15 15:31       ` Wei Liu
2015-05-15 12:35     ` Julien Grall
2015-05-15  2:35   ` Wei Liu
2015-05-14 17:01 ` [RFC 22/23] xen/privcmd: Add support for Linux " Julien Grall
2015-05-14 17:01 ` Julien Grall
2015-05-14 17:01   ` Julien Grall
2015-05-19 15:39   ` David Vrabel [this message]
2015-05-19 15:39   ` [Xen-devel] " David Vrabel
2015-05-19 15:39     ` David Vrabel
2015-06-18 17:05     ` Julien Grall
2015-06-18 17:05     ` [Xen-devel] " Julien Grall
2015-06-18 17:05       ` Julien Grall
2015-05-14 17:01 ` [RFC 23/23] arm/xen: Add support for " Julien Grall
2015-05-14 17:01   ` Julien Grall
2015-05-14 17:01   ` Julien Grall
2015-06-23 14:19   ` Stefano Stabellini
2015-06-23 14:19   ` Stefano Stabellini
2015-06-23 14:19     ` Stefano Stabellini
2015-06-23 14:37     ` Julien Grall
2015-06-23 14:37     ` Julien Grall
2015-06-23 14:37       ` Julien Grall
2015-06-23 14:49       ` Stefano Stabellini
2015-06-23 14:49       ` Stefano Stabellini
2015-06-23 14:49         ` Stefano Stabellini
2015-06-23 15:02         ` [Xen-devel] " Julien Grall
2015-06-23 15:02           ` Julien Grall
2015-06-23 16:12           ` Stefano Stabellini
2015-06-23 16:12           ` [Xen-devel] " Stefano Stabellini
2015-06-23 16:12             ` Stefano Stabellini
2015-06-23 15:02         ` Julien Grall
2015-05-15 15:45 ` [RFC 00/23] arm64: Add support for 64KB page granularity in Xen guest David Vrabel
2015-05-15 15:45 ` [Xen-devel] " David Vrabel
2015-05-15 15:45   ` David Vrabel
2015-05-15 15:51   ` Boris Ostrovsky
2015-05-15 15:51   ` [Xen-devel] " Boris Ostrovsky
2015-05-15 15:51     ` Boris Ostrovsky
2015-05-18 12:23   ` Julien Grall
2015-05-18 12:23   ` [Xen-devel] " Julien Grall
2015-05-18 12:23     ` Julien Grall
2015-06-23 13:37     ` Stefano Stabellini
2015-06-23 13:37     ` [Xen-devel] " Stefano Stabellini
2015-06-23 13:37       ` Stefano Stabellini
2015-06-23 13:41       ` Stefano Stabellini
2015-06-23 13:41       ` [Xen-devel] " Stefano Stabellini
2015-06-23 13:41         ` Stefano Stabellini

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='555B5933.9040405__16119.5697416135$1432050129$gmane$org@citrix.com' \
    --to=david.vrabel@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=ian.campbell@citrix.com \
    --cc=julien.grall@citrix.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --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.