From: David Vrabel <david.vrabel@citrix.com>
To: Juergen Gross <jgross@suse.com>, <linux-kernel@vger.kernel.org>,
<xen-devel@lists.xensource.com>, <konrad.wilk@oracle.com>,
<david.vrabel@citrix.com>, <boris.ostrovsky@oracle.com>,
<x86@kernel.org>, <tglx@linutronix.de>, <mingo@redhat.com>,
<hpa@zytor.com>
Subject: Re: [Xen-devel] [PATCH V2 2/5] xen: Delay m2p_override initialization
Date: Fri, 7 Nov 2014 13:04:09 +0000 [thread overview]
Message-ID: <545CC349.8020006@citrix.com> (raw)
In-Reply-To: <1415252853-7106-3-git-send-email-jgross@suse.com>
On 06/11/14 05:47, Juergen Gross wrote:
> The m2p overrides are used to be able to find the local pfn for a
> foreign mfn mapped into the domain. They are used by driver backends
> having to access frontend data.
>
> As this functionality isn't used in early boot it makes no sense to
> initialize the m2p override functions very early. It can be done
> later without doing any harm, removing the need for allocating memory
> via extend_brk().
>
> While at it make some m2p override functions static as they are only
> used internally.
[...]
> }
> /* This should be the leafs allocated for identity from _brk. */
> }
> - return (unsigned long)mfn_list;
>
> + m2p_override_init();
> + return (unsigned long)mfn_list;
> }
> #else
> unsigned long __init xen_revector_p2m_tree(void)
> {
> use_brk = 0;
> + m2p_override_init();
> return 0;
> }
This is mentioned in the description...
> #endif
> @@ -794,15 +794,16 @@ bool set_phys_to_machine(unsigned long pfn, unsigned long mfn)
> #define M2P_OVERRIDE_HASH_SHIFT 10
> #define M2P_OVERRIDE_HASH (1 << M2P_OVERRIDE_HASH_SHIFT)
>
> -static RESERVE_BRK_ARRAY(struct list_head, m2p_overrides, M2P_OVERRIDE_HASH);
> +static struct list_head *m2p_overrides;
> static DEFINE_SPINLOCK(m2p_override_lock);
>
> static void __init m2p_override_init(void)
> {
> unsigned i;
>
> - m2p_overrides = extend_brk(sizeof(*m2p_overrides) * M2P_OVERRIDE_HASH,
> - sizeof(unsigned long));
> + m2p_overrides = alloc_bootmem_align(
> + sizeof(*m2p_overrides) * M2P_OVERRIDE_HASH,
> + sizeof(unsigned long));
...as is this.
> -int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops,
> - struct gnttab_map_grant_ref *kmap_ops,
> - struct page **pages, unsigned int count)
> -{
> - int i, ret = 0;
> - bool lazy = false;
> - pte_t *pte;
> -
> - if (xen_feature(XENFEAT_auto_translated_physmap))
> - return 0;
> -
> - if (kmap_ops &&
> - !in_interrupt() &&
> - paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) {
> - arch_enter_lazy_mmu_mode();
> - lazy = true;
> - }
... but, what's going on here. What are the rest of these changes?
I suppose this is the "make some functions static" but it's an
unreviewable mess. If you can't do this with some one line changes
adding "static" and perhaps some forward declarations then please drop
this bit.
David
WARNING: multiple messages have this Message-ID (diff)
From: David Vrabel <david.vrabel@citrix.com>
To: Juergen Gross <jgross@suse.com>,
linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com,
konrad.wilk@oracle.com, david.vrabel@citrix.com,
boris.ostrovsky@oracle.com, x86@kernel.org, tglx@linutronix.de,
mingo@redhat.com, hpa@zytor.com
Subject: Re: [Xen-devel] [PATCH V2 2/5] xen: Delay m2p_override initialization
Date: Fri, 7 Nov 2014 13:04:09 +0000 [thread overview]
Message-ID: <545CC349.8020006@citrix.com> (raw)
In-Reply-To: <1415252853-7106-3-git-send-email-jgross@suse.com>
On 06/11/14 05:47, Juergen Gross wrote:
> The m2p overrides are used to be able to find the local pfn for a
> foreign mfn mapped into the domain. They are used by driver backends
> having to access frontend data.
>
> As this functionality isn't used in early boot it makes no sense to
> initialize the m2p override functions very early. It can be done
> later without doing any harm, removing the need for allocating memory
> via extend_brk().
>
> While at it make some m2p override functions static as they are only
> used internally.
[...]
> }
> /* This should be the leafs allocated for identity from _brk. */
> }
> - return (unsigned long)mfn_list;
>
> + m2p_override_init();
> + return (unsigned long)mfn_list;
> }
> #else
> unsigned long __init xen_revector_p2m_tree(void)
> {
> use_brk = 0;
> + m2p_override_init();
> return 0;
> }
This is mentioned in the description...
> #endif
> @@ -794,15 +794,16 @@ bool set_phys_to_machine(unsigned long pfn, unsigned long mfn)
> #define M2P_OVERRIDE_HASH_SHIFT 10
> #define M2P_OVERRIDE_HASH (1 << M2P_OVERRIDE_HASH_SHIFT)
>
> -static RESERVE_BRK_ARRAY(struct list_head, m2p_overrides, M2P_OVERRIDE_HASH);
> +static struct list_head *m2p_overrides;
> static DEFINE_SPINLOCK(m2p_override_lock);
>
> static void __init m2p_override_init(void)
> {
> unsigned i;
>
> - m2p_overrides = extend_brk(sizeof(*m2p_overrides) * M2P_OVERRIDE_HASH,
> - sizeof(unsigned long));
> + m2p_overrides = alloc_bootmem_align(
> + sizeof(*m2p_overrides) * M2P_OVERRIDE_HASH,
> + sizeof(unsigned long));
...as is this.
> -int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops,
> - struct gnttab_map_grant_ref *kmap_ops,
> - struct page **pages, unsigned int count)
> -{
> - int i, ret = 0;
> - bool lazy = false;
> - pte_t *pte;
> -
> - if (xen_feature(XENFEAT_auto_translated_physmap))
> - return 0;
> -
> - if (kmap_ops &&
> - !in_interrupt() &&
> - paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) {
> - arch_enter_lazy_mmu_mode();
> - lazy = true;
> - }
... but, what's going on here. What are the rest of these changes?
I suppose this is the "make some functions static" but it's an
unreviewable mess. If you can't do this with some one line changes
adding "static" and perhaps some forward declarations then please drop
this bit.
David
next prev parent reply other threads:[~2014-11-07 13:04 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-06 5:47 [PATCH V2 0/5] xen: Switch to virtual mapped linear p2m list Juergen Gross
2014-11-06 5:47 ` [PATCH V2 1/5] Xen: Delay remapping memory of pv-domain Juergen Gross
2014-11-07 14:57 ` [Xen-devel] " David Vrabel
2014-11-07 14:57 ` David Vrabel
2014-11-06 5:47 ` [PATCH V2 2/5] xen: Delay m2p_override initialization Juergen Gross
2014-11-07 13:04 ` David Vrabel [this message]
2014-11-07 13:04 ` [Xen-devel] " David Vrabel
2014-11-07 13:19 ` Juergen Gross
2014-11-07 14:08 ` David Vrabel
2014-11-07 14:08 ` David Vrabel
2014-11-06 5:47 ` [PATCH V2 3/5] xen: Delay invalidating extra memory Juergen Gross
2014-11-07 13:57 ` David Vrabel
2014-11-07 13:57 ` David Vrabel
2014-11-06 5:47 ` [PATCH V2 4/5] x86: Introduce function to get pmd entry pointer Juergen Gross
2014-11-06 5:47 ` [PATCH V2 5/5] Xen: switch to linear virtual mapped sparse p2m list Juergen Gross
2014-11-07 13:54 ` [Xen-devel] " David Vrabel
2014-11-07 13:54 ` David Vrabel
2014-11-07 14:11 ` Juergen Gross
2014-11-07 14:40 ` David Vrabel
2014-11-07 14:40 ` David Vrabel
2014-11-07 14:43 ` Juergen Gross
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=545CC349.8020006@citrix.com \
--to=david.vrabel@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xensource.com \
/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.