Anybody debugging PAE guest kernels?
Folks --
I'm porting FreeBSD to support PAE on xen-unstable. (Is anybody else doing this?) The kernel image I have properly communicates to Xend that the kernel is PAE aware and supports [extended-cr3] semantics (which I now fully understand; thanks Keir!).
My kernel gets loaded into guest memory and I attach gdbserver-xen to it. So far so good. I can view registers, I can step, I can look at global and local registers. All is good.
But, if I attempt to modify memory, e.g., setting a break point, XEN coughs up an error:
(XEN) DOM0: (file=mm.c, line=1750) Bad type (saw 2e000001 != exp e0000000) for mfn fa693 (pfn 572) (XEN) DOM0: (file=mm.c, line=618) Error getting mfn fa693 (pfn 572) from L1 entry 00000000fa693027 for dom7
Is anybody doing this? Or, am I out here alone ... again?
Xen version 3.0-unstable ([email protected]) (gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)) Mon Aug 28 17:24:36 PDT 2006 Latest ChangeSet: Thu Aug 24 01:49:41 2006 +0100 11249:1ff4cc298bec
(I'm going to update my hg repository, but I still have the question about anybody else using gdbserver w/ PAE guests.)
-- Randy
You want to talk to Kip Macy; I've done a little bit with freebsd7 domus, (essentially, I have hacked makefiles to make Kip Macy's stuff compile with -current of a few weeks ago instead of -current of a few months ago) but I am lacking in both skill and time, so I probably can not help you much.
I don't know of anyone working with FreeBSD on Xen PAE, though.
Quoted 29 lines · Randy Thelen
Date: Wed, 4 Oct 2006 16:53:39 -0700
From: Randy Thelen <[email protected]>
To: xen-devel <[email protected]>
Subject: [Xen-devel] Anybody debugging PAE guest kernels?Folks --
I'm porting FreeBSD to support PAE on xen-unstable. (Is anybody else doing this?) The kernel image I have properly communicates to Xend that the kernel is PAE aware and supports [extended-cr3] semantics (which I now fully understand; thanks Keir!).
My kernel gets loaded into guest memory and I attach gdbserver-xen to it. So far so good. I can view registers, I can step, I can look at global and local registers. All is good.
But, if I attempt to modify memory, e.g., setting a break point, XEN coughs up an error:
(XEN) DOM0: (file=mm.c, line=1750) Bad type (saw
2e000001!= expe0000000) for mfn fa693 (pfn 572) (XEN) DOM0: (file=mm.c, line=618) Error getting mfn fa693 (pfn 572) from L1 entry00000000fa693027for dom7Is anybody doing this? Or, am I out here alone ... again?
Xen version 3.0-unstable ([email protected]) (gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)) Mon Aug 28 17:24:36 PDT 2006 Latest ChangeSet: Thu Aug 24 01:49:41 2006 +0100 11249:1ff4cc298bec
(I'm going to update my hg repository, but I still have the question about anybody else using gdbserver w/ PAE guests.)
-- Randy
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Randy's probably a little fed up - I don't think I responded to his last e-mail :-/. Not out of spite, but rather overwhelmed with other things going on.
Anyhow, the function to look at is map_domain_va_pae in tools/libxc/xc_ptrace.c. The checks for HVM support seem to not always happen correctly. HTH.
-Kip
Quoted 56 lines · Luke Crawford
You want to talk to Kip Macy; I've done a little bit with freebsd7 domus, (essentially, I have hacked makefiles to make Kip Macy's stuff compile with -current of a few weeks ago instead of -current of a few months ago) but I am lacking in both skill and time, so I probably can not help you much.
I don't know of anyone working with FreeBSD on Xen PAE, though.
Quoted 33 lines · Randy Thelen
Date: Wed, 4 Oct 2006 16:53:39 -0700
From: Randy Thelen <[email protected]>
To: xen-devel <[email protected]>
Subject: [Xen-devel] Anybody debugging PAE guest kernels?Folks --
I'm porting FreeBSD to support PAE on xen-unstable. (Is anybody else doing this?) The kernel image I have properly communicates to Xend that the kernel is PAE aware and supports [extended-cr3] semantics (which I now fully understand; thanks Keir!).
My kernel gets loaded into guest memory and I attach gdbserver-xen to it. So far so good. I can view registers, I can step, I can look at global and local registers. All is good.
But, if I attempt to modify memory, e.g., setting a break point, XEN coughs up an error:
(XEN) DOM0: (file=mm.c, line=1750) Bad type (saw
2e000001!= expe0000000) for mfn fa693 (pfn 572)
(XEN) DOM0: (file=mm.c, line=618) Error getting mfn fa693 (pfn 572) from L1 entry00000000fa693027for dom7Is anybody doing this? Or, am I out here alone ... again?
Xen version 3.0-unstable ([email protected]) (gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)) Mon Aug 28 17:24:36 PDT 2006
Latest ChangeSet: Thu Aug 24 01:49:41 2006 +0100 11249:1ff4cc298bec(I'm going to update my hg repository, but I still have the question about anybody else using gdbserver w/ PAE guests.)
Quoted 6 lines
-- Randy
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 3 lines · Kip Macy
Randy's probably a little fed up - I don't think I responded to his last e-mail :-/. Not out of spite, but rather overwhelmed with other things going on.
:-) No worries.
Quoted 3 lines
Anyhow, the function to look at is
map_domain_va_paeintools/libxc/xc_ptrace.c. The checks for HVM support seem to not always happen correctly. HTH.
Thanks for the tip. However, note that I'm not running HVM and the error I'm getting comes from Xen proper:
Quoted 4 lines
Quoted 4 lines
(XEN) DOM0: (file=mm.c, line=1750) Bad type (saw
2e000001!= expe0000000) for mfn fa693 (pfn 572)
(XEN) DOM0: (file=mm.c, line=618) Error getting mfn fa693 (pfn 572) from L1 entry00000000fa693027for dom7
-- Randy
Quoted 7 lines
Quoted 4 lines
Anyhow, the function to look at is
map_domain_va_paeintools/libxc/xc_ptrace.c. The checks for HVM support seem to not always happen correctly. HTH.Thanks for the tip. However, note that I'm not running HVM and the error I'm getting comes from Xen proper:
Exactly. I've seen cases where the HVM check returns true when running against a paravirtualized FreeBSD guest. I had my mentee ifdef out the HVM check in his local copy of gdbserver. In your case, if the code is not parsing the page tables correctly it can result in in trying to read / write memory it isn't allowed to. Tracing errors back from mm.c is always a monumental PITA, but it might be worth looking at. At the very least, check what type it expects the page to be - I've long since forgotten what the numbers correspond to. If you're not already familiar with the page typing code you should have a look, familiarity with it will make tracking down errors much easier. One last thing to bear in mind for future reference is that DOM0 can't map page tables, even for a domU (at least last I tried), read/write.
-Kip
Quoted 15 lines
Quoted 7 lines
Quoted 7 lines
(XEN) DOM0: (file=mm.c, line=1750) Bad type (saw
2e000001!= expe0000000)
for mfn fa693 (pfn 572)
(XEN) DOM0: (file=mm.c, line=618) Error getting mfn fa693 (pfn
572) from L1
entry00000000fa693027for dom7-- Randy
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel