On 2015/06/27 11:23, Xishi Qiu wrote:
This patch introduces a new config called "CONFIG_ACPI_MIRROR_MEMORY", set it
                                             CONFIG_MEMORY_MIRROR
off by default.

Signed-off-by: Xishi Qiu <qiuxi...@huawei.com>
---
  mm/Kconfig | 8 ++++++++
  1 file changed, 8 insertions(+)

diff --git a/mm/Kconfig b/mm/Kconfig
index 390214d..c40bb8b 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -200,6 +200,14 @@ config MEMORY_HOTREMOVE
        depends on MEMORY_HOTPLUG && ARCH_ENABLE_MEMORY_HOTREMOVE
        depends on MIGRATION

+config MEMORY_MIRROR

  In following patches, you use CONFIG_MEMORY_MIRROR.

I think the name is too generic besides it's depends on ACPI.
But I'm not sure address based memory mirror is planned in other platform.

So, hmm. How about dividing the config into 2 parts like attached ? (just an 
example)

Thanks,
-Kame
>From 88213b0f76e2f603c5a38690cbd85a4df1e646ba Mon Sep 17 00:00:00 2001
From: KAMEZAWA Hiroyuki <kamezawa.hir...@jp.fujitsu.com>
Date: Mon, 29 Jun 2015 15:35:47 +0900
Subject: [PATCH] add a new config option for memory mirror

Add a new config option "CONFIG_MEMORY_MIRROR" for kernel assisted
memory mirroring.

In UEFI2.5 spec, Address based memory mirror is defined and it allows
the system to create partial memory mirror.

The feature guards important(kernel) memory to be mirrored by using
the address based memory mirror.

Now this depends on cpu architecure Haswell? Broadwell?
---
 arch/x86/Kconfig | 6 ++++++
 mm/Kconfig       | 9 +++++++++
 2 files changed, 15 insertions(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index e33e01b..56f17df 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -596,6 +596,12 @@ config X86_SUPPORTS_MEMORY_FAILURE
        depends on X86_64 || !SPARSEMEM
        select ARCH_SUPPORTS_MEMORY_FAILURE
 
+config X86_SUPPORTS_MEMORY_MIRROR
+       def_bool y
+       # UEFI 2.5spec. address based memory mirror, supported only after XXX
+       depends on X86_64 && ARCH_SUPPORTS_MEMORY_FAILURE
+       select ARCH_MEMORY_MIRROR
+
 config STA2X11
        bool "STA2X11 Companion Chip Support"
        depends on X86_32_NON_STANDARD && PCI
diff --git a/mm/Kconfig b/mm/Kconfig
index b3a60ee..e14dc2d 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -200,6 +200,15 @@ config MEMORY_HOTREMOVE
        depends on MEMORY_HOTPLUG && ARCH_ENABLE_MEMORY_HOTREMOVE
        depends on MIGRATION
 
+config MEMORY_MIRROR
+       bool "Address range mirroring support"
+       depends on ARCH_MEMORY_MIRROR
+       default n
+       help
+         This feature allows the kernel to assist address based memory
+         mirror supported by architecture/firmware. And place some types
+          of memory (especially, kernel memory) placed into mirrored range.
+
 #
 # If we have space for more page flags then we can enable additional
 # optimizations and functionality.
-- 
1.9.3

Reply via email to