Re: [Xen-devel] [PATCH v6] xen/grant-table: Avoid m2p_override duringmapping
From: Stefano Stabellini
Date: Mon Feb 03 2014 - 06:13:54 EST
On Mon, 3 Feb 2014, David Vrabel wrote:
> On 02/02/14 18:52, Zoltan Kiss wrote:
> > On 02/02/14 11:29, Julien Grall wrote:
> >> Hello,
> >>
> >> This patch is breaking Linux compilation on ARM:
> >>
> >> drivers/xen/grant-table.c: In function â__gnttab_map_refsâ:
> >> drivers/xen/grant-table.c:989:3: error: implicit declaration of
> >> function âFOREIGN_FRAMEâ [-Werror=implicit-function-declaration]
> >> if (unlikely(!set_phys_to_machine(pfn, FOREIGN_FRAME(mfn)))) {
> >> ^
> >> drivers/xen/grant-table.c: In function â__gnttab_unmap_refsâ:
> >> drivers/xen/grant-table.c:1054:3: error: implicit declaration of
> >> function âget_phys_to_machineâ [-Werror=implicit-function-declaration]
> >> mfn = get_phys_to_machine(pfn);
> >> ^
> >> drivers/xen/grant-table.c:1055:43: error: âFOREIGN_FRAME_BITâ
> >> undeclared (first use in this function)
> >> if (mfn == INVALID_P2M_ENTRY || !(mfn & FOREIGN_FRAME_BIT)) {
> >> ^
> >> drivers/xen/grant-table.c:1055:43: note: each undeclared identifier is
> >> reported only once for each function it appears in
> >> drivers/xen/grant-table.c:1068:9: error: too many arguments to
> >> function âm2p_remove_overrideâ
> >> mfn);
> >> ^
> >> In file included from include/xen/page.h:4:0,
> >> from drivers/xen/grant-table.c:48:
> >> /local/home/julien/works/midway/linux/arch/arm/include/asm/xen/page.h:106:19:
> >> note: declared here
> >> static inline int m2p_remove_override(struct page *page, bool
> >> clear_pte)
> >> ^
> >> cc1: some warnings being treated as errors
> >
> > Hi,
> >
> > That's bad indeed. I think the best solution is to put those parts
> > behind an #ifdef x86. The ones moved from x86/p2m.c to grant-table.c.
> > David, Stefano, what do you think?
>
> I don't think we want (more) #ifdef CONFIG_X86 in grant-table.c and the
> arch-specific bits will have to factored out into their own functions
> with suitable stubs provided for ARM.
We certainly don't want more ifdefs like that.
> But, this patch went in late and it's clearly not ready. So I think it
> should be reverted and we should aim to get it sorted out for 3.15.
>
> Konrad/Stefano (if you agree) please revert
> 08ece5bb2312b4510b161a6ef6682f37f4eac8a1 and send a pull request.
Unfortunately I have to agree: fixing the prototype of
m2p_remove_override and replacing get_phys_to_machine with pfn_to_mfn is
easy.
However FOREIGN_FRAME is an x86-ism and I don't feel confortable with
adding yet another #define under arch/arm/xen just to deal with x86
stuff that spill on common code.
Sorry for not spotting this earlier.
> Konrad, I also think you should look at adding an ARM build to your test
> system (I thought you had this already).
Let's talk about how to set it up offline.