提交 12031a62 编写于 作者: Y Yinghai Lu 提交者: Thomas Gleixner

x86: mtrr cleanup for converting continuous to discrete - auto detect v4

Loop through mtrr chunk_size and gran_size from 1M to 2G to find out
the optimal value so user does not need to add mtrr_chunk_size and
mtrr_gran_size to the kernel command line.

If optimal value is not found, print out all list to help select less
optimal value.

Add mtrr_spare_reg_nr= so user could set 2 instead of 1, if the card
need more entries.

v2: find the one with more spare entries
v3: fix hole_basek offset
v4: tight the compare between range and range_new
    loop stop with 4g
Signed-off-by: NYinghai Lu <yhlu.kernel@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Gabriel C <nix.or.die@googlemail.com>
Cc: Mika Fischer <mika.fischer@zoopnet.de>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 f5098d62
...@@ -610,8 +610,17 @@ and is between 256 and 4096 characters. It is defined in the file ...@@ -610,8 +610,17 @@ and is between 256 and 4096 characters. It is defined in the file
that could hold holes aka. UC entries. that could hold holes aka. UC entries.
mtrr_gran_size=nn[KMG] [X86] mtrr_gran_size=nn[KMG] [X86]
used for mtrr cleanup. It is granity of mtrr block. Used for mtrr cleanup. It is granularity of mtrr block.
Big value could prevent small alignment use up MTRRs. Default is 1.
Large value could prevent small alignment from
using up MTRRs.
mtrr_spare_reg_nr=n [X86]
Format: <integer>
Range: 0,7 : spare reg number
Default : 1
Used for mtrr cleanup. It is spare mtrr entries number.
Set to 2 or more if your graphical card needs more.
disable_mtrr_trim [X86, Intel and AMD only] disable_mtrr_trim [X86, Intel and AMD only]
By default the kernel will trim any uncacheable By default the kernel will trim any uncacheable
......
...@@ -1117,6 +1117,15 @@ config MTRR_SANITIZER_ENABLE_DEFAULT ...@@ -1117,6 +1117,15 @@ config MTRR_SANITIZER_ENABLE_DEFAULT
help help
Enable mtrr cleanup default value Enable mtrr cleanup default value
config MTRR_SANITIZER_SPARE_REG_NR_DEFAULT
int "MTRR cleanup spare reg num (0-7)"
range 0 7
default "1"
depends on MTRR_SANITIZER
help
mtrr cleanup spare entries default, it can be changed via
mtrr_spare_reg_nr=
config X86_PAT config X86_PAT
bool bool
prompt "x86 PAT support" prompt "x86 PAT support"
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册