summaryrefslogtreecommitdiffstats
path: root/meta-agl-jailhouse/recipes-kernel/linux/linux/0022-ivshmem-net-Switch-to-relative-descriptor-addresses.patch
diff options
context:
space:
mode:
authorJakub Luzny <jakub@luzny.cz>2020-07-19 17:00:08 +0200
committerJakub Luzny <jakub@luzny.cz>2020-07-24 12:46:57 +0200
commit3f6d193683449a323a3f1d689540ab697d3d7980 (patch)
tree093ad36c5bf3f031d469a635d0f2190a57c176e0 /meta-agl-jailhouse/recipes-kernel/linux/linux/0022-ivshmem-net-Switch-to-relative-descriptor-addresses.patch
parentc6889de97c1af6baa7ee8006aa75da170c9bd407 (diff)
Add layer to support Jailhouse hypervisorjellyfish_9.99.2jellyfish/9.99.29.99.2
Jailhouse is a partitioning hypervisor based on Linux. It is able to run bare-metal applications or (adapted) operating systems besides Linux. For this purpose, it configures CPU and device virtualization features of the hardware platform in a way that none of these domains, called "cells" here, can interfere with each other in an unacceptable way. This layer adds the Jailhouse package into AGL and also appends the BSPs to allow it to run. Currently, Raspberry Pi 4 and QEMU x86-64 targets are supported. To enable Jailhouse and include it in the image, the AGL feature agl-jailhouse must be enabled. Bug-AGL: SPEC-3507 Signed-off-by: Jakub Luzny <jakub@luzny.cz> Change-Id: I0fbc0b5d931c85d6f22b0222da8c2b106c4115e1
Diffstat (limited to 'meta-agl-jailhouse/recipes-kernel/linux/linux/0022-ivshmem-net-Switch-to-relative-descriptor-addresses.patch')
-rw-r--r--meta-agl-jailhouse/recipes-kernel/linux/linux/0022-ivshmem-net-Switch-to-relative-descriptor-addresses.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/meta-agl-jailhouse/recipes-kernel/linux/linux/0022-ivshmem-net-Switch-to-relative-descriptor-addresses.patch b/meta-agl-jailhouse/recipes-kernel/linux/linux/0022-ivshmem-net-Switch-to-relative-descriptor-addresses.patch
new file mode 100644
index 00000000..aca00e26
--- /dev/null
+++ b/meta-agl-jailhouse/recipes-kernel/linux/linux/0022-ivshmem-net-Switch-to-relative-descriptor-addresses.patch
@@ -0,0 +1,49 @@
+From d1a0011e9857e105e38d9a0ea6fd7b8e7e6d8dc9 Mon Sep 17 00:00:00 2001
+From: Jan Kiszka <jan.kiszka@siemens.com>
+Date: Tue, 3 Jan 2017 08:50:01 +0100
+Subject: [PATCH 22/32] ivshmem-net: Switch to relative descriptor addresses
+
+Make sure that we do not depend on identity-mapped shared memory
+regions.
+
+This also fixes an off-by-one in the range check of ivshm_net_desc_data.
+
+Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
+---
+ drivers/net/ivshmem-net.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/ivshmem-net.c b/drivers/net/ivshmem-net.c
+index 9f307ec4d677..0e770ca293a4 100644
+--- a/drivers/net/ivshmem-net.c
++++ b/drivers/net/ivshmem-net.c
+@@ -123,14 +123,14 @@ static void *ivshm_net_desc_data(struct ivshm_net *in,
+ struct vring_desc *desc,
+ u32 *len)
+ {
+- u64 addr = READ_ONCE(desc->addr);
++ u64 offs = READ_ONCE(desc->addr);
+ u32 dlen = READ_ONCE(desc->len);
+ void *data;
+
+- if (addr < in->shmaddr || desc->addr > in->shmaddr + in->shmlen)
++ if (offs >= in->shmlen)
+ return NULL;
+
+- data = in->shm + (addr - in->shmaddr);
++ data = in->shm + offs;
+
+ if (data < q->data || data >= q->end)
+ return NULL;
+@@ -317,7 +317,7 @@ static int ivshm_net_tx_frame(struct net_device *ndev, struct sk_buff *skb)
+ buf = tx->data + head;
+ skb_copy_and_csum_dev(skb, buf);
+
+- desc->addr = in->shmaddr + (buf - in->shm);
++ desc->addr = buf - in->shm;
+ desc->len = skb->len;
+
+ avail = tx->last_avail_idx++ & (vr->num - 1);
+--
+2.11.0
+