kernel_config_fragment 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. # Changes to this file are automatically trigger kernel reconfigures
  2. # even without using the linux-reconfigure target.
  3. CONFIG_MODULE_SRCVERSION_ALL=y
  4. # GDB debugging.
  5. CONFIG_DEBUG_FS=y
  6. CONFIG_DEBUG_INFO=y
  7. CONFIG_DEBUG_KERNEL=y
  8. CONFIG_GDB_SCRIPTS=y
  9. # Non-static variables show up on /proc/kallsyms
  10. # https://stackoverflow.com/questions/20196636/does-kallsyms-have-all-the-symbol-of-kernel-functions/44614878#44614878
  11. CONFIG_KALLSYMS_ALL=y
  12. # zcat /proc/config.gz
  13. CONFIG_IKCONFIG=y
  14. CONFIG_IKCONFIG_PROC=y
  15. # TODO make example.
  16. # This seems to allow userspace to create arbitrary configuration trees,
  17. # which kernel modules can then read and interpret.
  18. CONFIG_CONFIGFS_FS=y
  19. # KGDB
  20. CONFIG_CONSOLE_POLL=y
  21. CONFIG_KDB_CONTINUE_CATASTROPHIC=0
  22. CONFIG_KDB_DEFAULT_ENABLE=0x1
  23. CONFIG_KDB_KEYBOARD=y
  24. CONFIG_KGDB=y
  25. CONFIG_KGDB_KDB=y
  26. CONFIG_KGDB_LOW_LEVEL_TRAP=y
  27. CONFIG_KGDB_SERIAL_CONSOLE=y
  28. CONFIG_KGDB_TESTS=y
  29. CONFIG_KGDB_TESTS_ON_BOOT=n
  30. CONFIG_MAGIC_SYSRQ=y
  31. CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1
  32. CONFIG_SERIAL_KGDB_NMI=n
  33. # Module.symvers in kernel tree and modules tree contains CRC of signatures.
  34. # TODO: I think the CRC are stored in the built kernel and module, and checked
  35. # at insmod, but bgrep did not find it in kernel image.
  36. # Does not show in /proc/kallyms either.
  37. CONFIG_MODVERSIONS=y
  38. # ftrace
  39. CONFIG_DYNAMIC_FTRACE=y
  40. CONFIG_FTRACE=y
  41. CONFIG_FTRACE_SYSCALLS=y
  42. CONFIG_FUNCTION_GRAPH_TRACER=y
  43. CONFIG_FUNCTION_PROFILER=y
  44. CONFIG_FUNCTION_TRACER=y
  45. CONFIG_HWLAT_TRACER=y
  46. CONFIG_IRQSOFF_TRACER=y
  47. CONFIG_SCHED_TRACER=y
  48. CONFIG_STACK_TRACER=y
  49. CONFIG_TRACER_SNAPSHOT=y
  50. ## Networking
  51. # Will everything blow up?
  52. # https://superuser.com/questions/684005/how-does-one-permanently-disable-gnu-linux-networking/1255015#1255015
  53. #CONFIG_NET=n
  54. # If given, we can use QEMU 2.9.0 default x86 networking without any -net or -netdev options,
  55. # since E1000 is the default networking device as mentioned at:
  56. # https://en.wikibooks.org/w/index.php?title=QEMU/Networking&oldid=3268753
  57. CONFIG_E1000=y
  58. ## x86
  59. # https://stackoverflow.com/questions/20069620/print-kernels-page-table-entries
  60. # cat /sys/kernel/debug/kernel_page_tables
  61. CONFIG_X86_PTDUMP=y
  62. ## ARM
  63. # LEDs:
  64. #
  65. # cd /sys/class/leds/versatile:0
  66. # cat max_brightness
  67. # echo 255 >brightness
  68. #
  69. # https://raspberrypi.stackexchange.com/questions/697/how-do-i-control-the-system-leds-using-my-software
  70. #
  71. # Relevant QEMU files:
  72. #
  73. # - hw/arm/versatilepb.c
  74. # - hw/misc/arm_sysctl.c
  75. #
  76. # Relevant kernel files:
  77. #
  78. # - arch/arm/boot/dts/versatile-pb.dts
  79. # - drivers/leds/led-class.c
  80. # - drivers/leds/leds-sysctl.c
  81. #
  82. # Try hacking QEMU's `hw/misc/arm_sysctl.c` with a printf:
  83. #
  84. # static void arm_sysctl_write(void *opaque, hwaddr offset,
  85. # uint64_t val, unsigned size)
  86. # {
  87. # arm_sysctl_state *s = (arm_sysctl_state *)opaque;
  88. #
  89. # switch (offset) {
  90. # case 0x08: /* LED */
  91. # printf("LED val = %llx\n", (unsigned long long)val);
  92. #
  93. # to obeserve when the callback is made. But beware that one of the LEDs
  94. # has a heartbeat trigger by default (specified on dts), so it will produce a lot of output.
  95. CONFIG_LEDS_CLASS=y
  96. CONFIG_LEDS_CLASS_FLASH=y
  97. CONFIG_LEDS_SYSCON=y
  98. CONFIG_LEDS_TRIGGERS=y
  99. CONFIG_LEDS_TRIGGER_BACKLIGHT=y
  100. CONFIG_LEDS_TRIGGER_CPU=y
  101. CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
  102. CONFIG_LEDS_TRIGGER_GPIO=y
  103. CONFIG_LEDS_TRIGGER_HEARTBEAT=y
  104. CONFIG_LEDS_TRIGGER_ONESHOT=y
  105. CONFIG_LEDS_TRIGGER_TIMER=y
  106. CONFIG_NEW_LEDS=y
  107. # GPIO.
  108. CONFIG_ARM_AMBA=y
  109. CONFIG_GPIOLIB=y
  110. CONFIG_GPIO_SYSFS=y
  111. CONFIG_GPIO_PL061=y
  112. # In target:
  113. #
  114. # modprobe dummy-irq irq=34
  115. # insmod /platform_device.ko
  116. #
  117. # Outcome:
  118. #
  119. # lkmc_platform_device_write offset=0 value=12345678 size=4
  120. # dummy-irq: interrupt occurred on IRQ 34
  121. #
  122. # When the device generates an IRQ, the dummy module also snoops it.
  123. #
  124. # The IRQ number 34 was found by via dmesg on a previous "insmod /platform_device.ko".
  125. CONFIG_DUMMY_IRQ=m
  126. ## aarch64
  127. # For some reason not selected by default as it was for arm, and pci modules fail to build.
  128. # Not that we have PCI working on ARM anyways.
  129. CONFIG_PCI=y
  130. # Like CONFIG_X86_PTDUMP for ARM.
  131. CONFIG_ARM64_PTDUMP=y
  132. ## UIO
  133. # Userspace drivers: allow you to handle IRQs and do memory IO from userland through a /dev file.
  134. #
  135. # Superseded by the more featureful VFIO.
  136. #
  137. # Documentation/DocBook/uio-howto.tmpl contains actual userland examples
  138. # for the generic examples under drivers/uio
  139. #
  140. # UIO interface in a nutshell:
  141. #
  142. # - blocking read / poll: waits until interrupts
  143. # - write: call irqcontrol callback. Default: 0 or 1 to enable / disable interrupts.
  144. # - mmap: access device memory
  145. # All other UIO depend on this module.
  146. CONFIG_UIO=m
  147. # Generic platform devices.
  148. # https://yurovsky.github.io/2014/10/10/linux-uio-gpio-interrupt/
  149. CONFIG_UIO_DMEM_GENIRQ=m
  150. CONFIG_UIO_PDRV_GENIRQ=m
  151. # https://github.com/rumpkernel/wiki/wiki/Howto:-Accessing-PCI-devices-from-userspace
  152. # /sys/class/uio/
  153. # /sys/class/uio/uio0
  154. CONFIG_UIO_PCI_GENERIC=m