* [PATCH v4 3/7] arm64: Introduce a kernel configuration option for VA_BITS
@ 2014-04-29 4:59 Jungseok Lee
2014-04-29 14:45 ` Catalin Marinas
0 siblings, 1 reply; 3+ messages in thread
From: Jungseok Lee @ 2014-04-29 4:59 UTC (permalink / raw)
To: linux-arm-kernel, kvmarm, Catalin.Marinas, Marc Zyngier,
Christoffer Dall
Cc: linux-kernel, linux-samsung-soc, steve.capper, sungjinn.chung,
Arnd Bergmann, kgene.kim, ilho215.lee
This patch adds a kernel configuration for VA_BITS.
It helps to prevent unnecessary #ifdef statements insertions
for VA_BITS when implementing different page sizes and level of
translation tables.
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Steve Capper <steve.capper@linaro.org>
Signed-off-by: Jungseok Lee <jays.lee@samsung.com>
Reviewed-by: Sungjinn Chung <sungjinn.chung@samsung.com>
---
arch/arm64/Kconfig | 8 ++++++++
arch/arm64/include/asm/memory.h | 6 +-----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index c7f5d65..7b8d429 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -186,6 +186,14 @@ config ARM64_3_LEVELS
endchoice
+config ARM64_VA_BITS
+ int "Virtual address space size"
+ range 39 39 if ARM64_4K_PAGES && ARM64_3_LEVELS
+ range 42 42 if ARM64_64K_PAGES && ARM64_2_LEVELS
+ help
+ This feature is determined by a combination of page size and
+ level of translation tables.
+
config CPU_BIG_ENDIAN
bool "Build big-endian kernel"
help
diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h
index e94f945..f6e7480 100644
--- a/arch/arm64/include/asm/memory.h
+++ b/arch/arm64/include/asm/memory.h
@@ -41,11 +41,7 @@
* The module space lives between the addresses given by TASK_SIZE
* and PAGE_OFFSET - it must be within 128MB of the kernel text.
*/
-#ifdef CONFIG_ARM64_64K_PAGES
-#define VA_BITS (42)
-#else
-#define VA_BITS (39)
-#endif
+#define VA_BITS (CONFIG_ARM64_VA_BITS)
#define PAGE_OFFSET (UL(0xffffffffffffffff) << (VA_BITS - 1))
#define MODULES_END (PAGE_OFFSET)
#define MODULES_VADDR (MODULES_END - SZ_64M)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v4 3/7] arm64: Introduce a kernel configuration option for VA_BITS
2014-04-29 4:59 [PATCH v4 3/7] arm64: Introduce a kernel configuration option for VA_BITS Jungseok Lee
@ 2014-04-29 14:45 ` Catalin Marinas
2014-04-30 2:21 ` Jungseok Lee
0 siblings, 1 reply; 3+ messages in thread
From: Catalin Marinas @ 2014-04-29 14:45 UTC (permalink / raw)
To: Jungseok Lee
Cc: linux-arm-kernel@lists.infradead.org,
kvmarm@lists.cs.columbia.edu, Marc Zyngier, Christoffer Dall,
linux-kernel@vger.kernel.org, linux-samsung-soc,
steve.capper@linaro.org, sungjinn.chung@samsung.com,
Arnd Bergmann, kgene.kim@samsung.com, ilho215.lee@samsung.com
On Tue, Apr 29, 2014 at 05:59:23AM +0100, Jungseok Lee wrote:
> +config ARM64_VA_BITS
> + int "Virtual address space size"
> + range 39 39 if ARM64_4K_PAGES && ARM64_3_LEVELS
> + range 42 42 if ARM64_64K_PAGES && ARM64_2_LEVELS
> + help
> + This feature is determined by a combination of page size and
> + level of translation tables.
OK, so you are doing the VA bits selection already. But see my other
email about setting only exposing this and hiding the number of levels
(though number of levels can be mentioned in the help).
--
Catalin
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v4 3/7] arm64: Introduce a kernel configuration option for VA_BITS
2014-04-29 14:45 ` Catalin Marinas
@ 2014-04-30 2:21 ` Jungseok Lee
0 siblings, 0 replies; 3+ messages in thread
From: Jungseok Lee @ 2014-04-30 2:21 UTC (permalink / raw)
To: 'Catalin Marinas'
Cc: linux-arm-kernel, kvmarm, 'Marc Zyngier',
'Christoffer Dall', linux-kernel,
'linux-samsung-soc', steve.capper, sungjinn.chung,
'Arnd Bergmann', kgene.kim, ilho215.lee
On Tuesday, April 29, 2014 11:45 PM, Catalin Marinas wrote:
> On Tue, Apr 29, 2014 at 05:59:23AM +0100, Jungseok Lee wrote:
> > +config ARM64_VA_BITS
> > + int "Virtual address space size"
> > + range 39 39 if ARM64_4K_PAGES && ARM64_3_LEVELS
> > + range 42 42 if ARM64_64K_PAGES && ARM64_2_LEVELS
> > + help
> > + This feature is determined by a combination of page size and
> > + level of translation tables.
>
> OK, so you are doing the VA bits selection already. But see my other
> email about setting only exposing this and hiding the number of levels
> (though number of levels can be mentioned in the help).
Okay. I will hide the number of levels.
Best Regards
Jungseok Lee
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-04-30 2:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-29 4:59 [PATCH v4 3/7] arm64: Introduce a kernel configuration option for VA_BITS Jungseok Lee
2014-04-29 14:45 ` Catalin Marinas
2014-04-30 2:21 ` Jungseok Lee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox