Re: [OS-BUILD PATCH] redhat: ignore rpminspect runpath report on selftests/bpf/cpuv4/urandom_read

2024-09-29 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3420#note_2135030984

CKI failures are unrelated to this MR. Rawhide builds are failing in Rust
build.

-- 
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


[OS-BUILD PATCH] redhat: ignore rpminspect runpath report on selftests/bpf/cpuv4/urandom_read

2024-09-27 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik 

redhat: ignore rpminspect runpath report on selftests/bpf/cpuv4/urandom_read

Upstream Status: RHEL only

Upstream commit a5d0c26a27848 ("selftests/bpf: Add a cpuv4 test runner
for cpu=v4 testing") introduced a new BPF selftests variant for cpuv4.
This added a new copy of urandom_read into kselftests.

Since rpminspect reports an issue with DT_RPATH/DT_RUNPATH on the
urandom_read binary, add the new instance to the ignore list of the
rpminspect check (the ignore list was introduced by 2d1bd08b9fc2
("redhat: ignore rpminspect runpath report on urandom_read selftest
binaries")).

Signed-off-by: Viktor Malik 

diff --git a/redhat/scripts/gating/rpminspect.yaml 
b/redhat/scripts/gating/rpminspect.yaml
index blahblah..blahblah 100644
--- a/redhat/scripts/gating/rpminspect.yaml
+++ b/redhat/scripts/gating/rpminspect.yaml
@@ -29,3 +29,4 @@ runpath:
 ignore:
 - /usr/libexec/kselftests/bpf/urandom_read
 - /usr/libexec/kselftests/bpf/no_alu32/urandom_read
+- /usr/libexec/kselftests/bpf/cpuv4/urandom_read

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3420

-- 
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH] redhat: Drop bpftool from kernel spec

2024-09-05 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3338#note_2092647212

@dzickusrh thanks for the comment!

> I am curious how you handle updating bpftool package? One scenario that has
been tricky in the past is a newer bpftool update using an older buildroot
kernel-devel. I believe you get a vmlinux.h that is mismatched.

IIUC, bpftool should be backwards-compatible with the kernel, i.e. it should
be no problem if bpftool is built against `vmlinux.h` from an older kernel
version than bpftool comes from. So, my plan is to basically build bpftool
against the current buildroot, same as any other package.

> And does the bpftool accidentally use the build system files to make checks
instead of the buildroot? We had to put Makefile hacks for bpftool to inject
the right vmlinux.h file and others?? into the build process to override the
system files found on the AWS builders.

If I understand this one correctly, it's a good point. Looking at bpftool's
`Makefile`, it builds its own `vmlinux.h` from BTF and by default, it takes
BTF from KBuild (which we won't have) or from the running system (which we
don't want). So, I'll need to update the new bpftool specfile to pass the
correct `vmlinux.h` coming from `kernel-devel`. It should be as simple as
passing the path via `VMLINUX_H` build variable, though.

If you have any specific cases where you think this is not sufficient, I'll be
happy to look into them.

-- 
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


[OS-BUILD PATCH] redhat: Drop bpftool from kernel spec

2024-09-05 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik 

redhat: Drop bpftool from kernel spec

We are going to build bpftool as a separate package. There are 2 main
reasons for this change: (1) bpftool version is independent of the
kernel and having it in the kernel spec causes all kinds of problems and
(2) bpftool is loosely coupled to the libbpf library which is also
packaged separately.

Note that bpftool is still built during kernel build in 2 places:
- Bootstrap bpftool for generating vmlinux.h which goes into
  kernel-devel.
- As a part of kernel BPF selftests build. Here, we opt to use the
  bpftool from kernel sources rather than the system one because
  upstream selftests sometimes require unreleased bpftool features to
  build successfully.

Signed-off-by: Viktor Malik 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -335,12 +335,6 @@ 
KABI_TARBALL:=$(REDHAT)/kernel-abi-stablelists-$(SPECKABIVERSION).tar.xz
 KABIDW := $(REDHAT)/kabi-dwarf
 KABIDW_TARBALL:=$(REDHAT)/kernel-kabi-dw-$(SPECKABIVERSION).tar.xz
 
-# Taken from tools/lib/bpf/Makefile
-SPECBPFTOOLVERSION:=$(shell \
-   grep -oE '^LIBBPF_([0-9.]+)' $(TOPDIR)/tools/lib/bpf/libbpf.map | \
-   sort -rV | head -n1 | cut -d'_' -f2 | \
-   awk -F. -v OFS=. '{$$1 += 6 ; print}')
-
 # load Makefile variable settings from user-specified configuration file,
 # ~/.rhpkg.mk or $TOPDIR/.rhpkg.mk
 ifeq ("$(RHDISTGIT_CACHE)", "")
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100644
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -228,8 +228,6 @@ Summary: The Linux kernel
 %define with_libperf   %{?_without_libperf:   0} %{?!_without_libperf:   1}
 # tools
 %define with_tools %{?_without_tools: 0} %{?!_without_tools: 1}
-# bpf tool
-%define with_bpftool   %{?_without_bpftool:   0} %{?!_without_bpftool:   1}
 # kernel-debuginfo
 %define with_debuginfo %{?_without_debuginfo: 0} %{?!_without_debuginfo: 1}
 # kernel-abi-stablelists
@@ -389,7 +387,6 @@ Summary: The Linux kernel
 %define with_perf 0
 %define with_libperf 0
 %define with_tools 0
-%define with_bpftool 0
 %define with_kernel_abi_stablelists 0
 %define with_selftests 0
 %define with_ipaclones 0
@@ -402,7 +399,6 @@ Summary: The Linux kernel
 %define with_perf 0
 %define with_libperf 0
 %define with_tools 0
-%define with_bpftool 0
 %define with_kernel_abi_stablelists 0
 %define with_selftests 0
 %define with_ipaclones 0
@@ -418,7 +414,6 @@ Summary: The Linux kernel
 %define with_perf 0
 %define with_libperf 0
 %define with_tools 0
-%define with_bpftool 0
 %define with_kernel_abi_stablelists 0
 %define with_selftests 0
 %define with_ipaclones 0
@@ -444,11 +439,6 @@ Summary: The Linux kernel
 %define use_vdso 1
 %endif
 
-# selftests require bpftool to be built.  If bpftools is disabled, then 
disable selftests
-%if %{with_bpftool} == 0
-%define with_selftests 0
-%endif
-
 %ifnarch noarch
 %define with_kernel_abi_stablelists 0
 %endif
@@ -479,7 +469,6 @@ Summary: The Linux kernel
 %define with_tools 0
 %define with_perf 0
 %define with_libperf 0
-%define with_bpftool 0
 %define with_selftests 0
 %define with_debug 0
 %endif
@@ -573,7 +562,6 @@ Summary: The Linux kernel
 %define with_perf 0
 %define with_libperf 0
 %define with_tools 0
-%define with_bpftool 0
 %define with_selftests 0
 %define _enable_debug_packages 0
 %endif
@@ -713,12 +701,8 @@ BuildRequires: libnl3-devel
 %if %{with_tools} || %{signmodules} || %{signkernel}
 BuildRequires: openssl-devel
 %endif
-%if %{with_bpftool}
-BuildRequires: python3-docutils
-BuildRequires: zlib-devel binutils-devel llvm-devel
-%endif
 %if %{with_selftests}
-BuildRequires: clang llvm-devel fuse-devel
+BuildRequires: clang llvm-devel fuse-devel zlib-devel binutils-devel
 %ifarch x86_64
 BuildRequires: lld
 %endif
@@ -1243,42 +1227,6 @@ analysing the logical and timing behavior of Linux.
 # with_tools
 %endif
 
-%if %{with_bpftool}
-
-%if 0%{?fedora}
-# bpftoolverion doesn't bump with stable updates so let's stick with
-# upstream kernel version for the package name. We still get correct
-# output with bpftool -V.
-%define bpftoolversion  %specrpmversion
-%else
-%define bpftoolversion %%SPECBPFTOOLVERSION%%
-%endif
-
-%package -n bpftool
-Summary: Inspection and simple manipulation of eBPF programs and maps
-Version: %{bpftoolversion}
-%description -n bpftool
-This package contains the bpftool, which allows inspection and simple
-manipulation of eBPF programs and maps.
-
-%package -n bpftool-debuginfo
-Summary: Debug information for package bpftool
-Version: %{bpftoolversion}
-Group: Development/Debug
-Requires: %{name}-debuginfo-common-%{_target_cpu} = 
%{specrpmversion}-%{release}
-AutoReqProv: no
-%description -n bpftool-debuginfo
-This package provides debug information for the bpftool package.
-
-%{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p 
'.*%%{_sbindir}/bpftool(\.debug)?|XXX' -o bpftool-debugi

Re: [OS-BUILD PATCHv2] Fix binutils breakage

2023-11-06 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2749#note_1636610702

There's still one change necessary. Closing this thread and opening another
one.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCHv2] Fix binutils breakage

2023-11-06 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2749#note_1636610086

I believe that we decided to replace the `EXTRA_` flags by a custom bpftool,
otherwise there were errors:

```suggestion:-0+0
%{make} %{?_smp_mflags} TPROGS_USER_CFLAGS="%{?build_hostcflags}"
TPROGS_USER_LDFLAGS="%{?build_hostldflags}"
BPFTOOL="$(pwd)/tools/bpf/bpftool/bpftool" ARCH=$Arch V=1 M=samples/bpf/
VMLINUX_H="${RPM_VMLINUX_H}" || true
```

With this, samples/bpf should compile with PIE.

FWIW, it should suffice to move the below lines

```plaintext
2774 # Prevent bpf selftests to build bpftool repeatedly:
2775 export BPFTOOL=$(pwd)/tools/bpf/bpftool/bpftool
```

above this command, but when I tried that, the bpftool in samples still
attempted to build and errors occurred.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH] Fix binutils breakage

2023-10-26 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2749#note_1621698879

Applied upstream, patches are here:

https://lore.kernel.org/bpf/169832762501.4440.5459269955038255670.git-
patchwork-not...@kernel.org/

Feel free to pick them up as fit.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH] Fix binutils breakage

2023-10-25 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2749#note_1618369263

So the `strip` problem is really a bug which @tohojo also noticed. He opened a
bugzilla for that:
https://bugzilla.redhat.com/show_bug.cgi?id=2245296
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH] Fix binutils breakage

