2008-06-02 11:17:54

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 08 of 12] xen-console: add save/restore


-tip testing found the following xen-console symbols trouble:

ERROR: "console_drivers" [drivers/video/xen-fbfront.ko] undefined!
ERROR: "get_phys_to_machine" [drivers/video/xen-fbfront.ko] undefined!
ERROR: "get_phys_to_machine" [drivers/net/xen-netfront.ko] undefined!
ERROR: "get_phys_to_machine" [drivers/input/xen-kbdfront.ko] undefined!

with:

http://redhat.com/~mingo/misc/config-Mon_Jun__2_12_26_38_CEST_2008.bad

get_phys_to_machine can indeed be exported but i'm less sure about the
console_drivers export ... The temporary fix below resolves it for now.

Ingo

------------->
Subject: xen: build fixes
From: Ingo Molnar <[email protected]>
Date: Mon Jun 02 13:13:04 CEST 2008

Signed-off-by: Ingo Molnar <[email protected]>
---
arch/x86/xen/mmu.c | 1 +
kernel/printk.c | 2 ++
2 files changed, 3 insertions(+)

Index: linux/arch/x86/xen/mmu.c
===================================================================
--- linux.orig/arch/x86/xen/mmu.c
+++ linux/arch/x86/xen/mmu.c
@@ -136,6 +136,7 @@ unsigned long get_phys_to_machine(unsign
idx = p2m_index(pfn);
return p2m_top[topidx][idx];
}
+EXPORT_SYMBOL_GPL(get_phys_to_machine);

