From 811410fdbb3fb9c41ef97ee480b2fe1678341a81 Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Tue, 4 Jun 2019 13:50:28 +0200 Subject: [PATCH] foc: update to current github version (fix #3402) Instead of hosting our outdated own fork, this commit now uses kernkonzept's nowadays available github source repositories. This hopefully simplifies updates, or cherry-picking single fixes. --- repos/base-foc/config/arndale.kernel | 4 ++ repos/base-foc/config/arndale.user | 6 +-- repos/base-foc/config/imx6q_sabrelite.kernel | 9 ++-- repos/base-foc/config/imx6q_sabrelite.user | 6 +-- repos/base-foc/config/imx7.kernel | 6 ++- repos/base-foc/config/imx7.user | 6 +-- repos/base-foc/config/odroid_x2.kernel | 4 ++ repos/base-foc/config/odroid_x2.user | 6 +-- repos/base-foc/config/panda.kernel | 4 ++ repos/base-foc/config/panda.user | 6 +-- repos/base-foc/config/pbxa9.kernel | 4 ++ repos/base-foc/config/pbxa9.user | 6 +-- repos/base-foc/config/rpi.kernel | 5 ++ repos/base-foc/config/rpi.user | 6 +-- repos/base-foc/config/rpi3.kernel | 6 +++ repos/base-foc/config/rpi3.user | 4 +- repos/base-foc/config/x86_32.kernel | 3 ++ repos/base-foc/config/x86_32.user | 2 - repos/base-foc/config/x86_64.kernel | 3 ++ repos/base-foc/config/x86_64.user | 2 - ...move-moe-from-switch_ram_base-target.patch | 24 ++++++++++ ...OC-change-l4_task_cap_equal-semantic.patch | 42 +++++++++++++++++ ...0-raise-sigma0-s-priority-to-maximum.patch | 43 +++++++++++++++++ ...C-Increase-name-buffer-of-JDB-to-32K.patch | 30 ++++++++++++ ...FOC-adjust-panda-timer-to-version-A6.patch | 34 ++++++++++++++ ...scall-bindings-to-use-in-C-namespace.patch | 28 +++++++++++ ...ead-out-comport-on-x86-from-BDA-area.patch | 35 ++++++++++++++ ...RE-get-rid-of-__builtin_strlen-usage.patch | 47 +++++++++++++++++++ .../0011-Ex_regs-Change-user_flags.patch | 45 ++++++++++++++++++ ...2-Flush-the-TLB-after-idle-operation.patch | 29 ++++++++++++ ...er-mode-access-for-performance-monit.patch | 35 ++++++++++++++ ...-event-injection-if-requested-by-VMM.patch | 29 ++++++++++++ ...m-provide-cr0-to-guest-if-np-enabled.patch | 24 ++++++++++ ...m-avoid-forceful-exit-on-task-switch.patch | 25 ++++++++++ repos/base-foc/ports/foc.hash | 2 +- repos/base-foc/ports/foc.port | 46 +++++++++++++++--- 36 files changed, 570 insertions(+), 46 deletions(-) create mode 100644 repos/base-foc/patches/0001-L4RE-Remove-moe-from-switch_ram_base-target.patch create mode 100644 repos/base-foc/patches/0002-FOC-change-l4_task_cap_equal-semantic.patch create mode 100644 repos/base-foc/patches/0003-Sigma0-raise-sigma0-s-priority-to-maximum.patch create mode 100644 repos/base-foc/patches/0005-FOC-Increase-name-buffer-of-JDB-to-32K.patch create mode 100644 repos/base-foc/patches/0006-FOC-adjust-panda-timer-to-version-A6.patch create mode 100644 repos/base-foc/patches/0007-L4RE-fix-x86-syscall-bindings-to-use-in-C-namespace.patch create mode 100644 repos/base-foc/patches/0009-Bootstrap-read-out-comport-on-x86-from-BDA-area.patch create mode 100644 repos/base-foc/patches/0010-L4RE-get-rid-of-__builtin_strlen-usage.patch create mode 100644 repos/base-foc/patches/0011-Ex_regs-Change-user_flags.patch create mode 100644 repos/base-foc/patches/0012-Flush-the-TLB-after-idle-operation.patch create mode 100644 repos/base-foc/patches/0014-Always-enable-user-mode-access-for-performance-monit.patch create mode 100644 repos/base-foc/patches/0015-VMX-disable-event-injection-if-requested-by-VMM.patch create mode 100644 repos/base-foc/patches/0016-svm-provide-cr0-to-guest-if-np-enabled.patch create mode 100644 repos/base-foc/patches/0017-svm-avoid-forceful-exit-on-task-switch.patch diff --git a/repos/base-foc/config/arndale.kernel b/repos/base-foc/config/arndale.kernel index 204b2e95c..292487356 100644 --- a/repos/base-foc/config/arndale.kernel +++ b/repos/base-foc/config/arndale.kernel @@ -3,8 +3,10 @@ # Fiasco configuration # CONFIG_HAS_FPU_OPTION=y +CONFIG_HAS_LAZY_FPU=y CONFIG_HAS_VIRT_OBJ_SPACE_OPTION=y CONFIG_HAS_SERIAL_OPTION=y +CONFIG_HAS_JDB_DISASM_OPTION=y CONFIG_HAS_JDB_GZIP_OPTION=y CONFIG_HAS_MP_OPTION=y CONFIG_HAS_CPU_VIRT=y @@ -55,6 +57,7 @@ CONFIG_ABI_VF=y CONFIG_ARM_CORTEX_A15=y # CONFIG_CPU_VIRT is not set CONFIG_FPU=y +CONFIG_LAZY_FPU=y CONFIG_HAVE_ARM_SECMONIF_NONE=y CONFIG_HAVE_ARM_SECMONIF_MC=y # CONFIG_ARM_ALIGNMENT_CHECK is not set @@ -87,6 +90,7 @@ CONFIG_INLINE=y CONFIG_SERIAL=y CONFIG_JDB=y # CONFIG_JDB_LOGGING is not set +# CONFIG_JDB_DISASM is not set CONFIG_JDB_GZIP=y # CONFIG_JDB_ACCOUNTING is not set # CONFIG_WARN_NONE is not set diff --git a/repos/base-foc/config/arndale.user b/repos/base-foc/config/arndale.user index 435e4905f..88011bc86 100644 --- a/repos/base-foc/config/arndale.user +++ b/repos/base-foc/config/arndale.user @@ -43,25 +43,23 @@ CONFIG_PLATFORM_TYPE_exynos5=y # CONFIG_PLATFORM_TYPE_parallella is not set # CONFIG_PLATFORM_TYPE_rpi_b is not set # CONFIG_PLATFORM_TYPE_imx21 is not set -# CONFIG_PLATFORM_TYPE_imx51 is not set +# CONFIG_PLATFORM_TYPE_rcar3 is not set # CONFIG_PLATFORM_TYPE_ls1021atwr is not set # CONFIG_PLATFORM_TYPE_tegra3 is not set # CONFIG_PLATFORM_TYPE_imx7 is not set # CONFIG_PLATFORM_TYPE_imx28 is not set # CONFIG_PLATFORM_TYPE_omap3evm is not set -# CONFIG_PLATFORM_TYPE_rcar3_m3 is not set # CONFIG_PLATFORM_TYPE_zynqmp is not set # CONFIG_PLATFORM_TYPE_imx6 is not set # CONFIG_PLATFORM_TYPE_imx6ul is not set # CONFIG_PLATFORM_TYPE_armada38x is not set # CONFIG_PLATFORM_TYPE_omap5 is not set # CONFIG_PLATFORM_TYPE_rv_vexpress is not set +# CONFIG_PLATFORM_TYPE_imx51 is not set # CONFIG_PLATFORM_TYPE_rpi_a is not set # CONFIG_PLATFORM_TYPE_integrator is not set # CONFIG_PLATFORM_TYPE_custom is not set CONFIG_PLATFORM_TYPE="exynos5" -# CONFIG_USE_DROPS_STDDIR is not set -# CONFIG_USE_DICE is not set CONFIG_DROPS_STDDIR="/path/to/l4re" CONFIG_DROPS_INSTDIR="/path/to/l4re" CONFIG_BID_COLORED_PHASES=y diff --git a/repos/base-foc/config/imx6q_sabrelite.kernel b/repos/base-foc/config/imx6q_sabrelite.kernel index d9ed01edd..aed87f779 100644 --- a/repos/base-foc/config/imx6q_sabrelite.kernel +++ b/repos/base-foc/config/imx6q_sabrelite.kernel @@ -3,8 +3,10 @@ # Fiasco configuration # CONFIG_HAS_FPU_OPTION=y +CONFIG_HAS_LAZY_FPU=y CONFIG_HAS_VIRT_OBJ_SPACE_OPTION=y CONFIG_HAS_SERIAL_OPTION=y +CONFIG_HAS_JDB_DISASM_OPTION=y CONFIG_HAS_JDB_GZIP_OPTION=y CONFIG_HAS_MP_OPTION=y @@ -52,6 +54,7 @@ CONFIG_PF_IMX_6_TIMER_MPTIMER=y CONFIG_ABI_VF=y CONFIG_ARM_CORTEX_A9=y CONFIG_FPU=y +CONFIG_LAZY_FPU=y # CONFIG_ARM_ALIGNMENT_CHECK is not set CONFIG_ARM_EM_STD=y # CONFIG_ARM_EM_NS is not set @@ -59,14 +62,13 @@ CONFIG_ARM_EM_STD=y # CONFIG_ARM_SMC_USER is not set CONFIG_ARM_CACHE_L2CXX0=y # CONFIG_ARM_ENABLE_SWP is not set -CONFIG_HAS_ARM_PSCI=y -# CONFIG_ARM_PSCI is not set CONFIG_ARM_CPU_ERRATA=y # # Kernel options # -# CONFIG_MP is not set +CONFIG_MP=y +CONFIG_MP_MAX_CPUS=4 CONFIG_CONTEXT_4K=y # CONFIG_FINE_GRAINED_CPUTIME is not set CONFIG_SCHED_FIXED_PRIO=y @@ -83,6 +85,7 @@ CONFIG_NO_FRAME_PTR=y CONFIG_SERIAL=y CONFIG_JDB=y CONFIG_JDB_LOGGING=y +# CONFIG_JDB_DISASM is not set CONFIG_JDB_GZIP=y # CONFIG_JDB_ACCOUNTING is not set # CONFIG_WARN_NONE is not set diff --git a/repos/base-foc/config/imx6q_sabrelite.user b/repos/base-foc/config/imx6q_sabrelite.user index 75bbaaae2..accb74bdd 100644 --- a/repos/base-foc/config/imx6q_sabrelite.user +++ b/repos/base-foc/config/imx6q_sabrelite.user @@ -43,25 +43,23 @@ CONFIG_CPU_ARMV6PLUS=y # CONFIG_PLATFORM_TYPE_parallella is not set # CONFIG_PLATFORM_TYPE_rpi_b is not set # CONFIG_PLATFORM_TYPE_imx21 is not set -# CONFIG_PLATFORM_TYPE_imx51 is not set +# CONFIG_PLATFORM_TYPE_rcar3 is not set # CONFIG_PLATFORM_TYPE_ls1021atwr is not set # CONFIG_PLATFORM_TYPE_tegra3 is not set # CONFIG_PLATFORM_TYPE_imx7 is not set # CONFIG_PLATFORM_TYPE_imx28 is not set # CONFIG_PLATFORM_TYPE_omap3evm is not set -# CONFIG_PLATFORM_TYPE_rcar3_m3 is not set # CONFIG_PLATFORM_TYPE_zynqmp is not set CONFIG_PLATFORM_TYPE_imx6=y # CONFIG_PLATFORM_TYPE_imx6ul is not set # CONFIG_PLATFORM_TYPE_armada38x is not set # CONFIG_PLATFORM_TYPE_omap5 is not set # CONFIG_PLATFORM_TYPE_rv_vexpress is not set +# CONFIG_PLATFORM_TYPE_imx51 is not set # CONFIG_PLATFORM_TYPE_rpi_a is not set # CONFIG_PLATFORM_TYPE_integrator is not set # CONFIG_PLATFORM_TYPE_custom is not set CONFIG_PLATFORM_TYPE="imx6" -# CONFIG_USE_DROPS_STDDIR is not set -# CONFIG_USE_DICE is not set CONFIG_DROPS_STDDIR="/path/to/l4re" CONFIG_DROPS_INSTDIR="/path/to/l4re" CONFIG_BID_COLORED_PHASES=y diff --git a/repos/base-foc/config/imx7.kernel b/repos/base-foc/config/imx7.kernel index b728f2b3a..971af4a3b 100644 --- a/repos/base-foc/config/imx7.kernel +++ b/repos/base-foc/config/imx7.kernel @@ -3,8 +3,10 @@ # Fiasco configuration # CONFIG_HAS_FPU_OPTION=y +CONFIG_HAS_LAZY_FPU=y CONFIG_HAS_VIRT_OBJ_SPACE_OPTION=y CONFIG_HAS_SERIAL_OPTION=y +CONFIG_HAS_JDB_DISASM_OPTION=y CONFIG_HAS_JDB_GZIP_OPTION=y CONFIG_HAS_MP_OPTION=y CONFIG_HAS_CPU_VIRT=y @@ -51,6 +53,7 @@ CONFIG_ABI_VF=y CONFIG_ARM_CORTEX_A7=y # CONFIG_CPU_VIRT is not set CONFIG_FPU=y +CONFIG_LAZY_FPU=y # CONFIG_ARM_ALIGNMENT_CHECK is not set CONFIG_ARM_EM_STD=y # CONFIG_ARM_EM_NS is not set @@ -66,7 +69,7 @@ CONFIG_ARM_CPU_ERRATA=y # Kernel options # CONFIG_MP=y -CONFIG_MP_MAX_CPUS=4 +CONFIG_MP_MAX_CPUS=2 CONFIG_CONTEXT_4K=y # CONFIG_FINE_GRAINED_CPUTIME is not set CONFIG_SCHED_FIXED_PRIO=y @@ -83,6 +86,7 @@ CONFIG_INLINE=y CONFIG_SERIAL=y CONFIG_JDB=y # CONFIG_JDB_LOGGING is not set +# CONFIG_JDB_DISASM is not set CONFIG_JDB_GZIP=y # CONFIG_JDB_ACCOUNTING is not set # CONFIG_WARN_NONE is not set diff --git a/repos/base-foc/config/imx7.user b/repos/base-foc/config/imx7.user index 40211f467..b1e0cb687 100644 --- a/repos/base-foc/config/imx7.user +++ b/repos/base-foc/config/imx7.user @@ -43,25 +43,23 @@ CONFIG_CPU_ARMV6PLUS=y # CONFIG_PLATFORM_TYPE_parallella is not set # CONFIG_PLATFORM_TYPE_rpi_b is not set # CONFIG_PLATFORM_TYPE_imx21 is not set -# CONFIG_PLATFORM_TYPE_imx51 is not set +# CONFIG_PLATFORM_TYPE_rcar3 is not set # CONFIG_PLATFORM_TYPE_ls1021atwr is not set # CONFIG_PLATFORM_TYPE_tegra3 is not set CONFIG_PLATFORM_TYPE_imx7=y # CONFIG_PLATFORM_TYPE_imx28 is not set # CONFIG_PLATFORM_TYPE_omap3evm is not set -# CONFIG_PLATFORM_TYPE_rcar3_m3 is not set # CONFIG_PLATFORM_TYPE_zynqmp is not set # CONFIG_PLATFORM_TYPE_imx6 is not set # CONFIG_PLATFORM_TYPE_imx6ul is not set # CONFIG_PLATFORM_TYPE_armada38x is not set # CONFIG_PLATFORM_TYPE_omap5 is not set # CONFIG_PLATFORM_TYPE_rv_vexpress is not set +# CONFIG_PLATFORM_TYPE_imx51 is not set # CONFIG_PLATFORM_TYPE_rpi_a is not set # CONFIG_PLATFORM_TYPE_integrator is not set # CONFIG_PLATFORM_TYPE_custom is not set CONFIG_PLATFORM_TYPE="imx7" -# CONFIG_USE_DROPS_STDDIR is not set -# CONFIG_USE_DICE is not set CONFIG_DROPS_STDDIR="/path/to/l4re" CONFIG_DROPS_INSTDIR="/path/to/l4re" CONFIG_BID_COLORED_PHASES=y diff --git a/repos/base-foc/config/odroid_x2.kernel b/repos/base-foc/config/odroid_x2.kernel index bd9f876d1..653d29db7 100644 --- a/repos/base-foc/config/odroid_x2.kernel +++ b/repos/base-foc/config/odroid_x2.kernel @@ -3,8 +3,10 @@ # Fiasco configuration # CONFIG_HAS_FPU_OPTION=y +CONFIG_HAS_LAZY_FPU=y CONFIG_HAS_VIRT_OBJ_SPACE_OPTION=y CONFIG_HAS_SERIAL_OPTION=y +CONFIG_HAS_JDB_DISASM_OPTION=y CONFIG_HAS_JDB_GZIP_OPTION=y CONFIG_HAS_MP_OPTION=y @@ -54,6 +56,7 @@ CONFIG_PF_EXYNOS_TIMER_MCT=y CONFIG_ABI_VF=y CONFIG_ARM_CORTEX_A9=y CONFIG_FPU=y +CONFIG_LAZY_FPU=y CONFIG_HAVE_ARM_SECMONIF_NONE=y CONFIG_HAVE_ARM_SECMONIF_MC=y # CONFIG_ARM_ALIGNMENT_CHECK is not set @@ -88,6 +91,7 @@ CONFIG_NO_FRAME_PTR=y CONFIG_SERIAL=y CONFIG_JDB=y # CONFIG_JDB_LOGGING is not set +# CONFIG_JDB_DISASM is not set CONFIG_JDB_GZIP=y # CONFIG_JDB_ACCOUNTING is not set # CONFIG_WARN_NONE is not set diff --git a/repos/base-foc/config/odroid_x2.user b/repos/base-foc/config/odroid_x2.user index e159ed1e9..8bf5bbdb4 100644 --- a/repos/base-foc/config/odroid_x2.user +++ b/repos/base-foc/config/odroid_x2.user @@ -43,25 +43,23 @@ CONFIG_PLATFORM_TYPE_exynos4=y # CONFIG_PLATFORM_TYPE_parallella is not set # CONFIG_PLATFORM_TYPE_rpi_b is not set # CONFIG_PLATFORM_TYPE_imx21 is not set -# CONFIG_PLATFORM_TYPE_imx51 is not set +# CONFIG_PLATFORM_TYPE_rcar3 is not set # CONFIG_PLATFORM_TYPE_ls1021atwr is not set # CONFIG_PLATFORM_TYPE_tegra3 is not set # CONFIG_PLATFORM_TYPE_imx7 is not set # CONFIG_PLATFORM_TYPE_imx28 is not set # CONFIG_PLATFORM_TYPE_omap3evm is not set -# CONFIG_PLATFORM_TYPE_rcar3_m3 is not set # CONFIG_PLATFORM_TYPE_zynqmp is not set # CONFIG_PLATFORM_TYPE_imx6 is not set # CONFIG_PLATFORM_TYPE_imx6ul is not set # CONFIG_PLATFORM_TYPE_armada38x is not set # CONFIG_PLATFORM_TYPE_omap5 is not set # CONFIG_PLATFORM_TYPE_rv_vexpress is not set +# CONFIG_PLATFORM_TYPE_imx51 is not set # CONFIG_PLATFORM_TYPE_rpi_a is not set # CONFIG_PLATFORM_TYPE_integrator is not set # CONFIG_PLATFORM_TYPE_custom is not set CONFIG_PLATFORM_TYPE="exynos4" -# CONFIG_USE_DROPS_STDDIR is not set -# CONFIG_USE_DICE is not set CONFIG_DROPS_STDDIR="/path/to/l4re" CONFIG_DROPS_INSTDIR="/path/to/l4re" CONFIG_BID_COLORED_PHASES=y diff --git a/repos/base-foc/config/panda.kernel b/repos/base-foc/config/panda.kernel index b4dc689d3..dd8569065 100644 --- a/repos/base-foc/config/panda.kernel +++ b/repos/base-foc/config/panda.kernel @@ -3,8 +3,10 @@ # Fiasco configuration # CONFIG_HAS_FPU_OPTION=y +CONFIG_HAS_LAZY_FPU=y CONFIG_HAS_VIRT_OBJ_SPACE_OPTION=y CONFIG_HAS_SERIAL_OPTION=y +CONFIG_HAS_JDB_DISASM_OPTION=y CONFIG_HAS_JDB_GZIP_OPTION=y CONFIG_HAS_MP_OPTION=y @@ -47,6 +49,7 @@ CONFIG_PF_OMAP4_PANDABOARD=y CONFIG_ABI_VF=y CONFIG_ARM_CORTEX_A9=y CONFIG_FPU=y +CONFIG_LAZY_FPU=y # CONFIG_ARM_ALIGNMENT_CHECK is not set CONFIG_ARM_EM_STD=y # CONFIG_ARM_EM_NS is not set @@ -77,6 +80,7 @@ CONFIG_INLINE=y CONFIG_SERIAL=y CONFIG_JDB=y CONFIG_JDB_LOGGING=y +# CONFIG_JDB_DISASM is not set CONFIG_JDB_GZIP=y # CONFIG_JDB_ACCOUNTING is not set # CONFIG_WARN_NONE is not set diff --git a/repos/base-foc/config/panda.user b/repos/base-foc/config/panda.user index 09f18ff66..dce4f8e39 100644 --- a/repos/base-foc/config/panda.user +++ b/repos/base-foc/config/panda.user @@ -43,25 +43,23 @@ CONFIG_PLATFORM_TYPE_pandaboard=y # CONFIG_PLATFORM_TYPE_parallella is not set # CONFIG_PLATFORM_TYPE_rpi_b is not set # CONFIG_PLATFORM_TYPE_imx21 is not set -# CONFIG_PLATFORM_TYPE_imx51 is not set +# CONFIG_PLATFORM_TYPE_rcar3 is not set # CONFIG_PLATFORM_TYPE_ls1021atwr is not set # CONFIG_PLATFORM_TYPE_tegra3 is not set # CONFIG_PLATFORM_TYPE_imx7 is not set # CONFIG_PLATFORM_TYPE_imx28 is not set # CONFIG_PLATFORM_TYPE_omap3evm is not set -# CONFIG_PLATFORM_TYPE_rcar3_m3 is not set # CONFIG_PLATFORM_TYPE_zynqmp is not set # CONFIG_PLATFORM_TYPE_imx6 is not set # CONFIG_PLATFORM_TYPE_imx6ul is not set # CONFIG_PLATFORM_TYPE_armada38x is not set # CONFIG_PLATFORM_TYPE_omap5 is not set # CONFIG_PLATFORM_TYPE_rv_vexpress is not set +# CONFIG_PLATFORM_TYPE_imx51 is not set # CONFIG_PLATFORM_TYPE_rpi_a is not set # CONFIG_PLATFORM_TYPE_integrator is not set # CONFIG_PLATFORM_TYPE_custom is not set CONFIG_PLATFORM_TYPE="pandaboard" -# CONFIG_USE_DROPS_STDDIR is not set -# CONFIG_USE_DICE is not set CONFIG_DROPS_STDDIR="/path/to/l4re" CONFIG_DROPS_INSTDIR="/path/to/l4re" CONFIG_BID_COLORED_PHASES=y diff --git a/repos/base-foc/config/pbxa9.kernel b/repos/base-foc/config/pbxa9.kernel index b3fb89771..4e47c94d6 100644 --- a/repos/base-foc/config/pbxa9.kernel +++ b/repos/base-foc/config/pbxa9.kernel @@ -3,8 +3,10 @@ # Fiasco configuration # CONFIG_HAS_FPU_OPTION=y +CONFIG_HAS_LAZY_FPU=y CONFIG_HAS_VIRT_OBJ_SPACE_OPTION=y CONFIG_HAS_SERIAL_OPTION=y +CONFIG_HAS_JDB_DISASM_OPTION=y CONFIG_HAS_JDB_GZIP_OPTION=y CONFIG_HAS_MP_OPTION=y @@ -50,6 +52,7 @@ CONFIG_PF_REALVIEW_RAM_PHYS_BASE=0x70000000 CONFIG_ABI_VF=y CONFIG_ARM_CORTEX_A9=y CONFIG_FPU=y +CONFIG_LAZY_FPU=y # CONFIG_ARM_ALIGNMENT_CHECK is not set CONFIG_ARM_EM_STD=y # CONFIG_ARM_EM_NS is not set @@ -79,6 +82,7 @@ CONFIG_NO_FRAME_PTR=y CONFIG_SERIAL=y CONFIG_JDB=y CONFIG_JDB_LOGGING=y +# CONFIG_JDB_DISASM is not set CONFIG_JDB_GZIP=y # CONFIG_JDB_ACCOUNTING is not set # CONFIG_WARN_NONE is not set diff --git a/repos/base-foc/config/pbxa9.user b/repos/base-foc/config/pbxa9.user index 8b24d41ff..9d3e72833 100644 --- a/repos/base-foc/config/pbxa9.user +++ b/repos/base-foc/config/pbxa9.user @@ -43,25 +43,23 @@ CONFIG_PLATFORM_TYPE_rv_pbx=y # CONFIG_PLATFORM_TYPE_parallella is not set # CONFIG_PLATFORM_TYPE_rpi_b is not set # CONFIG_PLATFORM_TYPE_imx21 is not set -# CONFIG_PLATFORM_TYPE_imx51 is not set +# CONFIG_PLATFORM_TYPE_rcar3 is not set # CONFIG_PLATFORM_TYPE_ls1021atwr is not set # CONFIG_PLATFORM_TYPE_tegra3 is not set # CONFIG_PLATFORM_TYPE_imx7 is not set # CONFIG_PLATFORM_TYPE_imx28 is not set # CONFIG_PLATFORM_TYPE_omap3evm is not set -# CONFIG_PLATFORM_TYPE_rcar3_m3 is not set # CONFIG_PLATFORM_TYPE_zynqmp is not set # CONFIG_PLATFORM_TYPE_imx6 is not set # CONFIG_PLATFORM_TYPE_imx6ul is not set # CONFIG_PLATFORM_TYPE_armada38x is not set # CONFIG_PLATFORM_TYPE_omap5 is not set # CONFIG_PLATFORM_TYPE_rv_vexpress is not set +# CONFIG_PLATFORM_TYPE_imx51 is not set # CONFIG_PLATFORM_TYPE_rpi_a is not set # CONFIG_PLATFORM_TYPE_integrator is not set # CONFIG_PLATFORM_TYPE_custom is not set CONFIG_PLATFORM_TYPE="rv_pbx" -# CONFIG_USE_DROPS_STDDIR is not set -# CONFIG_USE_DICE is not set CONFIG_DROPS_STDDIR="/path/to/l4re" CONFIG_DROPS_INSTDIR="/path/to/l4re" CONFIG_BID_COLORED_PHASES=y diff --git a/repos/base-foc/config/rpi.kernel b/repos/base-foc/config/rpi.kernel index abd9a08ff..39f983c0d 100644 --- a/repos/base-foc/config/rpi.kernel +++ b/repos/base-foc/config/rpi.kernel @@ -3,7 +3,9 @@ # Fiasco configuration # CONFIG_HAS_FPU_OPTION=y +CONFIG_HAS_LAZY_FPU=y CONFIG_HAS_SERIAL_OPTION=y +CONFIG_HAS_JDB_DISASM_OPTION=y CONFIG_HAS_JDB_GZIP_OPTION=y # @@ -38,9 +40,11 @@ CONFIG_ARM_V6PLUS=y CONFIG_PF_BCM283X_RPI1=y # CONFIG_PF_BCM283X_RPI2 is not set # CONFIG_PF_BCM283X_RPI3 is not set +# CONFIG_PF_BCM283X_RPIZW is not set CONFIG_ABI_VF=y CONFIG_ARM_1176=y CONFIG_FPU=y +CONFIG_LAZY_FPU=y # CONFIG_ARM_ALIGNMENT_CHECK is not set CONFIG_ARM_EM_STD=y # CONFIG_ARM_EM_NS is not set @@ -69,6 +73,7 @@ CONFIG_NO_FRAME_PTR=y CONFIG_SERIAL=y CONFIG_JDB=y # CONFIG_JDB_LOGGING is not set +# CONFIG_JDB_DISASM is not set CONFIG_JDB_GZIP=y # CONFIG_JDB_ACCOUNTING is not set # CONFIG_WARN_NONE is not set diff --git a/repos/base-foc/config/rpi.user b/repos/base-foc/config/rpi.user index a45ef7b44..9add7d18c 100644 --- a/repos/base-foc/config/rpi.user +++ b/repos/base-foc/config/rpi.user @@ -42,25 +42,23 @@ CONFIG_CPU_ARMV6PLUS=y # CONFIG_PLATFORM_TYPE_parallella is not set CONFIG_PLATFORM_TYPE_rpi_b=y # CONFIG_PLATFORM_TYPE_imx21 is not set -# CONFIG_PLATFORM_TYPE_imx51 is not set +# CONFIG_PLATFORM_TYPE_rcar3 is not set # CONFIG_PLATFORM_TYPE_ls1021atwr is not set # CONFIG_PLATFORM_TYPE_tegra3 is not set # CONFIG_PLATFORM_TYPE_imx7 is not set # CONFIG_PLATFORM_TYPE_imx28 is not set # CONFIG_PLATFORM_TYPE_omap3evm is not set -# CONFIG_PLATFORM_TYPE_rcar3_m3 is not set # CONFIG_PLATFORM_TYPE_zynqmp is not set # CONFIG_PLATFORM_TYPE_imx6 is not set # CONFIG_PLATFORM_TYPE_imx6ul is not set # CONFIG_PLATFORM_TYPE_armada38x is not set # CONFIG_PLATFORM_TYPE_omap5 is not set # CONFIG_PLATFORM_TYPE_rv_vexpress is not set +# CONFIG_PLATFORM_TYPE_imx51 is not set # CONFIG_PLATFORM_TYPE_rpi_a is not set # CONFIG_PLATFORM_TYPE_integrator is not set # CONFIG_PLATFORM_TYPE_custom is not set CONFIG_PLATFORM_TYPE="rpi_b" -# CONFIG_USE_DROPS_STDDIR is not set -# CONFIG_USE_DICE is not set CONFIG_DROPS_STDDIR="/path/to/l4re" CONFIG_DROPS_INSTDIR="/path/to/l4re" CONFIG_BID_COLORED_PHASES=y diff --git a/repos/base-foc/config/rpi3.kernel b/repos/base-foc/config/rpi3.kernel index f6c4b779a..8773e5b18 100644 --- a/repos/base-foc/config/rpi3.kernel +++ b/repos/base-foc/config/rpi3.kernel @@ -3,8 +3,10 @@ # Fiasco configuration # CONFIG_HAS_FPU_OPTION=y +CONFIG_HAS_LAZY_FPU=y CONFIG_HAS_VIRT_OBJ_SPACE_OPTION=y CONFIG_HAS_SERIAL_OPTION=y +CONFIG_HAS_JDB_DISASM_OPTION=y CONFIG_HAS_JDB_GZIP_OPTION=y CONFIG_HAS_MP_OPTION=y CONFIG_HAS_CPU_VIRT=y @@ -43,12 +45,15 @@ CONFIG_ARM_V8=y # CONFIG_PF_BCM283X_RPI1 is not set # CONFIG_PF_BCM283X_RPI2 is not set CONFIG_PF_BCM283X_RPI3=y +# CONFIG_PF_BCM283X_RPIZW is not set CONFIG_ABI_VF=y CONFIG_ARM_CORTEX_A53=y # CONFIG_CPU_VIRT is not set CONFIG_FPU=y +CONFIG_LAZY_FPU=y # CONFIG_ARM_ALIGNMENT_CHECK is not set CONFIG_ARM_EM_STD=y +# CONFIG_ARM_EM_NS is not set # CONFIG_ARM_SMC_USER is not set CONFIG_BIT64_CHOICE=y CONFIG_ARM_LPAE=y @@ -78,6 +83,7 @@ CONFIG_INLINE=y CONFIG_SERIAL=y CONFIG_JDB=y CONFIG_JDB_LOGGING=y +# CONFIG_JDB_DISASM is not set CONFIG_JDB_GZIP=y # CONFIG_JDB_ACCOUNTING is not set # CONFIG_WARN_NONE is not set diff --git a/repos/base-foc/config/rpi3.user b/repos/base-foc/config/rpi3.user index d5384b4fb..3421247d9 100644 --- a/repos/base-foc/config/rpi3.user +++ b/repos/base-foc/config/rpi3.user @@ -19,12 +19,10 @@ CONFIG_CPU_ARM_ARMV8A=y # CONFIG_PLATFORM_TYPE_arm_virt is not set # CONFIG_PLATFORM_TYPE_rv_vexpress_a15 is not set CONFIG_PLATFORM_TYPE_rpi_b=y -# CONFIG_PLATFORM_TYPE_rcar3_m3 is not set +# CONFIG_PLATFORM_TYPE_rcar3 is not set # CONFIG_PLATFORM_TYPE_zynqmp is not set # CONFIG_PLATFORM_TYPE_custom is not set CONFIG_PLATFORM_TYPE="rpi_b" -# CONFIG_USE_DROPS_STDDIR is not set -# CONFIG_USE_DICE is not set CONFIG_DROPS_STDDIR="/path/to/l4re" CONFIG_DROPS_INSTDIR="/path/to/l4re" CONFIG_BID_COLORED_PHASES=y diff --git a/repos/base-foc/config/x86_32.kernel b/repos/base-foc/config/x86_32.kernel index a82d362a6..75a22ae61 100644 --- a/repos/base-foc/config/x86_32.kernel +++ b/repos/base-foc/config/x86_32.kernel @@ -2,6 +2,7 @@ # Automatically generated file; DO NOT EDIT. # Fiasco configuration # +CONFIG_HAS_LAZY_FPU=y CONFIG_HAS_VIRT_OBJ_SPACE_OPTION=y CONFIG_HAS_SERIAL_OPTION=y CONFIG_HAS_WATCHDOG_OPTION=y @@ -25,6 +26,8 @@ CONFIG_CPU_VIRT=y CONFIG_SCHED_APIC=y # CONFIG_WORKAROUND_AMD_FPU_LEAK is not set CONFIG_REGPARM3=y +CONFIG_FPU=y +# CONFIG_LAZY_FPU is not set # # Kernel options diff --git a/repos/base-foc/config/x86_32.user b/repos/base-foc/config/x86_32.user index 816a7f390..f1bfd1de9 100644 --- a/repos/base-foc/config/x86_32.user +++ b/repos/base-foc/config/x86_32.user @@ -17,8 +17,6 @@ CONFIG_CPU="586" CONFIG_PLATFORM_TYPE_pc=y # CONFIG_PLATFORM_TYPE_custom is not set CONFIG_PLATFORM_TYPE="pc" -# CONFIG_USE_DROPS_STDDIR is not set -# CONFIG_USE_DICE is not set CONFIG_DROPS_STDDIR="/path/to/l4re" CONFIG_DROPS_INSTDIR="/path/to/l4re" CONFIG_BID_COLORED_PHASES=y diff --git a/repos/base-foc/config/x86_64.kernel b/repos/base-foc/config/x86_64.kernel index d2d30d103..43dd42ac6 100644 --- a/repos/base-foc/config/x86_64.kernel +++ b/repos/base-foc/config/x86_64.kernel @@ -2,6 +2,7 @@ # Automatically generated file; DO NOT EDIT. # Fiasco configuration # +CONFIG_HAS_LAZY_FPU=y CONFIG_HAS_VIRT_OBJ_SPACE_OPTION=y CONFIG_HAS_SERIAL_OPTION=y CONFIG_HAS_WATCHDOG_OPTION=y @@ -23,6 +24,8 @@ CONFIG_ABI_VF=y CONFIG_CPU_VIRT=y CONFIG_SCHED_APIC=y # CONFIG_WORKAROUND_AMD_FPU_LEAK is not set +CONFIG_FPU=y +# CONFIG_LAZY_FPU is not set # # Kernel options diff --git a/repos/base-foc/config/x86_64.user b/repos/base-foc/config/x86_64.user index 5c9b226d7..dbe903848 100644 --- a/repos/base-foc/config/x86_64.user +++ b/repos/base-foc/config/x86_64.user @@ -17,8 +17,6 @@ CONFIG_CPU="K8" CONFIG_PLATFORM_TYPE_pc=y # CONFIG_PLATFORM_TYPE_custom is not set CONFIG_PLATFORM_TYPE="pc" -# CONFIG_USE_DROPS_STDDIR is not set -# CONFIG_USE_DICE is not set CONFIG_DROPS_STDDIR="/path/to/l4re" CONFIG_DROPS_INSTDIR="/path/to/l4re" CONFIG_BID_COLORED_PHASES=y diff --git a/repos/base-foc/patches/0001-L4RE-Remove-moe-from-switch_ram_base-target.patch b/repos/base-foc/patches/0001-L4RE-Remove-moe-from-switch_ram_base-target.patch new file mode 100644 index 000000000..e91f620a2 --- /dev/null +++ b/repos/base-foc/patches/0001-L4RE-Remove-moe-from-switch_ram_base-target.patch @@ -0,0 +1,24 @@ +From dde7b7a8de121c4569fdec32ada623146dd430dc Mon Sep 17 00:00:00 2001 +From: Sebastian Sumpf +Date: Wed, 20 Feb 2013 12:30:53 +0100 +Subject: [PATCH 01/15] L4RE: Remove 'moe' from 'switch_ram_base' target + +--- + l4/Makefile | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/l4/Makefile b/l4/Makefile +index 61f55524..814d5fe3 100644 +--- a/l4/Makefile ++++ b/l4/Makefile +@@ -480,7 +480,6 @@ define switch_ram_base_func + echo "# File semi-automatically generated by 'make switch_ram_base'" > $(OBJ_BASE)/Makeconf.ram_base; \ + echo "RAM_BASE := $(1)" >> $(OBJ_BASE)/Makeconf.ram_base; \ + PWD=$(PWD)/l4re-core/pkg/sigma0/server/src $(MAKE) RAM_BASE=$(1) -C pkg/l4re-core/sigma0/server/src; \ +- PWD=$(PWD)/l4re-core/pkg/moe/server/src $(MAKE) RAM_BASE=$(1) -C pkg/l4re-core/moe/server/src; \ + echo "RAM_BASE_SWITCH_OK := yes" >> $(OBJ_BASE)/Makeconf.ram_base + endef + +-- +2.11.0 + diff --git a/repos/base-foc/patches/0002-FOC-change-l4_task_cap_equal-semantic.patch b/repos/base-foc/patches/0002-FOC-change-l4_task_cap_equal-semantic.patch new file mode 100644 index 000000000..d33c40fee --- /dev/null +++ b/repos/base-foc/patches/0002-FOC-change-l4_task_cap_equal-semantic.patch @@ -0,0 +1,42 @@ +From 1b5b4c951c4f5d5495ab6acb98c586b85d123295 Mon Sep 17 00:00:00 2001 +From: Sebastian Sumpf +Date: Fri, 11 Jan 2013 17:14:26 +0100 +Subject: [PATCH 02/15] FOC: change l4_task_cap_equal semantic + +The syscall l4_task_cap_equal almost returns false although the referenced +kernel-objects are equal. This patch changes the semantic of the syscall so that +whenever two capabilities refering the same kernel-object are compared it will +return true. Please refer to the discussion of the following mail thread: +http://www.mail-archive.com/l4-hackers@os.inf.tu-dresden.de/msg05162.html + +Was 'foc_caps_equal.patch' +--- + kernel/fiasco/src/kern/task.cpp | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/kernel/fiasco/src/kern/task.cpp b/kernel/fiasco/src/kern/task.cpp +index 693da581..e30867e2 100644 +--- a/kernel/fiasco/src/kern/task.cpp ++++ b/kernel/fiasco/src/kern/task.cpp +@@ -518,10 +518,15 @@ Task::sys_caps_equal(Syscall_frame *, Utcb *utcb) + if (obj_a.special() || obj_b.special()) + return commit_result(obj_a.special_cap() == obj_b.special_cap()); + +- Obj_space::Capability c_a = lookup(obj_a.cap()); +- Obj_space::Capability c_b = lookup(obj_b.cap()); ++ Kobject_iface* ki_a = lookup(obj_a.cap()).obj(); ++ Kobject_iface* ki_b = lookup(obj_b.cap()).obj(); + +- return commit_result(c_a == c_b); ++ if (!ki_b || !ki_a) return commit_result(0); ++ ++ Mword o_a = ki_a->obj_id(); ++ Mword o_b = ki_b->obj_id(); ++ ++ return commit_result(o_a == o_b); + } + + PRIVATE inline NOEXPORT +-- +2.11.0 + diff --git a/repos/base-foc/patches/0003-Sigma0-raise-sigma0-s-priority-to-maximum.patch b/repos/base-foc/patches/0003-Sigma0-raise-sigma0-s-priority-to-maximum.patch new file mode 100644 index 000000000..c6fa99664 --- /dev/null +++ b/repos/base-foc/patches/0003-Sigma0-raise-sigma0-s-priority-to-maximum.patch @@ -0,0 +1,43 @@ +From a7c9b9eaf75f9574c2ae80094df15942bf54c4ca Mon Sep 17 00:00:00 2001 +From: Sebastian Sumpf +Date: Fri, 11 Jan 2013 17:38:28 +0100 +Subject: [PATCH 03/15] Sigma0: raise sigma0's priority to maximum. + +When sigma0 runs on a lower priority than the rest of the threads in the system +it might come to the point that while answering a page fault or I/O memory area +request the timeslice of the caller (core-pager) gets fully consumed. As long as +other threads are still executable and don't block sigma0 won't do progress +anymore, because it runs at the lowest priority. This commit simply sets +sigma0's priority to the highest in the system. + +Was: 'sigma0_prio.patch' +--- + l4/pkg/l4re-core/sigma0/server/src/init.cc | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/l4/pkg/l4re-core/sigma0/server/src/init.cc b/l4/pkg/l4re-core/sigma0/server/src/init.cc +index c2608ceb..ebd8d479 100644 +--- a/l4/pkg/l4re-core/sigma0/server/src/init.cc ++++ b/l4/pkg/l4re-core/sigma0/server/src/init.cc +@@ -27,6 +27,7 @@ + #include "ioports.h" + #include "mem_man_test.h" + #include ++#include + + /* started as the L4 sigma0 task from crt0.S */ + +@@ -61,6 +62,10 @@ init(l4_kernel_info_t *info) + l4_debugger_set_object_name(L4_BASE_FACTORY_CAP, "root factory"); + l4_debugger_set_object_name(L4_BASE_THREAD_CAP, "sigma0"); + ++ l4_sched_param_t params = l4_sched_param(255); ++ l4_scheduler_run_thread(L4_BASE_SCHEDULER_CAP, L4_BASE_THREAD_CAP, ¶ms); ++ ++ + Page_alloc_base::init(); + + init_memory(info); +-- +2.11.0 + diff --git a/repos/base-foc/patches/0005-FOC-Increase-name-buffer-of-JDB-to-32K.patch b/repos/base-foc/patches/0005-FOC-Increase-name-buffer-of-JDB-to-32K.patch new file mode 100644 index 000000000..b6ce08f54 --- /dev/null +++ b/repos/base-foc/patches/0005-FOC-Increase-name-buffer-of-JDB-to-32K.patch @@ -0,0 +1,30 @@ +From 09f403d2eb2c7dc089796f58c9a1f359fdea2c35 Mon Sep 17 00:00:00 2001 +From: Sebastian Sumpf +Date: Fri, 11 Jan 2013 17:34:06 +0100 +Subject: [PATCH 05/15] FOC: Increase name buffer of JDB to 32K + +Increase the size of the JDB kernel object names buffer. The original size was +too small for some Genode scenarios and caused missing thread names in the +kernel debugger thread list. + +Was: 'jdb_kobject_names.patch' +--- + kernel/fiasco/src/jdb/jdb_kobject_names.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/fiasco/src/jdb/jdb_kobject_names.cpp b/kernel/fiasco/src/jdb/jdb_kobject_names.cpp +index 5b5adbad..d65fbd56 100644 +--- a/kernel/fiasco/src/jdb/jdb_kobject_names.cpp ++++ b/kernel/fiasco/src/jdb/jdb_kobject_names.cpp +@@ -43,7 +43,7 @@ IMPLEMENTATION: + + enum + { +- Name_buffer_size = 8192, ++ Name_buffer_size = 4*8192, + Name_entries = Name_buffer_size / sizeof(Jdb_kobject_name), + }; + +-- +2.11.0 + diff --git a/repos/base-foc/patches/0006-FOC-adjust-panda-timer-to-version-A6.patch b/repos/base-foc/patches/0006-FOC-adjust-panda-timer-to-version-A6.patch new file mode 100644 index 000000000..24807d19a --- /dev/null +++ b/repos/base-foc/patches/0006-FOC-adjust-panda-timer-to-version-A6.patch @@ -0,0 +1,34 @@ +From 8ce1c02d02fa8a9e50124e3237c2e01ae73c248c Mon Sep 17 00:00:00 2001 +From: Sebastian Sumpf +Date: Wed, 8 Mar 2017 16:58:27 +0100 +Subject: [PATCH 06/15] FOC: adjust panda timer to version A6 + +A6 runs at 800 not 700 MHz (as the ES2 does) when bootstrapped by U-boot + +(thanks to mstein) +--- + .../fiasco/src/kern/arm/bsp/omap/timer-arm-mptimer-omap4.cpp | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/kernel/fiasco/src/kern/arm/bsp/omap/timer-arm-mptimer-omap4.cpp b/kernel/fiasco/src/kern/arm/bsp/omap/timer-arm-mptimer-omap4.cpp +index 72ef9b90..c0aef990 100644 +--- a/kernel/fiasco/src/kern/arm/bsp/omap/timer-arm-mptimer-omap4.cpp ++++ b/kernel/fiasco/src/kern/arm/bsp/omap/timer-arm-mptimer-omap4.cpp +@@ -4,5 +4,13 @@ INTERFACE [arm && mptimer && pf_omap4_pandaboard]: + EXTENSION class Timer + { + private: +- static Mword interval() { return 499999; } ++ static Mword interval() ++ { ++ /* ++ * This is only valid for Panda A6, as we run it at our offices. For A6 ++ * U-Boot will clock the board at 800 MHz leading to a 400 MHz private timer ++ * tick. ++ */ ++ return 399999; ++ } + }; +-- +2.11.0 + diff --git a/repos/base-foc/patches/0007-L4RE-fix-x86-syscall-bindings-to-use-in-C-namespace.patch b/repos/base-foc/patches/0007-L4RE-fix-x86-syscall-bindings-to-use-in-C-namespace.patch new file mode 100644 index 000000000..087228d0a --- /dev/null +++ b/repos/base-foc/patches/0007-L4RE-fix-x86-syscall-bindings-to-use-in-C-namespace.patch @@ -0,0 +1,28 @@ +From 266d89b9a54653bfe5cae2744ab72cf83ec13d6d Mon Sep 17 00:00:00 2001 +From: Stefan Kalkowski +Date: Wed, 3 May 2017 15:01:31 +0200 +Subject: [PATCH 07/15] L4RE: fix x86 syscall bindings to use in C++ namespace + +--- + l4/pkg/l4re-core/l4sys/include/ARCH-x86/ipc-invoke.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/l4/pkg/l4re-core/l4sys/include/ARCH-x86/ipc-invoke.h b/l4/pkg/l4re-core/l4sys/include/ARCH-x86/ipc-invoke.h +index 6e635697..18ef1f6d 100644 +--- a/l4/pkg/l4re-core/l4sys/include/ARCH-x86/ipc-invoke.h ++++ b/l4/pkg/l4re-core/l4sys/include/ARCH-x86/ipc-invoke.h +@@ -48,7 +48,11 @@ + #if 1 + + #ifdef __PIC__ ++#ifndef __cplusplus + extern void (*__l4sys_invoke_indirect)(void); ++#else ++extern "C" void (*__l4sys_invoke_indirect)(void); ++#endif + #endif + # define IPC_SYSENTER "# indirect sys invoke \n\t" \ + "call *%[func] \n\t" +-- +2.11.0 + diff --git a/repos/base-foc/patches/0009-Bootstrap-read-out-comport-on-x86-from-BDA-area.patch b/repos/base-foc/patches/0009-Bootstrap-read-out-comport-on-x86-from-BDA-area.patch new file mode 100644 index 000000000..98c56e75a --- /dev/null +++ b/repos/base-foc/patches/0009-Bootstrap-read-out-comport-on-x86-from-BDA-area.patch @@ -0,0 +1,35 @@ +From 2cf8f6f608aa4ade16402c10751aaa7d90b994f8 Mon Sep 17 00:00:00 2001 +From: Alexander Boettcher +Date: Mon, 10 Jun 2013 10:30:49 +0200 +Subject: [PATCH 09/15] Bootstrap: read out comport on x86 from BDA area + +With this patch the comport are tried to read out from the BIOS Data Area +on x86 machines. The BDA Area are part of the first physical page and may +contain the non-default io ports of the comport. + +When used together with 'bender' from the 'morbo' toolchain, even serial PCI +cards (also Intel's AMT Serial Over Line adapter) are detected automatically. +--- + l4/pkg/bootstrap/server/src/platform/x86_pc-base.h | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/l4/pkg/bootstrap/server/src/platform/x86_pc-base.h b/l4/pkg/bootstrap/server/src/platform/x86_pc-base.h +index c3e8c12f..95579c09 100644 +--- a/l4/pkg/bootstrap/server/src/platform/x86_pc-base.h ++++ b/l4/pkg/bootstrap/server/src/platform/x86_pc-base.h +@@ -957,7 +957,11 @@ public: + } + else if (comport == -1) + { +- legacy_uart(1, comirq, &board); ++ /* try to read Bios Data Area (BDA) to get comport information */ ++ unsigned short comport_count = (*((unsigned short *)0x410) >> 9) & 0x7; ++ if (comport_count) comport = *((unsigned short *)0x400), comirq, &board; ++ else comport = 1; ++ legacy_uart(comport, comirq, &board); + comport = 0; + } + else +-- +2.11.0 + diff --git a/repos/base-foc/patches/0010-L4RE-get-rid-of-__builtin_strlen-usage.patch b/repos/base-foc/patches/0010-L4RE-get-rid-of-__builtin_strlen-usage.patch new file mode 100644 index 000000000..f602178ab --- /dev/null +++ b/repos/base-foc/patches/0010-L4RE-get-rid-of-__builtin_strlen-usage.patch @@ -0,0 +1,47 @@ +From f3d44f2a42763bbcba7085f3005ee8a36dbf23e9 Mon Sep 17 00:00:00 2001 +From: Stefan Kalkowski +Date: Tue, 30 May 2017 09:03:57 +0200 +Subject: [PATCH 10/15] L4RE: get rid of __builtin_strlen usage + +--- + l4/pkg/l4re-core/l4sys/include/kdebug.h | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/l4/pkg/l4re-core/l4sys/include/kdebug.h b/l4/pkg/l4re-core/l4sys/include/kdebug.h +index cfb17464..64ee9900 100644 +--- a/l4/pkg/l4re-core/l4sys/include/kdebug.h ++++ b/l4/pkg/l4re-core/l4sys/include/kdebug.h +@@ -133,6 +133,13 @@ __kdebug_op_1(unsigned op, l4_mword_t val) L4_NOTHROW + return res; + } + ++L4_INLINE unsigned __kdebug_strlen(char const * s) ++{ ++ unsigned r = 0; ++ for (; s && *s; s++, r++); ++ return r; ++} ++ + L4_INLINE void enter_kdebug(char const *text) L4_NOTHROW + { + /* special case, enter without any text and use of the UTCB */ +@@ -144,14 +151,14 @@ L4_INLINE void enter_kdebug(char const *text) L4_NOTHROW + return; + } + +- __kdebug_text(L4_KDEBUG_ENTER, text, __builtin_strlen(text)); ++ __kdebug_text(L4_KDEBUG_ENTER, text, __kdebug_strlen(text)); + } + + L4_INLINE void outnstring(char const *text, unsigned len) + { __kdebug_text(L4_KDEBUG_OUTNSTRING, text, len); } + + L4_INLINE void outstring(char const *text) +-{ outnstring(text, __builtin_strlen(text)); } ++{ outnstring(text, __kdebug_strlen(text)); } + + + L4_INLINE void outchar(char c) +-- +2.11.0 + diff --git a/repos/base-foc/patches/0011-Ex_regs-Change-user_flags.patch b/repos/base-foc/patches/0011-Ex_regs-Change-user_flags.patch new file mode 100644 index 000000000..5db919d3d --- /dev/null +++ b/repos/base-foc/patches/0011-Ex_regs-Change-user_flags.patch @@ -0,0 +1,45 @@ +From b9323143eead13223b658c92010c923c959e2159 Mon Sep 17 00:00:00 2001 +From: Sebastian Sumpf +Date: Fri, 11 Jan 2013 17:27:42 +0100 +Subject: [PATCH 11/15] Ex_regs: Change 'user_flags' + +Return true if thread is ready. + +Was: 'foc_exregs_ret_state.patch' +--- + kernel/fiasco/src/kern/arm/thread-arm.cpp | 2 +- + kernel/fiasco/src/kern/ia32/thread-ia32.cpp | 5 ++++- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/kernel/fiasco/src/kern/arm/thread-arm.cpp b/kernel/fiasco/src/kern/arm/thread-arm.cpp +index 82b62998..7bce193b 100644 +--- a/kernel/fiasco/src/kern/arm/thread-arm.cpp ++++ b/kernel/fiasco/src/kern/arm/thread-arm.cpp +@@ -325,7 +325,7 @@ Thread::user_sp(Mword sp) + IMPLEMENT inline + Mword + Thread::user_flags() const +-{ return 0; } ++{ return state() & Thread_ready; } + + PUBLIC inline NEEDS ["trap_state.h"] + int +diff --git a/kernel/fiasco/src/kern/ia32/thread-ia32.cpp b/kernel/fiasco/src/kern/ia32/thread-ia32.cpp +index 3777821d..62a561a9 100644 +--- a/kernel/fiasco/src/kern/ia32/thread-ia32.cpp ++++ b/kernel/fiasco/src/kern/ia32/thread-ia32.cpp +@@ -80,7 +80,10 @@ Thread::user_ip() const + IMPLEMENT inline + Mword + Thread::user_flags() const +-{ return regs()->flags(); } ++{ ++ // pass thread-ready state in carry flag (Thread_ready is bit 0) ++ return (regs()->flags() & ~Thread_ready) | (state() & Thread_ready); ++} + + PRIVATE static inline + Mword +-- +2.11.0 + diff --git a/repos/base-foc/patches/0012-Flush-the-TLB-after-idle-operation.patch b/repos/base-foc/patches/0012-Flush-the-TLB-after-idle-operation.patch new file mode 100644 index 000000000..ad2597bfa --- /dev/null +++ b/repos/base-foc/patches/0012-Flush-the-TLB-after-idle-operation.patch @@ -0,0 +1,29 @@ +From 43cd446fe9bcba67a7d7312b14004e9063343a89 Mon Sep 17 00:00:00 2001 +From: Christian Prochaska +Date: Wed, 28 Aug 2013 19:53:23 +0200 +Subject: [PATCH 12/15] Flush the TLB after idle operation + +While a CPU executes the idle thread, it receives no cross-CPU TLB flush +requests. Therefore, the TLB needs to get flushed when leaving the idle +thread to compensate for any missed flush requests. + +Fixes ssumpf/foc#9. +--- + kernel/fiasco/src/kern/kernel_thread.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/kernel/fiasco/src/kern/kernel_thread.cpp b/kernel/fiasco/src/kern/kernel_thread.cpp +index 348fde9c..7e4a0d31 100644 +--- a/kernel/fiasco/src/kern/kernel_thread.cpp ++++ b/kernel/fiasco/src/kern/kernel_thread.cpp +@@ -182,6 +182,7 @@ Kernel_thread::idle_op() + arch_tickless_idle(cpu); + + Mem_space::enable_tlb(cpu); ++ Mem_unit::tlb_flush(); + Rcu::leave_idle(cpu); + Timer_tick::enable(cpu); + } +-- +2.11.0 + diff --git a/repos/base-foc/patches/0014-Always-enable-user-mode-access-for-performance-monit.patch b/repos/base-foc/patches/0014-Always-enable-user-mode-access-for-performance-monit.patch new file mode 100644 index 000000000..6990e03d8 --- /dev/null +++ b/repos/base-foc/patches/0014-Always-enable-user-mode-access-for-performance-monit.patch @@ -0,0 +1,35 @@ +From b74e427801f045578c401a140a8e66404bb3ff19 Mon Sep 17 00:00:00 2001 +From: Christian Prochaska +Date: Tue, 12 Feb 2019 19:54:06 +0100 +Subject: [PATCH 14/15] Always enable user mode access for performance monitors + +QEMU implements the cycle count register read by +'Genode::Trace::timestamp()', but does not report a supported debug model +version for Cortex-A9. +--- + kernel/fiasco/src/kern/arm/perf_cnt-arm.cpp | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/kernel/fiasco/src/kern/arm/perf_cnt-arm.cpp b/kernel/fiasco/src/kern/arm/perf_cnt-arm.cpp +index b7d6a935..bff54286 100644 +--- a/kernel/fiasco/src/kern/arm/perf_cnt-arm.cpp ++++ b/kernel/fiasco/src/kern/arm/perf_cnt-arm.cpp +@@ -190,8 +190,13 @@ PUBLIC static FIASCO_INIT_CPU + void + Perf_cnt::init_cpu() + { +- if (!is_avail()) +- return; ++ /* ++ * QEMU implements the cycle count register read by ++ * 'Genode::Trace::timestamp()', but does not report a supported debug model ++ * version for Cortex-A9. ++ */ ++ //if (!is_avail()) ++ //return; + + _nr_counters = (pmcr() >> 11) & 0x1f; + +-- +2.11.0 + diff --git a/repos/base-foc/patches/0015-VMX-disable-event-injection-if-requested-by-VMM.patch b/repos/base-foc/patches/0015-VMX-disable-event-injection-if-requested-by-VMM.patch new file mode 100644 index 000000000..a11afbc2a --- /dev/null +++ b/repos/base-foc/patches/0015-VMX-disable-event-injection-if-requested-by-VMM.patch @@ -0,0 +1,29 @@ +From a8411389dffc3c55dc5809d2e849b3afac94ee5d Mon Sep 17 00:00:00 2001 +From: Alexander Boettcher +Date: Fri, 12 Apr 2019 13:53:24 +0200 +Subject: [PATCH 15/15] VMX: disable event injection if requested by VMM + +--- + kernel/fiasco/src/kern/ia32/vm_vmx.cpp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/kernel/fiasco/src/kern/ia32/vm_vmx.cpp b/kernel/fiasco/src/kern/ia32/vm_vmx.cpp +index 7de4110f..44483b48 100644 +--- a/kernel/fiasco/src/kern/ia32/vm_vmx.cpp ++++ b/kernel/fiasco/src/kern/ia32/vm_vmx.cpp +@@ -306,6 +306,12 @@ Vm_vmx_t::load_guest_state(Cpu_number cpu, void *src) + + Vmx::vmwrite(Vmx::F_entry_int_info, irq_info); + } ++ else ++ { ++ // switch off event injection if requested but still pending in hw ++ if (Vmx::vmread(Vmx::F_entry_int_info) & (1UL << 31)) ++ Vmx::vmwrite(Vmx::F_entry_int_info, irq_info); ++ } + + // hm, we have to check for sanitizing the cr0 and cr4 shadow stuff + load(0x6000, 0x6006, src); +-- +2.11.0 + diff --git a/repos/base-foc/patches/0016-svm-provide-cr0-to-guest-if-np-enabled.patch b/repos/base-foc/patches/0016-svm-provide-cr0-to-guest-if-np-enabled.patch new file mode 100644 index 000000000..29d4d8194 --- /dev/null +++ b/repos/base-foc/patches/0016-svm-provide-cr0-to-guest-if-np-enabled.patch @@ -0,0 +1,24 @@ +From 518f0ab153ab528fb78c3643d490c2cbefe0dd80 Mon Sep 17 00:00:00 2001 +From: Alexander Boettcher +Date: Sat, 4 May 2019 19:19:22 +0200 +Subject: [PATCH 16/17] svm: provide cr0 to guest if np enabled + +--- + kernel/fiasco/src/kern/ia32/vm_svm.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/kernel/fiasco/src/kern/ia32/vm_svm.cpp b/kernel/fiasco/src/kern/ia32/vm_svm.cpp +index 9960a830..1330e36a 100644 +--- a/kernel/fiasco/src/kern/ia32/vm_svm.cpp ++++ b/kernel/fiasco/src/kern/ia32/vm_svm.cpp +@@ -656,6 +656,7 @@ Vm_svm::do_resume_vcpu(Context *ctxt, Vcpu_state *vcpu, Vmcb *vmcb_s) + + if (EXPECT_TRUE(kernel_vmcb_s->np_enabled())) + { ++ vmcb_s->state_save_area.cr0 = kernel_vmcb_s->state_save_area.cr0; + vmcb_s->state_save_area.cr3 = kernel_vmcb_s->state_save_area.cr3; + vmcb_s->state_save_area.cr4 = kernel_vmcb_s->state_save_area.cr4; + } +-- +2.11.0 + diff --git a/repos/base-foc/patches/0017-svm-avoid-forceful-exit-on-task-switch.patch b/repos/base-foc/patches/0017-svm-avoid-forceful-exit-on-task-switch.patch new file mode 100644 index 000000000..d8e787883 --- /dev/null +++ b/repos/base-foc/patches/0017-svm-avoid-forceful-exit-on-task-switch.patch @@ -0,0 +1,25 @@ +From 45bf2c699552d1e2891d322bea479d95f8c93d02 Mon Sep 17 00:00:00 2001 +From: Alexander Boettcher +Date: Sat, 4 May 2019 19:20:41 +0200 +Subject: [PATCH 17/17] svm: avoid forceful exit on task switch + +--- + kernel/fiasco/src/kern/ia32/vm_svm.cpp | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/kernel/fiasco/src/kern/ia32/vm_svm.cpp b/kernel/fiasco/src/kern/ia32/vm_svm.cpp +index 1330e36a..9ac5b87b 100644 +--- a/kernel/fiasco/src/kern/ia32/vm_svm.cpp ++++ b/kernel/fiasco/src/kern/ia32/vm_svm.cpp +@@ -486,8 +486,6 @@ Vm_svm::do_resume_vcpu(Context *ctxt, Vcpu_state *vcpu, Vmcb *vmcb_s) + kernel_vmcb_s->control_area.intercept_instruction0 |= (1 << 22); + // intercept HLT + kernel_vmcb_s->control_area.intercept_instruction0 |= (1 << 24); +- // intercept task switch +- kernel_vmcb_s->control_area.intercept_instruction0 |= (1 << 29); + // intercept shutdown + kernel_vmcb_s->control_area.intercept_instruction0 |= (1 << 31); + // intercept MONITOR/MWAIT +-- +2.11.0 + diff --git a/repos/base-foc/ports/foc.hash b/repos/base-foc/ports/foc.hash index 267df27b2..917f423e5 100644 --- a/repos/base-foc/ports/foc.hash +++ b/repos/base-foc/ports/foc.hash @@ -1 +1 @@ -23f5b19a4853073d9cde790709f5e8d9a6c401d7 +91ca3363690c5b9c992a110375242f5d426a6848 diff --git a/repos/base-foc/ports/foc.port b/repos/base-foc/ports/foc.port index 98e936afb..fbaeff2c4 100644 --- a/repos/base-foc/ports/foc.port +++ b/repos/base-foc/ports/foc.port @@ -1,6 +1,40 @@ -LICENSE := GPLv2 -VERSION := git -DOWNLOADS := foc.git -URL(foc) := https://github.com/alex-ab/foc.git -REV(foc) := 45bf2c699552d1e2891d322bea479d95f8c93d02 -DIR(foc) := src/kernel/foc +LICENSE := GPLv2 +VERSION := git +DOWNLOADS := mk.git foc.git l4re-core.git drivers-frst.git bootstrap.git + +URL(mk) := https://github.com/kernkonzept/mk.git +REV(mk) := dc4501f9cc3910c2038e0703ffdcd9062d2610e1 +DIR(mk) := src/kernel/foc/l4 + +URL(foc) := https://github.com/kernkonzept/fiasco.git +REV(foc) := 4367c50b1df878604b9833d4b41ae311d6e12e03 +DIR(foc) := src/kernel/foc/kernel/fiasco + +URL(l4re-core) := https://github.com/kernkonzept/l4re-core.git +REV(l4re-core) := fe794038e477e5a54762126689483c0e91a177a8 +DIR(l4re-core) := src/kernel/foc/l4/pkg/l4re-core + +URL(drivers-frst) := https://github.com/kernkonzept/drivers-frst.git +REV(drivers-frst) := ce2d7d33294cb7034a4226912463b24f6ffe1bc7 +DIR(drivers-frst) := src/kernel/foc/l4/pkg/drivers-frst + +URL(bootstrap) := https://github.com/kernkonzept/bootstrap.git +REV(bootstrap) := 36500c1253f46f527098febd4da7cbc9d0e2c218 +DIR(bootstrap) := src/kernel/foc/l4/pkg/bootstrap + +PATCHES := $(addprefix patches/,$(notdir $(wildcard $(REP_DIR)/patches/*.patch))) + +PATCH_OPT(patches/0001-L4RE-Remove-moe-from-switch_ram_base-target.patch) := -p2 -d${DIR(mk)} +PATCH_OPT(patches/0002-FOC-change-l4_task_cap_equal-semantic.patch) := -p3 -d${DIR(foc)} +PATCH_OPT(patches/0003-Sigma0-raise-sigma0-s-priority-to-maximum.patch) := -p4 -d${DIR(l4re-core)} +PATCH_OPT(patches/0005-FOC-Increase-name-buffer-of-JDB-to-32K.patch) := -p3 -d${DIR(foc)} +PATCH_OPT(patches/0006-FOC-adjust-panda-timer-to-version-A6.patch) := -p3 -d${DIR(foc)} +PATCH_OPT(patches/0007-L4RE-fix-x86-syscall-bindings-to-use-in-C-namespace.patch) := -p4 -d${DIR(l4re-core)} +PATCH_OPT(patches/0009-Bootstrap-read-out-comport-on-x86-from-BDA-area.patch) := -p4 -d${DIR(bootstrap)} +PATCH_OPT(patches/0010-L4RE-get-rid-of-__builtin_strlen-usage.patch) := -p4 -d${DIR(l4re-core)} +PATCH_OPT(patches/0011-Ex_regs-Change-user_flags.patch) := -p3 -d${DIR(foc)} +PATCH_OPT(patches/0012-Flush-the-TLB-after-idle-operation.patch) := -p3 -d${DIR(foc)} +PATCH_OPT(patches/0014-Always-enable-user-mode-access-for-performance-monit.patch):= -p3 -d${DIR(foc)} +PATCH_OPT(patches/0015-VMX-disable-event-injection-if-requested-by-VMM.patch) := -p3 -d${DIR(foc)} +PATCH_OPT(patches/0016-svm-provide-cr0-to-guest-if-np-enabled.patch) := -p3 -d${DIR(foc)} +PATCH_OPT(patches/0017-svm-avoid-forceful-exit-on-task-switch.patch) := -p3 -d${DIR(foc)}