2023-10-24 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2749#note_1617635466

Patches sent, added you to cc. I'd still wait a couple of days, if possible,
to see if upstream doesn't propose a different approach, to avoid carrying
non-upstream patches in ARK. But that's up to you.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH] Fix binutils breakage

2023-10-24 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2749#note_1617583855

Not yet, I wanted to resolve all the `-fPIE` problems first b/c we'll
eventually need to build `samples/bpf` in RHEL.

Anyways, I think that we're on a good path (see my last comment above), so I'm
going to post all three changes upstream (quoting `TPROGS_LDFLAGS`,
introducing `TPROGS_USER_CFLAGS/LDFLAGS`, and using custom bpftool for
samples) and will get back to you.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH] Fix binutils breakage

2023-10-24 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2749#note_1617578830

Argh, compiler/linker arguments in BPF Makefiles are sometimes a mess.

But, since the error occurs when linking `libbpf.a` for `samples/bpf/bpftool`,
let's take the same approach as we do for selftests and reuse the bpftool that
we've already built.

This will require one more patch to `samples/bpf/Makefile`:
```diff
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index 4ccf4236031c..ce9c2eea82d4 100644
--- a/samples/bpf/Makefile
+++ b/samples/bpf/Makefile
@@ -253,8 +253,9 @@ $(LIBBPF): $(wildcard $(LIBBPF_SRC)/*.[ch]
$(LIBBPF_SRC)/Makefile) | $(LIBBPF_OU

 BPFTOOLDIR := $(TOOLS_PATH)/bpf/bpftool
 BPFTOOL_OUTPUT := $(abspath $(BPF_SAMPLES_PATH))/bpftool
-BPFTOOL := $(BPFTOOL_OUTPUT)/bootstrap/bpftool
-$(BPFTOOL): $(wildcard $(BPFTOOLDIR)/*.[ch] $(BPFTOOLDIR)/Makefile) |
$(BPFTOOL_OUTPUT)
+DEFAULT_BPFTOOL := $(BPFTOOL_OUTPUT)/bootstrap/bpftool
+BPFTOOL ?= $(DEFAULT_BPFTOOL)
+$(DEFAULT_BPFTOOL): $(wildcard $(BPFTOOLDIR)/*.[ch] $(BPFTOOLDIR)/Makefile) |
$(BPFTOOL_OUTPUT)
$(MAKE) -C $(BPFTOOLDIR) srctree=$(BPF_SAMPLES_PATH)/../../
\
OUTPUT=$(BPFTOOL_OUTPUT)/ bootstrap
```