static void alloc_p2m(unsigned long **pp, unsigned long *mfnp)
{
Index: linux/kernel/printk.c
===================================================================
--- linux.orig/kernel/printk.c
+++ linux/kernel/printk.c
@@ -76,6 +76,8 @@ EXPORT_SYMBOL(oops_in_progress);
static DECLARE_MUTEX(console_sem);
static DECLARE_MUTEX(secondary_console_sem);
struct console *console_drivers;
+EXPORT_SYMBOL_GPL(console_drivers);
+
/*
* This is used for debugging the mess that is the VT code by
* keeping track if we have the console semaphore held. It's


2008-06-02 11:18:37

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 08 of 12] xen-console: add save/restore


* Ingo Molnar <[email protected]> wrote:

> -tip testing found the following xen-console symbols trouble:
>
> ERROR: "console_drivers" [drivers/video/xen-fbfront.ko] undefined!
> ERROR: "get_phys_to_machine" [drivers/video/xen-fbfront.ko] undefined!
> ERROR: "get_phys_to_machine" [drivers/net/xen-netfront.ko] undefined!
> ERROR: "get_phys_to_machine" [drivers/input/xen-kbdfront.ko] undefined!
>
> with:
>
> http://redhat.com/~mingo/misc/config-Mon_Jun__2_12_26_38_CEST_2008.bad

that would be:

http://redhat.com/~mingo/misc/config-Mon_Jun__2_12_25_13_CEST_2008.bad

Ingo

2008-06-02 11:50:50

by Jeremy Fitzhardinge

[permalink] [raw]
Subject: Re: [PATCH 08 of 12] xen-console: add save/restore

Ingo Molnar wrote:
> -tip testing found the following xen-console symbols trouble:
>
> ERROR: "console_drivers" [drivers/video/xen-fbfront.ko] undefined!
> ERROR: "get_phys_to_machine" [drivers/video/xen-fbfront.ko] undefined!
> ERROR: "get_phys_to_machine" [drivers/net/xen-netfront.ko] undefined!
> ERROR: "get_phys_to_machine" [drivers/input/xen-kbdfront.ko] undefined!
>
> with:
>
> http://redhat.com/~mingo/misc/config-Mon_Jun__2_12_26_38_CEST_2008.bad
>
> get_phys_to_machine can indeed be exported but i'm less sure about the
> console_drivers export ... The temporary fix below resolves it for now.
>

Exporting "get_phys_to_machine" is definitely the right thing to do,
though it might be an idea to put it in the xen_ namespace.

The console changes are Markus' territory. Markus?

Thanks,
J

> Ingo
>
> ------------->
> Subject: xen: build fixes
> From: Ingo Molnar <[email protected]>
> Date: Mon Jun 02 13:13:04 CEST 2008
>
> Signed-off-by: Ingo Molnar <[email protected]>
> ---
> arch/x86/xen/mmu.c | 1 +
> kernel/printk.c | 2 ++
> 2 files changed, 3 insertions(+)
>
> Index: linux/arch/x86/xen/mmu.c
> ===================================================================
> --- linux.orig/arch/x86/xen/mmu.c
> +++ linux/arch/x86/xen/mmu.c
> @@ -136,6 +136,7 @@ unsigned long get_phys_to_machine(unsign
> idx = p2m_index(pfn);
> return p2m_top[topidx][idx];
> }
> +EXPORT_SYMBOL_GPL(get_phys_to_machine);
>
> static void alloc_p2m(unsigned long **pp, unsigned long *mfnp)
> {
> Index: linux/kernel/printk.c
> ===================================================================
> --- linux.orig/kernel/printk.c
> +++ linux/kernel/printk.c
> @@ -76,6 +76,8 @@ EXPORT_SYMBOL(oops_in_progress);
> static DECLARE_MUTEX(console_sem);
> static DECLARE_MUTEX(secondary_console_sem);
> struct console *console_drivers;
> +EXPORT_SYMBOL_GPL(console_drivers);
> +
> /*
> * This is used for debugging the mess that is the VT code by
> * keeping track if we have the console semaphore held. It's
>

2008-06-02 12:14:15

by Markus Armbruster

[permalink] [raw]
Subject: Re: [Xen-devel] Re: [PATCH 08 of 12] xen-console: add save/restore

Ingo Molnar <[email protected]> writes:

> -tip testing found the following xen-console symbols trouble:
>
> ERROR: "console_drivers" [drivers/video/xen-fbfront.ko] undefined!
> ERROR: "get_phys_to_machine" [drivers/video/xen-fbfront.ko] undefined!
> ERROR: "get_phys_to_machine" [drivers/net/xen-netfront.ko] undefined!
> ERROR: "get_phys_to_machine" [drivers/input/xen-kbdfront.ko] undefined!
>
> with:
>
> http://redhat.com/~mingo/misc/config-Mon_Jun__2_12_26_38_CEST_2008.bad
>
> get_phys_to_machine can indeed be exported but i'm less sure about the
> console_drivers export ... The temporary fix below resolves it for now.
>
> Ingo

xen-fbfront makes itself the preferred console when it is actually
enabled. It does that by re-registering itself with CON_CONSDEV set,
and for that it needs to find its struct console. Simple, works.
Perhaps you can think of a better solution for this problem. I'm all
ears!

Details are in this commit:

xen: Enable console tty by default in domU if it's not a dummy

Without console= arguments on the kernel command line, the first
console to register becomes enabled and the preferred console (the one
behind /dev/console). This is normally tty (assuming
CONFIG_VT_CONSOLE is enabled, which it commonly is).

This is okay as long tty is a useful console. But unless we have the
PV framebuffer, and it is enabled for this domain, tty0 in domU is
merely a dummy. In that case, we want the preferred console to be the
Xen console hvc0, and we want it without having to fiddle with the
kernel command line. Commit b8c2d3dfbc117dff26058fbac316b8acfc2cb5f7
did that for us.

Since we now have the PV framebuffer, we want to enable and prefer tty
again, but only when PVFB is enabled. But even then we still want to
enable the Xen console as well.

Problem: when tty registers, we can't yet know whether the PVFB is
enabled. By the time we can know (xenstore is up), the console setup
game is over.

Solution: enable console tty by default, but keep hvc as the preferred
console. Change the preferred console to tty when PVFB probes
successfully, unless we've been given console kernel parameters.

Signed-off-by: Markus Armbruster <[email protected]>

[...]