All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Julien Grall <julien.grall@linaro.org>
Cc: "Keir (Xen.org)" <keir@xen.org>,
	Vijay Kilari <vijay.kilari@gmail.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Prasun Kapoor <Prasun.Kapoor@caviumnetworks.com>,
	andrew.cooper3@citrix.com,
	Vijaya Kumar K <vijaya.kumar@caviumnetworks.com>,
	Tim Deegan <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	manish.jaggi@caviumnetworks.com
Subject: Re: [PATCH v3] xen/arm: Do not allocate pte entries for MAP_SMALL_PAGES
Date: Tue, 10 Mar 2015 11:52:34 +0000	[thread overview]
Message-ID: <1425988354.21353.99.camel@citrix.com> (raw)
In-Reply-To: <54FED93E.5010806@linaro.org>

On Tue, 2015-03-10 at 11:45 +0000, Julien Grall wrote:
> On 09/03/15 16:08, Vijay Kilari wrote:
> > On Mon, Mar 9, 2015 at 5:46 PM, Julien Grall <julien.grall@linaro.org> wrote:
> >> Hi Vijay,
> >>
> >> Given the introduction of the new helper, the title looks wrong to me.
> >>
> >>
> >> On 09/03/2015 08:59, vijay.kilari@gmail.com wrote:
> >>>
> >>> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
> >>> index 7d4ba0c..e0be36b 100644
> >>> --- a/xen/arch/arm/mm.c
> >>> +++ b/xen/arch/arm/mm.c
> >>> @@ -827,14 +827,15 @@ static int create_xen_table(lpae_t *entry)
> >>>
> >>>   enum xenmap_operation {
> >>>       INSERT,
> >>> -    REMOVE
> >>> +    REMOVE,
> >>> +    RESERVE
> >>>   };
> >>>
> >>>   static int create_xen_entries(enum xenmap_operation op,
> >>>                                 unsigned long virt,
> >>>                                 unsigned long mfn,
> >>>                                 unsigned long nr_mfns,
> >>> -                              unsigned int ai)
> >>> +                              unsigned int flags)
> >>>   {
> >>>       int rc;
> >>>       unsigned long addr = virt, addr_end = addr + nr_mfns * PAGE_SIZE;
> >>> @@ -859,13 +860,17 @@ static int create_xen_entries(enum xenmap_operation
> >>> op,
> >>>
> >>>           switch ( op ) {
> >>>               case INSERT:
> >>> +            case RESERVE:
> >>>                   if ( third[third_table_offset(addr)].pt.valid )
> >>>                   {
> >>>                       printk("create_xen_entries: trying to replace an
> >>> existing mapping addr=%lx mfn=%lx\n",
> >>>                              addr, mfn);
> >>>                       return -EINVAL;
> >>>                   }
> >>> -                pte = mfn_to_xen_entry(mfn, ai);
> >>> +                if ( op == RESERVE || !is_pte_present(flags) )
> >>
> >>
> >> As you have a new operation (only used by populate_pt_range), why do you
> >> need to check is_pte_present?
> > 
> > map_pages_to_xen() can still take MAP_SMALL_PAGES as flags.
> > In future if any common code requires  MAP_SMALL_PAGES then,
> > this can be used.
> 
> The only usage was in vmap that you removed in this patch...
> 
> Furthermore, we decided to use to introduce populate_pt_range in order
> to avoid using MAP_SMALL_PAGES on ARM...
> 
> It's pointless to keep to different way to population page table...
> 
> [..]
> 
> >>
> >> And, therefore, MAP_SMALL_PAGES could be dropped.
> > 
> > MAP_SMALL_PAGES is still used in common code esp. EFI code.
> > We can remove this provided if we clean up this. But I still think
> > MAP_SMALL_PAGES is required to keep equivalent functionality of x86.
> 
> If you looked at the code you would have notice that the code is only
> compiled for x86 and would never work for ARM (_PAGE_PAT, _PAGE_PWT...
> doesn't exist).

Right, I think we should just remove MAP_SMALL_PAGES on ARM and if/when
it turns out we need it we can add it back and implement it in the PT
creation code.

In any case the fix to make vmap_init use the new function should
certainly be in a separate patch to anything which is fixing
MAP_SMALL_PAGES.

Ian.

  reply	other threads:[~2015-03-10 11:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-09  6:59 [PATCH v3] xen/arm: Do not allocate pte entries for MAP_SMALL_PAGES vijay.kilari
2015-03-09 12:16 ` Julien Grall
2015-03-09 16:08   ` Vijay Kilari
2015-03-10 11:45     ` Julien Grall
2015-03-10 11:52       ` Ian Campbell [this message]
2015-03-11  5:13         ` Vijay Kilari
2015-03-11 11:57           ` Ian Campbell
2015-03-09 13:26 ` Jan Beulich

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=1425988354.21353.99.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=Prasun.Kapoor@caviumnetworks.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@linaro.org \
    --cc=keir@xen.org \
    --cc=manish.jaggi@caviumnetworks.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=vijay.kilari@gmail.com \
    --cc=vijaya.kumar@caviumnetworks.com \
    --cc=xen-devel@lists.xen.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.