Re: [Xen-users] Trouble booting FreeBSD i386 PV DomU

2013-04-01 Thread Roger Pau Monné
On 31/03/13 19:45, Cherry G.Mathew wrote:
> 
> On 21/02/13 10:18, tech mailinglists wrote:
>> Hello all,
>>
>> I have created a FreeBSD PV DomU image formatted with ZFS. I compiled
>> FreeBSD with KERNCONF=XEN for the kernel and the normal world and
>> distribution target. Then I transfered it to a Debian Dom0 with Xen 4.2.1.
>>
>> I tried to boot the image befor I migrate it to LVM and I now get teh
>> following output:
>>
> 
> [...]
> 
>> run_interrupt_driven_hooks: still waiting after 300 seconds for
>> xenbus_free_evtchn
>> panic: run_interrupt_driven_config_hooks: waited too long
>> cpuid = 0
>> KDB: enter: panic
>> [ thread pid 0 tid 10 ]
>> Stopped at  kdb_enter+0x3a: movl$0,kdb_why
>> db>
> 
> 
> Try see if patch below should help the boot a bit along.

The problem is already solved, it was crashing because blkback in Dom0
was not correctly working -- nothing to do with FreeBSD. The 9.x
releases work correctly, the problem is with HEAD and the backtrace I've
posted. BTW, if you wish to try HEAD you will need the ELFNOTE patch
I've posted and boot with "hw.mca.enabled=0" to get to the panic I've
posted earlier.

___
freebsd-xen@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-xen
To unsubscribe, send any mail to "freebsd-xen-unsubscr...@freebsd.org"


Re: [Xen-users] Trouble booting FreeBSD i386 PV DomU

2013-03-26 Thread Roger Pau Monné
On 26/03/13 11:14, Colin Percival wrote:
> On 03/26/13 03:10, Roger Pau Monné wrote:
>> On 26/03/13 10:38, Colin Percival wrote:
>>> On 03/26/13 02:31, Roger Pau Monné wrote:
 Is Xen i386 PV broken?
