[PATCH] cxl/vendor: update niagara to only build on linux, add KConfig options

Gregory Price posted 1 patch 7 months, 1 week ago
Failed in applying to current master (apply log)
There is a newer version of this series
hw/cxl/Kconfig                    | 2 ++
hw/cxl/vendor/Kconfig             | 1 +
hw/cxl/vendor/skhynix/Kconfig     | 4 ++++
hw/cxl/vendor/skhynix/meson.build | 4 +++-
4 files changed, 10 insertions(+), 1 deletion(-)
create mode 100644 hw/cxl/vendor/Kconfig
create mode 100644 hw/cxl/vendor/skhynix/Kconfig
[PATCH] cxl/vendor: update niagara to only build on linux, add KConfig options
Posted by Gregory Price 7 months, 1 week ago
Niagara uses <sys/shm.h> which presently limits its compatibility to
linux hosts.  Change build to only build it on linux.

Add Kconfig file for skhynix directory, and make niagara depend on
CXL_MEM_DEVICE.  Add an explicit flag for niagara.

Signed-off-by: Gregory Price <gregory.price@memverge.com>
---
 hw/cxl/Kconfig                    | 2 ++
 hw/cxl/vendor/Kconfig             | 1 +
 hw/cxl/vendor/skhynix/Kconfig     | 4 ++++
 hw/cxl/vendor/skhynix/meson.build | 4 +++-
 4 files changed, 10 insertions(+), 1 deletion(-)
 create mode 100644 hw/cxl/vendor/Kconfig
 create mode 100644 hw/cxl/vendor/skhynix/Kconfig

diff --git a/hw/cxl/Kconfig b/hw/cxl/Kconfig
index dd6c54b54d..88022008c7 100644
--- a/hw/cxl/Kconfig
+++ b/hw/cxl/Kconfig
@@ -1,3 +1,5 @@
+source vendor/Kconfig
+
 config CXL
     bool
     default y if PCI_EXPRESS
diff --git a/hw/cxl/vendor/Kconfig b/hw/cxl/vendor/Kconfig
new file mode 100644
index 0000000000..aa23bb051b
--- /dev/null
+++ b/hw/cxl/vendor/Kconfig
@@ -0,0 +1 @@
+source skhynix/Kconfig
diff --git a/hw/cxl/vendor/skhynix/Kconfig b/hw/cxl/vendor/skhynix/Kconfig
new file mode 100644
index 0000000000..382fa0cd6c
--- /dev/null
+++ b/hw/cxl/vendor/skhynix/Kconfig
@@ -0,0 +1,4 @@
+config CXL_SKHYNIX_NIAGARA
+    bool
+    depends on CXL_MEM_DEVICE
+    default y if CXL_VENDOR
diff --git a/hw/cxl/vendor/skhynix/meson.build b/hw/cxl/vendor/skhynix/meson.build
index 4e57db65f1..6f194aa517 100644
--- a/hw/cxl/vendor/skhynix/meson.build
+++ b/hw/cxl/vendor/skhynix/meson.build
@@ -1 +1,3 @@
-system_ss.add(when: 'CONFIG_CXL_VENDOR', if_true: files('skhynix_niagara.c',))
+if targetos == 'linux'
+    system_ss.add(when: 'CONFIG_CXL_SKHYNIX_NIAGARA', if_true: files('skhynix_niagara.c',))
+endif
-- 
2.39.1
Re: [PATCH] cxl/vendor: update niagara to only build on linux, add KConfig options
Posted by Philippe Mathieu-Daudé 7 months, 1 week ago
Hi Gregory,

On 20/9/23 17:50, Gregory Price wrote:
> Niagara uses <sys/shm.h> which presently limits its compatibility to
> linux hosts.  Change build to only build it on linux.
> 
> Add Kconfig file for skhynix directory, and make niagara depend on
> CXL_MEM_DEVICE.  Add an explicit flag for niagara.
> 
> Signed-off-by: Gregory Price <gregory.price@memverge.com>
> ---
>   hw/cxl/Kconfig                    | 2 ++
>   hw/cxl/vendor/Kconfig             | 1 +
>   hw/cxl/vendor/skhynix/Kconfig     | 4 ++++
>   hw/cxl/vendor/skhynix/meson.build | 4 +++-
>   4 files changed, 10 insertions(+), 1 deletion(-)
>   create mode 100644 hw/cxl/vendor/Kconfig
>   create mode 100644 hw/cxl/vendor/skhynix/Kconfig


> diff --git a/hw/cxl/vendor/skhynix/Kconfig b/hw/cxl/vendor/skhynix/Kconfig
> new file mode 100644
> index 0000000000..382fa0cd6c
> --- /dev/null
> +++ b/hw/cxl/vendor/skhynix/Kconfig
> @@ -0,0 +1,4 @@
> +config CXL_SKHYNIX_NIAGARA
> +    bool
> +    depends on CXL_MEM_DEVICE

You want:

        depends on CXL_MEM_DEVICE && LINUX

> +    default y if CXL_VENDOR
> diff --git a/hw/cxl/vendor/skhynix/meson.build b/hw/cxl/vendor/skhynix/meson.build
> index 4e57db65f1..6f194aa517 100644
> --- a/hw/cxl/vendor/skhynix/meson.build
> +++ b/hw/cxl/vendor/skhynix/meson.build
> @@ -1 +1,3 @@
> -system_ss.add(when: 'CONFIG_CXL_VENDOR', if_true: files('skhynix_niagara.c',))
> +if targetos == 'linux'

(Then this check is not necessary).

> +    system_ss.add(when: 'CONFIG_CXL_SKHYNIX_NIAGARA', if_true: files('skhynix_niagara.c',))
> +endif