On 2018-04-27 11:36, Ralf Ramsauer wrote: > We will need to embed struct jailhouse_debug_console in struct > jailhouse_cell_desc later, which requires it to be declared a bit > earlier.
I think your subject and log no longer match the split-up into a separate header... > > No functional change. > > Signed-off-by: Ralf Ramsauer <[email protected]> > --- > include/jailhouse/cell-config.h | 44 +---------------- > include/jailhouse/console.h | 84 +++++++++++++++++++++++++++++++++ > 2 files changed, 86 insertions(+), 42 deletions(-) > create mode 100644 include/jailhouse/console.h > > diff --git a/include/jailhouse/cell-config.h b/include/jailhouse/cell-config.h > index ec8884af..a7bf5a99 100644 > --- a/include/jailhouse/cell-config.h > +++ b/include/jailhouse/cell-config.h > @@ -39,6 +39,8 @@ > #ifndef _JAILHOUSE_CELL_CONFIG_H > #define _JAILHOUSE_CELL_CONFIG_H > > +#include <jailhouse/console.h> > + > /* > * Incremented on any layout or semantic change of system or cell config. > * Also update HEADER_REVISION in tools. > @@ -182,48 +184,6 @@ struct jailhouse_iommu { > __u32 amd_features; > } __attribute__((packed)); > > -/* Bits 0..3 are used to select the particular driver */ > -#define JAILHOUSE_CON1_TYPE_NONE 0x0000 > -#define JAILHOUSE_CON1_TYPE_VGA 0x0001 > -#define JAILHOUSE_CON1_TYPE_8250 0x0002 > -#define JAILHOUSE_CON1_TYPE_PL011 0x0003 > -#define JAILHOUSE_CON1_TYPE_XUARTPS 0x0004 > -#define JAILHOUSE_CON1_TYPE_MVEBU 0x0005 > -#define JAILHOUSE_CON1_TYPE_HSCIF 0x0006 > -#define JAILHOUSE_CON1_TYPE_SCIFA 0x0007 > -#define JAILHOUSE_CON1_TYPE_IMX 0x0008 > -#define JAILHOUSE_CON1_TYPE_MASK 0x000f > - > -#define CON1_TYPE(flags) ((flags) & JAILHOUSE_CON1_TYPE_MASK) > - > -/* Bits 4 is used to select PIO (cleared) or MMIO (set) access */ > -#define JAILHOUSE_CON1_ACCESS_PIO 0x0000 > -#define JAILHOUSE_CON1_ACCESS_MMIO 0x0010 > - > -#define CON1_IS_MMIO(flags) ((flags) & JAILHOUSE_CON1_ACCESS_MMIO) > - > -/* Bits 5 is used to select 1 (cleared) or 4-bytes (set) register distance. > - * 1 byte implied 8-bit access, 4 bytes 32-bit access. */ > -#define JAILHOUSE_CON1_REGDIST_1 0x0000 > -#define JAILHOUSE_CON1_REGDIST_4 0x0020 > - > -#define CON1_USES_REGDIST_1(flags) (((flags) & JAILHOUSE_CON1_REGDIST_4) == > 0) > - > -/* Bits 8..11 are used to select the second console driver */ > -#define JAILHOUSE_CON2_TYPE_ROOTPAGE 0x0100 > -#define JAILHOUSE_CON2_TYPE_MASK 0x0f00 > - > -#define CON2_TYPE(flags) ((flags) & JAILHOUSE_CON2_TYPE_MASK) > - > -struct jailhouse_debug_console { > - __u64 address; > - __u32 size; > - __u32 flags; > - __u32 divider; > - __u32 gate_nr; > - __u64 clock_reg; > -} __attribute__((packed)); > - > #define JAILHOUSE_SYSTEM_SIGNATURE "JHSYST" > > /** > diff --git a/include/jailhouse/console.h b/include/jailhouse/console.h > new file mode 100644 > index 00000000..351f73f0 > --- /dev/null > +++ b/include/jailhouse/console.h > @@ -0,0 +1,84 @@ > +/* > + * Jailhouse, a Linux-based partitioning hypervisor > + * > + * Copyright (c) OTH Regensburg, 2018 > + * > + * Authors: > + * Ralf Ramsauer <[email protected]> > + * > + * This work is licensed under the terms of the GNU GPL, version 2. See > + * the COPYING file in the top-level directory. > + * > + * Alternatively, you can use or redistribute this file under the following > + * BSD license: > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS > IS" > + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE > + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF > + * THE POSSIBILITY OF SUCH DAMAGE. > + */ > + > +#ifndef _JAILHOUSE_CONSOLE_H > +#define _JAILHOUSE_CONSOLE_H > + > +/* Bits 0..3 are used to select the particular driver */ > +#define JAILHOUSE_CON1_TYPE_NONE 0x0000 > +#define JAILHOUSE_CON1_TYPE_VGA 0x0001 > +#define JAILHOUSE_CON1_TYPE_8250 0x0002 > +#define JAILHOUSE_CON1_TYPE_PL011 0x0003 > +#define JAILHOUSE_CON1_TYPE_XUARTPS 0x0004 > +#define JAILHOUSE_CON1_TYPE_MVEBU 0x0005 > +#define JAILHOUSE_CON1_TYPE_HSCIF 0x0006 > +#define JAILHOUSE_CON1_TYPE_SCIFA 0x0007 > +#define JAILHOUSE_CON1_TYPE_IMX 0x0008 > +#define JAILHOUSE_CON1_TYPE_MASK 0x000f > + > +#define CON1_TYPE(flags) ((flags) & JAILHOUSE_CON1_TYPE_MASK) > + > +/* Bits 4 is used to select PIO (cleared) or MMIO (set) access */ > +#define JAILHOUSE_CON1_ACCESS_PIO 0x0000 > +#define JAILHOUSE_CON1_ACCESS_MMIO 0x0010 > + > +#define CON1_IS_MMIO(flags) ((flags) & JAILHOUSE_CON1_ACCESS_MMIO) > + > +/* Bits 5 is used to select 1 (cleared) or 4-bytes (set) register distance. > + * 1 byte implied 8-bit access, 4 bytes 32-bit access. */ > +#define JAILHOUSE_CON1_REGDIST_1 0x0000 > +#define JAILHOUSE_CON1_REGDIST_4 0x0020 > + > +#define CON1_USES_REGDIST_1(flags) (((flags) & JAILHOUSE_CON1_REGDIST_4) == > 0) > + > +/* Bits 8..11 are used to select the second console driver */ > +#define JAILHOUSE_CON2_TYPE_ROOTPAGE 0x0100 > +#define JAILHOUSE_CON2_TYPE_MASK 0x0f00 This channel is not available for inmates... > + > +#define CON2_TYPE(flags) ((flags) & JAILHOUSE_CON2_TYPE_MASK) > + > +struct jailhouse_debug_console { > + __u64 address; > + __u32 size; > + __u32 flags; > + __u32 divider; > + __u32 gate_nr; > + __u64 clock_reg; > +} __attribute__((packed)); > + > +#endif /* !_JAILHOUSE_CONSOLE_H */ > It's actually no longer just a "debug" console when giving it to inmates, I would say. Moreover, we are creating a way more complex ABI towards our inmates when exposing that, compared to the simple platform info we currently have on x86. And we use the same API and ABI for the cell config now. That concerns me as well. For the cell config, we have at least some revision number now. The Comm Region may need that as well now. But even with that, there are now 3 places that can break on config updates: config definitions for the hypervisor and driver, python modules, and now also inmates... Jan -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
