S.P.Zeidler | 14 Jun 2012 23:49
Picon

help needed for creating a patch for NetBSD-4

Hi,

I've been trying to create a patch for NetBSD-4 from the patch in here:
http://releng.netbsd.org/cgi-bin/req-5.cgi?show=1772

I got something that compiles (which is better than I expected), but
panics when booting:

com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
ioapic0: enabling
timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
Kernelized RAIDframe activated
uvm_fault(0xffffffff80b281c0, 0x0, 1) -> e
kernel: page fault trap, code=0
Stopped in pid 10.1 (atabus0) at        netbsd:Xintr_lapic_ltimer+0x7c: movl %gs:0x1f4(%rip),%ebx
db> bt
Xintr_lapic_ltimer() at netbsd:Xintr_lapic_ltimer+0x7c
--- interrupt ---
0:
db> sh reg
ds          0
es          0
fs          0
gs          0
rdi         0
rsi         0x280000
rbp         0xffff80004914fd00
rbx         0xffff800004ac0000
rdx         0x10
rcx         0x10
(Continue reading)

David Laight | 15 Jun 2012 08:41
Picon

Re: help needed for creating a patch for NetBSD-4

On Thu, Jun 14, 2012 at 09:49:47PM +0000, S.P.Zeidler wrote:
> Hi,
> 
> I've been trying to create a patch for NetBSD-4 from the patch in here:
> http://releng.netbsd.org/cgi-bin/req-5.cgi?show=1772
> 
> I got something that compiles (which is better than I expected), but
> panics when booting:
...
> gs          0

I'd guess an extra 'swapgs' has been done.

The code changes aren't that simple.
IIRC the order the registers got saved and restored changed, possibly
the entire stack frame layout.
I had to change -5 to load the segment registers just before the iret,
-4 probably contains the even earlier version of those structure.
(cvsweb <at>  is down - can't check sources).

	David

--

-- 
David Laight: david <at> l8s.co.uk


Gmane