summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOla Redell <ola.redell@retotech.se>2017-12-17 21:41:53 +0000
committerOla Redell <ola.redell@retotech.se>2017-12-17 21:41:53 +0000
commitdf4216d07f301ea61e03a4f4419762fd8c33fd4d (patch)
treea4f3bdd02e89f1ba469cf39167235dc279c8c0f3
parente0a1fea1252e26f95f5a6302f0079d4e7649ffc2 (diff)
parent6c9981b7a368cf047ce98bc49e2beb74c58d4775 (diff)
downloadmeta-jailhouse-df4216d07f301ea61e03a4f4419762fd8c33fd4d.tar.gz
Merged in olrex/meta-jailhouse (pull request #1)
Master
-rw-r--r--README.md53
-rw-r--r--conf/machine/jailhouse-bpi.conf15
-rw-r--r--recipes-core/images/jailhouse-image.bb11
-rw-r--r--recipes-kernel/linux/jailhouse-linux-4.14.6/jailhouse-bpi/defconfig185
-rw-r--r--recipes-kernel/linux/jailhouse-linux-4.14.6/jailhouse-required-symbol-export.patch20
-rw-r--r--recipes-kernel/linux/jailhouse-linux-4.14.6/jailhouse-required-symbol-export_2.patch57
-rw-r--r--recipes-kernel/linux/jailhouse-linux-4.14.6/jailhouse-required-symbol-export_3.patch9
-rw-r--r--recipes-kernel/linux/jailhouse-linux_4.14.6.bb32
8 files changed, 362 insertions, 20 deletions
diff --git a/README.md b/README.md
index 29a9edc..b336987 100644
--- a/README.md
+++ b/README.md
@@ -17,13 +17,17 @@ This layer depends on:
17 layers: meta 17 layers: meta
18 branch: master 18 branch: master
19 19
20 URI: https://github.com/linux-sunxi/meta-sunxi
21 branch: master
22 tested with 7f88e6c78e7014960654c8f4b3bb0c4e188f0f43
23
20 24
21Maintainers 25Maintainers
22=========== 26===========
23 27
24* Ola Redell <ola@retotech.se> 28* Ola Redell <ola@retotech.se>
25* Anders Törnqvist <anders@retotech.se> 29* Anders Törnqvist <anders@retotech.se>
26* Jonas WestÃ¥ker <jonas@retotech.se> 30* Jonas Weståker <jonas@retotech.se>
27 31
28Please submit any patches against this jailhouse layer 32Please submit any patches against this jailhouse layer
29via email or https://bitbucket.org/retotech/meta-jailhouse 33via email or https://bitbucket.org/retotech/meta-jailhouse
@@ -35,6 +39,7 @@ Tested with
35* Yocto 2.2 39* Yocto 2.2
36* This layer has been developed for and tested with Bananapi M1 as target. 40* This layer has been developed for and tested with Bananapi M1 as target.
37No other targets have been used thus far. 41No other targets have been used thus far.
42* meta-sunxi, 7f88e6c78e7014960654c8f4b3bb0c4e188f0f43
38 43
39 44
40Adding the jailhouse layer to your build 45Adding the jailhouse layer to your build
@@ -76,7 +81,7 @@ recipe defines a CELLS variable that lists all recipes that provide cells (and
76inmates) for the jailhouse build. Adapt the CELLS variable according to your 81inmates) for the jailhouse build. Adapt the CELLS variable according to your
77needs, e.g. 82needs, e.g.
78 83
79 CELLS_append = " freertos-cell" 84 CELLS_pn-jailhouse = "freertos-cell"
80 85
81in `local.conf`. 86in `local.conf`.
82With this declaration, freertos-cell entries will be added both to the 87With this declaration, freertos-cell entries will be added both to the
@@ -114,23 +119,6 @@ Using this class and variables ensures that the file designated by the
114`CELLCONFIG` variable is pulled into the jailhouse build such that 119`CELLCONFIG` variable is pulled into the jailhouse build such that
115a corresponding *.cell file is created. 120a corresponding *.cell file is created.
116 121
117Example cell
118------------
119
120An example cell recipe for the freertos-cell from Siemens is available
121under `recipes-jailhouse/freertos-cell`. To use this, set the
122`CELLS` variable accordingly as described above.
123
124Test the cell by executing the following sequence once booted.
125
126 export JAILHOUSE_DIR=/usr/share/jailhouse
127 jailhouse enable ${JAILHOUSE_DIR}/cells/plamics-bpi-root.cell
128 jailhouse cell create ${JAILHOUSE_DIR}/cells/freertos-cell.cell
129 jailhouse cell load FreeRTOS ${JAILHOUSE_DIR}/inmates/freertos-demo.bin
130 jailhouse cell start FreeRTOS
131
132You should see output on the serial port used by the FreeRTOS inmate.
133
134Important Variables 122Important Variables
135=================== 123===================
136 124
@@ -168,3 +156,28 @@ are installed. This defaults to ${JH_DATADIR}/cells.
168 156
169`INMATES_DIR` Target directory into which inmate binaries (.bin) are installed. 157`INMATES_DIR` Target directory into which inmate binaries (.bin) are installed.
170Defaults to ${JH_DATADIR}/inmates. 158Defaults to ${JH_DATADIR}/inmates.
159
160Example image
161=============
162
163Build the example image `jailhouse-image` using the included machine
164configuration `jailhouse-bpi` together with the provided kernel recipe:
165
166 MACHINE=jailhouse-bpi bitbake jailhouse-image
167
168Example cell
169------------
170
171An example cell recipe for the freertos-cell from Siemens is available
172under `recipes-jailhouse/freertos-cell`. To use this, set the
173`CELLS` variable accordingly as described above.
174
175Test the cell by executing the following sequence once booted.
176
177 export JAILHOUSE_DIR=/usr/share/jailhouse
178 jailhouse enable ${JAILHOUSE_DIR}/cells/bananapi.cell
179 jailhouse cell create ${JAILHOUSE_DIR}/cells/freertos-cell.cell
180 jailhouse cell load FreeRTOS ${JAILHOUSE_DIR}/inmates/freertos-demo.bin
181 jailhouse cell start FreeRTOS
182
183You should see output on the serial port used by the FreeRTOS inmate.
diff --git a/conf/machine/jailhouse-bpi.conf b/conf/machine/jailhouse-bpi.conf
new file mode 100644
index 0000000..01ced78
--- /dev/null
+++ b/conf/machine/jailhouse-bpi.conf
@@ -0,0 +1,15 @@
1#@TYPE: Machine
2#@NAME: Jailhouse Bananapi M1
3#@DESCRIPTION: Machine configuration for the bananapi, based on allwinner A20 CPU http://bananapi.org/
4
5require conf/machine/include/sun7i.inc
6
7KERNEL_DEVICETREE = "sun7i-a20-bananapi.dtb"
8UBOOT_MACHINE = "Bananapi_config"
9SUNXI_FEX_FILE = "sys_config/a20/Bananapi.fex"
10
11PREFERRED_PROVIDER_virtual/kernel = "jailhouse-linux"
12PREFERRED_VERSION_jailhouse-linux_jailhouse-bpi="4.14.6"
13PREFERRED_VERSION_make-native="4.2.1"
14
15DEFAULTTUNE = "cortexa7hf-neon-vfpv4"
diff --git a/recipes-core/images/jailhouse-image.bb b/recipes-core/images/jailhouse-image.bb
new file mode 100644
index 0000000..60a1b31
--- /dev/null
+++ b/recipes-core/images/jailhouse-image.bb
@@ -0,0 +1,11 @@
1SUMMARY = "A small image just capable of starting Jailhouse with cells"
2
3include recipes-core/images/core-image-minimal.bb
4
5IMAGE_INSTALL_append= " \
6 jailhouse \
7 jailhouse-bash-completion \
8 kernel-module-jailhouse \
9 "
10
11IMAGE_FEATURES += "ssh-server-openssh"
diff --git a/recipes-kernel/linux/jailhouse-linux-4.14.6/jailhouse-bpi/defconfig b/recipes-kernel/linux/jailhouse-linux-4.14.6/jailhouse-bpi/defconfig
new file mode 100644
index 0000000..39c0e1d
--- /dev/null
+++ b/recipes-kernel/linux/jailhouse-linux-4.14.6/jailhouse-bpi/defconfig
@@ -0,0 +1,185 @@
1# CONFIG_LOCALVERSION_AUTO is not set
2CONFIG_NO_HZ=y
3CONFIG_HIGH_RES_TIMERS=y
4CONFIG_IKCONFIG=y
5CONFIG_IKCONFIG_PROC=y
6CONFIG_CGROUPS=y
7CONFIG_CGROUP_FREEZER=y
8CONFIG_CGROUP_DEVICE=y
9CONFIG_CPUSETS=y
10CONFIG_CGROUP_CPUACCT=y
11CONFIG_MEMCG=y
12CONFIG_MEMCG_SWAP=y
13CONFIG_MEMCG_KMEM=y
14CONFIG_CGROUP_PERF=y
15CONFIG_CGROUP_SCHED=y
16CONFIG_CFS_BANDWIDTH=y
17CONFIG_RT_GROUP_SCHED=y
18CONFIG_BLK_CGROUP=y
19CONFIG_BLK_DEV_INITRD=y
20CONFIG_CC_OPTIMIZE_FOR_SIZE=y
21CONFIG_PERF_EVENTS=y
22CONFIG_MODULES=y
23CONFIG_MODULE_UNLOAD=y
24CONFIG_ARCH_SUNXI=y
25# CONFIG_MACH_SUN4I is not set
26# CONFIG_MACH_SUN5I is not set
27# CONFIG_MACH_SUN6I is not set
28# CONFIG_MACH_SUN8I is not set
29# CONFIG_MACH_SUN9I is not set
30# CONFIG_ARM_ERRATA_643719 is not set
31CONFIG_PCI=y
32CONFIG_PCI_MSI=y
33CONFIG_PCI_DEBUG=y
34CONFIG_PCI_STUB=m
35CONFIG_PCI_HOST_GENERIC=y
36CONFIG_SMP=y
37CONFIG_AEABI=y
38CONFIG_HIGHMEM=y
39CONFIG_HIGHPTE=y
40CONFIG_ZBOOT_ROM_TEXT=0x0
41CONFIG_ZBOOT_ROM_BSS=0x0
42CONFIG_ARM_APPENDED_DTB=y
43CONFIG_ARM_ATAG_DTB_COMPAT=y
44CONFIG_CMDLINE=" loglevel=3"
45CONFIG_VFP=y
46CONFIG_NEON=y
47CONFIG_NET=y
48CONFIG_PACKET=y
49CONFIG_UNIX=y
50CONFIG_INET=y
51CONFIG_IP_PNP=y
52CONFIG_IP_PNP_DHCP=y
53CONFIG_IP_PNP_BOOTP=y
54# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
55# CONFIG_INET_XFRM_MODE_TUNNEL is not set
56# CONFIG_INET_XFRM_MODE_BEET is not set
57# CONFIG_INET_LRO is not set
58# CONFIG_INET_DIAG is not set
59# CONFIG_IPV6 is not set
60CONFIG_CFG80211=y
61CONFIG_CFG80211_DEBUGFS=y
62CONFIG_MAC80211=y
63CONFIG_DEVTMPFS=y
64CONFIG_DEVTMPFS_MOUNT=y
65CONFIG_OF_OVERLAY=y
66CONFIG_BLK_DEV_SD=y
67CONFIG_ATA=y
68CONFIG_AHCI_SUNXI=y
69CONFIG_NETDEVICES=y
70CONFIG_SUN4I_EMAC=y
71# CONFIG_NET_VENDOR_ARC is not set
72# CONFIG_NET_CADENCE is not set
73# CONFIG_NET_VENDOR_BROADCOM is not set
74# CONFIG_NET_VENDOR_CIRRUS is not set
75# CONFIG_NET_VENDOR_FARADAY is not set
76# CONFIG_NET_VENDOR_INTEL is not set
77# CONFIG_NET_VENDOR_MARVELL is not set
78# CONFIG_NET_VENDOR_MICREL is not set
79# CONFIG_NET_VENDOR_MICROCHIP is not set
80# CONFIG_NET_VENDOR_NATSEMI is not set
81# CONFIG_NET_VENDOR_ROCKER is not set
82# CONFIG_NET_VENDOR_SAMSUNG is not set
83# CONFIG_NET_VENDOR_SEEQ is not set
84# CONFIG_NET_VENDOR_SMSC is not set
85CONFIG_STMMAC_ETH=y
86# CONFIG_NET_VENDOR_VIA is not set
87# CONFIG_NET_VENDOR_WIZNET is not set
88CONFIG_ATH_CARDS=m
89CONFIG_CARL9170=m
90CONFIG_RTL_CARDS=m
91CONFIG_RTL8192CU=m
92# CONFIG_INPUT_MOUSEDEV is not set
93# CONFIG_INPUT_KEYBOARD is not set
94# CONFIG_INPUT_MOUSE is not set
95CONFIG_SERIAL_8250=y
96CONFIG_SERIAL_8250_CONSOLE=y
97CONFIG_SERIAL_8250_NR_UARTS=8
98CONFIG_SERIAL_8250_RUNTIME_UARTS=8
99CONFIG_SERIAL_8250_DW=y
100CONFIG_SERIAL_OF_PLATFORM=y
101# CONFIG_HW_RANDOM is not set
102CONFIG_I2C=y
103CONFIG_I2C_CHARDEV=y
104CONFIG_I2C_MV64XXX=y
105CONFIG_SPI=y
106CONFIG_SPI_SUN4I=y
107CONFIG_SPI_SUN6I=y
108CONFIG_GPIO_SYSFS=y
109CONFIG_POWER_SUPPLY=y
110CONFIG_POWER_RESET=y
111# CONFIG_HWMON is not set
112CONFIG_WATCHDOG=y
113CONFIG_SUNXI_WATCHDOG=y
114CONFIG_MFD_AXP20X=y
115CONFIG_MFD_SUN6I_PRCM=y
116CONFIG_REGULATOR=y
117CONFIG_REGULATOR_FIXED_VOLTAGE=y
118CONFIG_REGULATOR_GPIO=y
119CONFIG_FB=y
120CONFIG_FB_SIMPLE=y
121CONFIG_HID_PLANTRONICS=y
122CONFIG_USB=y
123CONFIG_USB_EHCI_HCD=y
124CONFIG_USB_EHCI_HCD_PLATFORM=y
125CONFIG_USB_OHCI_HCD=y
126CONFIG_USB_OHCI_HCD_PLATFORM=y
127CONFIG_MMC=y
128CONFIG_MMC_SUNXI=y
129CONFIG_LEDS_CLASS=y
130CONFIG_LEDS_GPIO=y
131CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
132CONFIG_RTC_CLASS=y
133# CONFIG_RTC_INTF_SYSFS is not set
134# CONFIG_RTC_INTF_PROC is not set
135CONFIG_RTC_DRV_SUNXI=y
136CONFIG_UIO=y
137CONFIG_UIO_PDRV_GENIRQ=y
138# CONFIG_IOMMU_SUPPORT is not set
139CONFIG_GENERIC_PHY=y
140CONFIG_EXT4_FS=y
141CONFIG_VFAT_FS=y
142CONFIG_TMPFS=y
143CONFIG_TMPFS_POSIX_ACL=y
144CONFIG_NFS_FS=y
145CONFIG_NFS_V3_ACL=y
146CONFIG_NFS_V4=y
147CONFIG_ROOT_NFS=y
148CONFIG_NLS_CODEPAGE_437=y
149CONFIG_NLS_ISO8859_1=y
150CONFIG_PRINTK_TIME=y
151CONFIG_DEBUG_KERNEL=y
152CONFIG_LOCKUP_DETECTOR=y
153CONFIG_SCHEDSTATS=y
154CONFIG_TIMER_STATS=y
155CONFIG_DEBUG_RT_MUTEXES=y
156CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y
157CONFIG_PROVE_LOCKING=y
158CONFIG_DEBUG_ATOMIC_SLEEP=y
159CONFIG_DEBUG_LOCKING_API_SELFTESTS=y
160CONFIG_SPARSE_RCU_POINTER=y
161CONFIG_FUNCTION_TRACER=y
162CONFIG_FTRACE_SYSCALLS=y
163CONFIG_KGDB=y
164CONFIG_KGDB_TESTS=y
165CONFIG_DEBUG_USER=y
166CONFIG_CRYPTO_ANSI_CPRNG=y
167CONFIG_VIRTUALIZATION=y
168CONFIG_EXTCON=y
169CONFIG_PHY_SUN4I_USB=y
170CONFIG_ATH_COMMON=m
171CONFIG_ATH9K_HW=m
172CONFIG_ATH9K_COMMON=m
173CONFIG_ATH9K_HTC=m
174CONFIG_WEXT_CORE=y
175CONFIG_WEXT_PROC=y
176CONFIG_NL80211_TESTMODE=y
177CONFIG_CFG80211_DEVELOPER_WARNINGS=y
178CONFIG_CFG80211_REG_DEBUG=y
179CONFIG_CFG80211_WEXT=y
180CONFIG_MAC80211_MESH=y
181CONFIG_MAC80211_DEBUGFS=y
182CONFIG_MAC80211_MESSAGE_TRACING=y
183CONFIG_MAC80211_DEBUG_MENU=y
184CONFIG_CARL9170_HWRNG=y
185CONFIG_HW_RANDOM=y
diff --git a/recipes-kernel/linux/jailhouse-linux-4.14.6/jailhouse-required-symbol-export.patch b/recipes-kernel/linux/jailhouse-linux-4.14.6/jailhouse-required-symbol-export.patch
new file mode 100644
index 0000000..472a56e
--- /dev/null
+++ b/recipes-kernel/linux/jailhouse-linux-4.14.6/jailhouse-required-symbol-export.patch
@@ -0,0 +1,20 @@
1diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
2index 7e45f69..dc0336e 100644
3--- a/arch/arm/kernel/armksyms.c
4+++ b/arch/arm/kernel/armksyms.c
5@@ -20,6 +20,7 @@
6
7 #include <asm/checksum.h>
8 #include <asm/ftrace.h>
9+#include <asm/virt.h>
10
11 /*
12 * libgcc functions - functions that are used internally by the
13@@ -181,3 +182,7 @@ EXPORT_SYMBOL(__pv_offset);
14 EXPORT_SYMBOL(arm_smccc_smc);
15 EXPORT_SYMBOL(arm_smccc_hvc);
16 #endif
17+
18+#ifdef CONFIG_ARM_VIRT_EXT
19+EXPORT_SYMBOL_GPL(__boot_cpu_mode);
20+#endif
diff --git a/recipes-kernel/linux/jailhouse-linux-4.14.6/jailhouse-required-symbol-export_2.patch b/recipes-kernel/linux/jailhouse-linux-4.14.6/jailhouse-required-symbol-export_2.patch
new file mode 100644
index 0000000..b58b522
--- /dev/null
+++ b/recipes-kernel/linux/jailhouse-linux-4.14.6/jailhouse-required-symbol-export_2.patch
@@ -0,0 +1,57 @@
1From 90165e12a59df7e26bfb4cedd76a1def45cee5a9 Mon Sep 17 00:00:00 2001
2From: Ralf Ramsauer <ralf.ramsauer@oth-regensburg.de>
3Date: Wed, 7 Jun 2017 15:48:43 +0200
4Subject: [PATCH] arm, arm64: export __hyp_stub_vectors
5
6HVC_GET_VECTORS got removed. External hypervisors, like Jailhouse, need
7this address when they are deactivated, in order to restore original
8state.
9
10Signed-off-by: Ralf Ramsauer <ralf.ramsauer@oth-regensburg.de>
11Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12---
13 arch/arm/kernel/hyp-stub.S | 2 ++
14 arch/arm64/kernel/hyp-stub.S | 2 ++
15 2 files changed, 4 insertions(+)
16
17diff --git a/arch/arm/kernel/hyp-stub.S b/arch/arm/kernel/hyp-stub.S
18index 60146e3..d34efc5 100644
19--- a/arch/arm/kernel/hyp-stub.S
20+++ b/arch/arm/kernel/hyp-stub.S
21@@ -19,6 +19,7 @@
22 #include <linux/init.h>
23 #include <linux/irqchip/arm-gic-v3.h>
24 #include <linux/linkage.h>
25+#include <asm-generic/export.h>
26 #include <asm/assembler.h>
27 #include <asm/virt.h>
28
29@@ -282,4 +283,5 @@ __hyp_stub_trap: W(b) __hyp_stub_do_trap
30 __hyp_stub_irq: W(b) .
31 __hyp_stub_fiq: W(b) .
32 ENDPROC(__hyp_stub_vectors)
33+EXPORT_SYMBOL_GPL(__hyp_stub_vectors)
34
35diff --git a/arch/arm64/kernel/hyp-stub.S b/arch/arm64/kernel/hyp-stub.S
36index e1261fb..061b32e 100644
37--- a/arch/arm64/kernel/hyp-stub.S
38+++ b/arch/arm64/kernel/hyp-stub.S
39@@ -21,6 +21,7 @@
40 #include <linux/linkage.h>
41 #include <linux/irqchip/arm-gic-v3.h>
42
43+#include <asm-generic/export.h>
44 #include <asm/assembler.h>
45 #include <asm/kvm_arm.h>
46 #include <asm/kvm_asm.h>
47@@ -51,6 +52,7 @@ ENTRY(__hyp_stub_vectors)
48 ventry el1_fiq_invalid // FIQ 32-bit EL1
49 ventry el1_error_invalid // Error 32-bit EL1
50 ENDPROC(__hyp_stub_vectors)
51+EXPORT_SYMBOL_GPL(__hyp_stub_vectors)
52
53 .align 11
54
55--
562.1.4
57
diff --git a/recipes-kernel/linux/jailhouse-linux-4.14.6/jailhouse-required-symbol-export_3.patch b/recipes-kernel/linux/jailhouse-linux-4.14.6/jailhouse-required-symbol-export_3.patch
new file mode 100644
index 0000000..12f6a91
--- /dev/null
+++ b/recipes-kernel/linux/jailhouse-linux-4.14.6/jailhouse-required-symbol-export_3.patch
@@ -0,0 +1,9 @@
1diff -Nur linux-4.14.6_orig/lib/ioremap.c linux-4.14.6/lib/ioremap.c
2--- linux-4.14.6_orig/lib/ioremap.c 2017-12-14 09:53:15.000000000 +0100
3+++ linux-4.14.6/lib/ioremap.c 2017-12-14 17:20:45.906872824 +0100
4@@ -179,3 +179,5 @@
5
6 return err;
7 }
8+
9+EXPORT_SYMBOL_GPL(ioremap_page_range);
diff --git a/recipes-kernel/linux/jailhouse-linux_4.14.6.bb b/recipes-kernel/linux/jailhouse-linux_4.14.6.bb
new file mode 100644
index 0000000..3cd4e97
--- /dev/null
+++ b/recipes-kernel/linux/jailhouse-linux_4.14.6.bb
@@ -0,0 +1,32 @@
1SECTION = "kernel"
2DESCRIPTION = "Mainline Linux kernel"
3LICENSE = "GPLv2"
4LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
5COMPATIBLE_MACHINE = "(sun4i|sun5i|sun7i)"
6
7inherit kernel
8
9require recipes-kernel/linux/linux-dtb.inc
10require recipes-kernel/linux/linux.inc
11
12# Pull in the devicetree files into the rootfs
13RDEPENDS_kernel-base += "kernel-devicetree"
14
15KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}"
16
17S = "${WORKDIR}/linux-${PV}"
18
19SRC_URI[md5sum] = "938baaf8fd3d232e9fbc2f402adf0d3f"
20SRC_URI[sha256sum] = "0907678ba9ea146ddbdecd0a0b6363f56b896b5c61c9a15e809effb3ea346ccc"
21
22
23SRC_URI = "https://www.kernel.org/pub/linux/kernel/v4.x/linux-${PV}.tar.xz \
24 file://defconfig \
25 "
26
27SRC_URI_append_jailhouse-bpi = " \
28 file://jailhouse-required-symbol-export.patch \
29 file://jailhouse-required-symbol-export_2.patch \
30 file://jailhouse-required-symbol-export_3.patch \
31 "
32