Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s390x: fix building with latest Linux kernel #2232

Conversation

adrianreber
Copy link
Member

Building on the latest Linux kernel (6.5-rc1) fails with:

In file included from compel/include/uapi/compel/asm/infect-types.h:7,
                 from compel/arch/s390/src/lib/infect.c:12:
compel/arch/s390/src/lib/infect.c: In function 'rewind_psw': compel/arch/s390/src/lib/infect.c:157:29: error: 'UL' undeclared (first use in this function)
  157 |         mask = (psw->mask & PSW_MASK_EA) ? -1UL : (psw->mask & PSW_MASK_BA) ? (1UL << 31) - 1 : (1UL << 24) - 1;
      |                             ^~~~~~~~~~~
compel/arch/s390/src/lib/infect.c:157:29: note: each undeclared identifier is reported only once for each function it appears in
compel/arch/s390/src/lib/infect.c: In function 'get_ri_cb':
compel/arch/s390/src/lib/infect.c:272:25: error: 'UL' undeclared (first use in this function)
  272 |         if (psw->mask & PSW_MASK_RI)
      |                         ^~~~~~~~~~~
compel/arch/s390/src/lib/infect.c: In function 's390_disable_ri_bit':
compel/arch/s390/src/lib/infect.c:289:23: error: 'UL' undeclared (first use in this function)
  289 |         psw->mask &= ~PSW_MASK_RI;
      |                       ^~~~~~~~~~~
compel/arch/s390/src/lib/infect.c: In function 'arch_can_dump_task':
compel/arch/s390/src/lib/infect.c:523:25: error: 'UL' undeclared (first use in this function)
  523 |         if (psw->mask & PSW_MASK_RI) {
      |

This is caused by:

torvalds/linux@b8af599

This is fixed with this patch.

Building on the latest Linux kernel (6.5-rc1) fails with:

In file included from compel/include/uapi/compel/asm/infect-types.h:7,
                 from compel/arch/s390/src/lib/infect.c:12:
compel/arch/s390/src/lib/infect.c: In function 'rewind_psw':
compel/arch/s390/src/lib/infect.c:157:29: error: 'UL' undeclared (first use in this function)
  157 |         mask = (psw->mask & PSW_MASK_EA) ? -1UL : (psw->mask & PSW_MASK_BA) ? (1UL << 31) - 1 : (1UL << 24) - 1;
      |                             ^~~~~~~~~~~
compel/arch/s390/src/lib/infect.c:157:29: note: each undeclared identifier is reported only once for each function it appears in
compel/arch/s390/src/lib/infect.c: In function 'get_ri_cb':
compel/arch/s390/src/lib/infect.c:272:25: error: 'UL' undeclared (first use in this function)
  272 |         if (psw->mask & PSW_MASK_RI)
      |                         ^~~~~~~~~~~
compel/arch/s390/src/lib/infect.c: In function 's390_disable_ri_bit':
compel/arch/s390/src/lib/infect.c:289:23: error: 'UL' undeclared (first use in this function)
  289 |         psw->mask &= ~PSW_MASK_RI;
      |                       ^~~~~~~~~~~
compel/arch/s390/src/lib/infect.c: In function 'arch_can_dump_task':
compel/arch/s390/src/lib/infect.c:523:25: error: 'UL' undeclared (first use in this function)
  523 |         if (psw->mask & PSW_MASK_RI) {
      |

This is caused by:

torvalds/linux@b8af599

This is fixed with this patch.

Signed-off-by: Adrian Reber <areber@redhat.com>
Copy link

@yselkowitz yselkowitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While IMO it would be best to add the missing #include <linux/const.h> to the s390 asm/ptrace.h in the kernel headers themselves, these includes should probably be where #include <asm/ptrace.h> is stated.

@@ -9,6 +9,7 @@
#include <errno.h>
#include <elf.h>
#include <compel/plugins/std/syscall-codes.h>
#include <linux/const.h>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be in compel/arch/s390/src/lib/include/uapi/asm/infect-types.h which contains the #include <asm/ptrace.h>?

@@ -4,6 +4,7 @@
#include <sys/user.h>
#include <asm/unistd.h>
#include <sys/uio.h>
#include <linux/const.h>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't criu/arch/s390/include/asm/restorer.h which contains the #include <asm/ptrace.h> be a better place for this?

@adrianreber
Copy link
Member Author

I also reached out to the original authors of that kernel change.

@adrianreber
Copy link
Member Author

https://lore.kernel.org/all/20230731183926.330932-1-hca@linux.ibm.com/

@adrianreber
Copy link
Member Author

It seems the kernel fix will make it into rc5. No need to fix it in CRIU then I think.

akiyks pushed a commit to akiyks/linux that referenced this pull request Aug 2, 2023
Adrian Reber reported the following CRIU build bug after
commit b8af599 ("s390/ptrace: make all psw related
defines also available for asm"):

compel/arch/s390/src/lib/infect.c: In function 'arch_can_dump_task':
compel/arch/s390/src/lib/infect.c:523:25: error: 'UL' undeclared (first use in this function)
  523 |         if (psw->mask & PSW_MASK_RI) {
      |                         ^~~~~~~~~~~

Add the missing linux/const.h include to fix this.

Reported-by: Adrian Reber <areber@redhat.com>
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2225745
Link: checkpoint-restore/criu#2232
Tested-by: Adrian Reber <areber@redhat.com>
Fixes: b8af599 ("s390/ptrace: make all psw related defines also available for asm")
Link: https://lore.kernel.org/r/20230731183926.330932-1-hca@linux.ibm.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
LegoLivesMatter pushed a commit to LegoLivesMatter/linux that referenced this pull request Aug 5, 2023
Adrian Reber reported the following CRIU build bug after
commit b8af599 ("s390/ptrace: make all psw related
defines also available for asm"):

compel/arch/s390/src/lib/infect.c: In function 'arch_can_dump_task':
compel/arch/s390/src/lib/infect.c:523:25: error: 'UL' undeclared (first use in this function)
  523 |         if (psw->mask & PSW_MASK_RI) {
      |                         ^~~~~~~~~~~

Add the missing linux/const.h include to fix this.

Reported-by: Adrian Reber <areber@redhat.com>
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2225745
Link: checkpoint-restore/criu#2232
Tested-by: Adrian Reber <areber@redhat.com>
Fixes: b8af599 ("s390/ptrace: make all psw related defines also available for asm")
Link: https://lore.kernel.org/r/20230731183926.330932-1-hca@linux.ibm.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
@yselkowitz
Copy link

If the fix has landed in a 6.5 RC then I think this can be closed.

@github-actions
Copy link

github-actions bot commented Sep 9, 2023

A friendly reminder that this PR had no activity for 30 days.

@adrianreber adrianreber deleted the 2023-07-31-s390x-AC branch September 10, 2023 20:42
@adrianreber
Copy link
Member Author

Closed as it was fixed in the kernel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants