This is the stack trace that I receive in mdb: - Bad kernel fault at addr=0x50 pid=0, pc=0xfe94ac2b, sp=0xf6caf2f0, eflags=0x10286 cr0: 8005003b<pg,wp,ne,et,ts,mp,pe> cr4: 6b8<xmme,fxsr,pge,pae,pse,de> cr2: 50 cr3: 2110000 gs: 1b0 fs: f6ca0000 es: fec30160 ds: fec30160 edi: f6caf2f0 esi: 0 ebp: cdd33c30 esp: cdd33bd0 ebx: 0 edx: 0 ecx: 0 eax: 0 trp: e err: 0 eip: fe94ac2b cs: 158 efl: 10286 usp: f6caf2f0 ss: cd786008
cdd33aec unix:die+98 (e, cdd33b98, 50, 0) cdd33b84 unix:trap+119b (cdd33b98, 50, 0) cdd33b98 unix:cmntrap+7c (1b0, f6ca0000, fec3) cdd33c30 genunix:devmap_devmem_setup+f (0, cd786008, ce4b5e) cdd33c94 platform:platform_attach+16b (cd786008, 0) cdd33cc4 genunix:devi_attach+6c (cd786008, 0) cdd33ce8 genunix:attach_node+81 (cd786008) cdd33d08 genunix:i_ndi_config_node+8f (cd786008, 6, 0) cdd33d28 genunix:i_ddi_attachchild+35 (cd786008) cdd33d44 genunix:devi_attach_node+98 (cd786008, 4048) cdd33d74 genunix:config_immediate_children+c9 (cd786a48, 4048, e8) cdd33d90 genunix:devi_config_common+7f (cd786a48, 4048, e8) cdd33dc8 genunix:mt_config_thread+40 (d0308de8, 0) cdd33dd8 unix:thread_start+8 () Also when I try to load the dump file using 'mdb -k unix.0' command on a reboot, an error is thrown saying: - mdb: failed to read dump header: Bad address mdb: failed to initialize target: Bad address I've also attached the sample code in the previous mail. Regards, Bhaskar. -----Original Message----- From: Jayaraman, Bhaskar Sent: Thursday, September 17, 2009 11:43 AM To: 'Garrett D'Amore' Cc: opensolaris-code@opensolaris.org Subject: RE: [osol-code]devmap_devmem_setup() Garrett, I'm trying to port xenbus drivers onto Solaris HVM and hence I need to get to the register space of the platform PCI device which xen emulates for each VM. So any help in this regard would be very helpful. I'm attaching the sample code which I picked up from http://dsc.sun.com/solaris/developer/support/driver/faqs.html#QA3.17 and then modified. In the attach routine I tried doing the ddi_regs_map_setup on BAR1 of the platform device but I keep getting 0xc000 as its virtual address. If I try writing anything to it the driver crashes the system. Then I decided to switch to devmap_devmem_setup but then on calling it the driver crashes the system. Regards, Bhaskar. -----Original Message----- From: Garrett D'Amore [mailto:garr...@damore.org] Sent: Wednesday, September 16, 2009 7:13 PM To: Jayaraman, Bhaskar Cc: opensolaris-code@opensolaris.org Subject: Re: [osol-code] Doubt in ddi_regs_map_setup! Jayaraman, Bhaskar wrote: > Ok I changed the call to devmap_devmem_setup() but my driver is crashing. Any > idea why this could be happening? I'm calling it from the 'attach' routine > which I hope is allowed. Also all my callbacks do nothing and return 0 unless > they're void i.e. I'm not setting the pvtp pointers in the callbacks or > anything. > Regards, > Bhaskar. > It doesn't sound like conceptually you are doing anything wrong. I think we'd need to look at the crash dump and source code in order to understand why you're experiencing these crashes. - Garrett > -----Original Message----- > From: Garrett D'Amore [mailto:garr...@damore.org] > Sent: Tuesday, September 15, 2009 7:35 PM > To: Jayaraman, Bhaskar > Cc: opensolaris-code@opensolaris.org > Subject: Re: [osol-code] Doubt in ddi_regs_map_setup! > > Jayaraman, Bhaskar wrote: > >> Hi, I'm making this call on my driver's BAR1 which has a physical >> address 0xf2000008 written on it. So I'm assuming that when I call a >> hat_getpfnum(kas.a_hat, returned_address), I should get the physical >> page frame number. >> >> Instead I get 0xffffffff as its return value (which is definitely some >> error). Also the virtual address that ddi_regs_map_setup is returning >> 0xc000 as the virtual address for the physical address in the BAR1. >> >> Please note that hat_getpfnum returns proper values for other virtual >> addresses. Can someone help me understand what is going on in my case? >> >> > > I'm not sure exactly why this is failing, but you do know that > hat_getkpfnum() is an obsolete interface, right? Its been obsolete for > quite a long time now. (I think maybe as far back as Solaris 8.) > > If you're using this for mmap(), you should try implementing a > devmap(9e) routine instead. > > -- Garrett > >> Regards, >> >> Bhaskar. >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> opensolaris-code mailing list >> opensolaris-code@opensolaris.org >> http://mail.opensolaris.org/mailman/listinfo/opensolaris-code >> >> > > _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code