Skip to content

Rebase on a 6.12.12 kernel #88

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

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
KERNEL_VERSION = linux-6.12.3
KERNEL_VERSION = linux-6.12.12
KERNEL_REMOTE = https://cdn.kernel.org/pub/linux/kernel/v6.x/$(KERNEL_VERSION).tar.xz
KERNEL_TARBALL = tarballs/$(KERNEL_VERSION).tar.xz
KERNEL_SOURCES = $(KERNEL_VERSION)
KERNEL_PATCHES = $(shell find patches/ -name "0*.patch" | sort)
KERNEL_C_BUNDLE = kernel.c

ABI_VERSION = 4
FULL_VERSION = 4.7.1
TIMESTAMP = "Mon Jan 20 16:45:32 CET 2025"
FULL_VERSION = 4.8.0
TIMESTAMP = "Mon Feb 3 12:07:59 CET 2025"

KERNEL_FLAGS = KBUILD_BUILD_TIMESTAMP=$(TIMESTAMP)
KERNEL_FLAGS += KBUILD_BUILD_USER=root
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 08321e01f374236bbd4358824a7d0bed75db56ca Mon Sep 17 00:00:00 2001
From 3cdd1e7073a04145ead29ce2929806b6c51c6b2b Mon Sep 17 00:00:00 2001
From: Sergio Lopez <[email protected]>
Date: Fri, 10 Sep 2021 13:05:01 +0200
Subject: [PATCH 1/4] virtio: enable DMA API if memory is restricted
Expand Down Expand Up @@ -32,7 +32,7 @@ index b9095751e43b..9e6420d5bc66 100644

if (!virtio_has_feature(dev, VIRTIO_F_VERSION_1))
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 98374ed7c577..8daebc83208c 100644
index 0112742e4504..84bfe596405f 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -6,6 +6,7 @@
Expand Down
2 changes: 1 addition & 1 deletion patches-sev/0002-x86-sev-write-AP-reset-vector.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 9da8c48cd0849c0c58b848c01f8cca7adf79ee70 Mon Sep 17 00:00:00 2001
From ff833b3915a24afda4ba722b282bbb9106f2efe5 Mon Sep 17 00:00:00 2001
From: Sergio Lopez <[email protected]>
Date: Thu, 20 Oct 2022 10:23:16 +0200
Subject: [PATCH 2/4] x86/sev: write AP reset vector
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From ff94a2d240ee168296ce4e2bb3370ee10272bbef Mon Sep 17 00:00:00 2001
From f58ad6fcbd4e17bdab18489c7f1704ef694d17a8 Mon Sep 17 00:00:00 2001
From: Sergio Lopez <[email protected]>
Date: Wed, 3 Aug 2022 12:35:12 +0200
Subject: [PATCH 3/4] Implement driver to retrieve secrets from cmdline
Expand Down
2 changes: 1 addition & 1 deletion patches-sev/0004-x86-sev-Avoid-using-native_cpuid.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 459990b97e11b3be4272d06b4647bdab6bdf099e Mon Sep 17 00:00:00 2001
From 5ed2eee642191331953448a3de62ddbea4189cdd Mon Sep 17 00:00:00 2001
From: Sergio Lopez <[email protected]>
Date: Wed, 5 Jun 2024 16:20:08 +0200
Subject: [PATCH 4/4] x86/sev: Avoid using native_cpuid
Expand Down
4 changes: 2 additions & 2 deletions patches/0001-krunfw-Don-t-panic-when-init-dies.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 784c1bce5f1ca4c39d6c94dd1db220291cb26f9a Mon Sep 17 00:00:00 2001
From 0cd52cfd16b4ba16e0a938fb368db82cbabcb4e3 Mon Sep 17 00:00:00 2001
From: Sergio Lopez <[email protected]>
Date: Thu, 2 Mar 2023 07:34:49 +0100
Subject: [PATCH 01/19] krunfw: Don't panic when init dies
Subject: [PATCH 01/22] krunfw: Don't panic when init dies

In libkrun, the isolated process runs as PID 1. When it exits,
trigger an orderly reboot instead of panic'ing.
Expand Down
4 changes: 2 additions & 2 deletions patches/0002-krunfw-Ignore-run_cmd-on-orderly-reboot.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From c843c27bf58ade43ae935391ade4908d980ba1a2 Mon Sep 17 00:00:00 2001
From 74add18a2324033242375735a1a10583d0649bd1 Mon Sep 17 00:00:00 2001
From: Sergio Lopez <[email protected]>
Date: Mon, 16 May 2022 16:04:27 +0200
Subject: [PATCH 02/19] krunfw: Ignore run_cmd on orderly reboot
Subject: [PATCH 02/22] krunfw: Ignore run_cmd on orderly reboot

