kconfig: split CONFIG_SPARSE_MEM from fuzzing
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 7 Oct 2021 13:08:11 +0000 (15:08 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 14 Oct 2021 07:50:56 +0000 (09:50 +0200)
Pass CONFIG_FUZZ via host_kconfig, and use it to select the
sparse-mem device.

Cc: Alexander Oleinik <alxndr@bu.edu>
Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Alexander Bulekov <alxndr@bu.edu>
Message-Id: <20211007130829.632254-1-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Kconfig.host
hw/mem/Kconfig
hw/mem/meson.build
meson.build

index 24255ef4419ee78792bd652c600371df10f0c0a2..60b9c07b5eef6a543109d48180377638a1a66288 100644 (file)
@@ -41,3 +41,7 @@ config PVRDMA
 config MULTIPROCESS_ALLOWED
     bool
     imply MULTIPROCESS
+
+config FUZZ
+    bool
+    select SPARSE_MEM
index 8b19fdc49f1685fbf11dae22d8951131123f43ab..03dbb3c7df59459a532d2af78db61fe498b571b5 100644 (file)
@@ -8,3 +8,6 @@ config MEM_DEVICE
 config NVDIMM
     bool
     select MEM_DEVICE
+
+config SPARSE_MEM
+    bool
index 3c8fdef9f9e95af9625563bdba2de2f8901fbd6d..82f86d117e668bc86b978936b9021bdd39029ea2 100644 (file)
@@ -6,4 +6,4 @@ mem_ss.add(when: 'CONFIG_NVDIMM', if_true: files('nvdimm.c'))
 
 softmmu_ss.add_all(when: 'CONFIG_MEM_DEVICE', if_true: mem_ss)
 
-softmmu_ss.add(when: 'CONFIG_FUZZ', if_true: files('sparse-mem.c'))
+softmmu_ss.add(when: 'CONFIG_SPARSE_MEM', if_true: files('sparse-mem.c'))
index 0b9ebf9bfb034e3b7dcf3f9b76af119198eb956c..4a584760aac4f5399f771bf1583dda032a12e9a7 100644 (file)
@@ -1599,6 +1599,7 @@ endif
 
 have_ivshmem = config_host_data.get('CONFIG_EVENTFD')
 host_kconfig = \
+  ('CONFIG_FUZZ' in config_host ? ['CONFIG_FUZZ=y'] : []) + \
   ('CONFIG_TPM' in config_host ? ['CONFIG_TPM=y'] : []) + \
   ('CONFIG_SPICE' in config_host ? ['CONFIG_SPICE=y'] : []) + \
   (have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \