1

I am updating a config when upgrade my kernel version. I want a minimum change to the config file so that code reviewers don't take much time.

There is a Kconfig entry as following for RETPOLINE:

config RETPOLINE
        bool "Avoid speculative indirect branches in kernel"
        default y
        ---help---
          Compile kernel with the retpoline compiler options to guard against
          kernel-to-user data leaks by avoiding speculative indirect
          branches. Requires a compiler with -mindirect-branch=thunk-extern
          support for full protection. The kernel may run slower.

          Without compiler support, at least indirect branches in assembler
          code are eliminated. Since this includes the syscall entry path,
          it is not entirely pointless.

And I noticed I have to add following into config file to avoid user prompt when running "make":

diff --git a/config b/config
index 96de254..15a0978 100644
--- a/config
+++ b/config
@@ -370,6 +370,7 @@ CONFIG_X86_X2APIC=y
 CONFIG_X86_MPPARSE=y
 # CONFIG_GOLDFISH is not set
 # CONFIG_INTEL_RDT is not set
+# CONFIG_RETPOLINE is not set
 # CONFIG_X86_EXTENDED_PLATFORM is not set
 # CONFIG_X86_INTEL_LPSS is not set
 # CONFIG_X86_AMD_PLATFORM_DEVICE is not set

The user prompt (I am trying to avoid) is:

$ vi .config
No mapping found
Press ENTER or type command to continue
[ali@simonLocalRHEL7 kernel-4.9]$ make
scripts/kconfig/conf  --silentoldconfig Kconfig
*
* Restart config...
*
*
* IO Schedulers
*
Deadline I/O scheduler (IOSCHED_DEADLINE) [Y/n/?] y
CFQ I/O scheduler (IOSCHED_CFQ) [Y/n/?] y
Default I/O scheduler
> 1. Deadline (DEFAULT_DEADLINE)
  2. CFQ (DEFAULT_CFQ)
  3. No-op (DEFAULT_NOOP)
choice[1-3?]: 1
Kyber I/O scheduler (MQ_IOSCHED_KYBER) [N/y/?] n
Default single-queue blk-mq I/O scheduler
> 1. None (DEFAULT_SQ_NONE) (NEW)
choice[1]: 1
Default multi-queue blk-mq I/O scheduler
> 1. None (DEFAULT_MQ_NONE) (NEW)
choice[1]: 1
*
* Processor type and features
*
DMA memory allocation support (ZONE_DMA) [Y/n/?] y
Symmetric multi-processing support (SMP) [Y/n/?] y
Support x2apic (X86_X2APIC) [Y/n/?] y
Enable MPS table (X86_MPPARSE) [Y/n/?] y
Intel Resource Director Technology support (INTEL_RDT) [N/y/?] n
Avoid speculative indirect branches in kernel (RETPOLINE) [Y/n/?] (NEW)

My question is what is the rule behind to avoid user prompt when typing "make"? (Sorry I didn't figure out in the Kconfig syntax.)

artless noise
  • 21,212
  • 6
  • 68
  • 105
Simon Guo
  • 11
  • 1
  • *"When will “make” prompt for user selection of Kconfig options when compiling linux kernel?"* -- When you use an *old* **.config** file from a different kernel version. *"My question is what is the rule behind to avoid user prompt when typing "make"?"* -- Answer all the new questions, and then save the new configuration. – sawdust Sep 18 '18 at 22:42
  • I understand saving the new config will eliminate the user prompt when make. But my question is what is the rule behind in Kconfig syntax to prompt user input (for example retpoline entry)? And why "# CONFIG_RETPOLINE is not set" should be added to .config to avoid user input prompt. – Simon Guo Sep 19 '18 at 01:35

0 Answers0