kernel_config_fragment 5.7 KB

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