All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org
Cc: "Wei Liu" <wei.liu2@citrix.com>,
	"Ian Campbell" <ian.campbell@citrix.com>,
	"Stefano Stabellini" <stefano.stabellini@eu.citrix.com>,
	"Ian Jackson" <ian.jackson@eu.citrix.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH] libxc: introduce a per architecture scratch pfn for temporary grant mapping
Date: Wed, 14 Jan 2015 13:20:41 +0000	[thread overview]
Message-ID: <54B66D29.6050001@linaro.org> (raw)
In-Reply-To: <54B66805.4080902@citrix.com>

On 14/01/15 12:58, Andrew Cooper wrote:
> On 13/01/15 20:10, Julien Grall wrote:
>> The code to initialize the grant table in libxc uses
>> xc_domain_maximum_gpfn() + 1 to get a guest pfn for mapping the grant
>> frame and to initialize it.
>>
>> This solution has two major issues:
>>     - The check of the return of xc_domain_maximum_gpfn is buggy because
>>     xen_pfn_t is unsigned and in case of an error -ERRNO is returned.
>>     Which is never catch with ( pfn <= 0 ).
> 
> Wow - xc_domain_maximum_gpfn() will currently truncate long to int on
> 64bit systems.  That is unhelpful of it.
> 
>>     - The guest memory layout maybe filled up to the end, i.e
>>     xc_domain_maximum_gpfn() + 1 gives either 0 or an invalid PFN due to
>>     hardware limitation.
> 
> I realise I am throwing a spanner in the works here, but if you are
> looking to fix it, lets fix this properly rather than hacking around the
> problem further.
> 
> There is currently no way for the toolstack to map something on behalf
> of a guest which is not in the guest physmap.  As a workaround, the code
> here shoots a guest ram page, adds a non-ram page to the physmap, maps,
> edits, unmaps and replaces the ram.

Hmmm... why do you talk about shooting a guest RAM page? Neither the
current code, nor the suggested solution for ARM does a such things.

ARM is defining a grant table range which is out of the RAM and not
mapped at that time. So we can reuse it with any possible issue.

Regards,

-- 
Julien Grall

  reply	other threads:[~2015-01-14 13:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-13 20:10 [PATCH] libxc: introduce a per architecture scratch pfn for temporary grant mapping Julien Grall
2015-01-14 11:03 ` Ian Campbell
2015-01-14 13:32   ` Julien Grall
2015-01-14 12:58 ` Andrew Cooper
2015-01-14 13:20   ` Julien Grall [this message]
2015-01-14 13:23     ` Andrew Cooper
2015-01-14 13:26       ` Julien Grall
2015-01-14 13:31       ` Ian Campbell
2015-01-14 13:56         ` Andrew Cooper
2015-01-15 10:45   ` Tim Deegan
2015-01-15 13:14     ` Andrew Cooper
2015-01-15 13:20       ` Julien Grall
2015-01-21 12:03 ` Julien Grall
2015-01-21 12:07   ` Andrew Cooper

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=54B66D29.6050001@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=wei.liu2@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.