Commit f3611fdd authored by Charles E. Youse's avatar Charles E. Youse Committed by Anas Nashif
Browse files

boards/x86_jailhouse: remove support for Jailhouse hypervisor



This configuration is not used, maintained or tested, so it is removed.

Signed-off-by: default avatarCharles E. Youse <charles.youse@intel.com>
parent 0fe4e1b3
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
# SPDX-License-Identifier: Apache-2.0

config BOARD_X86_JAILHOUSE
	bool "QEMU x86 (root cell)"
	depends on SOC_IA32
	select QEMU_TARGET
	select CPU_HAS_FPU if !X86_IAMCU
+0 −12
Original line number Diff line number Diff line
# SPDX-License-Identifier: Apache-2.0

if BOARD_X86_JAILHOUSE

config BOARD
	default "x86_jailhouse"

config JAILHOUSE
	bool "Zephyr port to boot as a (x86) Jailhouse inmate cell payload"
	default y

endif # BOARD_X86_JAILHOUSE
+0 −42
Original line number Diff line number Diff line
# SPDX-License-Identifier: Apache-2.0

set(EMU_PLATFORM qemu)

set(QEMU_binary_suffix x86_64)

# QEMU, in Jailhouse's case, is not emulating Zephyr's hardware
# directly, but the root cell/system, with a mount point reaching
# the kernel itself available
set(QEMU_KERNEL_OPTION ";")

if(NOT CONFIG_REBOOT)
  set(REBOOT_FLAG -no-reboot)
endif()

if (NOT DEFINED JAILHOUSE_QEMU_IMG_FILE)
  message(FATAL_ERROR "You have to provide a valid qcow2 QEMU image to be a Jailhouse root cell (variable JAILHOUSE_QEMU_IMG_FILE)!")
endif()

set(QEMU_CPU_TYPE_${ARCH} kvm64,-kvm_pv_eoi,-kvm_steal_time,-kvm_asyncpf,-kvmclock,+vmx,+x2apic,+arat)
set(QEMU_FLAGS_${ARCH}
  -machine q35,kernel_irqchip=split
  ${REBOOT_FLAG}
  -m 1G
  -enable-kvm
  -smp 4
  -device intel-iommu,intremap=on,x-buggy-eim=on
  -cpu ${QEMU_CPU_TYPE_${ARCH}}
  -drive file=${JAILHOUSE_QEMU_IMG_FILE},format=qcow2,id=disk,if=none
  -device ide-hd,drive=disk
  -netdev user,id=net
  -device e1000e,addr=2.0,netdev=net
  -device intel-hda,addr=1b.0
  -device hda-duplex
  -fsdev local,path=./zephyr,security_model=passthrough,id=vfs
  -device virtio-9p-pci,addr=1f.7,mount_tag=host,fsdev=vfs
  )

# TODO: Support debug
# board_set_debugger_ifnset(qemu)
# debugserver: QEMU_EXTRA_FLAGS += -s -S
# debugserver: qemu
+0 −122
Original line number Diff line number Diff line
.. _x86_jailhouse:

Jailhouse cell X86 Emulation (QEMU)
###################################

Overview
********

The X86 Jailhouse QEMU board configuration is used to emulate the X86
architecture. This board configuration provides support for x86 64-bit
(KVM) passthrough CPUs (-cpu kvm64) and the following devices:

* Advanced Programmable Interrupt Controller (APIC)
* NS16550 UART

This is to prove that Zephyr, with this Jailhouse port, would run on
any x86-64 CPUs baremetal as well. The port only reaches the UART via
port I/O, now, but it can be extended to do MMIO.

Hardware
********

Supported Features
==================

This configuration supports the following hardware features:

+--------------+------------+-----------------------+
| Interface    | Controller | Driver/Component      |
+==============+============+=======================+
| APIC         | on-chip    | interrupt controller  |
+--------------+------------+-----------------------+
| NS16550      | on-chip    | serial port           |
| UART         |            |                       |
+--------------+------------+-----------------------+

Devices
=======

Serial Port
-----------

