[Top] [All Lists]

[PATCH 4.9 05/44] MIPS: VDSO: avoid duplicate CAC_BASE definition

Subject: [PATCH 4.9 05/44] MIPS: VDSO: avoid duplicate CAC_BASE definition
From: Greg Kroah-Hartman <>
Date: Thu, 16 Mar 2017 23:29:30 +0900
Cc: Greg Kroah-Hartman <>,, Arnd Bergmann <>, Paul Burton <>,, Ralf Baechle <>
In-reply-to: <>
List-archive: <>
List-help: <>
List-id: linux-mips <>
List-owner: <>
List-post: <>
List-software: Ecartis version 1.0.0
List-subscribe: <>
List-unsubscribe: <>
Original-recipient: rfc822;
References: <>
User-agent: quilt/0.65
4.9-stable review patch.  If anyone has any objections, please let me know.


From: Arnd Bergmann <>

commit 1742ac265046f34223e06d5d283496f0291be259 upstream.

vdso.h includes <spaces.h> implicitly after defining CONFIG_32BITS.
This defeats the override in mach-ip27/spaces.h, leading to
a build error that shows up in

In file included from arch/mips/include/asm/mach-ip27/spaces.h:29:0,
                 from arch/mips/include/asm/page.h:12,
                 from arch/mips/vdso/vdso.h:26,
                 from arch/mips/vdso/gettimeofday.c:11:
arch/mips/include/asm/mach-generic/spaces.h:28:0: error: "CAC_BASE" redefined 
 #define CAC_BASE  _AC(0x80000000, UL)

An earlier patch tried to make the second definition conditional,
but that patch had the #ifdef in the wrong place, and would lead
to another warning:

arch/mips/include/asm/io.h: In function 'phys_to_virt':
arch/mips/include/asm/io.h:138:9: error: cast to pointer from integer of 
different size [-Werror=int-to-pointer-cast]

For all I can tell, there is no other reason than vdso32 to ever
include this file with CONFIG_32BITS set, and the vdso itself should
never refer to the base addresses as it is running in user space,
so adding an #ifdef here is safe.

Fixes: 3ffc17d8768b ("MIPS: Adjust MIPS64 CAC_BASE to reflect Config.K0")
Signed-off-by: Arnd Bergmann <>
Cc: Paul Burton <>
Signed-off-by: Ralf Baechle <>
Signed-off-by: Greg Kroah-Hartman <>

 arch/mips/include/asm/mach-ip27/spaces.h |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/arch/mips/include/asm/mach-ip27/spaces.h
+++ b/arch/mips/include/asm/mach-ip27/spaces.h
@@ -12,14 +12,16 @@
  * IP27 uses the R10000's uncached attribute feature.  Attribute 3 selects
- * uncached memory addressing.
+ * uncached memory addressing. Hide the definitions on 32-bit compilation
+ * of the compat-vdso code.
+#ifdef CONFIG_64BIT
 #define HSPEC_BASE             0x9000000000000000
 #define IO_BASE                        0x9200000000000000
 #define MSPEC_BASE             0x9400000000000000
 #define UNCAC_BASE             0x9600000000000000
 #define CAC_BASE               0xa800000000000000
 #define TO_MSPEC(x)            (MSPEC_BASE | ((x) & TO_PHYS_MASK))
 #define TO_HSPEC(x)            (HSPEC_BASE | ((x) & TO_PHYS_MASK))

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH 4.9 05/44] MIPS: VDSO: avoid duplicate CAC_BASE definition, Greg Kroah-Hartman <=