Re: kqemu and sched_lock, please test port update

From: Teufel <bsd_at_kuehlbox.de>
Date: Sat, 21 Jul 2007 12:25:15 +0200
Hi Juergen,

just cvsuped the kernel and applied the kqemu-kmod below. Previously, I
had immediately the sched lock 1 panic with the ULE 3.0 and this patch
seems to fix the problem. The win2k3 image is now running for about 2
hours in kernel and user mode! Thanks! Hope this helps you. x86 kernel.

Greetings,
          Stephan

*kqemu status:*

QEMU 0.9.0 monitor - type 'help' for more information
(qemu) info kqemu
kqemu support: enabled for user and kernel code
(qemu

*CPU:*

CPU: Intel(R) Core(TM)2 CPU          6600  _at_ 2.40GHz (2404.13-MHz
686-class CPU)
  Origin = "GenuineIntel"  Id = 0x6f6  Stepping = 6

Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=0xe3bd<SSE3,RSVD2,MON,DS_CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM>
  AMD Features=0x20000000<LM>
  AMD Features2=0x1<LAHF>
  Cores per package: 2
real memory  = 2146828288 (2047 MB)
avail memory = 2091282432 (1994 MB)

Juergen Lock wrote:
> I just noticed this, and came up with the update below.  I still don't
> have a -current box so I need you to test this before I commit it...
>
>  Thanx,
> 	Juergen
>
> Index: Makefile
> ===================================================================
> RCS file: /home/pcvs/ports/emulators/kqemu-kmod/Makefile,v
> retrieving revision 1.19
> diff -u -r1.19 Makefile
> --- Makefile	14 Jul 2007 17:48:56 -0000	1.19
> +++ Makefile	20 Jul 2007 21:21:14 -0000
> _at__at_ -7,7 +7,7 _at__at_
>  
>  PORTNAME=	kqemu
>  PORTVERSION=	1.3.0.p11
> -PORTREVISION=	1
> +PORTREVISION=	2
>  CATEGORIES=	emulators kld
>  MASTER_SITES=	http://fabrice.bellard.free.fr/qemu/ \
>  		http://qemu.org/ \
> Index: files/patch-kqemu-freebsd.c
> ===================================================================
> RCS file: /home/pcvs/ports/emulators/kqemu-kmod/files/patch-kqemu-freebsd.c,v
> retrieving revision 1.5
> diff -u -r1.5 patch-kqemu-freebsd.c
> --- files/patch-kqemu-freebsd.c	6 Feb 2007 20:46:29 -0000	1.5
> +++ files/patch-kqemu-freebsd.c	20 Jul 2007 21:17:33 -0000
> _at__at_ -1,5 +1,23 _at__at_
>  Index: kqemu-freebsd.c
> -_at__at_ -321,6 +321,9 _at__at_
> +_at__at_ -208,9 +208,17 _at__at_
> + int CDECL kqemu_schedule(void)
> + {
> +     /* kqemu_log("kqemu_schedule\n"); */
> ++#if __FreeBSD_version < 700044
> +     mtx_lock_spin(&sched_lock);
> +     mi_switch(SW_VOL, NULL);
> +     mtx_unlock_spin(&sched_lock);
> ++#else
> ++    /* -current no longer uses sched_lock */
> ++    struct thread *td = curthread;
> ++    thread_lock(td);
> ++    mi_switch(SW_VOL, NULL);
> ++    thread_unlock(td);
> ++#endif
> +     return SIGPENDING(curthread);
> + }
> + #endif
> +_at__at_ -320,6 +328,9 _at__at_
>   #if __FreeBSD_version >= 500000
>       dev->si_drv1 = NULL;
>       TAILQ_REMOVE(&kqemuhead, ks, kqemu_ent);
> _at__at_ -9,4 +27,3 _at__at_
>       destroy_dev(dev);
>   #endif
>       free(ks, M_KQEMU);
> -
> _______________________________________________
> freebsd-current_at_freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
>   
Received on Sat Jul 21 2007 - 08:19:48 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:15 UTC