The board configuration uses a single serial communication channel
that uses the NS16550 serial driver operating in polling mode (port
I/O is used).

Known Problems or Limitations
=============================

The following platform features are unsupported:

* Serial port in Direct Memory Access (DMA) mode
* Serial Peripheral Interface (SPI) flash
* General-Purpose Input/Output (GPIO)
* Inter-Integrated Circuit (I2C)
* Ethernet

Programming and Debugging
*************************

Use this configuration to run basic Zephyr applications and kernel
tests in a QEMU emulated environment (we assume the same QEMU
configuration used to accommodate Jailhouse's configs/qemu-x86.c root
cell configuration).

For example, with the :ref:`synchronization_sample`:

.. zephyr-app-commands::
   :zephyr-app: samples/synchronization
   :board: x86_jailhouse
   :gen-args: -DJAILHOUSE_QEMU_IMG_FILE=some/valid.qcow2
   :goals: build run

This assumes the user has the binary qemu-system-x86_64 in their
system (not provided by Zephyr's toolchain). This is because the base
system here will be 64-bit and Zephyr will boot as a virtual guest in
it. The variable ``JAILHOUSE_QEMU_IMG_FILE`` is the path to a
:file:`.qcow2` file. This qcow2 image must contain the base image with
Jailhouse installed (not provided by Zephyr's SDK, again).

This will build an image with the synchronization sample app and mount
the current directory inside QEMU under /mnt.

From a console, in that QEMU instance, issue:

.. code-block:: shell

        $ sudo insmod <path to jailhouse.ko>
        $ sudo jailhouse enable <path to configs/qemu-x86.cell>
        $ sudo jailhouse cell create <path to configs/tiny-demo.cell>
        $ sudo mount -t 9p -o trans/virtio host /mnt
        $ sudo jailhouse cell load tiny-demo /mnt/zephyr.bin
        $ sudo jailhouse cell start tiny-demo
        $ sudo jailhouse cell destroy tiny-demo
        $ sudo jailhouse disable
        $ sudo rmmod jailhouse

This should display the following console output:

.. code-block:: console

        Created cell "tiny-demo"
        Page pool usage after cell creation: mem 275/1480, remap 65607/131072
        Cell "tiny-demo" can be loaded
        CPU 3 received SIPI, vector 100
        Started cell "tiny-demo"
        ***** BOOTING ZEPHYR OS v1.8.99 - BUILD: Jun 27 2017 13:09:26 *****
        threadA: Hello World from x86!
        threadB: Hello World from x86!
        threadA: Hello World from x86!
        threadB: Hello World from x86!
        threadA: Hello World from x86!
        threadB: Hello World from x86!
        threadA: Hello World from x86!
        threadB: Hello World from x86!
        threadA: Hello World from x86!
        threadB: Hello World from x86!

Debugging
=========

Refer to the detailed overview about :ref:`application_debugging`.
+0 −53
Original line number Diff line number Diff line
/* SPDX-License-Identifier: Apache-2.0 */

/dts-v1/;

#include <mem.h>

#define DT_FLASH_SIZE		DT_SIZE_K(4092)

#if XIP
	#define DT_SRAM_SIZE		DT_SIZE_K(4096)
#else
	#define DT_SRAM_SIZE		DT_SIZE_K(8188)
#endif

#include <ia32.dtsi>

/ {
	model = "QEMU X86";
	compatible = "intel,ia32";

	aliases {
		uart-0 = &uart0;
		uart-1 = &uart1;
	};

	chosen {
		zephyr,sram = &sram0;
		zephyr,flash = &flash0;
		zephyr,console = &uart0;
		zephyr,shell-uart = &uart0;
		zephyr,bt-uart = &uart1;
		zephyr,uart-pipe = &uart1;
		zephyr,bt-mon-uart = &uart1;
	};
};

&uart0 {
	status = "ok";
	current-speed = <115200>;
};

&uart1 {
	status = "ok";
	current-speed = <115200>;
};

&flash0 {
	reg = <0x0 DT_SRAM_SIZE>;
};

&sram0 {
	reg = <0x0 DT_SRAM_SIZE>;
};
Loading