Patch needed for RELENG_2_1 XENHVM on Xen 4.2 dom0
-
I've run into a problem with using Xen PVHVM drivers on RELENG_2_1 on freeBSD 8.3.
I consistently get a "Fatal trap 12" error booting a XENHVM kernel on my Xen 4.2.3 dom0. For reference, I'm using the default (current) Centos 6.4 Xen packages, installed from the Centos Base repository using the instructions http://wiki.centos.org/HowTos/Xen/Xen4QuickStart - so this is likely to affect other users. One forum user here, sabrewarrior, has it running okay on the latest Xen 4.3, but I don't know which OS s/he's running for the dom0 (probably not Centos).
The solution to the "Fatal trap 12 error" is to patch /usr/pfSensesrc/src/sys/xen/xenstore/xenstore.c with the following:
@@ -306,6 +306,10 @@ { const char **ret; + /* :XXX: */ + if (len < 1) + return (NULL); + /* Protect against unterminated buffers. */ strings[len - 1] = '\0';
Here's the error and trace:
Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0xffffff010294c2ef fault code = supervisor write data, page not present instruction pointer = 0x20:0xffffffff80a56a68 stack pointer = 0x28:0xffffffff816b19f0 frame pointer = 0x28:0xffffffff816b1a30 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = trace trap, interrupt enabled, resume, IOPL = 0 current process = 0 (swapper)
-
Just an update - switching to a newer Xen 4.3 dom0 (Fedora 20) still has the same issue.
Patching xenstore.c using the above patch fixes the issue.