diff options
author | Jakub Luzny <jakub@luzny.cz> | 2020-07-19 17:00:08 +0200 |
---|---|---|
committer | Jakub Luzny <jakub@luzny.cz> | 2020-07-24 12:46:57 +0200 |
commit | 3f6d193683449a323a3f1d689540ab697d3d7980 (patch) | |
tree | 093ad36c5bf3f031d469a635d0f2190a57c176e0 /meta-agl-jailhouse/recipes-kernel/linux/linux/0010-uio-Enable-read-only-mappings.patch | |
parent | c6889de97c1af6baa7ee8006aa75da170c9bd407 (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/0010-uio-Enable-read-only-mappings.patch')
-rw-r--r-- | meta-agl-jailhouse/recipes-kernel/linux/linux/0010-uio-Enable-read-only-mappings.patch | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/meta-agl-jailhouse/recipes-kernel/linux/linux/0010-uio-Enable-read-only-mappings.patch b/meta-agl-jailhouse/recipes-kernel/linux/linux/0010-uio-Enable-read-only-mappings.patch new file mode 100644 index 00000000..2fa65641 --- /dev/null +++ b/meta-agl-jailhouse/recipes-kernel/linux/linux/0010-uio-Enable-read-only-mappings.patch @@ -0,0 +1,57 @@ +From 9c8885c6e020451e4a4578be9db318e5c07227ea Mon Sep 17 00:00:00 2001 +From: Jan Kiszka <jan.kiszka@siemens.com> +Date: Tue, 4 Jun 2019 14:40:09 +0200 +Subject: [PATCH 10/32] uio: Enable read-only mappings + +This allows to tag memory regions read-only, denying userspace to map +them writable. Default remains read/write. + +Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> +--- + drivers/uio/uio.c | 9 +++++++++ + include/linux/uio_driver.h | 2 ++ + 2 files changed, 11 insertions(+) + +diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c +index a57698985f9c..ac18542ee4fe 100644 +--- a/drivers/uio/uio.c ++++ b/drivers/uio/uio.c +@@ -790,6 +790,15 @@ static int uio_mmap(struct file *filep, struct vm_area_struct *vma) + goto out; + } + ++ if (idev->info->mem[mi].readonly) { ++ if (vma->vm_flags & VM_WRITE) { ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ vma->vm_flags &= ~VM_MAYWRITE; ++ } ++ + if (idev->info->mmap) { + ret = idev->info->mmap(idev->info, vma); + goto out; +diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h +index 01081c4726c0..ebfc06e36ca2 100644 +--- a/include/linux/uio_driver.h ++++ b/include/linux/uio_driver.h +@@ -31,6 +31,7 @@ struct uio_map; + * @offs: offset of device memory within the page + * @size: size of IO (multiple of page size) + * @memtype: type of memory addr points to ++ * @readonly: true of region is read-only + * @internal_addr: ioremap-ped version of addr, for driver internal use + * @map: for use by the UIO core only. + */ +@@ -40,6 +41,7 @@ struct uio_mem { + unsigned long offs; + resource_size_t size; + int memtype; ++ bool readonly; + void __iomem *internal_addr; + struct uio_map *map; + }; +-- +2.11.0 + |