[RFC PATCH] hw/mem/Kconfig: NVDIMM device requires CONFIG_MEM_DEVICE

Philippe Mathieu-Daudé posted 1 patch 4 years, 6 months ago
Test asan passed
Test checkpatch passed
Test FreeBSD passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Test docker-quick@centos7 passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20191015164642.31069-1-philmd@redhat.com
Maintainers: Igor Mammedov <imammedo@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>
hw/mem/Kconfig | 1 +
1 file changed, 1 insertion(+)
[RFC PATCH] hw/mem/Kconfig: NVDIMM device requires CONFIG_MEM_DEVICE
Posted by Philippe Mathieu-Daudé 4 years, 6 months ago
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.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
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(+)

diff --git a/hw/mem/Kconfig b/hw/mem/Kconfig
index 620fd4cb59..5da724d7a2 100644
--- a/hw/mem/Kconfig
+++ b/hw/mem/Kconfig
@@ -7,5 +7,6 @@ config MEM_DEVICE
 
 config NVDIMM
     bool
+    select MEM_DEVICE
     default y
     depends on PC
-- 
2.21.0


Re: [RFC PATCH] hw/mem/Kconfig: NVDIMM device requires CONFIG_MEM_DEVICE
Posted by Paolo Bonzini 4 years, 6 months ago
On 15/10/19 18:46, Philippe Mathieu-Daudé wrote:
> 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.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> 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(+)
> 
> diff --git a/hw/mem/Kconfig b/hw/mem/Kconfig
> index 620fd4cb59..5da724d7a2 100644
> --- a/hw/mem/Kconfig
> +++ b/hw/mem/Kconfig
> @@ -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

Re: [RFC PATCH] hw/mem/Kconfig: NVDIMM device requires CONFIG_MEM_DEVICE
Posted by Laurent Vivier 4 years, 6 months ago
Le 15/10/2019 à 18:46, Philippe Mathieu-Daudé a écrit :
> 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.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> 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(+)
> 
> diff --git a/hw/mem/Kconfig b/hw/mem/Kconfig
> index 620fd4cb59..5da724d7a2 100644
> --- a/hw/mem/Kconfig
> +++ b/hw/mem/Kconfig
> @@ -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

Re: [RFC PATCH] hw/mem/Kconfig: NVDIMM device requires CONFIG_MEM_DEVICE
Posted by Thomas Huth 4 years, 6 months ago
On 15/10/2019 18.46, Philippe Mathieu-Daudé wrote:
> 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.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> 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(+)
> 
> diff --git a/hw/mem/Kconfig b/hw/mem/Kconfig
> index 620fd4cb59..5da724d7a2 100644
> --- a/hw/mem/Kconfig
> +++ b/hw/mem/Kconfig
> @@ -7,5 +7,6 @@ config MEM_DEVICE
>  
>  config NVDIMM
>      bool
> +    select MEM_DEVICE
>      default y
>      depends on PC

Looks reasonable to me.

Reviewed-by: Thomas Huth <thuth@redhat.com>