and the specfile change:
```suggestion:-0+0
%{make} %{?_smp_mflags} TPROGS_USER_CFLAGS="%{?build_hostcflags}"
TPROGS_USER_LDFLAGS="%{?build_ldflags}"
BPFTOOL="$(pwd)/tools/bpf/bpftool/bpftool" ARCH=$Arch V=1 M=samples/bpf/
VMLINUX_H="${RPM_VMLINUX_H}" || true
```

This way, the samples successfully build for me. Unfortunately, rpmbuild fails
later when stripping the BPF programs `samples/bpf/*_kern.o` (another binutils
problem?), but we should be able to resolve that by just not stripping them.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH] Fix binutils breakage

2023-10-20 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2749#note_1612448872

@dzickusrh @hertonrk-rh I'd suggest applying one more patch (in addition to
the above quoting change) to `samples/bpf/Makefile`:
```diff
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index 4ccf4236031c..140c58959b07 100644
--- a/samples/bpf/Makefile
+++ b/samples/bpf/Makefile
@@ -150,6 +150,9 @@ always-y += ibumad_kern.o
 always-y += hbm_out_kern.o
 always-y += hbm_edt_kern.o

+TPROGS_CFLAGS += $(TPROGS_USER_CFLAGS)
+TPROGS_LDFLAGS += $(TPROGS_USER_LDFLAGS)
+
 ifeq ($(ARCH), arm)
 # Strip all except -D__LINUX_ARM_ARCH__ option needed to handle linux
 # headers when arm instruction set identification is requested.
@@ -312,7 +315,7 @@ XDP_SAMPLE_CFLAGS += -Wall -O2 \
 -I$(LIBBPF_INCLUDE) \
 -I$(src)/../../tools/testing/selftests/bpf

-$(obj)/$(XDP_SAMPLE): TPROGS_CFLAGS = $(XDP_SAMPLE_CFLAGS)
+$(obj)/$(XDP_SAMPLE): TPROGS_CFLAGS = $(XDP_SAMPLE_CFLAGS)
$(TPROGS_USER_CFLAGS)
 $(obj)/$(XDP_SAMPLE): $(src)/xdp_sample_user.h $(src)/xdp_sample_shared.h

 -include $(BPF_SAMPLES_PATH)/Makefile.target

```

and then updating this specfile change to:
```suggestion:-0+0
%{make} %{?_smp_mflags} TPROGS_USER_CFLAGS="%{?build_hostcflags}"
TPROGS_USER_LDFLAGS="%{?build_hostldflags}"
EXTRA_CFLAGS="%{?build_hostcflags}" EXTRA_LDFLAGS="%{?build_hostldflags}"
ARCH=$Arch V=1 M=samples/bpf/ VMLINUX_H="${RPM_VMLINUX_H}" || true
```

The `EXTRA_CFLAGS`/`EXTRA_LDFLAGS` setting should resolve the remaining -fPIE
error for libbpf.a.

@dzickusrh could you give this a try?
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH] Fix binutils breakage

2023-10-18 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2749#note_1609066156

Argh, it won't work b/c [samples/bpf/Makefile:315](https://gitlab.com/cki-
project/kernel-ark/-/blob/os-build/samples/bpf/Makefile?ref_type=heads#L315)
overrides `TPROGS_CFLAGS` for one target.

It looks like we'll need a Makefile patch after all so I'm a bit inclined
towards introducing a new variable `TPROGS_EXTRA_CFLAGS` which can be set from
CLI and is always appended to `TPROGS_CFLAGS`.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH] Fix binutils breakage

