-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rebase on the latest LTS kernel. Only minor changes required in "vsock-dgram-generalize-recvmsg-and-drop-transport-dg.patch". Also, update the Asahi TSO patches to include the "fixup!" patches in bits/220-tso, and add "drm-virtio-Support-fence-passing-feature.patch" to enable userspace to implement cross-domain fence optimizations. Signed-off-by: Sergio Lopez <[email protected]>
- Loading branch information
Showing
22 changed files
with
708 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From aa2644a251efee27236a017487fc30f82227cb1e Mon Sep 17 00:00:00 2001 | ||
From 6616593252269d81b003d7aa1e7e4dd156d1a629 Mon Sep 17 00:00:00 2001 | ||
From: Sergio Lopez <[email protected]> | ||
Date: Fri, 10 Sep 2021 13:05:01 +0200 | ||
Subject: [PATCH 12/15] virtio: enable DMA API if memory is restricted | ||
Subject: [PATCH 1/4] virtio: enable DMA API if memory is restricted | ||
|
||
When running on a system with restricted memory access, the driver | ||
can't have direct access to the memory. In this scenario, | ||
|
@@ -32,7 +32,7 @@ index 71dee622b771..f92475dbca43 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 6f7e5010a673..d40dbac45284 100644 | ||
index 80669e05bf0e..438b4f6c5cdb 100644 | ||
--- a/drivers/virtio/virtio_ring.c | ||
+++ b/drivers/virtio/virtio_ring.c | ||
@@ -6,6 +6,7 @@ | ||
|
@@ -54,5 +54,5 @@ index 6f7e5010a673..d40dbac45284 100644 | |
/* | ||
* In theory, it's possible to have a buggy QEMU-supposed | ||
-- | ||
2.45.2 | ||
2.46.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From ba40cb466eac33c12dc2d285f7af8f45e0cfbfd7 Mon Sep 17 00:00:00 2001 | ||
From ecbb6d5db802293ef27575a672336e17e8c2abfd Mon Sep 17 00:00:00 2001 | ||
From: Sergio Lopez <[email protected]> | ||
Date: Thu, 20 Oct 2022 10:23:16 +0200 | ||
Subject: [PATCH 13/15] x86/sev: write AP reset vector | ||
Subject: [PATCH 2/4] x86/sev: write AP reset vector | ||
|
||
If a jump table can't be found, write the SEV-ES trampoline location | ||
into the AP reset vector used by libkrun's qboot. | ||
|
@@ -55,5 +55,5 @@ index 9905dc0e0b09..38df85fd1324 100644 | |
/* Check if AP Jump Table is page-aligned */ | ||
if (jump_table_addr & ~PAGE_MASK) | ||
-- | ||
2.45.2 | ||
2.46.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From 49e3dd72da01fff91a85f4d4bc0e705dbde9ae67 Mon Sep 17 00:00:00 2001 | ||
From 0738c09d916b06afa162facb0edc84ffe121c35a Mon Sep 17 00:00:00 2001 | ||
From: Sergio Lopez <[email protected]> | ||
Date: Wed, 3 Aug 2022 12:35:12 +0200 | ||
Subject: [PATCH 14/15] Implement driver to retrieve secrets from cmdline | ||
Subject: [PATCH 3/4] Implement driver to retrieve secrets from cmdline | ||
|
||
When CMDLINE_OVERRIDE is enabled, the contents originally present in | ||
the location passed on the cmdline pointer of the zero page are | ||
|
@@ -292,5 +292,5 @@ index c787e94cc898..2fb8a8af9af6 100644 | |
|
||
/* | ||
-- | ||
2.45.2 | ||
2.46.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From 3fcf7bfe438218d884d8aa36159bcf6ec37e23eb Mon Sep 17 00:00:00 2001 | ||
From 95ae01ac9240b47dcdeda540e59a24ba0bdaf963 Mon Sep 17 00:00:00 2001 | ||
From: Sergio Lopez <[email protected]> | ||
Date: Wed, 5 Jun 2024 16:20:08 +0200 | ||
Subject: [PATCH 15/15] x86/sev: Avoid using native_cpuid | ||
Subject: [PATCH 4/4] x86/sev: Avoid using native_cpuid | ||
|
||
In the state we get into the kernel from qboot-krunfw we can't return | ||
from #VC properly, so avoid calling native_cpuid in the early stages | ||
|
@@ -61,5 +61,5 @@ index cc47a818a640..a2b5b08eee23 100644 | |
/* Check the SEV MSR whether SEV or SME is enabled */ | ||
RIP_REL_REF(sev_status) = msr = __rdmsr(MSR_AMD64_SEV); | ||
-- | ||
2.45.2 | ||
2.46.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From 2b01861f2623f4434d90e484448e8c9e45c1242c Mon Sep 17 00:00:00 2001 | ||
From 7f18f75689b7b0f34ca711daa4e29e2d4ae5f910 Mon Sep 17 00:00:00 2001 | ||
From: Sergio Lopez <[email protected]> | ||
Date: Thu, 2 Mar 2023 07:34:49 +0100 | ||
Subject: [PATCH 01/15] krunfw: Don't panic when init dies | ||
Subject: [PATCH 01/17] 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. | ||
|
@@ -58,5 +58,5 @@ index 6ebef11c8876..4323caa5b871 100644 | |
machine_restart(cmd); | ||
} | ||
-- | ||
2.45.2 | ||
2.46.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From 887e1f887d0c04fe8ccf511a9521c38e2a817a2d Mon Sep 17 00:00:00 2001 | ||
From 5ed6edb3e75df34958f788bca363748cea75eea1 Mon Sep 17 00:00:00 2001 | ||
From: Sergio Lopez <[email protected]> | ||
Date: Mon, 16 May 2022 16:04:27 +0200 | ||
Subject: [PATCH 02/15] krunfw: Ignore run_cmd on orderly reboot | ||
Subject: [PATCH 02/17] 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. | ||
|
@@ -28,5 +28,5 @@ index 4323caa5b871..d9d6f0dd2ebc 100644 | |
if (ret) { | ||
pr_warn("Failed to start orderly reboot: forcing the issue\n"); | ||
-- | ||
2.45.2 | ||
2.46.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From 0334eb653db47ada29d2e523b2e7651dee2fb4e2 Mon Sep 17 00:00:00 2001 | ||
From 06a9c813b4f59d92edf78a6011a719629323081c 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/15] vsock/dgram: generalize recvmsg and drop | ||
Subject: [PATCH 03/17] vsock/dgram: generalize recvmsg and drop | ||
transport->dgram_dequeue | ||
|
||
This commit drops the transport->dgram_dequeue callback and makes | ||
|
@@ -14,13 +14,13 @@ Signed-off-by: Bobby Eshleman <[email protected]> | |
drivers/vhost/vsock.c | 4 +- | ||
include/linux/virtio_vsock.h | 3 ++ | ||
include/net/af_vsock.h | 13 ++++- | ||
net/vmw_vsock/af_vsock.c | 51 ++++++++++++++++++- | ||
net/vmw_vsock/af_vsock.c | 58 +++++++++++++++++++-- | ||
net/vmw_vsock/hyperv_transport.c | 17 +++++-- | ||
net/vmw_vsock/virtio_transport.c | 4 +- | ||
net/vmw_vsock/virtio_transport_common.c | 18 +++++++ | ||
net/vmw_vsock/vmci_transport.c | 68 ++++++++++--------------- | ||
net/vmw_vsock/vsock_loopback.c | 4 +- | ||
9 files changed, 132 insertions(+), 50 deletions(-) | ||
9 files changed, 137 insertions(+), 52 deletions(-) | ||
|
||
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c | ||
index d94a06008ff6..549158375086 100644 | ||
|
@@ -54,7 +54,7 @@ index fbf30721bac9..1098a4c0d738 100644 | |
int virtio_transport_connect(struct vsock_sock *vsk); | ||
|
||
diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h | ||
index dc3cb16835b6..3fee8b8bb3e0 100644 | ||
index f8b09a82f62e..7a342d406c34 100644 | ||
--- a/include/net/af_vsock.h | ||
+++ b/include/net/af_vsock.h | ||
@@ -120,11 +120,20 @@ struct vsock_transport { | ||
|
@@ -81,28 +81,24 @@ index dc3cb16835b6..3fee8b8bb3e0 100644 | |
/* STREAM. */ | ||
/* TODO: stream_bind() */ | ||
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c | ||
index 4afb6a541cf3..c66d3def5e6e 100644 | ||
index f5eb737a677d..c3fdb22cfd39 100644 | ||
--- a/net/vmw_vsock/af_vsock.c | ||
+++ b/net/vmw_vsock/af_vsock.c | ||
@@ -1273,11 +1273,15 @@ static int vsock_dgram_connect(struct socket *sock, | ||
int vsock_dgram_recvmsg(struct socket *sock, struct msghdr *msg, | ||
size_t len, int flags) | ||
@@ -1273,10 +1273,62 @@ static int vsock_dgram_connect(struct socket *sock, | ||
int __vsock_dgram_recvmsg(struct socket *sock, struct msghdr *msg, | ||
size_t len, int flags) | ||
{ | ||
- struct sock *sk = sock->sk; | ||
- struct vsock_sock *vsk = vsock_sk(sk); | ||
+ const struct vsock_transport *transport; | ||
#ifdef CONFIG_BPF_SYSCALL | ||
const struct proto *prot; | ||
#endif | ||
struct vsock_sock *vsk; | ||
+ struct vsock_sock *vsk; | ||
+ struct sk_buff *skb; | ||
+ size_t payload_len; | ||
struct sock *sk; | ||
+ struct sock *sk; | ||
+ int err; | ||
|
||
sk = sock->sk; | ||
vsk = vsock_sk(sk); | ||
@@ -1288,7 +1292,52 @@ int vsock_dgram_recvmsg(struct socket *sock, struct msghdr *msg, | ||
return prot->recvmsg(sk, msg, len, flags, NULL); | ||
#endif | ||
+ | ||
+ sk = sock->sk; | ||
+ vsk = vsock_sk(sk); | ||
|
||
- return vsk->transport->dgram_dequeue(vsk, msg, len, flags); | ||
+ if (flags & MSG_OOB || flags & MSG_ERRQUEUE) | ||
|
@@ -152,8 +148,8 @@ index 4afb6a541cf3..c66d3def5e6e 100644 | |
+ skb_free_datagram(&vsk->sk, skb); | ||
+ return err; | ||
} | ||
EXPORT_SYMBOL_GPL(vsock_dgram_recvmsg); | ||
|
||
int vsock_dgram_recvmsg(struct socket *sock, struct msghdr *msg, | ||
diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c | ||
index e2157e387217..a83b30d366af 100644 | ||
--- a/net/vmw_vsock/hyperv_transport.c | ||
|
@@ -352,5 +348,5 @@ index 0ce65d0a4a44..6b19e308a140 100644 | |
.stream_dequeue = virtio_transport_stream_dequeue, | ||
.stream_enqueue = virtio_transport_stream_enqueue, | ||
-- | ||
2.45.2 | ||
2.46.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From 5981f2c4b9ec44a6195d2ba892100e1cdbe80d24 Mon Sep 17 00:00:00 2001 | ||
From 5a2b5b9c1a9f473836c361153b15c10eab012e9a 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/15] vsock: refactor transport lookup code | ||
Subject: [PATCH 04/17] vsock: refactor transport lookup code | ||
|
||
Introduce new reusable function vsock_connectible_lookup_transport() | ||
that performs the transport lookup logic. | ||
|
@@ -14,7 +14,7 @@ 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 c66d3def5e6e..813588bee10f 100644 | ||
index c3fdb22cfd39..5a517638deed 100644 | ||
--- a/net/vmw_vsock/af_vsock.c | ||
+++ b/net/vmw_vsock/af_vsock.c | ||
@@ -424,6 +424,22 @@ static void vsock_deassign_transport(struct vsock_sock *vsk) | ||
|
@@ -57,5 +57,5 @@ index c66d3def5e6e..813588bee10f 100644 | |
default: | ||
return -ESOCKTNOSUPPORT; | ||
-- | ||
2.45.2 | ||
2.46.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From a01abc12504a5819737fc8dcb6026eb2c52e67de Mon Sep 17 00:00:00 2001 | ||
From 9b076ce6da60de7904d340289a2187325efee512 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/15] vsock: make vsock bind reusable | ||
Subject: [PATCH 06/17] 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. | ||
|
@@ -12,7 +12,7 @@ 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 2567641a829f..034c3db91fc3 100644 | ||
index afe28d3b0b74..6a94a623dd07 100644 | ||
--- a/net/vmw_vsock/af_vsock.c | ||
+++ b/net/vmw_vsock/af_vsock.c | ||
@@ -232,11 +232,12 @@ static void __vsock_remove_connected(struct vsock_sock *vsk) | ||
|
@@ -102,5 +102,5 @@ index 2567641a829f..034c3db91fc3 100644 | |
struct sockaddr_vm *addr) | ||
{ | ||
-- | ||
2.45.2 | ||
2.46.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From 6befcab4d48cb38c8e34f13a6f5f1b7b45c5449e Mon Sep 17 00:00:00 2001 | ||
From aacd77363c0f5c8515f9ef55889cd367d42d06f9 Mon Sep 17 00:00:00 2001 | ||
From: Jiang Wang <[email protected]> | ||
Date: Sat, 10 Jun 2023 00:58:35 +0000 | ||
Subject: [PATCH 09/15] tests: add vsock dgram tests | ||
Subject: [PATCH 09/17] tests: add vsock dgram tests | ||
|
||
This patch adds tests for vsock datagram. | ||
|
||
|
@@ -667,5 +667,5 @@ index 5dc7767039f6..7c66e934341a 100644 | |
{}, | ||
}; | ||
-- | ||
2.45.2 | ||
2.46.0 | ||
|
Oops, something went wrong.