From: Justin M. Forbes <jforbes(a)fedoraproject.org>
Workaround for gcc12 compile issues in ubcmd-util.h
While upstream has made no move around this and I am not positive that
this is the "proper" fix for upstream, it does get us building again for
several arches. This is being added as "include in release" until
upstream weighs in so that at least ark-latest builds for many
architectures. There are still issues with gcc12 and armv7.
Signed-off-by: Justin M. Forbes <jforbes(a)fedoraproject.org>
diff --git a/tools/lib/subcmd/subcmd-util.h b/tools/lib/subcmd/subcmd-util.h
index blahblah..blahblah 100644
--- a/tools/lib/subcmd/subcmd-util.h
+++ b/tools/lib/subcmd/subcmd-util.h
@@ -49,13 +49,12 @@ static NORETURN inline void die(const char *err, ...)
static inline void *xrealloc(void *ptr, size_t size)
{
- void *ret = realloc(ptr, size);
- if (!ret && !size)
- ret = realloc(ptr, 1);
+ void *ret;
+ if (!size)
+ size = 1;
+ ret = realloc(ptr, size);
if (!ret) {
ret = realloc(ptr, size);
- if (!ret && !size)
- ret = realloc(ptr, 1);
if (!ret)
die("Out of memory, realloc failed");
}
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1594
From: Prarit Bhargava <prarit(a)redhat.com>
kernel.spec: Add glibc-static build requirement
CKI and brew builds resulted in two different values for
CONFIG_CC_CAN_LINK_STATIC. In CKI CONFIG_CC_CAN_LINK_STATIC=y while in
brew CONFIG_CC_CAN_LINK_STATIC was not defined. This occurs because
glibc-static is installed on the CKI build containers and was not
installed in brew.
In order to guarantee consistency across build systems add a build
requirement for the glibc-static package.
Signed-off-by: Prarit Bhargava <prarit(a)redhat.com>
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
@@ -585,6 +585,8 @@ BuildRequires: net-tools, hostname, bc, elfutils-devel
BuildRequires: dwarves
BuildRequires: python3-devel
BuildRequires: gcc-plugin-devel
+# required for CONFIG_CC_CAN_LINK_STATIC=y
+BuildRequires: glibc-static
%ifnarch %{nobuildarches} noarch
BuildRequires: bpftool
%endif
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1538
From: David Hildenbrand <david(a)redhat.com>
[redhat] virtio: enable virtio-mem on x86-64 as tech-preview
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2014492
Let's enable CONFIG_VIRTIO_MEM=m on x86-64 in RHEL 9. As it will be
tech-preview, properly taint the kernel as soon as we're initializing
the driver for an actual device in a !kdump environment where we might
actually hot(un)plug memory when instructed by the hypervisor.
We won't be tainting in a kdump kernel where the sole purpose is to check
if a given PFN is actually part of a plugged virtio-mem device and can
be dumped safely.
Signed-off-by: David Hildenbrand <david(a)redhat.com>
diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c
index blahblah..blahblah 100644
--- a/drivers/virtio/virtio_mem.c
+++ b/drivers/virtio/virtio_mem.c
@@ -2754,6 +2754,19 @@ static int virtio_mem_probe(struct virtio_device *vdev)
/* trigger a config update to start processing the requested_size */
if (!vm->in_kdump) {
+#ifdef CONFIG_RHEL_DIFFERENCES
+ static bool printed;
+
+ /*
+ * virtio-mem, and especially its memory hot(un)plug
+ * functionality, is tech-preview.
+ */
+ if (!printed) {
+ printed = true;
+ mark_tech_preview("virtio_mem", THIS_MODULE);
+ }
+#endif /* CONFIG_RHEL_DIFFERENCES */
+
atomic_set(&vm->config_changed, 1);
queue_work(system_freezable_wq, &vm->wq);
}
diff --git a/redhat/configs/common/generic/x86/x86_64/CONFIG_VIRTIO_MEM b/redhat/configs/common/generic/x86/x86_64/CONFIG_VIRTIO_MEM
index blahblah..blahblah 100644
--- a/redhat/configs/common/generic/x86/x86_64/CONFIG_VIRTIO_MEM
+++ b/redhat/configs/common/generic/x86/x86_64/CONFIG_VIRTIO_MEM
@@ -1 +1 @@
-# CONFIG_VIRTIO_MEM is not set
+CONFIG_VIRTIO_MEM=m
diff --git a/redhat/configs/fedora/generic/x86/x86_64/CONFIG_VIRTIO_MEM b/redhat/configs/fedora/generic/x86/x86_64/CONFIG_VIRTIO_MEM
deleted file mode 100644
index blahblah..blahblah 0
--- a/redhat/configs/fedora/generic/x86/x86_64/CONFIG_VIRTIO_MEM
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_VIRTIO_MEM=m
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1535
From: David Hildenbrand on gitlab.com
Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1592
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2043141
Upstream: RHEL only
The above bugzilla is for RHEL9/CS9 and I'll send a MR soon that performs
the same changes to CS9.
Enable CONFIG_CMA on aarch64 in ARK as we already have in fedora. We did
the same change for x86-64 just recently. Move the relevant configs from
redhat/configs/fedora to redhat/configs/common.
While in tech-preview, we'll require a manual configuration of cma on
the kernel command line -- we will default to "cma=0". Once e.g., "cma=64M"
has been specified, cma_activate_area() will call mark_tech_preview("CMA"),
essentially tainting the kernel. Once no longer in tech-preview, we can
enable CMA as default by e.g., similarly defaulting to "cma=64M".
The real change is preceded by some cleanups around CMA configs.
Signed-off-by: David Hildenbrand <david(a)redhat.com>
---
redhat/configs/ark/generic/arm/CONFIG_CMA_SIZE_MBYTES | 1 +
redhat/configs/fedora/generic/arm/CONFIG_CMA => redhat/configs/common/generic/arm/CONFIG_CMA | 0
redhat/configs/fedora/generic/arm/CONFIG_CMA_ALIGNMENT => redhat/configs/common/generic/arm/CONFIG_CMA_ALIGNMENT | 0
redhat/configs/fedora/generic/arm/CONFIG_CMA_SIZE_SEL_MAX => redhat/configs/common/generic/arm/CONFIG_CMA_SIZE_SEL_MAX | 0
redhat/configs/fedora/generic/arm/CONFIG_CMA_SIZE_SEL_MBYTES => redhat/configs/common/generic/arm/CONFIG_CMA_SIZE_SEL_MBYTES | 0
redhat/configs/fedora/generic/arm/CONFIG_CMA_SIZE_SEL_MIN => redhat/configs/common/generic/arm/CONFIG_CMA_SIZE_SEL_MIN | 0
redhat/configs/fedora/generic/arm/CONFIG_CMA_SIZE_SEL_PERCENTAGE => redhat/configs/common/generic/arm/CONFIG_CMA_SIZE_SEL_PERCENTAGE | 0
redhat/configs/fedora/generic/arm/CONFIG_DMA_CMA => redhat/configs/common/generic/arm/CONFIG_DMA_CMA | 0
redhat/configs/common/generic/powerpc/CONFIG_CMA_AREAS | 1 -
redhat/configs/common/generic/powerpc/CONFIG_CMA_DEBUG | 1 -
redhat/configs/common/generic/powerpc/CONFIG_CMA_DEBUGFS | 1 -
redhat/configs/common/generic/s390x/CONFIG_CMA_AREAS | 1 -
redhat/configs/common/generic/s390x/CONFIG_CMA_DEBUG | 1 -
redhat/configs/common/generic/s390x/CONFIG_CMA_DEBUGFS | 1 -
redhat/configs/common/generic/x86/x86_64/CONFIG_CMA_AREAS | 1 -
redhat/configs/common/generic/x86/x86_64/CONFIG_CMA_DEBUG | 1 -
redhat/configs/common/generic/x86/x86_64/CONFIG_CMA_DEBUGFS | 1 -
redhat/configs/ark/generic/CONFIG_CMA_AREAS => redhat/configs/common/generic/CONFIG_CMA_AREAS | 0
redhat/configs/ark/generic/CONFIG_CMA_DEBUG => redhat/configs/common/generic/CONFIG_CMA_DEBUG | 0
redhat/configs/ark/generic/CONFIG_CMA_DEBUGFS => redhat/configs/common/generic/CONFIG_CMA_DEBUGFS | 0
redhat/configs/fedora/generic/arm/CONFIG_CMA_AREAS | 1 -
redhat/configs/fedora/generic/arm/CONFIG_CMA_DEBUG | 1 -
redhat/configs/fedora/generic/CONFIG_CMA_SYSFS | 1 -
23 files changed, 1 insertions(+), 12 deletions(-)
From: Ondrej Mosnacek <omosnace(a)redhat.com>
spec: don't overwrite auto.conf with .config
This seems unnecessary (the auto.conf file is already there) and after
commit 129ab0d2d9f3 ("kbuild: do not quote string values in
include/config/auto.conf") it actually makes building external modules
fail with a syntax error, because the kernel Makefile newly assumes that
string values in auto.conf are not quoted.
I tested a scratch build with the cp line removed and it was possible to
build an external module without an issue. Still, to be on the safe
side, explicitly sync the timestamp of auto.conf with the root Makefile
as is done with version.h two lines above.
Signed-off-by: Ondrej Mosnacek <omosnace(a)redhat.com>
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
@@ -1960,12 +1960,11 @@ BuildKernel() {
# Clean up intermediate tools files
find $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/tools \( -iname "*.o" -o -iname "*.cmd" \) -exec rm -f {} +
- # Make sure the Makefile and version.h have a matching timestamp so that
- # external modules can be built
- touch -r $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/Makefile $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include/generated/uapi/linux/version.h
-
- # Copy .config to include/config/auto.conf so "make prepare" is unnecessary.
- cp $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/.config $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include/config/auto.conf
+ # Make sure the Makefile, version.h, and auto.conf have a matching
+ # timestamp so that external modules can be built
+ touch -r $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/Makefile \
+ $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include/generated/uapi/linux/version.h \
+ $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include/config/auto.conf
%if %{with_debuginfo}
eu-readelf -n vmlinux | grep "Build ID" | awk '{print $NF}' > vmlinux.id
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1597