2023-10-18 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2749#note_1609047113

Agreed, I just wasn't sure if this is acceptable for the specfile. Makefile
always uses `+=` so it should work without modification (except for the above
Don's patch to enable setting `TPROGS_LDFLAGS` the same way).
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH] Fix binutils breakage

2023-10-18 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2749#note_1608645136

I don't think that setting `TPROGS_CFLAGS` here is correct.

The reason is that `samples/bpf/Makefile` appends a couple of options to
`TPROGS_CFLAGS`, particularly several include paths
([samples/bpf/Makefile:173-177](https://gitlab.com/cki-project/kernel-
ark/-/blob/os-build/samples/bpf/Makefile?ref_type=heads#L173-L177)):
```
TPROGS_CFLAGS += -I$(objtree)/usr/include
TPROGS_CFLAGS += -I$(srctree)/tools/testing/selftests/bpf/
TPROGS_CFLAGS += -I$(LIBBPF_INCLUDE)
TPROGS_CFLAGS += -I$(srctree)/tools/include
TPROGS_CFLAGS += -I$(srctree)/tools/perf
```
Due to the way Make works, these are overridden by setting `TPROGS_CFLAGS`
from CLI, resulting in include errors:
```
samples/bpf/test_lru_dist.c:20:10: fatal error: bpf/bpf.h: No such file or
directory
   20 | #include 
  |  ^~~
compilation terminated.
```
I don't have a proper solution for now but will try to think about it.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH] Fix binutils breakage

2023-10-17 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2749#note_1608094306

@dzickusrh I can do that. If you don't mind, I'll add you to CC so that you
can see when it's merged.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCHv2 0/2] spec: fix building and packaging of resolve_btfids

2023-06-05 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2490#note_1419241711

The above change was merged to the upstream. I just backported it and posted
v2.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


[OS-BUILD PATCHv2 1/2] tools/resolve_btfids: Fix setting HOSTCFLAGS

2023-06-05 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik 

tools/resolve_btfids: Fix setting HOSTCFLAGS

commit edd75c802855271c8610f58a2fc9e54aefc49ce5
Author: Viktor Malik 
Date:   Tue May 30 14:33:52 2023 +0200

tools/resolve_btfids: Fix setting HOSTCFLAGS

Building BPF selftests with custom HOSTCFLAGS yields an error:

# make HOSTCFLAGS="-O2"
[...]
  HOSTCC  
./tools/testing/selftests/bpf/tools/build/resolve_btfids/main.o
main.c:73:10: fatal error: linux/rbtree.h: No such file or directory
   73 | #include 
  |  ^~~~

The reason is that tools/bpf/resolve_btfids/Makefile passes header
include paths by extending HOSTCFLAGS which is overridden by setting
HOSTCFLAGS in the make command (because of Makefile rules [1]).

This patch fixes the above problem by passing the include paths via
`HOSTCFLAGS_resolve_btfids` which is used by tools/build/Build.include
and can be combined with overridding HOSTCFLAGS.

[1] https://www.gnu.org/software/make/manual/html_node/Overriding.html

Fixes: 56a2df7615fa ("tools/resolve_btfids: Compile resolve_btfids as host 
program")
Signed-off-by: Viktor Malik 
Signed-off-by: Andrii Nakryiko 
Acked-by: Jiri Olsa 
Link: https://lore.kernel.org/bpf/20230530123352.1308488-1-vma...@redhat.com

Signed-off-by: Viktor Malik 

diff --git a/tools/bpf/resolve_btfids/Makefile 
b/tools/bpf/resolve_btfids/Makefile
index blahblah..blahblah 100644
--- a/tools/bpf/resolve_btfids/Makefile
+++ b/tools/bpf/resolve_btfids/Makefile
@@ -67,7 +67,7 @@ $(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] 
$(LIBBPF_SRC)/Makefile) | $(LIBBPF_OU
 LIBELF_FLAGS := $(shell $(HOSTPKG_CONFIG) libelf --cflags 2>/dev/null)
 LIBELF_LIBS  := $(shell $(HOSTPKG_CONFIG) libelf --libs 2>/dev/null || echo 
-lelf)
 
-HOSTCFLAGS += -g \
+HOSTCFLAGS_resolve_btfids += -g \
   -I$(srctree)/tools/include \
   -I$(srctree)/tools/include/uapi \
   -I$(LIBBPF_INCLUDE) \
@@ -76,7 +76,7 @@ HOSTCFLAGS += -g \
 
 LIBS = $(LIBELF_LIBS) -lz
 
-export srctree OUTPUT HOSTCFLAGS Q HOSTCC HOSTLD HOSTAR
+export srctree OUTPUT HOSTCFLAGS_resolve_btfids Q HOSTCC HOSTLD HOSTAR
 include $(srctree)/tools/build/Makefile.include
 
 $(BINARY_IN): fixdep FORCE prepare | $(OUTPUT)

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2490
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


[OS-BUILD PATCHv2 2/2] spec: remove resolve_btfids from kernel-devel

2023-06-05 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik 

spec: remove resolve_btfids from kernel-devel

Since 56a2df7615fa ("tools/resolve_btfids: Compile resolve_btfids as
host program"), resolve_btfids is compiled using HOSTCC. Therefore, it
shouldn't be included in the kernel-devel package as its arch could not
match the target arch.

Only include source files in kernel-devel so that it is recompiled when
running 'make prepare'.

Signed-off-by: Viktor Malik 

diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100644
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -2062,7 +2062,8 @@ BuildKernel() {
 cp --parents tools/build/Build $RPM_BUILD_ROOT/lib/modules/$KernelVer/build
 cp --parents tools/build/fixdep.c 
$RPM_BUILD_ROOT/lib/modules/$KernelVer/build
 cp --parents tools/objtool/sync-check.sh 
$RPM_BUILD_ROOT/lib/modules/$KernelVer/build
-cp -a --parents tools/bpf/resolve_btfids 
$RPM_BUILD_ROOT/lib/modules/$KernelVer/build
+cp -a --parents tools/bpf/resolve_btfids/main.c 
$RPM_BUILD_ROOT/lib/modules/$KernelVer/build
+cp -a --parents tools/bpf/resolve_btfids/Build 
$RPM_BUILD_ROOT/lib/modules/$KernelVer/build
 
 cp --parents security/selinux/include/policycap_names.h 
$RPM_BUILD_ROOT/lib/modules/$KernelVer/build
 cp --parents security/selinux/include/policycap.h 
$RPM_BUILD_ROOT/lib/modules/$KernelVer/build

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2490
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


[OS-BUILD PATCHv2 0/2] spec: fix building and packaging of resolve_btfids

2023-06-05 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2490

Commit 56a2df7615fa changed the `resolve_btfids` tool to be built as a host
program. This causes selftests compilation error as we override `HOSTCFLAGS`
when calling `make` from the specfile, effectively supressing the effect of
`HOSTCFLAGS` update in
`tools/bpf/resolve_btfids/Makefile`. See [1] for details why this happens.

This fixes the above error by passing `HOSTCGLAGS` and `HOSTLDFLAGS` through
environment variables rather than through the make command.

In addition, since `resolve_btfids` is now compiled as a host program, it
shouldn't be included in the `kernel-devel` package as its arch could not
match the target arch. Instead, this just adds its source files to the package
so that it is built when running `make prepare`.

[1] https://www.gnu.org/software/make/manual/html_node/Overriding.html

Signed-off-by: Viktor Malik 

---
 redhat/kernel.spec.template   |  3 ++-
 tools/bpf/resolve_btfids/Makefile |  4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH 0/2] spec: fix building and packaging of resolve_btfids

2023-05-30 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2490#note_1410090540

The `override` directive doesn't propagate into sub-make so it doesn't work
here (already tried).

Also, the variable name is not arbitrary, it's used this way in
[tools/build/Build.include:102](https://gitlab.com/cki-project/kernel-
ark/-/blob/os-build/tools/build/Build.include#L102).
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH 0/2] spec: fix building and packaging of resolve_btfids

2023-05-30 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2490#note_1409839033

Good point, I'll send it upstream.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH 0/2] spec: fix building and packaging of resolve_btfids

2023-05-30 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2490#note_1409781457

I agree that it's a mess, but this part has been overridden by 56a2df7615
("tools/resolve_btfids: Compile resolve_btfids as host program").

I believe that the actual problem is that `resolve_btfids/Makefile` overrides
`HOSTCFLAGS` (used to be `CFLAGS` but it's the same issue) and that has been
there since the beginning. We just started hitting it now b/c we override
`HOSTCFLAGS` but not `CFLAGS`.

A possible solution would be to change the overridden variable to:
```diff
diff --git a/tools/bpf/resolve_btfids/Makefile
b/tools/bpf/resolve_btfids/Makefile
index ac548a7baa73..aabccc2da1b6 100644
--- a/tools/bpf/resolve_btfids/Makefile
+++ b/tools/bpf/resolve_btfids/Makefile
@@ -67,7 +67,7 @@ $(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch]
$(LIBBPF_SRC)/Makefile) | $(LIBBPF_OU
 LIBELF_FLAGS := $(shell $(HOSTPKG_CONFIG) libelf --cflags 2>/dev/null)
 LIBELF_LIBS  := $(shell $(HOSTPKG_CONFIG) libelf --libs 2>/dev/null || echo
-lelf)

-HOSTCFLAGS += -g \
+HOSTCFLAGS_resolve_btfids := -g \
   -I$(srctree)/tools/include \
   -I$(srctree)/tools/include/uapi \
   -I$(LIBBPF_INCLUDE) \
@@ -76,7 +76,7 @@ HOSTCFLAGS += -g \

 LIBS = $(LIBELF_LIBS) -lz

-export srctree OUTPUT HOSTCFLAGS Q HOSTCC HOSTLD HOSTAR
+export srctree OUTPUT HOSTCFLAGS_resolve_btfids Q HOSTCC HOSTLD HOSTAR
 include $(srctree)/tools/build/Makefile.include

 $(BINARY_IN): fixdep FORCE prepare | $(OUTPUT)
```
This way, the update is specific for `resolve_btfids` and can be used in
combination with overriding `HOSTCFLAGS` from the make command.

WDYT @jbencrh? Does this make sense to be sent upstream, too?
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


[OS-BUILD PATCH 1/2] spec: pass HOSTCFLAGS/HOSTLDFLAGS as env vars to make

2023-05-29 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik 

spec: pass HOSTCFLAGS/HOSTLDFLAGS as env vars to make

Upstream commit 56a2df7615fa ("tools/resolve_btfids: Compile
resolve_btfids as host program") changed the 'resolve_btfids' tool to be
built as a host program. This causes selftests compilation error as we
override HOSTCFLAGS when calling 'make' from the specfile, effectively
supressing the effect of HOSTCFLAGS update in
tools/bpf/resolve_btfids/Makefile. See [1] for details why this happens.

This patch fixes the above error by passing HOSTCGLAGS and HOSTLDFLAGS
through environment variables rather than through the make command.

[1] https://www.gnu.org/software/make/manual/html_node/Overriding.html

Signed-off-by: Viktor Malik 

diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100644
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -1728,7 +1728,7 @@ cp_vmlinux()
 %define build_hostldflags %{?build_ldflags}
 %endif
 
-%define make %{__make} %{?cross_opts} %{?make_opts} 
HOSTCFLAGS="%{?build_hostcflags}" HOSTLDFLAGS="%{?build_hostldflags}"
+%define make HOSTCFLAGS="%{?build_hostcflags}" 
HOSTLDFLAGS="%{?build_hostldflags}" %{__make} %{?cross_opts} %{?make_opts}
 
 InitBuildVars() {
 # Initialize the kernel .config file and create some variables that are

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2490
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


[OS-BUILD PATCH 2/2] spec: remove resolve_btfids from kernel-devel

2023-05-29 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik 

spec: remove resolve_btfids from kernel-devel

Since 56a2df7615fa ("tools/resolve_btfids: Compile resolve_btfids as
host program"), resolve_btfids is compiled using HOSTCC. Therefore, it
shouldn't be included in the kernel-devel package as its arch could not
match the target arch.

Only include source files in kernel-devel so that it is recompiled when
running 'make prepare'.

Signed-off-by: Viktor Malik 

diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100644
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -2062,7 +2062,8 @@ BuildKernel() {
 cp --parents tools/build/Build $RPM_BUILD_ROOT/lib/modules/$KernelVer/build
 cp --parents tools/build/fixdep.c 
$RPM_BUILD_ROOT/lib/modules/$KernelVer/build
 cp --parents tools/objtool/sync-check.sh 
$RPM_BUILD_ROOT/lib/modules/$KernelVer/build
-cp -a --parents tools/bpf/resolve_btfids 
$RPM_BUILD_ROOT/lib/modules/$KernelVer/build
+cp -a --parents tools/bpf/resolve_btfids/main.c 
$RPM_BUILD_ROOT/lib/modules/$KernelVer/build
+cp -a --parents tools/bpf/resolve_btfids/Build 
$RPM_BUILD_ROOT/lib/modules/$KernelVer/build
 
 cp --parents security/selinux/include/policycap_names.h 
$RPM_BUILD_ROOT/lib/modules/$KernelVer/build
 cp --parents security/selinux/include/policycap.h 
$RPM_BUILD_ROOT/lib/modules/$KernelVer/build

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2490
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


[OS-BUILD PATCH 0/2] spec: fix building and packaging of resolve_btfids

2023-05-29 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2490

Commit 56a2df7615fa changed the `resolve_btfids` tool to be built as a host
program. This causes selftests compilation error as we override `HOSTCFLAGS`
when calling `make` from the specfile, effectively supressing the effect of
`HOSTCFLAGS` update in
`tools/bpf/resolve_btfids/Makefile`. See [1] for details why this happens.

This fixes the above error by passing `HOSTCGLAGS` and `HOSTLDFLAGS` through
environment variables rather than through the make command.

In addition, since `resolve_btfids` is now compiled as a host program, it
shouldn't be included in the `kernel-devel` package as its arch could not
match the target arch. Instead, this just adds its source files to the package
so that it is built when running `make prepare`.

[1] https://www.gnu.org/software/make/manual/html_node/Overriding.html

Signed-off-by: Viktor Malik 

---
 redhat/kernel.spec.template |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCHv3] redhat/spec: Update bpftool versioning scheme

2023-03-01 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2295#note_1298140207

Thanks for the hint @ptalbert! Should be fixed now, hopefully I did it right.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


[OS-BUILD PATCHv3] redhat/spec: Update bpftool versioning scheme

2023-03-01 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik 

redhat/spec: Update bpftool versioning scheme

The upstream has changed the versioning scheme of bpftool [1].
Instead of following the kernel version, it is now deduced from the
libbpf version by adding +6 to the libbpf major version number.

This appropriately updates the bpftool sub-package version number. The
version is deduced automatically from the libbpf version, which can be
retrieved from tools/lib/bpf/libbpf.map.

One problem is that even though RPM allows to override sub-package
version, doing that overrides the internal %{version} macro. The macro
is used later throughout the specfile, so we reset it to its default
value (%{specversion}) at the end of the bpftool sub-package definition.

[1] https://lore.kernel.org/bpf/20220210104237.11649-3-quen...@isovalent.com/

Signed-off-by: Viktor Malik 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -281,6 +281,12 @@ 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECKABIVERSION).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
 KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECKABIVERSION).tar.bz2
 
+# Taken from tools/lib/bpf/Makefile
+SPECBPFTOOLVERSION:=$(shell \
+   grep -oE '^LIBBPF_([0-9.]+)' $(TOPDIR)/tools/lib/bpf/libbpf.map | \
+   sort -rV | head -n1 | cut -d'_' -f2 | \
+   awk -F. -v OFS=. '{$$1 += 6 ; print}')
+
 # load Makefile variable settings from user-specified configuration file,
 # ~/.rhpkg.mk or $TOPDIR/.rhpkg.mk
 ifeq ("$(RHDISTGIT_CACHE)", "")
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -1091,23 +1091,31 @@ and root causes of unexpected results.
 
 %if %{with_bpftool}
 
+%define bpftoolversion %%SPECBPFTOOLVERSION%%
+
 %package -n bpftool
 Summary: Inspection and simple manipulation of eBPF programs and maps
 License: GPLv2
+Version: %{bpftoolversion}
 %description -n bpftool
 This package contains the bpftool, which allows inspection and simple
 manipulation of eBPF programs and maps.
 
 %package -n bpftool-debuginfo
 Summary: Debug information for package bpftool
+Version: %{bpftoolversion}
 Group: Development/Debug
-Requires: %{name}-debuginfo-common-%{_target_cpu} = %{version}-%{release}
+Requires: %{name}-debuginfo-common-%{_target_cpu} = %{specversion}-%{release}
 AutoReqProv: no
 %description -n bpftool-debuginfo
 This package provides debug information for the bpftool package.
 
 %{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p 
'.*%%{_sbindir}/bpftool(\.debug)?|XXX' -o bpftool-debuginfo.list}
 
+# Setting "Version:" above overrides the internal {version} macro,
+# need to restore it here
+%define version %{specversion}
+
 # with_bpftool
 %endif
 
diff --git a/redhat/scripts/genspec/genspec.sh 
b/redhat/scripts/genspec/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/scripts/genspec/genspec.sh
+++ b/redhat/scripts/genspec/genspec.sh
@@ -55,6 +55,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
s/%%SPECKABIVERSION%%/$SPECKABIVERSION/
+   s/%%SPECBPFTOOLVERSION%%/$SPECBPFTOOLVERSION/
s/%%SPECTARFILE_RELEASE%%/$SPECTARFILE_RELEASE/
s/%%SPECSELFTESTS_MUST_BUILD%%/$SPECSELFTESTS_MUST_BUILD/" 
"$SOURCES/$SPECFILE"
 test -n "$RHSELFTESTDATA" && test -f "$SOURCES/$SPECFILE" && sed -i -e "
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -63,6 +63,7 @@ RPM=../redhat/rpm
 RPMBUILD=rpmbuild 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
+SPECBPFTOOLVERSION=7.2.0 
 SPECBUILD=0.rc5.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECFILE=kernel.spec 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec 
b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
@@ -12,4 +12,5 @@
 %define specrelease 0.rc5.6%{?buildid}%{?dist}
 %define kabiversion 5.16.0-0.rc5.6.test.el7
 %define selftests_must_build 0
+%define bpftoolversion 7.2.0
 Mon Mar 28 2022 Fedora Kernel Team  
[5.16.0-0.rc5.6.test]
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -63,6 +63,7 @@ RPM=../redhat/rpm
 RPMBUILD=rpmbuild 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
+SPECBPFTOOLVERSION=7.2.0 
 SPECBUILD=0.rc5.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECFILE=kernel.spec 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec 
b/redhat/self-te

[OS-BUILD PATCHv2] redhat/spec: Update bpftool versioning scheme

2023-02-22 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik 

redhat/spec: Update bpftool versioning scheme

The upstream has changed the versioning scheme of bpftool [1].
Instead of following the kernel version, it is now deduced from the
libbpf version by adding +6 to the libbpf major version number.

This appropriately updates the bpftool sub-package version number. The
version is deduced automatically from the libbpf version, which can be
retrieved from tools/lib/bpf/libbpf.map.

One problem is that even though RPM allows to override sub-package
version, doing that overrides the internal %{version} macro. The macro
is used later throughout the specfile, so we reset it to its default
value (%{specversion}) at the end of the bpftool sub-package definition.

[1] https://lore.kernel.org/bpf/20220210104237.11649-3-quen...@isovalent.com/

Signed-off-by: Viktor Malik 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -281,6 +281,12 @@ 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECKABIVERSION).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
 KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECKABIVERSION).tar.bz2
 
+# Taken from tools/lib/bpf/Makefile
+BPFTOOLVERSION:=$(shell \
+   grep -oE '^LIBBPF_([0-9.]+)' $(TOPDIR)/tools/lib/bpf/libbpf.map | \
+   sort -rV | head -n1 | cut -d'_' -f2 | \
+   awk -F. -v OFS=. '{$$1 += 6 ; print}')
+
 # load Makefile variable settings from user-specified configuration file,
 # ~/.rhpkg.mk or $TOPDIR/.rhpkg.mk
 ifeq ("$(RHDISTGIT_CACHE)", "")
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -1091,23 +1091,31 @@ and root causes of unexpected results.
 
 %if %{with_bpftool}
 
+%define bpftoolversion %%BPFTOOLVERSION%%
+
 %package -n bpftool
 Summary: Inspection and simple manipulation of eBPF programs and maps
 License: GPLv2
+Version: %{bpftoolversion}
 %description -n bpftool
 This package contains the bpftool, which allows inspection and simple
 manipulation of eBPF programs and maps.
 
 %package -n bpftool-debuginfo
 Summary: Debug information for package bpftool
+Version: %{bpftoolversion}
 Group: Development/Debug
-Requires: %{name}-debuginfo-common-%{_target_cpu} = %{version}-%{release}
+Requires: %{name}-debuginfo-common-%{_target_cpu} = %{specversion}-%{release}
 AutoReqProv: no
 %description -n bpftool-debuginfo
 This package provides debug information for the bpftool package.
 
 %{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p 
'.*%%{_sbindir}/bpftool(\.debug)?|XXX' -o bpftool-debuginfo.list}
 
+# Setting "Version:" above overrides the internal {version} macro,
+# need to restore it here
+%define version %{specversion}
+
 # with_bpftool
 %endif
 
diff --git a/redhat/scripts/genspec/genspec.sh 
b/redhat/scripts/genspec/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/scripts/genspec/genspec.sh
+++ b/redhat/scripts/genspec/genspec.sh
@@ -55,6 +55,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
s/%%SPECKABIVERSION%%/$SPECKABIVERSION/
+   s/%%BPFTOOLVERSION%%/$BPFTOOLVERSION/
s/%%SPECTARFILE_RELEASE%%/$SPECTARFILE_RELEASE/
s/%%SPECSELFTESTS_MUST_BUILD%%/$SPECSELFTESTS_MUST_BUILD/" 
"$SOURCES/$SPECFILE"
 test -n "$RHSELFTESTDATA" && test -f "$SOURCES/$SPECFILE" && sed -i -e "

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2295
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


[OS-BUILD PATCH] redhat/spec: Update bpftool versioning scheme

2023-02-22 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik 

redhat/spec: Update bpftool versioning scheme

The upstream has changed the versioning scheme of bpftool [1].
Instead of following the kernel version, it is now deduced from the
libbpf version by adding +6 to the libbpf major version number.

This appropriately updates the bpftool sub-package version number. The
version is deduced automatically from the libbpf version, which can be
retrieved from tools/lib/bpf/libbpf.map.

One problem is that even though RPM allows to override sub-package
version, doing that overrides the internal %{version} macro. The macro
is used later throughout the specfile, so we reset it to its default
value (%{specversion}) at the end of the bpftool sub-package definition.

[1] https://lore.kernel.org/bpf/20220210104237.11649-3-quen...@isovalent.com/

Signed-off-by: Viktor Malik 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -281,6 +281,12 @@ 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECKABIVERSION).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
 KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECKABIVERSION).tar.bz2
 
+# Taken from tools/lib/bpf/Makefile
+BPFTOOLVERSION:=$(shell \
+   grep -oE '^LIBBPF_([0-9.]+)' $(TOPDIR)/tools/lib/bpf/libbpf.map | \
+   sort -rV | head -n1 | cut -d'_' -f2 | \
+   awk -F. -v OFS=. '{$$1 += 6 ; print}')
+
 # load Makefile variable settings from user-specified configuration file,
 # ~/.rhpkg.mk or $TOPDIR/.rhpkg.mk
 ifeq ("$(RHDISTGIT_CACHE)", "")
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -1091,23 +1091,31 @@ and root causes of unexpected results.
 
 %if %{with_bpftool}
 
+%define bpftoolversion %%BPFTOOLVERSION%%
+
 %package -n bpftool
 Summary: Inspection and simple manipulation of eBPF programs and maps
 License: GPLv2
+Version: %{bpftoolversion}
 %description -n bpftool
 This package contains the bpftool, which allows inspection and simple
 manipulation of eBPF programs and maps.
 
 %package -n bpftool-debuginfo
 Summary: Debug information for package bpftool
+Version: %{bpftoolversion}
 Group: Development/Debug
-Requires: %{name}-debuginfo-common-%{_target_cpu} = %{version}-%{release}
+Requires: %{name}-debuginfo-common-%{_target_cpu} = %{specversion}-%{release}
 AutoReqProv: no
 %description -n bpftool-debuginfo
 This package provides debug information for the bpftool package.
 
 %{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p 
'.*%%{_sbindir}/bpftool(\.debug)?|XXX' -o bpftool-debuginfo.list}
 
+# Setting "Version:" above overrides the internal {version} macro,
+# need to restore it here
+%define version %{specversion}
+
 # with_bpftool
 %endif
 
diff --git a/redhat/scripts/genspec/genspec.sh 
b/redhat/scripts/genspec/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/scripts/genspec/genspec.sh
+++ b/redhat/scripts/genspec/genspec.sh
@@ -55,6 +55,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
s/%%SPECKABIVERSION%%/$SPECKABIVERSION/
+   s/%%BPFTOOLVERSION%%/$BPFTOOLVERSION/
s/%%SPECTARFILE_RELEASE%%/$SPECTARFILE_RELEASE/
s/%%SPECSELFTESTS_MUST_BUILD%%/$SPECSELFTESTS_MUST_BUILD/" 
"$SOURCES/$SPECFILE"
 test -n "$RHSELFTESTDATA" && test -f "$SOURCES/$SPECFILE" && sed -i -e "

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2295
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH] redhat/configs: Enable CONFIG_TEST_BPF

2022-02-08 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1604#note_836355088

You're right, sorry about the mistake. I'm not eligible to approve !1609 but
it's correct. Thanks for the fix!
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH] redhat/configs: Enable CONFIG_TEST_BPF

2022-02-07 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik 

redhat/configs: Enable CONFIG_TEST_BPF

The option is required to run selftests/net/test_bpf.sh.

Signed-off-by: Viktor Malik 

diff --git a/redhat/configs/common/generic/CONFIG_TEST_BPF 
b/redhat/configs/common/generic/CONFIG_TEST_BPF
index blahblah..blahblah 100644
--- a/redhat/configs/common/generic/CONFIG_TEST_BPF
+++ b/redhat/configs/common/generic/CONFIG_TEST_BPF
@@ -1 +1 @@
-# CONFIG_TEST_BPF is not set
+CONFIG_TEST_BPF=y
diff --git a/redhat/mod-internal.list b/redhat/mod-internal.list
index blahblah..blahblah 100644
--- a/redhat/mod-internal.list
+++ b/redhat/mod-internal.list
@@ -45,3 +45,4 @@ refscale
 memcpy_kunit
 dev_addr_lists_test
 test_hash
+test_bpf

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1604
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure