Juergen Keil
2007-Feb-14 19:26 UTC
[qemu-discuss] Re: qemu-0.9.0 with initial tap interface
> >% gdiff ../kqemu-osol-1.3.0pre9/kqemu-solaris.c . > >54c54 > >< static uint_t kqemu_busy = 0; > >--- > > > > > >>static uint32_t kqemu_busy = 0; > >> > >> > >73c73 > >< static uint_t upages_locked = 0; > >--- > > > > > >>static uint32_t upages_locked = 0; > >> > >> > >102c102 > >< atomic_inc_uint(&upages_locked); > >--- > > > > > >> atomic_add_32(&upages_locked, 1); > >> > >> > >141c141 > >< atomic_inc_uint(&upages_locked); > >--- > > > > > >> atomic_add_32(&upages_locked, 1); > >> > >> > >158c158 > >< atomic_dec_uint(&upages_locked); > >--- > > > > > >> atomic_add_32(&upages_locked, -1); > >> > >> > >626c626 > >< atomic_inc_uint(&kqemu_busy); > >--- > > > > > >> atomic_add_32(&kqemu_busy, 1); > >> > >> > >642c642 > >< atomic_dec_uint(&kqemu_busy); > >--- > > > > > >> atomic_add_32(&kqemu_busy, -1); > >> > >> > And it all works? Interesting. ... > > So the next question is, do you think this will work on Solaris 9/X86?The 32-bit kqemu binary compiled on snv_55 loads on a S9 x86 kernel; but panics the kernel as soon as qemu tries to use the /dev/kqemu device. AFAICT, the problem is that the kthread_t structure has changed between s9 and s10/s11, so that the statement... struct kqemu_user_page * CDECL kqemu_lock_user_page(unsigned long *ppage_index, unsigned long user_addr) { proc_t *p = curproc; sets ''p'' to a junk proc_t*. % grep curproc /usr/include/sys/thread.h #define curproc (ttoproc(curthread)) /* current process pointer */ Compiling on S9 for S9 might fix it, but I''ve not yet tested that...
Jürgen Keil
2007-Feb-15 09:46 UTC
[qemu-discuss] Re: qemu-0.9.0 with initial tap interface
I wrote:> The 32-bit kqemu binary compiled on snv_55 loads on a S9 x86 kernel; > but panics the kernel as soon as qemu tries to use the /dev/kqemu > device. > > AFAICT, the problem is that the kthread_t structure has changed between > s9 and s10/s11, so that the statement... > > struct kqemu_user_page * CDECL > kqemu_lock_user_page(unsigned long *ppage_index, > unsigned long user_addr) > { > proc_t *p = curproc; > > sets ''p'' to a junk proc_t*. > > > Compiling on S9 for S9 might fix it, but I''ve not yet tested that...Trying to compile kqemu-solaris.c on S9 revealed more problems: the kernel''s "struct page" has changed between S9 and S10/Nevada, too. The physical page number member p_pagenum in page_t is missing. Changes like this (kthread_t, page_t) could also affect S10 and Nevada; whenever kernel data structures like kthread_t, page_t changes (patch installed, bfu''ed or upgraded to a newer OpenSolaris kernel), the binary kqemu module could break and crash the kernel. In such a case, the fix would be to recompile kqemu from sources and reinstall it. -- This message posted from opensolaris.org