kernel_config_fragment 5.8 KB

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