Skip to content

Conversation

kilobyte
Copy link
Contributor

With current userspace kernel headers, the build fails:

/<>/src/os/linux/lnx_system.c: In function ‘get_supported_block_sizes’:
/<>/src/os/linux/lnx_system.c:336:52: error: ‘ND_DEVICE_NAMESPACE_BLK’ undeclared (first use in this function); did you mean ‘ND_DEVICE_NAMESPACE_IO’?
336 | (nstype == ND_DEVICE_NAMESPACE_BLK))
| ^~~~~~~~~~~~~~~~~~~~~~~
| ND_DEVICE_NAMESPACE_IO
compilation terminated due to -Wfatal-errors.
make[3]: *** [CMakeFiles/ipmctl_os_interface.dir/build.make:149: CMakeFiles/ipmctl_os_interface.dir/src/os/linux/lnx_system.c.o] Error 1

As block sizes we fetch have never been used for anything, let's just drop the query.

Quoting Linux commit f8669f1d6a86a6b17104ceca9340ded280307ac1:

> Block Aperture Window support was an attempt to layer an error model
> over PMEM for platforms that did not support machine-check-recovery.
> However, it was abandoned before it ever shipped, and only ever existed
> in the ACPI specification. Meanwhile Linux has carried a large pile of
> dead code for non-shipping infrastructure. [...]

We fetched block sizes but never used that info for anything.  Now that
the required defines have been dropped in kernel 5.18, let's purge that
code.

Signed-off-by: Adam Borowski <adam.borowski@intel.com>
@StevenPontsler
Copy link
Contributor

Thanks, we will take a look.

@kilobyte
Copy link
Contributor Author

Here's the original report, BTW.

@StevenPontsler
Copy link
Contributor

The name ND_DEVICE_NAMESPACE_BLK is defined in ndctl.h as is ND_DEVICE_NAMESPACE_IO.

Looking at the report linked to it appears like the file should be coming from one of these packages

Get:87 http://127.0.0.1:12990/debian sid/main amd64 libndctl6 amd64 73-2 [61.8 kB]
Get:88 http://127.0.0.1:12990/debian sid/main amd64 libndctl-dev amd64 73-2 [12.3 kB]

which I believe is
https://packages.debian.org/source/sid/ndctl

looking in http://deb.debian.org/debian/pool/main/n/ndctl/ndctl_73.orig.tar.gz it appears like ND_DEVICE_NAMESPACE_BLK is defined

So I think the code as exists should compile. I am missing something?

@kilobyte
Copy link
Contributor Author

The define comes from #include <linux/ndctl.h> rather than ndctl/ndctl.h. The former is shipped by linux-libc-dev which already deleted it, rather than by ndctl which had no release that corresponds to 5.18 kernel yet.

But even if ndctl/ndctl.h keeps the historic define, the values queries have never been actually used by ipmctl.

@nolanhergert
Copy link
Contributor

You are correct, we don't expose the values to any external API. Making your change as well as some other sections. It'll take a while, since we need to start the change internally. Thanks!

@kilobyte
Copy link
Contributor Author

I'll use my patch as-is for Debian packaging then (as maintainers get shouted a lot for "does not build" bugs), you can take your time.

doanac pushed a commit to lmp-mirrors/meta-intel that referenced this pull request Aug 10, 2022
OE-core has updated kernel headers to 5.19 and that is resulting in
failures:

| /build/cje/workspace/poky/build/tmp/work/corei7-64-poky-linux/ipmctl/03.00.00.0439-r0/git/src/os/linux/lnx_system.c:336:52: error: 'ND_DEVICE_NAMESPACE_BLK' undeclared (first use in this function); did you mean 'ND_DEVICE_NAMESPACE_IO'?
|   336 |                                         (nstype == ND_DEVICE_NAMESPACE_BLK))
|       |                                                    ^~~~~~~~~~~~~~~~~~~~~~~
|       |                                                    ND_DEVICE_NAMESPACE_IO
| compilation terminated due to -Wfatal-errors.

For more details:

intel/ipmctl#194

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
@vynu
Copy link

vynu commented Nov 28, 2023

Hello, is this issue going to be fixed any time soon ??

@mikolajkolakowski
Copy link
Contributor

mikolajkolakowski commented Nov 30, 2023

@vynu , we are not planning to spin new version of ipmctl at this time.
What is the rationale for this change to be released?

@kilobyte
Copy link
Contributor Author

Every downstream project that builds ipmctl from source needs to apply the patch.

For some projects, applying patches is a routine matter, for others it requires tedious manual hacks. But in every case, it's unnecessary work that's multiplied for every downstream.

@nolanhergert nolanhergert merged commit 16a0525 into intel:master_3_0 Dec 5, 2023
@nolanhergert
Copy link
Contributor

Done, thanks @kilobyte! Let me know if there is another step I should do.

daregit pushed a commit to daregit/yocto-combined that referenced this pull request May 22, 2024
OE-core has updated kernel headers to 5.19 and that is resulting in
failures:

| /build/cje/workspace/poky/build/tmp/work/corei7-64-poky-linux/ipmctl/03.00.00.0439-r0/git/src/os/linux/lnx_system.c:336:52: error: 'ND_DEVICE_NAMESPACE_BLK' undeclared (first use in this function); did you mean 'ND_DEVICE_NAMESPACE_IO'?
|   336 |                                         (nstype == ND_DEVICE_NAMESPACE_BLK))
|       |                                                    ^~~~~~~~~~~~~~~~~~~~~~~
|       |                                                    ND_DEVICE_NAMESPACE_IO
| compilation terminated due to -Wfatal-errors.

For more details:

intel/ipmctl#194

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
daregit pushed a commit to daregit/yocto-combined that referenced this pull request May 22, 2024
OE-core has updated kernel headers to 5.19 and that is resulting in
failures:

| /build/cje/workspace/poky/build/tmp/work/corei7-64-poky-linux/ipmctl/03.00.00.0439-r0/git/src/os/linux/lnx_system.c:336:52: error: 'ND_DEVICE_NAMESPACE_BLK' undeclared (first use in this function); did you mean 'ND_DEVICE_NAMESPACE_IO'?
|   336 |                                         (nstype == ND_DEVICE_NAMESPACE_BLK))
|       |                                                    ^~~~~~~~~~~~~~~~~~~~~~~
|       |                                                    ND_DEVICE_NAMESPACE_IO
| compilation terminated due to -Wfatal-errors.

For more details:

intel/ipmctl#194

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants