xen/arm: livepatch: Include xen/mm.h rather than asm/mm.h
authorJulien Grall <jgrall@amazon.com>
Fri, 15 Jan 2021 19:29:47 +0000 (19:29 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 15 Jan 2021 20:05:29 +0000 (12:05 -0800)
commitdb9c4ad1b1abaef3c38027b9b2700d9250d13125
tree07719d118b0ca03d2cccb775fa95f7f03cff805f
parentcc83ee4c6c3790dd98a91cc0d34162dab067bca7
xen/arm: livepatch: Include xen/mm.h rather than asm/mm.h

Livepatch fails to build on Arm after commit ced9795c6cb4 "mm: split
out mfn_t / gfn_t / pfn_t definitions and helpers":

In file included from livepatch.c:13:0:
/oss/xen/xen/include/asm/mm.h:32:28: error: field ‘list’ has incomplete type
     struct page_list_entry list;
                            ^~~~
/oss/xen/xen/include/asm/mm.h:53:43: error: ‘MAX_ORDER’ undeclared here (not in a function); did you mean ‘PFN_ORDER’?
                 unsigned long first_dirty:MAX_ORDER + 1;
                                           ^~~~~~~~~
                                           PFN_ORDER
/oss/xen/xen/include/asm/mm.h:53:31: error: bit-field ‘first_dirty’ width not an integer constant
                 unsigned long first_dirty:MAX_ORDER + 1;
                               ^~~~~~~~~~~

This is happening because asm/mm.h is included directly by livepatch.c.
Yet it depends on xen/mm.h to be included first so MAX_ORDER is defined.

Resolve the build failure by including xen/mm.h rather than asm/mm.h.

Fixes: ced9795c6cb4 ("mm: split out mfn_t / gfn_t / pfn_t definitions and helpers")
Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/livepatch.c