Skip to content
Permalink
Browse files

inmates: x86: linux-loader: Enrich setup_data with flags

Reserve 32 bits in the setup_data for additional flags. Soon,
jailhouse-cell-linux will use them to indicate the availability of
platform UARTs.

We extended the features of the setup_data, but didn't change the
semantics of any other field. So increase the number of the
compatibility version.

Signed-off-by: Ralf Ramsauer <ralf.ramsauer@oth-regensburg.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
  • Loading branch information...
rralf authored and jan-kiszka committed Jul 29, 2019
1 parent ded106d commit 5c45b67ebc7dbdeb959a750d52f226fca48d37ae
Showing with 6 additions and 3 deletions.
  1. +2 −0 inmates/tools/x86/linux-loader.c
  2. +4 −3 tools/jailhouse-cell-linux
@@ -34,6 +34,8 @@ struct setup_data {
u32 apic_khz;
u8 standard_ioapic;
u8 cpu_ids[SMP_MAX_CPUS];
/* Flags bits 0-3: has access to platform UART n */
u32 flags;
} __attribute__((packed));

/* We use the cmdline section for zero page and setup data. */
@@ -776,10 +776,11 @@ class X86ZeroPage:
def x86_gen_setup_data(config):
SETUP_TYPE_JAILHOUSE = 6
MAX_CPUS = 255
SETUP_DATA_VERSION = 1
SETUP_DATA_VERSION = 2
SETUP_DATA_COMPAT_VERSION = 1
standard_ioapic = 0
setup_data_hdr_struct = '8xII'
setup_data_struct = ('HH12x8xB%ux' % MAX_CPUS)
setup_data_struct = ('HH12x8xB%ux4x' % MAX_CPUS)

for irqchip in config.irqchips:
if irqchip.is_standard():
@@ -788,7 +789,7 @@ def x86_gen_setup_data(config):
return struct.pack(setup_data_hdr_struct, SETUP_TYPE_JAILHOUSE,
struct.calcsize(setup_data_struct)) + \
struct.pack(setup_data_struct, SETUP_DATA_VERSION,
SETUP_DATA_VERSION, standard_ioapic)
SETUP_DATA_COMPAT_VERSION, standard_ioapic)


# pretend to be part of the jailhouse tool

0 comments on commit 5c45b67

Please sign in to comment.
You can’t perform that action at this time.