We don't really support restarting the conventional way, so ignore
"run_cmd" so we can fall back to an emergency sync and reboot.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 71445bf49bdd1eeb6e5f199b1c8eca36586708fc Mon Sep 17 00:00:00 2001
From c59d9f765e8e220b2d819323c89c6106853a977b Mon Sep 17 00:00:00 2001
From: Bobby Eshleman <bobby.eshleman () bytedance ! com>
Date: Sat, 10 Jun 2023 00:58:28 +0000
Subject: [PATCH 03/19] vsock/dgram: generalize recvmsg and drop
Subject: [PATCH 03/22] vsock/dgram: generalize recvmsg and drop
transport->dgram_dequeue

This commit drops the transport->dgram_dequeue callback and makes
Expand Down Expand Up @@ -81,10 +81,10 @@ index 9e85424c8343..fe0fb5c01823 100644
/* STREAM. */
/* TODO: stream_bind() */
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index dfd29160fe11..014b8414a7d6 100644
index 15724f171b0f..a94f7f4b6f5f 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -1277,10 +1277,62 @@ static int vsock_dgram_connect(struct socket *sock,
@@ -1311,10 +1311,62 @@ static int vsock_dgram_connect(struct socket *sock,
int __vsock_dgram_recvmsg(struct socket *sock, struct msghdr *msg,
size_t len, int flags)
{
Expand Down Expand Up @@ -203,10 +203,10 @@ index b58c3818f284..48008d8341d7 100644
.stream_dequeue = virtio_transport_stream_dequeue,
.stream_enqueue = virtio_transport_stream_enqueue,
diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
index 9acc13ab3f82..13ae96f0d2ec 100644
index 7f7de6d88096..17e8f2078e8d 100644
--- a/net/vmw_vsock/virtio_transport_common.c
+++ b/net/vmw_vsock/virtio_transport_common.c
@@ -1047,6 +1047,24 @@ int virtio_transport_dgram_bind(struct vsock_sock *vsk,
@@ -1050,6 +1050,24 @@ int virtio_transport_dgram_bind(struct vsock_sock *vsk,
}
EXPORT_SYMBOL_GPL(virtio_transport_dgram_bind);

Expand Down
10 changes: 5 additions & 5 deletions patches/0004-vsock-refactor-transport-lookup-code.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 99a059c51f1d19be35e622e8297c4f5d9ee94b6e Mon Sep 17 00:00:00 2001
From 1c7c134fb4f8b22cca987ec00ff14e57ffaecde1 Mon Sep 17 00:00:00 2001
From: Bobby Eshleman <bobby.eshleman () bytedance ! com>
Date: Sat, 10 Jun 2023 00:58:29 +0000
Subject: [PATCH 04/19] vsock: refactor transport lookup code
Subject: [PATCH 04/22] vsock: refactor transport lookup code

Introduce new reusable function vsock_connectible_lookup_transport()
that performs the transport lookup logic.
Expand All @@ -14,10 +14,10 @@ Signed-off-by: Bobby Eshleman <[email protected]>
1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index 014b8414a7d6..5a45600002f5 100644
index a94f7f4b6f5f..48c38f4dd09f 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -425,6 +425,22 @@ static void vsock_deassign_transport(struct vsock_sock *vsk)
@@ -427,6 +427,22 @@ static void vsock_deassign_transport(struct vsock_sock *vsk)
vsk->transport = NULL;
}

Expand All @@ -40,7 +40,7 @@ index 014b8414a7d6..5a45600002f5 100644
/* Assign a transport to a socket and call the .init transport callback.
*
* Note: for connection oriented socket this must be called when vsk->remote_addr
@@ -465,13 +481,8 @@ int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk)
@@ -467,13 +483,8 @@ int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk)
break;
case SOCK_STREAM:
case SOCK_SEQPACKET:
Expand Down
24 changes: 12 additions & 12 deletions patches/0005-vsock-support-multi-transport-datagrams.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 448088b2a662ed19728b42e75c9a5f500d2c5359 Mon Sep 17 00:00:00 2001
From 5d4877987ae261f78b4bba7030ed3d157af6e51e Mon Sep 17 00:00:00 2001
From: Bobby Eshleman <bobby.eshleman () bytedance ! com>
Date: Sat, 10 Jun 2023 00:58:30 +0000
Subject: [PATCH 05/19] vsock: support multi-transport datagrams
Subject: [PATCH 05/22] vsock: support multi-transport datagrams

This patch adds support for multi-transport datagrams.

Expand Down Expand Up @@ -82,10 +82,10 @@ index 954c5d66f8e4..741d643534f4 100644
int virtio_transport_dgram_get_cid(struct sk_buff *skb, unsigned int *cid);
int virtio_transport_dgram_get_port(struct sk_buff *skb, unsigned int *port);
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index 5a45600002f5..2c4fda4215f1 100644
index 48c38f4dd09f..2dcb36d85743 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -441,6 +441,18 @@ vsock_connectible_lookup_transport(unsigned int cid, __u8 flags)
@@ -443,6 +443,18 @@ vsock_connectible_lookup_transport(unsigned int cid, __u8 flags)
return transport;
}

Expand All @@ -104,7 +104,7 @@ index 5a45600002f5..2c4fda4215f1 100644
/* Assign a transport to a socket and call the .init transport callback.
*
* Note: for connection oriented socket this must be called when vsk->remote_addr
@@ -477,7 +489,8 @@ int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk)
@@ -479,7 +491,8 @@ int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk)

switch (sk->sk_type) {
case SOCK_DGRAM:
Expand All @@ -114,7 +114,7 @@ index 5a45600002f5..2c4fda4215f1 100644
break;
case SOCK_STREAM:
case SOCK_SEQPACKET:
@@ -694,6 +707,9 @@ static int __vsock_bind_connectible(struct vsock_sock *vsk,
@@ -705,6 +718,9 @@ static int __vsock_bind_connectible(struct vsock_sock *vsk,
static int __vsock_bind_dgram(struct vsock_sock *vsk,
struct sockaddr_vm *addr)
{
Expand All @@ -124,7 +124,7 @@ index 5a45600002f5..2c4fda4215f1 100644
return vsk->transport->dgram_bind(vsk, addr);
}

@@ -1178,19 +1194,24 @@ static int vsock_dgram_sendmsg(struct socket *sock, struct msghdr *msg,
@@ -1212,19 +1228,24 @@ static int vsock_dgram_sendmsg(struct socket *sock, struct msghdr *msg,

lock_sock(sk);

Expand Down Expand Up @@ -156,7 +156,7 @@ index 5a45600002f5..2c4fda4215f1 100644
/* Ensure this address is of the right type and is a valid
* destination.
*/
@@ -1199,11 +1220,27 @@ static int vsock_dgram_sendmsg(struct socket *sock, struct msghdr *msg,
@@ -1233,11 +1254,27 @@ static int vsock_dgram_sendmsg(struct socket *sock, struct msghdr *msg,
remote_addr->svm_cid = transport->get_local_cid();

if (!vsock_addr_bound(remote_addr)) {
Expand Down Expand Up @@ -184,7 +184,7 @@ index 5a45600002f5..2c4fda4215f1 100644

if (remote_addr->svm_cid == VMADDR_CID_ANY)
remote_addr->svm_cid = transport->get_local_cid();
@@ -1211,23 +1248,23 @@ static int vsock_dgram_sendmsg(struct socket *sock, struct msghdr *msg,
@@ -1245,23 +1282,23 @@ static int vsock_dgram_sendmsg(struct socket *sock, struct msghdr *msg,
/* XXX Should connect() or this function ensure remote_addr is
* bound?
*/
Expand Down Expand Up @@ -217,7 +217,7 @@ index 5a45600002f5..2c4fda4215f1 100644
out:
release_sock(sk);
return err;
@@ -1261,13 +1298,18 @@ static int vsock_dgram_connect(struct socket *sock,
@@ -1295,13 +1332,18 @@ static int vsock_dgram_connect(struct socket *sock,
if (err)
goto out;

Expand Down Expand Up @@ -274,10 +274,10 @@ index 48008d8341d7..f64281de9783 100644
.dgram_allow = virtio_transport_dgram_allow,
.dgram_get_cid = virtio_transport_dgram_get_cid,
diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
index 13ae96f0d2ec..2a0f720e33d8 100644
index 17e8f2078e8d..0cebeeb1c94a 100644
--- a/net/vmw_vsock/virtio_transport_common.c
+++ b/net/vmw_vsock/virtio_transport_common.c
@@ -1040,13 +1040,6 @@ bool virtio_transport_stream_allow(u32 cid, u32 port)
@@ -1043,13 +1043,6 @@ bool virtio_transport_stream_allow(u32 cid, u32 port)
}
EXPORT_SYMBOL_GPL(virtio_transport_stream_allow);

Expand Down
18 changes: 9 additions & 9 deletions patches/0006-vsock-make-vsock-bind-reusable.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 7409ec09ad5cb801a3a22c2ab14ecfef6db7fa74 Mon Sep 17 00:00:00 2001
From 62e557477f1d893e16d79f9bd003cac8c64193ac Mon Sep 17 00:00:00 2001
From: Bobby Eshleman <bobby.eshleman () bytedance ! com>
Date: Sat, 10 Jun 2023 00:58:31 +0000
Subject: [PATCH 06/19] vsock: make vsock bind reusable
Subject: [PATCH 06/22] vsock: make vsock bind reusable

This commit makes the bind table management functions in vsock usable
for different bind tables. For use by datagrams in a future patch.
Expand All @@ -12,10 +12,10 @@ Signed-off-by: Bobby Eshleman <[email protected]>
1 file changed, 26 insertions(+), 7 deletions(-)

diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index 2c4fda4215f1..fc4d894a62bd 100644
index 2dcb36d85743..6f6bce0cebb1 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -233,11 +233,12 @@ static void __vsock_remove_connected(struct vsock_sock *vsk)
@@ -235,11 +235,12 @@ static void __vsock_remove_connected(struct vsock_sock *vsk)
sock_put(&vsk->sk);
}

Expand All @@ -30,7 +30,7 @@ index 2c4fda4215f1..fc4d894a62bd 100644
if (vsock_addr_equals_addr(addr, &vsk->local_addr))
return sk_vsock(vsk);

@@ -250,6 +251,11 @@ static struct sock *__vsock_find_bound_socket(struct sockaddr_vm *addr)
@@ -252,6 +253,11 @@ static struct sock *__vsock_find_bound_socket(struct sockaddr_vm *addr)
return NULL;
}

Expand All @@ -42,7 +42,7 @@ index 2c4fda4215f1..fc4d894a62bd 100644
static struct sock *__vsock_find_connected_socket(struct sockaddr_vm *src,
struct sockaddr_vm *dst)
{
@@ -649,12 +655,17 @@ static void vsock_pending_work(struct work_struct *work)
@@ -660,12 +666,17 @@ static void vsock_pending_work(struct work_struct *work)

/**** SOCKET OPERATIONS ****/

Expand All @@ -62,7 +62,7 @@ index 2c4fda4215f1..fc4d894a62bd 100644
if (!port)
port = get_random_u32_above(LAST_RESERVED_PORT);

@@ -670,7 +681,8 @@ static int __vsock_bind_connectible(struct vsock_sock *vsk,
@@ -681,7 +692,8 @@ static int __vsock_bind_connectible(struct vsock_sock *vsk,

new_addr.svm_port = port++;

Expand All @@ -72,7 +72,7 @@ index 2c4fda4215f1..fc4d894a62bd 100644
found = true;
break;
}
@@ -687,7 +699,8 @@ static int __vsock_bind_connectible(struct vsock_sock *vsk,
@@ -698,7 +710,8 @@ static int __vsock_bind_connectible(struct vsock_sock *vsk,
return -EACCES;
}

Expand All @@ -82,7 +82,7 @@ index 2c4fda4215f1..fc4d894a62bd 100644
return -EADDRINUSE;
}

@@ -699,11 +712,17 @@ static int __vsock_bind_connectible(struct vsock_sock *vsk,
@@ -710,11 +723,17 @@ static int __vsock_bind_connectible(struct vsock_sock *vsk,
* by AF_UNIX.
*/
__vsock_remove_bound(vsk);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From c1fc9e5866174b3ec0330c94f2441d836f265008 Mon Sep 17 00:00:00 2001
From edbbbdb92698f8ef428febcfc18a72f8b38369e2 Mon Sep 17 00:00:00 2001
From: Bobby Eshleman <bobby.eshleman () bytedance ! com>
Date: Sat, 10 Jun 2023 00:58:32 +0000
Subject: [PATCH 07/19] virtio/vsock: add VIRTIO_VSOCK_F_DGRAM feature bit
Subject: [PATCH 07/22] virtio/vsock: add VIRTIO_VSOCK_F_DGRAM feature bit

This commit adds a feature bit for virtio vsock to support datagrams.

Expand Down
Loading