On 2016-10-11 17:11, andreas.koe...@st.oth-regensburg.de wrote:
> From: Andreas Koelbl <andreas.koe...@st.oth-regensburg.de>
> 
> This smaller interface should be used when no output is needed.
> 
> Signed-off-by: Andreas Koelbl <andreas.koe...@st.oth-regensburg.de>
> ---
>  hypervisor/Makefile          |  6 +++++-
>  hypervisor/arch/arm/Makefile |  9 ++++++++-
>  hypervisor/dbg-write-stubs.c | 28 ++++++++++++++++++++++++++++
>  3 files changed, 41 insertions(+), 2 deletions(-)
>  create mode 100644 hypervisor/dbg-write-stubs.c
> 
> diff --git a/hypervisor/Makefile b/hypervisor/Makefile
> index e070abd..03b2d32 100644
> --- a/hypervisor/Makefile
> +++ b/hypervisor/Makefile
> @@ -39,7 +39,7 @@ ifneq ($(wildcard $(src)/../config.h),)
>  KBUILD_CFLAGS += -include $(obj)/../config.h
>  endif
>  
> -CORE_OBJECTS = setup.o printk.o paging.o control.o lib.o mmio.o
> +CORE_OBJECTS = setup.o dbg-write-stubs.o paging.o control.o lib.o mmio.o
>  
>  define filechk_version
>       $(src)/../scripts/gen_version_h $(src)/..
> @@ -71,6 +71,10 @@ define cmd_defines
>        echo "#endif" ) > $@
>  endef
>  
> +ifdef CONFIG_DEBUG_OUTPUT
> +CORE_OBJECTS += printk.o
> +endif
> +
>  defines-file := include/generated/asm-defines.h
>  
>  targets := $(defines-file) arch/$(SRCARCH)/asm-defines.s
> diff --git a/hypervisor/arch/arm/Makefile b/hypervisor/arch/arm/Makefile
> index 5d06679..4c5f564 100644
> --- a/hypervisor/arch/arm/Makefile
> +++ b/hypervisor/arch/arm/Makefile
> @@ -16,7 +16,7 @@ KBUILD_AFLAGS := $(subst -include 
> asm/unified.h,,$(KBUILD_AFLAGS))
>  
>  always := built-in.o
>  
> -obj-y := entry.o dbg-write.o exception.o setup.o control.o lib.o
> +obj-y := entry.o exception.o setup.o control.o lib.o
>  obj-y += traps.o mmio.o
>  obj-y += paging.o mmu_hyp.o mmu_cell.o caches.o
>  obj-y += psci.o smp-stubs.o
> @@ -27,3 +27,10 @@ obj-$(CONFIG_SERIAL_AMBA_PL011) += uart-pl011.o
>  obj-$(CONFIG_SERIAL_8250_DW) += uart-8250-dw.o
>  obj-$(CONFIG_SERIAL_TEGRA) += uart-tegra.o
>  obj-$(CONFIG_MACH_VEXPRESS) += smp-vexpress.o
> +ifdef CONFIG_DEBUG_OUTPUT
> +     obj-y += dbg-write.o
> +     obj-$(CONFIG_SERIAL_AMBA_PL011) += uart-pl011.o
> +     obj-$(CONFIG_SERIAL_8250_DW) += uart-8250-dw.o
> +     obj-$(CONFIG_SERIAL_TEGRA) += uart-tegra.o
> +endif
> +
> diff --git a/hypervisor/dbg-write-stubs.c b/hypervisor/dbg-write-stubs.c
> new file mode 100644
> index 0000000..7e87645
> --- /dev/null
> +++ b/hypervisor/dbg-write-stubs.c
> @@ -0,0 +1,28 @@
> +/*
> + * Jailhouse, a Linux-based partitioning hypervisor
> + *
> + * Copyright (c) OTH Regensburg, 2016
> + *
> + * Authors:
> + *  Andreas K├Âlbl <andreas.koe...@st.oth-regensburg.de>
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2.  See
> + * the COPYING file in the top-level directory.
> + */
> +#include <jailhouse/printk.h>
> +
> +void __attribute__((weak)) arch_dbg_write_init(void)
> +{
> +}
> +
> +void __attribute__((weak)) arch_dbg_write(const char *msg)
> +{
> +}
> +
> +void __attribute__((weak)) printk(const char *fmt, ...)
> +{
> +}
> +
> +void __attribute__((weak)) panic_printk(const char *fmt, ...)
> +{
> +}
> 

As you correctly found out: If we really want to save code & data, we
also need to eliminate the strings from the printk sites. And that
likely only works via defining the printk away.

So, for a quick solution to just silence the output on ARM, rather make
sure that a zero'ed jailhouse_system.debug_console works fine, just like
it already does on x86.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA ITP 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 jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to