XEN/arm XENFB support
Adding xen-devel
Lars
Quoted 15 lines · peter
Goodmorning,
I'm currently playing with XEN/arm on my Allwinner A20 (cubieboard2) I would like to get the XENFB driver working on domU.
But currently in xen/arm there's no support for VFB, atleast qemu is not supported.
But this video http://www.youtube.com/watch?v=po1IeElg8tg and this one
http://www.youtube.com/watch?v=Km6gBnIqaWo is showing a working framebuffer.
So there are people which got a framebuffer working on domU. But still i couldn't find anything on the internet how to do this. Is there anyone with experience with VFB on xen/arm ?Greetings,
Quoted 9 lines
Peter van der Perk
_______________________________________________
Xen-users mailing list
[email protected]
http://lists.xen.org/xen-users
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 10 lines · Lars Kurth
On Mon, Dec 16, 2013 at 8:16 AM, peter <[email protected]> wrote:
I'm currently playing with XEN/arm on my Allwinner A20 (cubieboard2) I would like to get the XENFB driver working on domU.
But currently in xen/arm there's no support for VFB, atleast qemu is not supported.
But this video http://www.youtube.com/watch?v=po1IeElg8tg and this one
http://www.youtube.com/watch?v=Km6gBnIqaWo is showing a working framebuffer. So there are people which got a framebuffer working on domU. But still i couldn't find anything on the internet how to do this. Is there anyone with experience with VFB on xen/arm ?
I'm not sure what the first link used but the second was using a form of hybrid GPU passthrough/paravirtualisation for which the code has not been reeleased and AFAIK has nothing to do with VFB.
I've not tried VFB on ARM yet (busy with other things) but I suspect that if you were to build upstream qemu on ARM with Xen support enabled then it would just work. I would recommend giving that a go -- please let us know how you get on.
Below is a patch which I wrote ages ago that I have just rebased onto current xen staging *without retesting*. It is supposed to DTWT and enable the qemu build for ARM (as well as providing a mechanism to start the correct dom0 qemu, which you don't need for vfb).
As I say I haven't tested, or even built, and in particular I never tried PVFB with it even what I wrote it, so YMMV.
Ian.
commit 7b5d54c9a5d09c4138bec905c9accea34173ba77
Author: Ian Campbell <[email protected]> Date: Wed May 15 16:34:55 2013 +0100
tools: build and launch correct qemu for architecture
xl now provides a launch-dom0-qemu command which avoids the need to have the initscripts be aware of the specific qermu binary name, which differs by architecture and which also may have been specified by the user via the --with-system-qemu=PATH option to configure.
Perhaps this should be a separate binary hidden in libexec?
config/arm32.mk +2 -0
@@ -3,6 +3,8 @@ CONFIG_ARM_32 := y CONFIG_ARM_$(XEN_OS) := y CONFIG_XEN_INSTALL_SUFFIX := +CONFIG_QEMU_ARCH := arm +CONFIG_QEMU_TARGET := arm-softmmu # -march= -mcpu=
config/arm64.mk +2 -0
@@ -3,6 +3,8 @@ CONFIG_ARM_64 := y CONFIG_ARM_$(XEN_OS) := y CONFIG_XEN_INSTALL_SUFFIX := +CONFIG_QEMU_ARCH := aarch64 +CONFIG_QEMU_TARGET := arm-softmmu CFLAGS += #-marm -march= -mcpu= etc
config/x86_32.mk +3 -0
@@ -2,6 +2,9 @@ CONFIG_X86 := y CONFIG_X86_32 := y CONFIG_X86_$(XEN_OS) := y +CONFIG_QEMU_ARCH := i386 +CONFIG_QEMU_TARGET := i386-softmmu + CONFIG_HVM := y CONFIG_MIGRATE := y CONFIG_XCUTILS := y
config/x86_64.mk +3 -0
@@ -2,6 +2,9 @@ CONFIG_X86 := y CONFIG_X86_64 := y CONFIG_X86_$(XEN_OS) := y +CONFIG_QEMU_ARCH := x86_64 +CONFIG_QEMU_ARCH := i386-softmmu + CONFIG_COMPAT := y CONFIG_HVM := y CONFIG_MIGRATE := y
tools/Makefile +2 -3
@@ -107,7 +107,7 @@ distclean: subdirs-distclean config.cache autom4te.cache ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH)) -IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \ +IOEMU_CONFIGURE_CROSS ?= --cpu=$(CONFIG_QEMU_ARCH) \ --cross-prefix=$(CROSS_COMPILE) \ --interp-prefix=$(CROSS_SYS_ROOT) endif
@@ -186,8 +186,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find source=.; \ fi; \ cd qemu-xen-dir; \ - $$source/configure --enable-xen --target-list=i386-softmmu \ - $(QEMU_XEN_ENABLE_DEBUG) \ + $$source/configure --enable-xen --target-list=$(CONFIG_QEMU_TARGET) \ --prefix=$(PREFIX) \ --source-path=$$source \ --extra-cflags="-I$(XEN_ROOT)/tools/include \
tools/hotplug/Linux/init.d/xencommons +1 -5
@@ -116,11 +116,7 @@ do_start () { echo Starting xenconsoled... test -z "$XENCONSOLED_TRACE" || XENCONSOLED_ARGS=" --log=$XENCONSOLED_TRACE" ${SBINDIR}/xenconsoled --pid-file=$XENCONSOLED_PIDFILE $XENCONSOLED_ARGS - echo Starting QEMU as disk backend for dom0 - test -z "$QEMU_XEN" && QEMU_XEN="${LIBEXEC}/qemu-system-i386" - $QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize \ - -monitor /dev/null -serial /dev/null -parallel /dev/null \ - -pidfile $QEMU_PIDFILE + xl launch-dom0-qemu $QEMU_XEN } do_stop () { echo Stopping xenconsoled
tools/libxl/Makefile +1 -0
@@ -27,6 +27,7 @@ CFLAGS_LIBXL += $(CFLAGS_libxenguest) CFLAGS_LIBXL += $(CFLAGS_libxenstore) CFLAGS_LIBXL += $(CFLAGS_libblktapctl) CFLAGS_LIBXL += -Wshadow +CFLAGS_LIBXL += -DCONFIG_QEMU_ARCH=\"$(CONFIG_QEMU_ARCH)\" LIBXL_LIBS-$(CONFIG_ARM) += -lfdt
tools/libxl/libxl.h +3 -0
@@ -605,6 +605,9 @@ int libxl_ctx_alloc(libxl_ctx **pctx, int version, xentoollog_logger *lg);int libxl_ctx_free (libxl_ctx *ctx/* 0 is OK */ ); +/* exec's device model for dom0 and does not return. */ +void libxl_launch_dom0_qemu (libxl_ctx *ctx,const char *qemu_path,const char *pidfile); +/* domain related functions */ int libxl_domain_create_new(libxl_ctx *ctx, libxl_domain_config *d_config,
tools/libxl/libxl_dm.c +32 -1
@@ -38,7 +38,7 @@ static const char *qemu_xen_path(libxl__gc *gc)#ifdef QEMU_XEN_PATH return QEMU_XEN_PATH ;#else -return libxl__abs_path (gc,"qemu-system-i386" ,libxl__libexec_path ()); +return libxl__abs_path (gc,"qemu-system-" CONFIG_QEMU_ARCH ,libxl__libexec_path ());#endif }
@@ -1560,6 +1560,37 @@ out:return ret; } +void libxl_launch_dom0_qemu (libxl_ctx *ctx,const char *qemu_path,const char *pidfile) +{ +GC_INIT (ctx); + +flexarray_t *dm_args =flexarray_make (gc,16 ,1 ); + +if (qemu_path ==NULL ) + qemu_path =qemu_xen_path (gc); + +flexarray_vappend (dm_args, +"-xen-domid" ,"0" , +"-xen-attach" , +"-name" ,"dom0" , +"-nographic" , +"-M" "xenpv" , +"-daemonize" , +"-monitor" ,"/dev/null" , +"-serial" ,"/dev/null" , +"-parallel" ,"/dev/null" , +NULL ); +if (pidfile) +flexarray_append_pair (dm_args,"-pidfile" ,libxl__strdup (gc, pidfile)); + +libxl__exec (gc,-1 ,-1 ,-1 , + qemu_path, (char **)flexarray_contents (dm_args),NULL ); + +/* Shouldn't return */ +LOG (CRITICAL ,"Failed to exec dom0 device model" ); +GC_FREE ; +} +/* * Local variables: * mode: C
tools/libxl/xl.h +1 -0
@@ -106,6 +106,7 @@ int main_setenforce(int argc, char **argv);int main_loadpolicy (int argc,char **argv);int main_remus (int argc,char **argv);int main_devd (int argc,char **argv); +int main_launch_dom0_qemu (int argc,char **argv);void help (const char *command);
tools/libxl/xl_cmdimpl.c +25 -0
@@ -7313,6 +7313,31 @@ out:return ret; } +int main_launch_dom0_qemu (int argc,char **argv) +{ +int opt; +const char *qemu =NULL ; +const char *pidfile =NULL ; + + SWITCH_FOREACH_OPT(opt, "p:", NULL, "launch-dom-qemu", 0) { +case 'p' : + pidfile = optarg; +break ; +/* No options */ + } +if (optind < argc) + qemu = argv[optind]; + +fprintf (stderr,"argc %d\n" , argc); +fprintf (stderr,"qemu = %s" , qemu ? :"<default>" ); + +fprintf (stdout,"Starting QEMU as disk backend for dom0" ); + +libxl_launch_dom0_qemu (ctx, qemu, pidfile); + +return 0 ; +} +/* * Local variables: * mode: C
tools/libxl/xl_cmdtable.c +6 -0
@@ -494,6 +494,12 @@ struct cmd_spec cmd_table[] = { "[options]", "-F Run in the foreground", }, + {"launch-dom0-qemu" , + &main_launch_dom0_qemu,0 ,1 , +"Start qemu process to service dom0 disk backends" , +"[options] [QEMU_PATH]" , + "-p PIDFILE Write a PIDFILE\n", + }, };int cmdtable_len =sizeof (cmd_table)/sizeof (struct cmd_spec );
Thank you for the info/patch Ian.
With some modifications to Qemu, I managed to cross compile qemu-system-arm with XEN support.
Based on version: 1c514a7734b7f98625a0d18d5e8ee7581f26e50c (Merge remote branch 'perard/cpu-hotplug-port-v2' into xen-staging-master-7). And got my Qemu backend working.
I can see that INPUT_XEN_KBDDEV_FRONTEND is working (d9) 6input: Xen Virtual Keyboard as /devices/virtual/input/input0 (d9) 6input: Xen Virtual Pointer as /devices/virtual/input/input1
And that XEN bus is prompting for VFB
(d9) 6xenbus_probe_frontend: Device with no driver: device/vfb/0
But it seems that the xen-fbfront only supports PV and not PVH. (Linux kernel 3.12-RC5)
Because the init code is returning on:
if (!xen_pv_domain()) return -ENODEV;
When I comment this code out.
I do get these errors:
[ 1698.899496] Failed to unmap pfn:5c081 rc:-2
(XEN) dom10 IPA 0x0000000000000000
(XEN) P2M @ 021b8300 mfn:0x4dc18
(XEN) 1ST[0x0] = 0x000000004da276ff
(XEN) 2ND[0x0] = 0x000000006b6856ff
(XEN) 3RD[0x0] = 0x0000000000000000
[ 1698.933034] Failed to map pfn to mfn rc:0:-22 pfn:5c349 mfn:0
(XEN) dom10 IPA 0x000000002777c000
(XEN) P2M @ 021b8300 mfn:0x4dc18
(XEN) 1ST[0x0] = 0x000000004da276ff
(XEN) 2ND[0x13b] = 0x0000000000000000
[ 1698.951353] Failed to map pfn to mfn rc:0:-22 pfn:5c348 mfn:b6b2777c
Yes lots of them, and my VFB is not working tough.
So I've searched on the internet if someone got VFB on PVH working. But I couldn't find anything about, so is there someone who got VFB working on PVH (x86) ?
-----Original Message-----
From: Ian Campbell <[email protected]>
To: peter <[email protected]>
Cc: "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, Lars Kurth <[email protected]>
Date: Mon, 16 Dec 2013 09:59:09 +0000
Subject: Re: [Xen-devel] [Xen-users] XEN/arm XENFB support
Quoted 305 lines · Lars Kurth
Quoted 3 lines · peter
I'm currently playing with XEN/arm on my Allwinner A20
(cubieboard2)
Quoted 2 lines
I would like to get the XENFB driver working on domU. But currently in xen/arm there's no support for VFB, atleast
qemu is not
Quoted 2 lines
supported.
But this video http://www.youtube.com/watch?v=po1IeElg8tg andthis one
Quoted 1 line
http://www.youtube.com/watch?v=Km6gBnIqaWo is showing a
working framebuffer.
Quoted 2 lines
So there are people which got a framebuffer working on domU. But still i couldn't find anything on the internet how to do
this.
Quoted 1 line
Is there anyone with experience with VFB on xen/arm ?
I'm not sure what the first link used but the second was using a form of
hybrid GPU passthrough/paravirtualisation for which the code has not been reeleased and AFAIK has nothing to do with VFB.I've not tried VFB on ARM yet (busy with other things) but I suspect that if you were to build upstream qemu on ARM with Xen support enabled then it would just work. I would recommend giving that a go -- please let us know how you get on.
Below is a patch which I wrote ages ago that I have just rebased onto current xen staging *without retesting*. It is supposed to DTWT and enable the qemu build for ARM (as well as providing a mechanism to start
the correct dom0 qemu, which you don't need for vfb).As I say I haven't tested, or even built, and in particular I never tried PVFB with it even what I wrote it, so YMMV.
Ian.
commit
7b5d54c9a5d09c4138bec905c9accea34173ba77Author: Ian Campbell <[email protected]> Date: Wed May 15 16:34:55 2013 +0100tools: build and launch correct qemu for architecture
xl now provides a launch-dom0-qemu command which avoids the need to
have the
initscripts be aware of the specific qermu binary name, which
differs by
architecture and which also may have been specified by the user via
the
--with-system-qemu=PATH option to configure.Perhaps this should be a separate binary hidden in libexec?
Signed-off-by Ian Campbell <[email protected]>config/arm32.mk +2
-0@@ -3,6 +3,8 @@ CONFIG_ARM_32 := y CONFIG_ARM_$(XEN_OS) := y CONFIG_XEN_INSTALL_SUFFIX := +CONFIG_QEMU_ARCH := arm +CONFIG_QEMU_TARGET := arm-softmmu # -march= -mcpu=config/arm64.mk +2
-0@@ -3,6 +3,8 @@ CONFIG_ARM_64 := y CONFIG_ARM_$(XEN_OS) := y CONFIG_XEN_INSTALL_SUFFIX := +CONFIG_QEMU_ARCH := aarch64 +CONFIG_QEMU_TARGET := arm-softmmu CFLAGS += #-marm -march= -mcpu= etcconfig/x86_32.mk +3
-0@@ -2,6 +2,9 @@ CONFIG_X86 := y CONFIG_X86_32 := y CONFIG_X86_$(XEN_OS) := y +CONFIG_QEMU_ARCH := i386 +CONFIG_QEMU_TARGET := i386-softmmu + CONFIG_HVM := y CONFIG_MIGRATE := y CONFIG_XCUTILS := yconfig/x86_64.mk +3
-0@@ -2,6 +2,9 @@ CONFIG_X86 := y CONFIG_X86_64 := y CONFIG_X86_$(XEN_OS) := y +CONFIG_QEMU_ARCH := x86_64 +CONFIG_QEMU_ARCH := i386-softmmu + CONFIG_COMPAT := y CONFIG_HVM := y CONFIG_MIGRATE := ytools/Makefile +2
-3@@ -107,7 +107,7 @@ distclean: subdirs-distclean config.cache autom4te.cache ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH)) -IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \ +IOEMU_CONFIGURE_CROSS ?= --cpu=$(CONFIG_QEMU_ARCH) \ --cross-prefix=$(CROSS_COMPILE) \ --interp-prefix=$(CROSS_SYS_ROOT) endif@@ -186,8 +186,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find source=.; \ fi; \ cd qemu-xen-dir; \ - $$source/configure --enable-xen --target-list=i386-softmmu \ - $(QEMU_XEN_ENABLE_DEBUG) \ + $$source/configure --enable-xen --target-list=$(CONFIG_QEMU_TARGET) \ --prefix=$(PREFIX) \ --source-path=$$source \ --extra-cflags="-I$(XEN_ROOT)/tools/include \tools/hotplug/Linux/init.d/xencommons +0
-1@@ -116,11 +116,7 @@ do_start () { echo Starting xenconsoled... test -z "$XENCONSOLED_TRACE" || XENCONSOLED_ARGS=" --log=$XENCONSOLED_TRACE" ${SBINDIR}/xenconsoled --pid-file=$XENCONSOLED_PIDFILE$XENCONSOLED_ARGS
tools/hotplug/Linux/init.d/xencommons +1
-6- echo Starting QEMU as disk backend for dom0 - test -z "$QEMU_XEN" && QEMU_XEN="${LIBEXEC}/qemu-system-i386" - $QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize \ - -monitor /dev/null -serial /dev/null -parallel /dev/null \ - -pidfile $QEMU_PIDFILE + xl launch-dom0-qemu $QEMU_XEN } do_stop () { echo Stopping xenconsoledtools/libxl/Makefile +1
-0@@ -27,6 +27,7 @@ CFLAGS_LIBXL += $(CFLAGS_libxenguest) CFLAGS_LIBXL += $(CFLAGS_libxenstore) CFLAGS_LIBXL += $(CFLAGS_libblktapctl) CFLAGS_LIBXL += -Wshadow +CFLAGS_LIBXL += -DCONFIG_QEMU_ARCH=\"$(CONFIG_QEMU_ARCH)\" LIBXL_LIBS-$(CONFIG_ARM) += -lfdttools/libxl/libxl.h +3
-0@@ -605,6 +605,9 @@ int libxl_ctx_alloc(libxl_ctx **pctx, int version, xentoollog_logger *lg);int libxl_ctx_free (libxl_ctx *ctx/* 0 is OK */ ); +/* exec's device model for dom0 and does not return. */ +void libxl_launch_dom0_qemu (libxl_ctx *ctx,const char *qemu_path,const char *pidfile); +/* domain related functions */ int libxl_domain_create_new(libxl_ctx *ctx,
libxl_domain_config*d_config,tools/libxl/libxl_dm.c +1
-1@@ -38,7 +38,7 @@ static const char *qemu_xen_path(libxl__gc *gc)#ifdef QEMU_XEN_PATH return QEMU_XEN_PATH ;#else -return libxl__abs_path (gc,"qemu-system-i386" , libxl__libexec_path()); +return libxl__abs_path (gc,"qemu-system-" CONFIG_QEMU_ARCH ,libxl__libexec_path ());#endif }
tools/libxl/libxl_dm.c +31
-0@@ -1560,6 +1560,37 @@ out:return ret; } +void libxl_launch_dom0_qemu (libxl_ctx *ctx,const char *qemu_path,const char *pidfile) +{ +GC_INIT (ctx); + +flexarray_t *dm_args =flexarray_make (gc,16 ,1 ); + +if (qemu_path ==NULL ) + qemu_path =qemu_xen_path (gc); + +flexarray_vappend (dm_args, +"-xen-domid" ,"0" , +"-xen-attach" , +"-name" ,"dom0" , +"-nographic" , +"-M" "xenpv" , +"-daemonize" , +"-monitor" ,"/dev/null" , +"-serial" ,"/dev/null" , +"-parallel" ,"/dev/null" , +NULL ); +if (pidfile) +flexarray_append_pair (dm_args,"-pidfile" ,libxl__strdup (gc, pidfile)); + +libxl__exec (gc,-1 ,-1 ,-1 , + qemu_path, (char **)flexarray_contents (dm_args),NULL ); + +/* Shouldn't return */ +LOG (CRITICAL ,"Failed to exec dom0 device model" ); +GC_FREE ; +} +/*
* Local variables:
* mode: Ctools/libxl/xl.h +1
-0@@ -106,6 +106,7 @@ int main_setenforce(int argc, char **argv);int main_loadpolicy (int argc,char **argv);int main_remus (int argc,char **argv);int main_devd (int argc,char **argv); +int main_launch_dom0_qemu (int argc,char **argv);void help (const char *command);tools/libxl/xl_cmdimpl.c +25
-0@@ -7313,6 +7313,31 @@ out:return ret; } +int main_launch_dom0_qemu (int argc,char **argv) +{ +int opt; +const char *qemu =NULL ; +const char *pidfile =NULL ; + + SWITCH_FOREACH_OPT(opt, "p:", NULL, "launch-dom-qemu", 0) { +case 'p' : + pidfile = optarg; +break ; +/* No options */ + } +if (optind < argc) + qemu = argv[optind]; + +fprintf (stderr,"argc %d\n" , argc); +fprintf (stderr,"qemu = %s" , qemu ? :"<default>" ); + +fprintf (stdout,"Starting QEMU as disk backend for dom0" ); + +libxl_launch_dom0_qemu (ctx, qemu, pidfile); + +return 0 ; +} +/* * Local variables: * mode: C tools/libxl/xl_cmdtable.c +6
-0@@ -494,6 +494,12 @@ struct cmd_spec cmd_table[] = { "[options]", "-F Run in the foreground", }, + {"launch-dom0-qemu" , + &main_launch_dom0_qemu,0 ,1 , +"Start qemu process to service dom0 disk backends" , +"[options] [QEMU_PATH]" , + "-p PIDFILE Write a PIDFILE\n", + }, };int cmdtable_len =sizeof (cmd_table)/sizeof (struct cmd_spec );
On Tue, 2013-12-17 at 08:20 +0100, peter wrote:
Please can you avoid top posting on the -devel list.
I've put -users and Lars to bcc since I think we are now well into -devel territory.
Quoted 37 lines
Thank you for the info/patch Ian.
With some modifications to Qemu, I managed to cross compile qemu-system-arm with XEN support.
Based on version:1c514a7734b7f98625a0d18d5e8ee7581f26e50c(Merge remote branch 'perard/cpu-hotplug-port-v2' into xen-staging-master-7). And got my Qemu backend working.I can see that
INPUT_XEN_KBDDEV_FRONTENDis working (d9) 6input: Xen Virtual Keyboard as /devices/virtual/input/input0 (d9) 6input: Xen Virtual Pointer as /devices/virtual/input/input1And that XEN bus is prompting for VFB
(d9) 6xenbus_probe_frontend: Device with no driver: device/vfb/0But it seems that the xen-fbfront only supports PV and not PVH. (Linux kernel 3.12-RC5)
Because the init code is returning on:if (!xen_pv_domain()) return -ENODEV;When I comment this code out.
I do get these errors:[ 1698.899496] Failed to unmap pfn:5c081 rc:-2(XEN) dom10 IPA
0x0000000000000000
(XEN) P2M @021b8300mfn:0x4dc18
(XEN) 1ST[0x0] =0x000000004da276ff
(XEN) 2ND[0x0] =0x000000006b6856ff
(XEN) 3RD[0x0] =0x0000000000000000[ 1698.933034] Failed to map pfn to mfn rc:0:-22 pfn:5c349 mfn:0(XEN) dom10 IPA
0x000000002777c000
(XEN) P2M @021b8300mfn:0x4dc18
(XEN) 1ST[0x0] =0x000000004da276ff
(XEN) 2ND[0x13b] =0x0000000000000000
Quoted 7 lines
[ 1698.951353] Failed to map pfn to mfn rc:0:-22 pfn:5c348 mfn:b6b2777cYes lots of them, and my VFB is not working tough.
So I've searched on the internet if someone got VFB on PVH working. But I couldn't find anything about, so is there someone who got VFB working on PVH (x86) ?
I've not heard of anyone, the focus of x86-PVH has been on getting the basic functionality going.
In general PV drivers should just work but in some corner cases they need adjustments for the "autotranslate" (i.e. hardware assisted paging) case which is one of the key areas where both ARM, PVH-x86 and HVM-x86 differ from traditional PV-x86 guests.
So it might be that the vfb driver requires some such adjustment, or it might be that the foreign mapping stuff is not working for you -- which would be the same issue as you are having with domain building in the other thread.
Given that I think we should try and get to the bottom of the foreign mapping stuff first.
Eventually it might be worth investigating
http://xen.1045712.n5.nabble.com/PATCH-Add-grant-references-for-fbfront-kbdfront-td3332068.html since the fb driver didn't really ought to be using foreign mappings anyway -- it should use grant references. However those patches only cover the frontend case and the author was using something other than qemu as the backend, so there is at least some actual development work required here.
Ian.
Quoted 6 lines · peter
Thank you for the info/patch Ian.
With some modifications to Qemu, I managed to cross compile qemu-system-arm with XEN support.
Based on version:1c514a7734b7f98625a0d18d5e8ee7581f26e50c(Merge remote branch 'perard/cpu-hotplug-port-v2' into xen-staging-master-7). And got my Qemu backend working.
Nice! Could you please post your patch?
Quoted 7 lines
I can see that
INPUT_XEN_KBDDEV_FRONTENDis working (d9) 6input: Xen Virtual Keyboard as /devices/virtual/input/input0 (d9) 6input: Xen Virtual Pointer as /devices/virtual/input/input1And that XEN bus is prompting for VFB
(d9) 6xenbus_probe_frontend: Device with no driver: device/vfb/0
Quoted 8 lines
But it seems that the xen-fbfront only supports PV and not PVH. (Linux kernel 3.12-RC5)
Because the init code is returning on:if (!xen_pv_domain()) return -ENODEV;When I comment this code out.
Yeah, it should be turned into:
if (!xen_domain())
return -ENODEV;
Quoted 3 lines
I do get these errors:
[ 1698.899496] Failed to unmap pfn:5c081 rc:-2
These ones should be unrelated and not fatal, and Julien is working to fix the underlying issue.
Quoted 7 lines
(XEN) dom10 IPA
0x0000000000000000
(XEN) P2M @021b8300mfn:0x4dc18
(XEN) 1ST[0x0] =0x000000004da276ff
(XEN) 2ND[0x0] =0x000000006b6856ff
(XEN) 3RD[0x0] =0x0000000000000000[ 1698.933034] Failed to map pfn to mfn rc:0:-22 pfn:5c349 mfn:0
Quoted 7 lines
(XEN) dom10 IPA
0x000000002777c000
(XEN) P2M @021b8300mfn:0x4dc18
(XEN) 1ST[0x0] =0x000000004da276ff
(XEN) 2ND[0x13b] =0x0000000000000000[ 1698.951353] Failed to map pfn to mfn rc:0:-22 pfn:5c348 mfn:b6b2777cYes lots of them, and my VFB is not working tough.
I suspect these are the actual symptoms of the problem. Looking around the frontend and the backend I couldn't find the issue. If you post your patch I might give it a try.
Quoted 327 lines
So I've searched on the internet if someone got VFB on PVH working. But I couldn't find anything about, so is there someone who got VFB working on PVH (x86) ?
-----Original Message-----
From: Ian Campbell <[email protected]>
To: peter <[email protected]>
Cc: "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, Lars Kurth <[email protected]>
Date: Mon, 16 Dec 2013 09:59:09 +0000
Subject: Re: [Xen-devel] [Xen-users] XEN/arm XENFB supportQuoted 295 lines · Lars Kurth
Quoted 3 lines · peter
I'm currently playing with XEN/arm on my Allwinner A20
(cubieboard2)
Quoted 2 lines
I would like to get the XENFB driver working on domU. But currently in xen/arm there's no support for VFB, atleast
qemu is not
Quoted 2 lines
supported.
But this video http://www.youtube.com/watch?v=po1IeElg8tg andthis one
Quoted 1 line
http://www.youtube.com/watch?v=Km6gBnIqaWo is showing a
working framebuffer.
Quoted 2 lines
So there are people which got a framebuffer working on domU. But still i couldn't find anything on the internet how to do
this.
Quoted 1 line
Is there anyone with experience with VFB on xen/arm ?
I'm not sure what the first link used but the second was using a form of
hybrid GPU passthrough/paravirtualisation for which the code has not been reeleased and AFAIK has nothing to do with VFB.I've not tried VFB on ARM yet (busy with other things) but I suspect that if you were to build upstream qemu on ARM with Xen support enabled then it would just work. I would recommend giving that a go -- please let us know how you get on.
Below is a patch which I wrote ages ago that I have just rebased onto current xen staging *without retesting*. It is supposed to DTWT and enable the qemu build for ARM (as well as providing a mechanism to start
the correct dom0 qemu, which you don't need for vfb).As I say I haven't tested, or even built, and in particular I never tried PVFB with it even what I wrote it, so YMMV.
Ian.
commit
7b5d54c9a5d09c4138bec905c9accea34173ba77Author: Ian Campbell <[email protected]> Date: Wed May 15 16:34:55 2013 +0100tools: build and launch correct qemu for architecture
xl now provides a launch-dom0-qemu command which avoids the need to
have the
initscripts be aware of the specific qermu binary name, which
differs by
architecture and which also may have been specified by the user via
the
--with-system-qemu=PATH option to configure.Perhaps this should be a separate binary hidden in libexec?
Signed-off-by Ian Campbell <[email protected]>config/arm32.mk +2
-0@@ -3,6 +3,8 @@ CONFIG_ARM_32 := y CONFIG_ARM_$(XEN_OS) := y CONFIG_XEN_INSTALL_SUFFIX := +CONFIG_QEMU_ARCH := arm +CONFIG_QEMU_TARGET := arm-softmmu # -march= -mcpu=config/arm64.mk +2
-0@@ -3,6 +3,8 @@ CONFIG_ARM_64 := y CONFIG_ARM_$(XEN_OS) := y CONFIG_XEN_INSTALL_SUFFIX := +CONFIG_QEMU_ARCH := aarch64 +CONFIG_QEMU_TARGET := arm-softmmu CFLAGS += #-marm -march= -mcpu= etcconfig/x86_32.mk +3
-0@@ -2,6 +2,9 @@ CONFIG_X86 := y CONFIG_X86_32 := y CONFIG_X86_$(XEN_OS) := y +CONFIG_QEMU_ARCH := i386 +CONFIG_QEMU_TARGET := i386-softmmu + CONFIG_HVM := y CONFIG_MIGRATE := y CONFIG_XCUTILS := yconfig/x86_64.mk +3
-0@@ -2,6 +2,9 @@ CONFIG_X86 := y CONFIG_X86_64 := y CONFIG_X86_$(XEN_OS) := y +CONFIG_QEMU_ARCH := x86_64 +CONFIG_QEMU_ARCH := i386-softmmu + CONFIG_COMPAT := y CONFIG_HVM := y CONFIG_MIGRATE := ytools/Makefile +2
-3@@ -107,7 +107,7 @@ distclean: subdirs-distclean config.cache autom4te.cache ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH)) -IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \ +IOEMU_CONFIGURE_CROSS ?= --cpu=$(CONFIG_QEMU_ARCH) \ --cross-prefix=$(CROSS_COMPILE) \ --interp-prefix=$(CROSS_SYS_ROOT) endif@@ -186,8 +186,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find source=.; \ fi; \ cd qemu-xen-dir; \ - $$source/configure --enable-xen --target-list=i386-softmmu \ - $(QEMU_XEN_ENABLE_DEBUG) \ + $$source/configure --enable-xen --target-list=$(CONFIG_QEMU_TARGET) \ --prefix=$(PREFIX) \ --source-path=$$source \ --extra-cflags="-I$(XEN_ROOT)/tools/include \tools/hotplug/Linux/init.d/xencommons +0
-1@@ -116,11 +116,7 @@ do_start () { echo Starting xenconsoled... test -z "$XENCONSOLED_TRACE" || XENCONSOLED_ARGS=" --log=$XENCONSOLED_TRACE" ${SBINDIR}/xenconsoled --pid-file=$XENCONSOLED_PIDFILE$XENCONSOLED_ARGS
tools/hotplug/Linux/init.d/xencommons +1
-6- echo Starting QEMU as disk backend for dom0 - test -z "$QEMU_XEN" && QEMU_XEN="${LIBEXEC}/qemu-system-i386" - $QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize \ - -monitor /dev/null -serial /dev/null -parallel /dev/null \ - -pidfile $QEMU_PIDFILE + xl launch-dom0-qemu $QEMU_XEN } do_stop () { echo Stopping xenconsoledtools/libxl/Makefile +1
-0@@ -27,6 +27,7 @@ CFLAGS_LIBXL += $(CFLAGS_libxenguest) CFLAGS_LIBXL += $(CFLAGS_libxenstore) CFLAGS_LIBXL += $(CFLAGS_libblktapctl) CFLAGS_LIBXL += -Wshadow +CFLAGS_LIBXL += -DCONFIG_QEMU_ARCH=\"$(CONFIG_QEMU_ARCH)\" LIBXL_LIBS-$(CONFIG_ARM) += -lfdttools/libxl/libxl.h +3
-0@@ -605,6 +605,9 @@ int libxl_ctx_alloc(libxl_ctx **pctx, int version, xentoollog_logger *lg);int libxl_ctx_free (libxl_ctx *ctx/* 0 is OK */ ); +/* exec's device model for dom0 and does not return. */ +void libxl_launch_dom0_qemu (libxl_ctx *ctx,const char *qemu_path,const char *pidfile); +/* domain related functions */ int libxl_domain_create_new(libxl_ctx *ctx,
libxl_domain_config*d_config,tools/libxl/libxl_dm.c +1
-1@@ -38,7 +38,7 @@ static const char *qemu_xen_path(libxl__gc *gc)#ifdef QEMU_XEN_PATH return QEMU_XEN_PATH ;#else -return libxl__abs_path (gc,"qemu-system-i386" , libxl__libexec_path()); +return libxl__abs_path (gc,"qemu-system-" CONFIG_QEMU_ARCH ,libxl__libexec_path ());#endif }
tools/libxl/libxl_dm.c +31
-0@@ -1560,6 +1560,37 @@ out:return ret; } +void libxl_launch_dom0_qemu (libxl_ctx *ctx,const char *qemu_path,const char *pidfile) +{ +GC_INIT (ctx); + +flexarray_t *dm_args =flexarray_make (gc,16 ,1 ); + +if (qemu_path ==NULL ) + qemu_path =qemu_xen_path (gc); + +flexarray_vappend (dm_args, +"-xen-domid" ,"0" , +"-xen-attach" , +"-name" ,"dom0" , +"-nographic" , +"-M" "xenpv" , +"-daemonize" , +"-monitor" ,"/dev/null" , +"-serial" ,"/dev/null" , +"-parallel" ,"/dev/null" , +NULL ); +if (pidfile) +flexarray_append_pair (dm_args,"-pidfile" ,libxl__strdup (gc, pidfile)); + +libxl__exec (gc,-1 ,-1 ,-1 , + qemu_path, (char **)flexarray_contents (dm_args),NULL ); + +/* Shouldn't return */ +LOG (CRITICAL ,"Failed to exec dom0 device model" ); +GC_FREE ; +} +/*
* Local variables:
* mode: Ctools/libxl/xl.h +1
-0@@ -106,6 +106,7 @@ int main_setenforce(int argc, char **argv);int main_loadpolicy (int argc,char **argv);int main_remus (int argc,char **argv);int main_devd (int argc,char **argv); +int main_launch_dom0_qemu (int argc,char **argv);void help (const char *command);tools/libxl/xl_cmdimpl.c +25
-0@@ -7313,6 +7313,31 @@ out:return ret; } +int main_launch_dom0_qemu (int argc,char **argv) +{ +int opt; +const char *qemu =NULL ; +const char *pidfile =NULL ; + + SWITCH_FOREACH_OPT(opt, "p:", NULL, "launch-dom-qemu", 0) { +case 'p' : + pidfile = optarg; +break ; +/* No options */ + } +if (optind < argc) + qemu = argv[optind]; + +fprintf (stderr,"argc %d\n" , argc); +fprintf (stderr,"qemu = %s" , qemu ? :"<default>" ); + +fprintf (stdout,"Starting QEMU as disk backend for dom0" ); + +libxl_launch_dom0_qemu (ctx, qemu, pidfile); + +return 0 ; +} +/* * Local variables: * mode: C tools/libxl/xl_cmdtable.c +0
-0@@ -494,6 +494,12 @@ struct cmd_spec cmd_table[] = {"[options]" , "-F Run in the foreground",tools/libxl/xl_cmdtable.c struct cmd_spec cmd_table[] = { · line 505
Quoted 10 lines
tools/libxl/xl_cmdtable.c +6
-0}, + {"launch-dom0-qemu" , + &main_launch_dom0_qemu,0 ,1 , +"Start qemu process to service dom0 disk backends" , +"[options] [QEMU_PATH]" , + "-p PIDFILE Write a PIDFILE\n", + }, };int cmdtable_len =sizeof (cmd_table)/sizeof (struct cmd_spec );_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 9 lines · Stefano Stabellini
Quoted 6 lines · peter
Thank you for the info/patch Ian.
With some modifications to Qemu, I managed to cross compile qemu-system-arm with XEN support.
Based on version:1c514a7734b7f98625a0d18d5e8ee7581f26e50c(Merge remote branch 'perard/cpu-hotplug-port-v2' into xen-staging-master-7). And got my Qemu backend working.Nice! Could you please post your patch?
Actually I have just tried it out and with the appended QEMU patch works fine. I'll come up with a proper patch and send it upstream.
hw/display/xenfb.c +5 -5
@@ -409,7 +409,7 @@ static void input_event(struct XenDevice *xendev)/* -------------------------------------------------------------------- */ -static void xenfb_copy_mfns (int mode,int count,unsigned long *dst,void *src) +static void xenfb_copy_mfns (int mode,int count,xen_pfn_t *dst,void *src) {uint32_t *src32 = src;uint64_t *src64 = src;
@@ -424,8 +424,8 @@ static int xenfb_map_fb(struct XenFB *xenfb)struct xenfb_page *page = xenfb->c.page;char *protocol = xenfb->c.xendev.protocol;int n_fbdirs; -unsigned long *pgmfns =NULL ; -unsigned long *fbmfns =NULL ; +xen_pfn_t *pgmfns =NULL ; +xen_pfn_t *fbmfns =NULL ;void *map, *pd;int mode, ret =-1 ;
@@ -483,8 +483,8 @@ static int xenfb_map_fb(struct XenFB *xenfb) n_fbdirs = xenfb->fbpages * mode /8 ; n_fbdirs = (n_fbdirs + (XC_PAGE_SIZE -1 )) /XC_PAGE_SIZE ; - pgmfns =g_malloc0 (sizeof (unsigned long ) * n_fbdirs); - fbmfns =g_malloc0 (sizeof (unsigned long ) * xenfb->fbpages); + pgmfns =g_malloc0 (sizeof (xen_pfn_t) * n_fbdirs); + fbmfns =g_malloc0 (sizeof (xen_pfn_t) * xenfb->fbpages);xenfb_copy_mfns (mode, n_fbdirs, pgmfns, pd); map = xc_map_foreign_pages(xen_xc, xenfb->c.xendev.dom,
xen-all.c +0 -2
@@ -381,8 +381,6 @@ static int xen_remove_from_physmap(XenIOState *state, rc =xc_domain_add_to_physmap (xen_xc, xen_domid, XENMAPSPACE_gmfn, idx, gpfn);if (rc) { -fprintf (stderr,"add_to_physmap MFN %" PRI_xen_pfn" to PFN %" - PRI_xen_pfn" failed: %d\n" , idx, gpfn, rc);return -rc; } }
xen-mapcache.c +0 -5
@@ -33,13 +33,8 @@# define DPRINTF (fmt, ...) do { } while (0)#endif -#if defined(__i386__)# define MCACHE_BUCKET_SHIFT 16# define MCACHE_MAX_SIZE (1UL<<31)/* 2GB Cap */ -#elif defined(__x86_64__) -# define MCACHE_BUCKET_SHIFT 20 -# define MCACHE_MAX_SIZE (1UL<<35)/* 32GB Cap */ -#endif #define MCACHE_BUCKET_SIZE (1UL << MCACHE_BUCKET_SHIFT)/* This is the size of the virtual address space reserve to QEMU that will not
xen-all.c static int xen_remove_from_physmap(XenIOState *state, · line 385
Quoted 10 lines · Stefano Stabellini
xen-all.c +0
-2@@ -381,8 +381,6 @@ static int xen_remove_from_physmap(XenIOState *state, rc =xc_domain_add_to_physmap (xen_xc, xen_domid, XENMAPSPACE_gmfn, idx, gpfn);if (rc) { -fprintf (stderr,"add_to_physmap MFN %" PRI_xen_pfn" to PFN %" - PRI_xen_pfn" failed: %d\n" , idx, gpfn, rc);
This message seemed useful to me...
Quoted 9 lines
xen-all.c +0
-0return -rc; } }xen-mapcache.c +0
-0
xen-mapcache.c line 42
Quoted 10 lines
xen-mapcache.c +0
-5@@ -33,13 +33,8 @@# define DPRINTF (fmt, ...) do { } while (0)#endif -#if defined(__i386__)# define MCACHE_BUCKET_SHIFT 16# define MCACHE_MAX_SIZE (1UL<<31)/* 2GB Cap */ -#elif defined(__x86_64__) -# define MCACHE_BUCKET_SHIFT 20 -# define MCACHE_MAX_SIZE (1UL<<35)/* 32GB Cap */ -#endif
This bit seems a unrelated? Or should it really be adding __arm__ and __aarch64__ bits and this was just a quick hack?
It'd be good if someone would pick up Daniel De Graaf's frontend patches (see earlier in the thread) to use grants instead of priv mappings and implement the matching backend stuff in qemu...
Ian.
Quoted 8 lines · Ian Campbell
Quoted 6 lines · Stefano Stabellini
xen-all.c +0
-0@@ -381,8 +381,6 @@ static int xen_remove_from_physmap(XenIOState *state,
Quoted 6 lines
xen-all.c static int xen_remove_from_physmap(XenIOState *state, · line 385
Quoted 4 lines
xen-all.c +0
-2rc =xc_domain_add_to_physmap (xen_xc, xen_domid, XENMAPSPACE_gmfn, idx, gpfn);if (rc) { -fprintf (stderr,"add_to_physmap MFN %" PRI_xen_pfn" to PFN %" - PRI_xen_pfn" failed: %d\n" , idx, gpfn, rc);This message seemed useful to me...
Yeah, this is just a debug patch to show the concept. I am cleaning it up now.
Quoted 12 lines
Quoted 12 lines
xen-all.c +0
-0return -rc; } }xen-mapcache.c +0
-0@@ -33,13 +33,8 @@# define DPRINTF (fmt, ...) do { } while (0)#endif
Quoted 10 lines
xen-mapcache.c line 42
Quoted 7 lines
xen-mapcache.c +0
-5-#if defined(__i386__)# define MCACHE_BUCKET_SHIFT 16# define MCACHE_MAX_SIZE (1UL<<31)/* 2GB Cap */ -#elif defined(__x86_64__) -# define MCACHE_BUCKET_SHIFT 20 -# define MCACHE_MAX_SIZE (1UL<<35)/* 32GB Cap */ -#endif This bit seems a unrelated? Or should it really be adding
__arm__and__aarch64__bits and this was just a quick hack?
Right, this was a quick hack.
Quoted 7 lines
It'd be good if someone would pick up Daniel De Graaf's frontend patches (see earlier in the thread) to use grants instead of priv mappings and implement the matching backend stuff in qemu...
Ian.