Skip to contentSkip to conversation

hw/mem/Kconfig: NVDIMM device requires CONFIG_MEM_DEVICE

RFC PATCH Applied Philippe Mathieu-Daudé 4 participants 4 messages Oct 15, 2019 – Oct 21, 2019

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 hw/mem/Kconfig: NVDIMM device requires CONFIG_MEM_DEVICE

When selecting only the NVDIMM device with "NVDIMM y", the device is not compiled/linked because it does not select MEM_DEVICE and hw/mem/Makefile.objs is not included:

  $ git grep mem/ hw/Makefile.objs
  hw/Makefile.objs:39:devices-dirs-$(CONFIG_MEM_DEVICE) += mem/

Let NVDIMM config select MEM_DEVICE.

---
I'm not sure this is the best fix, maybe we should simply include mem/ regardless of CONFIG_MEM_DEVICE (all mem devices use it).

---
 hw/mem/Kconfig | 1 +
 1 file changed, 1 insertion(+)
hw/mem/Kconfig +1 -0
index 620fd4cb59..5da724d7a2 100644
@@ -7,5 +7,6 @@ config MEM_DEVICE
 
 config NVDIMM
     bool
+    select MEM_DEVICE
     default y
     depends on PC
Signature · 1 line
2.21.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 22 lines · Philippe Mathieu-Daudé

When selecting only the NVDIMM device with "NVDIMM y", the device is not compiled/linked because it does not select MEM_DEVICE and hw/mem/Makefile.objs is not included:

  $ git grep mem/ hw/Makefile.objs
  hw/Makefile.objs:39:devices-dirs-$(CONFIG_MEM_DEVICE) += mem/

Let NVDIMM config select MEM_DEVICE.

---
I'm not sure this is the best fix, maybe we should simply include mem/ regardless of CONFIG_MEM_DEVICE (all mem devices use it).

---
 hw/mem/Kconfig | 1 +
 1 file changed, 1 insertion(+)
hw/mem/Kconfig +0 -0
index 620fd4cb59..5da724d7a2 100644

hw/mem/Kconfig config MEM_DEVICE · line 12

Quoted 6 lines
hw/mem/Kconfig +1 -0
@@ -7,5 +7,6 @@ config MEM_DEVICE
 
 config NVDIMM
     bool
+    select MEM_DEVICE
     default y
     depends on PC

Looks reasonable to me.

#2 lore raw
In reply to Philippe Mathieu-Daudé

Le 15/10/2019 à 18:46, Philippe Mathieu-Daudé a écrit :

Quoted 23 lines

When selecting only the NVDIMM device with "NVDIMM y", the device is not compiled/linked because it does not select MEM_DEVICE and hw/mem/Makefile.objs is not included:

  $ git grep mem/ hw/Makefile.objs
  hw/Makefile.objs:39:devices-dirs-$(CONFIG_MEM_DEVICE) += mem/

Let NVDIMM config select MEM_DEVICE.

---
I'm not sure this is the best fix, maybe we should simply include mem/ regardless of CONFIG_MEM_DEVICE (all mem devices use it).

---
 hw/mem/Kconfig | 1 +
 1 file changed, 1 insertion(+)
hw/mem/Kconfig +0 -0
index 620fd4cb59..5da724d7a2 100644

hw/mem/Kconfig config MEM_DEVICE · line 12

Quoted 6 lines
hw/mem/Kconfig +1 -0
@@ -7,5 +7,6 @@ config MEM_DEVICE
 
 config NVDIMM
     bool
+    select MEM_DEVICE
     default y
     depends on PC

Applied to my trivial-patches branch.

Thanks,
Laurent

#3 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 23 lines · Philippe Mathieu-Daudé

When selecting only the NVDIMM device with "NVDIMM y", the device is not compiled/linked because it does not select MEM_DEVICE and hw/mem/Makefile.objs is not included:

  $ git grep mem/ hw/Makefile.objs
  hw/Makefile.objs:39:devices-dirs-$(CONFIG_MEM_DEVICE) += mem/

Let NVDIMM config select MEM_DEVICE.

---
I'm not sure this is the best fix, maybe we should simply include mem/ regardless of CONFIG_MEM_DEVICE (all mem devices use it).

---
 hw/mem/Kconfig | 1 +
 1 file changed, 1 insertion(+)
hw/mem/Kconfig +0 -0
index 620fd4cb59..5da724d7a2 100644

hw/mem/Kconfig config MEM_DEVICE · line 12

Quoted 6 lines
hw/mem/Kconfig +1 -0
@@ -7,5 +7,6 @@ config MEM_DEVICE
 
 config NVDIMM
     bool
+    select MEM_DEVICE
     default y
     depends on PC

Queued, thanks. As a follow-up, hw/mem/memory-device.c can be common-obj-y.

Paolo