Re: [PATCH 02/10] x86: jailhouse: Add infrastructure for running in non-root cell

From: Jan Kiszka
Date: Sat Nov 18 2017 - 14:23:11 EST


On 2017-11-17 22:54, Thomas Gleixner wrote:
> On Thu, 16 Nov 2017, Jan Kiszka wrote:
>
>> +config JAILHOUSE_GUEST
>> + bool "Jailhouse non-root cell support"
>> + depends on PARAVIRT && X86_64
>> + ---help---
>> + This option allows to run Linux as guest in a Jailhouse non-root
>> + cell. You can leave this option disabled if you only want to start
>> + Jailhouse and run Linux afterwards in the root cell.
>> +
>> + You likely also want to disable CONFIG_SUSPEND and CONFIG_SERIO to
>> + avoid access to I/O resources that are usually not assigned to the
>> + non-root cell.
>
> That should be prevented programatically.

Theoretically, serio access could also be assigned to a non-root cell.
But excluding SUSPEND may make sense unconditionally, will check again.

>
>> +#include <linux/kernel.h>
>> +#include <asm/cpu.h>
>> +#include <asm/hypervisor.h>
>> +#include <asm/setup.h>
>> +
>> +#define SETUP_JAILHOUSE 0x53484c4a /* "JLHS" */
>> +
>> +#define SETUP_REQUIRED_VERSION 1
>> +
>> +/*
>> + * The boot loader is passing platform information via this Jailhouse-specific
>> + * setup data structure.
>> + */
>> +struct jailhouse_setup_data {
>> + struct setup_data header;
>> + u16 version;
>> + u16 compatible_version;
>> + u16 pm_timer_address;
>> + u16 num_cpus;
>> + u64 pci_mmconfig_base;
>> + u8 standard_ioapic;
>> + u8 cpu_ids[255];
>
> Shouldn't this structure and SETUP_JAILHOUSE be defined in a header file
> which can be exported to boot loaders?

Something like arch/x86/include/uapi/asm/jailhouse_setup.h?

Jan