>>>
>>> Not completely broken, but it's certainly not in a good state.  I believe
>>> it's broken with SMP, for example -- if the "crashed on cpu#7" in your
>>> output means cpu#7 from the guest, it would certainly explain things.
>>
>> My guest only has one vcpu (vcpu#0):
> 
> Ok, I wasn't sure how to parse that output.
> 
>>> HVM is the way to go with FreeBSD/Xen.
>>
>> Yes, I'm already working on that, and got vector callbacks working on
>> both i386 and amd64 HVM guests, thanks to Justin T. Gibbs patch. Now I
>> was trying to boot a PV guest to see how much breakage this change
>> introduced to PV, but I'm not able to make it work, even without my patches.
>>
>> I've replied to this xen-users thread because the author seem to have a
>> working FreeBSD DomU PV guest, and I was wondering how he did it. From
>> my POV it seems like PV guests hasn't been working for a long time,
>> since Xen 3.3 dropped support for non-PAE guests, and the FreeBSD kernel
>> is detected as non-PAE.
> 
> I had FreeBSD 8.2-RELEASE and a 9.0-CURRENT @ January 2011 running with PV
> in EC2 (http://www.daemonology.net/freebsd-on-ec2/, look for "t1.micro
> instances only") and that used PAE.  But it's entirely likely that something
> got broken in the past two years and nobody noticed because nobody ever uses
> PV...

I've checked and 9.1 is working OK (at least boots and seems to be 
functional). I've also found the reason why HEAD doesn't work, and it's 
probably caused by the switch to clang, which seems to have problems 
with the ELFNOTE macro, here is a patch that makes i386 PV boot again:

---
diff --git a/sys/i386/include/asmacros.h b/sys/i386/include/asmacros.h
index c1c3f64..474dfe1 100644
--- a/sys/i386/include/asmacros.h
+++ b/sys/i386/include/asmacros.h
@@ -211,7 +211,7 @@
 
 #ifdef __STDC__
 #define ELFNOTE(name, type, desctype, descdata...) \
-.pushsection .note.name ;   \
+.pushsection .note.name,"",@note;   \
   .align 4  ;   \
   .long 2f - 1f /* namesz */;   \
   .long 4f - 3f /* descsz */;   \
@@ -223,7 +223,7 @@
 .popsection
 #else /* !__STDC__, i.e. -traditional */
 #define ELFNOTE(name, type, desctype, descdata) \
-.pushsection .note.name ;   \
+.pushsection .note.name,"",@note;   \
   .align 4  ;   \
   .long 2f - 1f /* namesz */;   \
   .long 4f - 3f /* descsz */;   \
---

But there's even more problems...

rtc0: [XEN] xen_rtc_gettime
rtc0: [XEN] xen_rtc_gettime: wallclock 1364233979 sec; 99989 nsec
rtc0: [XEN] xen_rtc_gettime: uptime 76890 sec; 166126554 nsec
rtc0: [XEN] xen_rtc_gettime: TOD 1364310870 sec; 166126543 nsec
start_init: trying /sbin/init
pid 26 (sh), uid 0: exited on signal 4
panic: removing pages from non-current pmap
cpuid = 0
KDB: enter: panic
[ thread pid 26 tid 100037 ]
Stopped at  kdb_enter+0x3d: movl$0,kdb_why
db> bt
Tracing pid 26 tid 100037 td 0xc25e4900
kdb_enter(c03f8ad8,c03f8ad8,c04321de,ccf7699c,c04321de,...) at 
kdb_enter+0x3d/frame 0xccf76930
kassert_panic(c047c478,100,c04321de,ccf7699c,ccf7699c,...) at 
kassert_panic+0x232/frame 0xccf7696c
kassert_panic(c04321de,c0431504,e0a,7bc,c044fe94,...) at 
kassert_panic+0xea/frame 0xccf76990
pmap_remove_pages(c2427638,c064bd74,8,c2427638,c248c8b8,...) at 
pmap_remove_pages+0xb3/frame 0xccf76a00
vmspace_exit(c25e4900,0,c03f2588,140,4,...) at vmspace_exit+0xb1/frame 
0xccf76a28
exit1(c25e4900,4,1a,c248cacc,0,...) at exit1+0x654/frame 0xccf76a88
sigexit(c25e4900,4,c03f8b70,b0a,c0153a4f,...) at sigexit+0xc7f/frame 0xccf76c20
postsig(4,0,c03fee92,10d,0,...) at postsig+0x3b2/frame 0xccf76cdc
ast(ccf76d18) at ast+0x388/frame 0xccf76d0c
vm86_biosret() at vm86_biosret+0x9c/frame 0xbf7fcba8

>From ef73078b37f283401159119538b8ac85bbd512d6 Mon Sep 17 00:00:00 2001
From: Roger Pau Monne 
Date: Tue, 26 Mar 2013 12:39:58 +0100
Subject: [PATCH] xen: fix ELFNOTE macro

Add an empty flag and the corresponding type of section to
pushsection.
---
 sys/i386/include/asmacros.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/i386/include/asmacros.h b/sys/i386/include/asmacros.h
index c1c3f64..474dfe1 100644
--- a/sys/i386/include/asmacros.h
+++ b/sys/i386/include/asmacros.h
@@ -211,7 +211,7 @@
 
 #ifdef __STDC__
 #define ELFNOTE(name, type, desctype, descdata...) \
-.pushsection .note.name ;   \
+.pushsection .note.name,"",@note;   \
   .align 4  ;   \
   .long 2f - 1f /* namesz */;   \
   .long 4f - 3f /* descsz */;   \
@@ -223,7 +223,7 @@
 .popsection
 #else /* !__STDC__, i.e. -traditional */
 #define ELFNOTE(name, type, desctype, d

Re: [Xen-users] Trouble booting FreeBSD i386 PV DomU

2013-03-26 Thread Colin Percival
On 03/26/13 03:10, Roger Pau Monné wrote:
> On 26/03/13 10:38, Colin Percival wrote:
>> On 03/26/13 02:31, Roger Pau Monné wrote:
>>> Is Xen i386 PV broken?
>>
>> Not completely broken, but it's certainly not in a good state.  I believe
>> it's broken with SMP, for example -- if the "crashed on cpu#7" in your
>> output means cpu#7 from the guest, it would certainly explain things.
> 
> My guest only has one vcpu (vcpu#0):

Ok, I wasn't sure how to parse that output.

>> HVM is the way to go with FreeBSD/Xen.
> 
> Yes, I'm already working on that, and got vector callbacks working on
> both i386 and amd64 HVM guests, thanks to Justin T. Gibbs patch. Now I
> was trying to boot a PV guest to see how much breakage this change
> introduced to PV, but I'm not able to make it work, even without my patches.
> 
> I've replied to this xen-users thread because the author seem to have a
> working FreeBSD DomU PV guest, and I was wondering how he did it. From
> my POV it seems like PV guests hasn't been working for a long time,
> since Xen 3.3 dropped support for non-PAE guests, and the FreeBSD kernel
> is detected as non-PAE.

I had FreeBSD 8.2-RELEASE and a 9.0-CURRENT @ January 2011 running with PV
in EC2 (http://www.daemonology.net/freebsd-on-ec2/, look for "t1.micro
instances only") and that used PAE.  But it's entirely likely that something
got broken in the past two years and nobody noticed because nobody ever uses
PV...

-- 
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid

___
freebsd-xen@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-xen
To unsubscribe, send any mail to "freebsd-xen-unsubscr...@freebsd.org"


Re: [Xen-users] Trouble booting FreeBSD i386 PV DomU

2013-03-26 Thread Roger Pau Monné
On 26/03/13 10:38, Colin Percival wrote:
> On 03/26/13 02:31, Roger Pau Monné wrote:
>> Is Xen i386 PV broken?
> 
> Not completely broken, but it's certainly not in a good state.  I believe
> it's broken with SMP, for example -- if the "crashed on cpu#7" in your
> output means cpu#7 from the guest, it would certainly explain things.

My guest only has one vcpu (vcpu#0):

Domain 12 (vcpu#0) crashed on cpu#7

That is running on physical CPU 7

> HVM is the way to go with FreeBSD/Xen.

Yes, I'm already working on that, and got vector callbacks working on
both i386 and amd64 HVM guests, thanks to Justin T. Gibbs patch. Now I
was trying to boot a PV guest to see how much breakage this change
introduced to PV, but I'm not able to make it work, even without my patches.

I've replied to this xen-users thread because the author seem to have a
working FreeBSD DomU PV guest, and I was wondering how he did it. From
my POV it seems like PV guests hasn't been working for a long time,
since Xen 3.3 dropped support for non-PAE guests, and the FreeBSD kernel
is detected as non-PAE.
___
freebsd-xen@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-xen
To unsubscribe, send any mail to "freebsd-xen-unsubscr...@freebsd.org"


Re: [Xen-users] Trouble booting FreeBSD i386 PV DomU

2013-03-26 Thread Colin Percival
On 03/26/13 02:31, Roger Pau Monné wrote:
> Is Xen i386 PV broken?

Not completely broken, but it's certainly not in a good state.  I believe
it's broken with SMP, for example -- if the "crashed on cpu#7" in your
output means cpu#7 from the guest, it would certainly explain things.

HVM is the way to go with FreeBSD/Xen.

-- 
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid

___
freebsd-xen@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-xen
To unsubscribe, send any mail to "freebsd-xen-unsubscr...@freebsd.org"


Re: [Xen-users] Trouble booting FreeBSD i386 PV DomU

2013-03-26 Thread Roger Pau Monné
On 21/02/13 10:18, tech mailinglists wrote:
> Hello all,
> 
> I have created a FreeBSD PV DomU image formatted with ZFS. I compiled
> FreeBSD with KERNCONF=XEN for the kernel and the normal world and
> distribution target. Then I transfered it to a Debian Dom0 with Xen 4.2.1.
> 
> I tried to boot the image befor I migrate it to LVM and I now get teh
> following output:
> 
> Parsing config from freebsd-test.cfg
> libxl: error: libxl_dm.c:1212:device_model_spawn_outcome: domain 12
> device model: spawn failed (rc=-3)
> libxl: error: libxl_qmp.c:641:libxl__qmp_initialize: Connection error:
> No such file or directory
> Daemon running with PID 3451
> WARNING: loader(8) metadata is missing!
> GDB: no debug ports present
> KDB: debugger backends: ddb
> KDB: current backend: ddb
> APIC: Using the MPTable enumerator.
> SMP: Added CPU 0 (BSP)
> Copyright (c) 1992-2012 The FreeBSD Project.
> Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
> The Regents of the University of California. All rights reserved.
> FreeBSD is a registered trademark of The FreeBSD Foundation.
> FreeBSD 9.1-RELEASE #0: Wed Feb 20 14:16:03 CET 2013
> root@build:/usr/obj/usr/src/sys/XEN i386
> WARNING: WITNESS option enabled, expect reduced performance.
> Xen reported: 3341.754 MHz processor.
> Timecounter "ixen" frequency 1953125 Hz quality 0
> CPU: Intel(R) Core(TM) i7 CPU 975  @ 3.33GHz (3341.75-MHz
> 686-class CPU)
>   Origin = "GenuineIntel"  Id = 0x106a5  Family = 6  Model = 1a 
> Stepping = 5
>  
> Features=0xbfe3fbff
>  
> Features2=0x98e3bd
>   AMD Features=0x2810
>   AMD Features2=0x1
> 
> Data TLB: 4 KB pages, 4-way set associative, 64 entries
> 1st-level data cache: 32 KB, 8-way set associative, 64 byte line size
> L2 cache: 256 kbytes, 8-way associative, 64 bytes/line
> real memory  = 2147483648 (2048 MB)
> Physical memory chunk(s):
> 0x00a58000 - 0x7d995fff, 2096357376 bytes (511806 pages)
> avail memory = 2092105728 (1995 MB)
> INTR: Adding local APIC 0 as a target
> ULE: setup cpu 0
> [XEN] IPI cpu=0 irq=128 vector=RESCHEDULE_VECTOR (0)
> [XEN] IPI cpu=0 irq=129 vector=CALL_FUNCTION_VECTOR (1)
> Event-channel device installed.
> io: 
> random: 
> mem: 
> Pentium Pro MTRR support enabled
> null: 
> nfslock: pseudo-device
> [XEN] xen_rtc_probe: probing Hypervisor RTC clock
> rtc0:  on motherboard
> [XEN] xen_rtc_attach: attaching Hypervisor RTC clock
> rtc0: registered as a time-of-day clock (resolution 100us,
> adjustment 0.5s)
> xenstore0:  on motherboard
> Grant table initialized
> xc0:  on motherboard
> Device configuration finished.
> procfs registered
> Event timer "ixen" quality 600
> Timecounters tick every 10.000 msec
> lo0: bpf attached
> xenbusb_front0:  on xenstore0
> xenbusb_add_device: Device device/suspend/event-channel ignored. State 6
> xenbusb_back0:  on xenstore0
> xctrl0:  on xenstore0
> [XEN] hypervisor wallclock nudged; nudging TOD.
> run_interrupt_driven_hooks: still waiting after 60 seconds for
> xenbus_free_evtchn
> run_interrupt_driven_hooks: still waiting after 120 seconds for
> xenbus_free_evtchn
> run_interrupt_driven_hooks: still waiting after 180 seconds for
> xenbus_free_evtchn
> run_interrupt_driven_hooks: still waiting after 240 seconds for
> xenbus_free_evtchn
> run_interrupt_driven_hooks: still waiting after 300 seconds for
> xenbus_free_evtchn
> panic: run_interrupt_driven_config_hooks: waited too long
> cpuid = 0
> KDB: enter: panic
> [ thread pid 0 tid 10 ]
> Stopped at  kdb_enter+0x3a: movl$0,kdb_why
> db>

Hello,

I've been trying to get a FreeBSD PV guest, I've installed FreeBSD i386 
HEAD and then tried to recompile the kernel using KERNCONF=XEN, but Xen 
refuses to load the resulting kernel:

root@loki:~# xl -vvv create -c freebsd32pv.cfg
Parsing config from freebsd32pv.cfg
libxl: debug: libxl_create.c:1174:do_domain_create: ao 0x22e5a20: create: 
how=(nil) callback=(nil) poller=0x22e5a80
libxl: debug: libxl_device.c:229:libxl__device_disk_set_backend: Disk vdev=hda 
spec.backend=unknown
libxl: debug: libxl_device.c:265:libxl__device_disk_set_backend: Disk vdev=hda, 
using backend phy
libxl: debug: libxl_create.c:677:initiate_domain_create: running bootloader
libxl: debug: libxl_bootloader.c:327:libxl__bootloader_run: no bootloader 
configured, using user supplied kernel
libxl: debug: libxl_event.c:561:libxl__ev_xswatch_deregister: watch 
w=0x22e60c0: deregister unregistered
libxl: debug: libxl_numa.c:435:libxl__get_numa_candidate: New best NUMA 
placement candidate found: nr_nodes=1, nr_cpus=8, nr_vcpus=15, free_memkb=4353
libxl: detail: libxl_dom.c:192:numa_place_domain: NUMA placement candidate with 
1 nodes, 8 cpus and 4353 KB free selected
domainbuilder: detail: xc_dom_allocate: 
cmdline="boot_verbose=1,vfs.root.mountfrom=ufs:/dev/ad0s1a,kern.hz=100", 
features="(null)"
libxl: debug: libxl_dom.c:380:libxl__build_pv: pv kernel mapped 0 path 
/root/kernel.freebsd

domainbuilder: detail: xc_dom_ker