|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v4 1/7] x86/p2m/pod: make it build with !CONFIG_HVM
>>> On 13.09.18 at 18:38, <wei.liu2@xxxxxxxxxx> wrote:
> --- a/xen/arch/x86/mm/p2m-pt.c
> +++ b/xen/arch/x86/mm/p2m-pt.c
> @@ -974,7 +974,9 @@ long p2m_pt_audit_p2m(struct p2m_domain *p2m)
> unsigned long mfn, gfn, m2pfn;
>
> ASSERT(p2m_locked_by_me(p2m));
> +#ifdef CONFIG_HVM
> ASSERT(pod_locked_by_me(p2m));
> +#endif
>
> /* Audit part one: walk the domain's p2m table, checking the entries. */
> if ( pagetable_get_pfn(p2m_get_pagetable(p2m)) != 0 )
> @@ -1105,6 +1107,7 @@ long p2m_pt_audit_p2m(struct p2m_domain *p2m)
> unmap_domain_page(l4e);
> }
>
> +#ifdef CONFIG_HVM
> if ( entry_count != p2m->pod.entry_count )
> {
> printk("%s: refcounted entry count %ld, audit count %lu!\n",
> @@ -1113,6 +1116,7 @@ long p2m_pt_audit_p2m(struct p2m_domain *p2m)
> entry_count);
> BUG();
> }
> +#endif
>
> return pmbad;
> }
A single #ifdef around the entire function please, with
#else
# define p2m_pt_audit_p2m NULL
#endif
or some such (like making the audit_p2m structure member go away
altogether), as your change to the conditional around audit_p2m()
suppresses the only caller.
> --- a/xen/arch/x86/mm/p2m.c
> +++ b/xen/arch/x86/mm/p2m.c
> @@ -49,18 +49,28 @@ boolean_param("hap_2mb", opt_hap_2mb);
>
> DEFINE_PERCPU_RWLOCK_GLOBAL(p2m_percpu_rwlock);
>
> +static void p2m_pod_init(struct p2m_domain *p2m)
> +{
> +#ifdef CONFIG_HVM
> + unsigned int i;
> +
> + mm_lock_init(&p2m->pod.lock);
> + INIT_PAGE_LIST_HEAD(&p2m->pod.super);
> + INIT_PAGE_LIST_HEAD(&p2m->pod.single);
> +
> + for ( i = 0; i < ARRAY_SIZE(p2m->pod.mrp.list); ++i )
> + p2m->pod.mrp.list[i] = gfn_x(INVALID_GFN);
> +#endif
> +}
I think this really belongs into p2m-pod.c.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |