On 2017-01-19 21:11, Ralf Ramsauer wrote: > We're about to implement a second HV console channel: a 'virtual' > console available for the root cell via sysfs. In order to encode its > configuration in struct jailhouse_debug_console, rename > JAILHOUSE_CON_TYPE to JAILHOUSE_CON1_TYPE. > > Most of the work was done automatically with sed. > > Signed-off-by: Ralf Ramsauer <[email protected]> > --- > Documentation/debug-output.md | 24 ++++++++++++------------ > Documentation/vga-console.txt | 2 +- > configs/amd-seattle.c | 4 ++-- > configs/bananapi.c | 4 ++-- > configs/f2a88xm-hd3.c | 4 ++-- > configs/foundation-v8.c | 4 ++-- > configs/hikey.c | 4 ++-- > configs/imb-a180.c | 4 ++-- > configs/jetson-tk1.c | 4 ++-- > configs/jetson-tx1.c | 4 ++-- > configs/orangepi0.c | 4 ++-- > configs/qemu-vm.c | 4 ++-- > configs/vexpress.c | 4 ++-- > configs/zynqmp-zcu102.c | 4 ++-- > driver/main.c | 2 +- > hypervisor/arch/arm-common/dbg-write.c | 10 +++++----- > hypervisor/arch/x86/dbg-write.c | 6 +++--- > hypervisor/arch/x86/uart.c | 2 +- > hypervisor/include/jailhouse/cell-config.h | 22 +++++++++++----------- > hypervisor/paging.c | 2 +- > tools/root-cell-config.c.tmpl | 4 ++-- > 21 files changed, 61 insertions(+), 61 deletions(-) > > diff --git a/Documentation/debug-output.md b/Documentation/debug-output.md > index 1e5888fc23..6367fbcd93 100644 > --- a/Documentation/debug-output.md > +++ b/Documentation/debug-output.md > @@ -12,22 +12,22 @@ options. > ### .flags > All architectures support the empty debug output driver, which is selected by > default if nothing else is chosen: > - - JAILHOUSE_CON_TYPE_NONE > + - JAILHOUSE_CON1_TYPE_NONE > > Possible debug outputs for x86: > - - JAILHOUSE_CON_TYPE_UART_X86 /* generic X86 PIO/MMIO UART driver */ > - - JAILHOUSE_CON_TYPE_VGA /* VGA console */ > + - JAILHOUSE_CON1_TYPE_UART_X86 /* generic X86 PIO/MMIO UART driver */ > + - JAILHOUSE_CON1_TYPE_VGA /* VGA console */ > > VGA output is only available for x86. For further documentation on VGA output > see [vga-console.txt](vga-console.txt). > > Possible debug outputs for arm and arm64: > - - JAILHOUSE_CON_TYPE_8250 /* 8250 compatible UART */ > - - JAILHOUSE_CON_TYPE_PL011 /* AMBA PL011 UART */ > + - JAILHOUSE_CON1_TYPE_8250 /* 8250 compatible UART */ > + - JAILHOUSE_CON1_TYPE_PL011 /* AMBA PL011 UART */ > > Additional flags that can be or'ed: > - - JAILHOUSE_CON_FLAG_PIO /* x86 only */ > - - JAILHOUSE_CON_FLAG_MMIO /* x86 and ARM. Should always be selected for > + - JAILHOUSE_CON1_FLAG_PIO /* x86 only */ > + - JAILHOUSE_CON1_FLAG_MMIO /* x86 and ARM. Should always be selected for > * ARM. */ > > ### .address and .size > @@ -59,8 +59,8 @@ Example configuration for PIO based debug output on x86: > .debug_console = { > .address = 0x3f8, /* PIO address */ > .divider = 0x1, /* 115200 Baud */ > - .flags = JAILHOUSE_CON_TYPE_UART_X86 | /* generic x86 UART driver */ > - JAILHOUSE_CON_FLAG_PIO, /* use PIO instead of MMIO */ > + .flags = JAILHOUSE_CON1_TYPE_UART_X86 | /* generic x86 UART driver */ > + JAILHOUSE_CON1_FLAG_PIO, /* use PIO instead of MMIO */ > }, > ``` > > @@ -72,15 +72,15 @@ Example configuration for MMIO based debug output on ARM > (8250 UART): > .clock_reg = 0x60006000 + 0x330, /* Optional: Debug Clock Register */ > .gate_nr = (65 % 32), /* Optional: Debug Clock Gate Nr */ > .divider = 0xdd, /* 115200 */ > - .flags = JAILHOUSE_CON_TYPE_8250 | /* choose the 8250 driver */ > - JAILHOUSE_CON_FLAG_MMIO, /* choose MMIO register access */ > + .flags = JAILHOUSE_CON1_TYPE_8250 | /* choose the 8250 driver */ > + JAILHOUSE_CON1_FLAG_MMIO, /* choose MMIO register access > */ > }, > ``` > > Example configuration for disabled debug output (architecture independent): > ``` > .debug_console = { > - .flags = JAILHOUSE_CON_TYPE_NONE, > + .flags = JAILHOUSE_CON1_TYPE_NONE, > } > ``` > > diff --git a/Documentation/vga-console.txt b/Documentation/vga-console.txt > index 7b37826488..81dcc403b0 100644 > --- a/Documentation/vga-console.txt > +++ b/Documentation/vga-console.txt > @@ -20,7 +20,7 @@ Add the following to the header section of your root cell's > config: > .debug_console = { > .address = 0xb8000, > .size = 0x1000, > - .flags = JAILHOUSE_CON_TYPE_VGA | JAILHOUSE_CON_FLAG_MMIO, > + .flags = JAILHOUSE_CON1_TYPE_VGA | JAILHOUSE_CON1_FLAG_MMIO, > }, > > Boot using the following kernel parameters: > diff --git a/configs/amd-seattle.c b/configs/amd-seattle.c > index 7d32eacc01..66e3fdcd82 100644 > --- a/configs/amd-seattle.c > +++ b/configs/amd-seattle.c > @@ -32,8 +32,8 @@ struct { > .debug_console = { > .address = 0xe1010000, > .size = 0x1000, > - .flags = JAILHOUSE_CON_TYPE_PL011 | > - JAILHOUSE_CON_FLAG_MMIO, > + .flags = JAILHOUSE_CON1_TYPE_PL011 | > + JAILHOUSE_CON1_FLAG_MMIO, > }, > .platform_info = { > .pci_mmconfig_base = 0xf0000000, > diff --git a/configs/bananapi.c b/configs/bananapi.c > index ef7f824060..484d808ac3 100644 > --- a/configs/bananapi.c > +++ b/configs/bananapi.c > @@ -37,8 +37,8 @@ struct { > /* .clock_reg = 0x01c2006c, */ > /* .gate_nr = 16 */ > /* .divider = 0x0d, */ > - .flags = JAILHOUSE_CON_TYPE_8250 | > - JAILHOUSE_CON_FLAG_MMIO, > + .flags = JAILHOUSE_CON1_TYPE_8250 | > + JAILHOUSE_CON1_FLAG_MMIO, > }, > .platform_info = { > .pci_mmconfig_base = 0x2000000, > diff --git a/configs/f2a88xm-hd3.c b/configs/f2a88xm-hd3.c > index 7c57407bbf..62a9117b99 100644 > --- a/configs/f2a88xm-hd3.c > +++ b/configs/f2a88xm-hd3.c > @@ -41,8 +41,8 @@ struct { > .debug_console = { > .address = 0x3f8, > /* .divider = 0x1, */ > - .flags = JAILHOUSE_CON_TYPE_UART_X86 | > - JAILHOUSE_CON_FLAG_PIO, > + .flags = JAILHOUSE_CON1_TYPE_UART_X86 | > + JAILHOUSE_CON1_FLAG_PIO, > }, > .platform_info = { > .pci_mmconfig_base = 0xe0000000, > diff --git a/configs/foundation-v8.c b/configs/foundation-v8.c > index 9ae975567d..c4112004d9 100644 > --- a/configs/foundation-v8.c > +++ b/configs/foundation-v8.c > @@ -31,8 +31,8 @@ struct { > .debug_console = { > .address = 0x1c090000, > .size = 0x1000, > - .flags = JAILHOUSE_CON_TYPE_PL011 | > - JAILHOUSE_CON_FLAG_MMIO, > + .flags = JAILHOUSE_CON1_TYPE_PL011 | > + JAILHOUSE_CON1_FLAG_MMIO, > }, > .platform_info.arm = { > #ifdef CONFIG_ARM_GIC_V3 > diff --git a/configs/hikey.c b/configs/hikey.c > index c45fc96e74..a739222b93 100644 > --- a/configs/hikey.c > +++ b/configs/hikey.c > @@ -32,8 +32,8 @@ struct { > .debug_console = { > .address = 0xf7113000, > .size = 0x1000, > - .flags = JAILHOUSE_CON_TYPE_PL011 | > - JAILHOUSE_CON_FLAG_MMIO, > + .flags = JAILHOUSE_CON1_TYPE_PL011 | > + JAILHOUSE_CON1_FLAG_MMIO, > }, > .platform_info = { > .pci_mmconfig_base = 0xf6000000, > diff --git a/configs/imb-a180.c b/configs/imb-a180.c > index d5987bbe71..fa36d791d3 100644 > --- a/configs/imb-a180.c > +++ b/configs/imb-a180.c > @@ -40,8 +40,8 @@ struct { > .debug_console = { > .address = 0x3f8, > /* .divider = 0x1, */ > - .flags = JAILHOUSE_CON_TYPE_UART_X86 | > - JAILHOUSE_CON_FLAG_PIO, > + .flags = JAILHOUSE_CON1_TYPE_UART_X86 | > + JAILHOUSE_CON1_FLAG_PIO, > }, > .platform_info = { > .pci_mmconfig_base = 0xe0000000, > diff --git a/configs/jetson-tk1.c b/configs/jetson-tk1.c > index b8176dee79..d6713405bf 100644 > --- a/configs/jetson-tk1.c > +++ b/configs/jetson-tk1.c > @@ -40,8 +40,8 @@ struct { > /* .clock_reg = 0x60006000 + 0x330, */ > /* .gate_nr = (65 % 32), */ > /* .divider = 0xdd, */ > - .flags = JAILHOUSE_CON_TYPE_8250 | > - JAILHOUSE_CON_FLAG_MMIO, > + .flags = JAILHOUSE_CON1_TYPE_8250 | > + JAILHOUSE_CON1_FLAG_MMIO, > }, > .platform_info = { > .pci_mmconfig_base = 0x48000000, > diff --git a/configs/jetson-tx1.c b/configs/jetson-tx1.c > index cf80aa4786..af1f55775b 100644 > --- a/configs/jetson-tx1.c > +++ b/configs/jetson-tx1.c > @@ -34,8 +34,8 @@ struct { > .debug_console = { > .address = 0x70006000, > .size = 0x0040, > - .flags = JAILHOUSE_CON_TYPE_8250 | > - JAILHOUSE_CON_FLAG_MMIO, > + .flags = JAILHOUSE_CON1_TYPE_8250 | > + JAILHOUSE_CON1_FLAG_MMIO, > }, > .platform_info.arm = { > .gicd_base = 0x50041000, > diff --git a/configs/orangepi0.c b/configs/orangepi0.c > index a37e5d49d8..14f1a0e0dd 100644 > --- a/configs/orangepi0.c > +++ b/configs/orangepi0.c > @@ -34,8 +34,8 @@ struct { > .debug_console = { > .address = 0x01c28000, > .size = 0x1000, > - .flags = JAILHOUSE_CON_TYPE_8250 | > - JAILHOUSE_CON_FLAG_MMIO, > + .flags = JAILHOUSE_CON1_TYPE_8250 | > + JAILHOUSE_CON1_FLAG_MMIO, > }, > .platform_info = { > .pci_mmconfig_base = 0x2000000, > diff --git a/configs/qemu-vm.c b/configs/qemu-vm.c > index 04d0c947f5..0ce34eeab6 100644 > --- a/configs/qemu-vm.c > +++ b/configs/qemu-vm.c > @@ -40,8 +40,8 @@ struct { > .debug_console = { > .address = 0x3f8, > /* .divider = 0x1, */ > - .flags = JAILHOUSE_CON_TYPE_UART_X86 | > - JAILHOUSE_CON_FLAG_PIO, > + .flags = JAILHOUSE_CON1_TYPE_UART_X86 | > + JAILHOUSE_CON1_FLAG_PIO, > }, > .platform_info = { > .pci_mmconfig_base = 0xb0000000, > diff --git a/configs/vexpress.c b/configs/vexpress.c > index 15202970f8..61c99b9b73 100644 > --- a/configs/vexpress.c > +++ b/configs/vexpress.c > @@ -31,8 +31,8 @@ struct { > .debug_console = { > .address = 0x1c090000, > .size = 0x1000, > - .flags = JAILHOUSE_CON_TYPE_PL011 | > - JAILHOUSE_CON_FLAG_MMIO, > + .flags = JAILHOUSE_CON1_TYPE_PL011 | > + JAILHOUSE_CON1_FLAG_MMIO, > }, > .platform_info.arm = { > #ifdef CONFIG_ARM_GIC_V3 > diff --git a/configs/zynqmp-zcu102.c b/configs/zynqmp-zcu102.c > index d236ae6f49..120a73dc6d 100644 > --- a/configs/zynqmp-zcu102.c > +++ b/configs/zynqmp-zcu102.c > @@ -34,8 +34,8 @@ struct { > .debug_console = { > .address = 0xff000000, > .size = 0x1000, > - .flags = JAILHOUSE_CON_TYPE_XUARTPS | > - JAILHOUSE_CON_FLAG_MMIO, > + .flags = JAILHOUSE_CON1_TYPE_XUARTPS | > + JAILHOUSE_CON1_FLAG_MMIO, > }, > .platform_info = { > .pci_mmconfig_base = 0xfc000000, > diff --git a/driver/main.c b/driver/main.c > index e793d9d7a3..676794bef1 100644 > --- a/driver/main.c > +++ b/driver/main.c > @@ -301,7 +301,7 @@ static int jailhouse_cmd_enable(struct jailhouse_system > __user *arg) > } > > #ifdef JAILHOUSE_BORROW_ROOT_PT > - if (CON_IS_MMIO(config->debug_console.flags)) { > + if (CON1_IS_MMIO(config->debug_console.flags)) { > console = ioremap(config->debug_console.address, > config->debug_console.size); > if (!console) { > diff --git a/hypervisor/arch/arm-common/dbg-write.c > b/hypervisor/arch/arm-common/dbg-write.c > index e88b18b916..e9e51a3242 100644 > --- a/hypervisor/arch/arm-common/dbg-write.c > +++ b/hypervisor/arch/arm-common/dbg-write.c > @@ -42,16 +42,16 @@ static void arm_uart_write(const char *msg) > > void arch_dbg_write_init(void) > { > - unsigned char con_type = CON_TYPE(system_config->debug_console.flags); > + unsigned char con_type = CON1_TYPE(system_config->debug_console.flags); > > - if (!CON_IS_MMIO(system_config->debug_console.flags)) > + if (!CON1_IS_MMIO(system_config->debug_console.flags)) > return; > > - if (con_type == JAILHOUSE_CON_TYPE_PL011) > + if (con_type == JAILHOUSE_CON1_TYPE_PL011) > uart = &uart_pl011_ops; > - else if (con_type == JAILHOUSE_CON_TYPE_8250) > + else if (con_type == JAILHOUSE_CON1_TYPE_8250) > uart = &uart_8250_ops; > - else if (con_type == JAILHOUSE_CON_TYPE_XUARTPS) > + else if (con_type == JAILHOUSE_CON1_TYPE_XUARTPS) > uart = &uart_xuartps_ops; > > if (uart) { > diff --git a/hypervisor/arch/x86/dbg-write.c b/hypervisor/arch/x86/dbg-write.c > index 60e8adb43a..30ddc9087a 100644 > --- a/hypervisor/arch/x86/dbg-write.c > +++ b/hypervisor/arch/x86/dbg-write.c > @@ -17,13 +17,13 @@ > > void arch_dbg_write_init(void) > { > - unsigned char dbg_type = CON_TYPE(system_config->debug_console.flags); > + unsigned char dbg_type = CON1_TYPE(system_config->debug_console.flags); > > /* PIO / MMIO differentiation is done inside the driver code */ > - if (dbg_type == JAILHOUSE_CON_TYPE_UART_X86) { > + if (dbg_type == JAILHOUSE_CON1_TYPE_UART_X86) { > uart_init(); > arch_dbg_write = uart_write; > - } else if (dbg_type == JAILHOUSE_CON_TYPE_VGA) { > + } else if (dbg_type == JAILHOUSE_CON1_TYPE_VGA) { > vga_init(); > arch_dbg_write = vga_write; > } > diff --git a/hypervisor/arch/x86/uart.c b/hypervisor/arch/x86/uart.c > index 736cf3b2d2..09b9e84f7c 100644 > --- a/hypervisor/arch/x86/uart.c > +++ b/hypervisor/arch/x86/uart.c > @@ -57,7 +57,7 @@ void uart_init(void) > u32 flags = system_config->debug_console.flags; > u32 divider = system_config->debug_console.divider; > > - if (CON_IS_MMIO(flags)) { > + if (CON1_IS_MMIO(flags)) { > uart_reg_out = uart_mmio32_out; > uart_reg_in = uart_mmio32_in; > uart_base = (u64)hypervisor_header.debug_console_base; > diff --git a/hypervisor/include/jailhouse/cell-config.h > b/hypervisor/include/jailhouse/cell-config.h > index 2f8c7cb901..80fa5a78b4 100644 > --- a/hypervisor/include/jailhouse/cell-config.h > +++ b/hypervisor/include/jailhouse/cell-config.h > @@ -176,21 +176,21 @@ struct jailhouse_iommu { > } __attribute__((packed)); > > /* Bits 0..3 are used to select the particular driver */ > -#define JAILHOUSE_CON_TYPE_NONE 0x0000 > -#define JAILHOUSE_CON_TYPE_UART_X86 0x0001 > -#define JAILHOUSE_CON_TYPE_VGA 0x0002 > -#define JAILHOUSE_CON_TYPE_8250 0x0003 > -#define JAILHOUSE_CON_TYPE_PL011 0x0004 > -#define JAILHOUSE_CON_TYPE_XUARTPS 0x0005 > -#define JAILHOUSE_CON_TYPE_MASK 0x000f > +#define JAILHOUSE_CON1_TYPE_NONE 0x0000 > +#define JAILHOUSE_CON1_TYPE_UART_X86 0x0001 > +#define JAILHOUSE_CON1_TYPE_VGA 0x0002 > +#define JAILHOUSE_CON1_TYPE_8250 0x0003 > +#define JAILHOUSE_CON1_TYPE_PL011 0x0004 > +#define JAILHOUSE_CON1_TYPE_XUARTPS 0x0005 > +#define JAILHOUSE_CON1_TYPE_MASK 0x000f > > -#define CON_TYPE(flags) ((flags) & JAILHOUSE_CON_TYPE_MASK) > +#define CON1_TYPE(flags) ((flags) & JAILHOUSE_CON1_TYPE_MASK) > > /* We use bit 4..5 to differentiate between PIO and MMIO access */ > -#define JAILHOUSE_CON_FLAG_PIO 0x0010 > -#define JAILHOUSE_CON_FLAG_MMIO 0x0020 > +#define JAILHOUSE_CON1_FLAG_PIO 0x0010 > +#define JAILHOUSE_CON1_FLAG_MMIO 0x0020 > > -#define CON_IS_MMIO(flags) ((flags) & JAILHOUSE_CON_FLAG_MMIO) > +#define CON1_IS_MMIO(flags) ((flags) & JAILHOUSE_CON1_FLAG_MMIO) > > struct jailhouse_debug_console { > __u64 address; > diff --git a/hypervisor/paging.c b/hypervisor/paging.c > index 67ed63f415..a431550f56 100644 > --- a/hypervisor/paging.c > +++ b/hypervisor/paging.c > @@ -595,7 +595,7 @@ int paging_init(void) > if (err) > return err; > > - if (CON_IS_MMIO(system_config->debug_console.flags)) { > + if (CON1_IS_MMIO(system_config->debug_console.flags)) { > vaddr = (unsigned long)hypervisor_header.debug_console_base; > /* check if console overlaps remapping region */ > if (vaddr + system_config->debug_console.size >= REMAP_BASE && > diff --git a/tools/root-cell-config.c.tmpl b/tools/root-cell-config.c.tmpl > index b7be8b7406..85c1834ac3 100644 > --- a/tools/root-cell-config.c.tmpl > +++ b/tools/root-cell-config.c.tmpl > @@ -62,8 +62,8 @@ struct { > }, > .debug_console = { > .address = 0x3f8, > - .flags = JAILHOUSE_CON_TYPE_UART_X86 | > - JAILHOUSE_CON_FLAG_PIO, > + .flags = JAILHOUSE_CON1_TYPE_UART_X86 | > + JAILHOUSE_CON1_FLAG_PIO, > }, > .platform_info = { > .pci_mmconfig_base = ${hex(mmconfig.base)}, >
Reviewed-by: Jan Kiszka <[email protected]> -- 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.
