kqemu locking my machine hard on amd64 smp, with most recent patches

Juergen Lock nox at jelal.kn-bremen.de
Tue Jun 3 20:54:40 UTC 2008


On Sun, May 18, 2008 at 06:16:21PM -0400, Todd Wasson wrote:
> Hi Juergen.  That patch seems to have fixed the problem for me, as verified 
> with both kqemu-kmod-1.3.0.p11_6 and kqemu-kmod-1.3.0.p11_7.  However, I'm 
> somewhat uneasy about using this patch on my system long-term, since it 
> hasn't been rigorously tested.  Are there putative implications of this 
> patch with other software that I should be aware of?  Is this kernel patch 
> considered to be the final fix, or just a band-aid until the underlying 
> cause can be addressed from within kqemu alone?

I just noticed the new fixup code should better be called before
entering the monitor not after, maybe that was what caused your problem.
Can you please try the following patch (without the kernel patch)?

 Thanx,
	Juergen

Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/emulators/kqemu-kmod/Makefile,v
retrieving revision 1.26
diff -u -p -r1.26 Makefile
--- Makefile	18 May 2008 20:23:40 -0000	1.26
+++ Makefile	3 Jun 2008 20:45:07 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	kqemu
 PORTVERSION=	1.3.0.p11
-PORTREVISION=	7
+PORTREVISION=	8
 CATEGORIES=	emulators kld
 MASTER_SITES=	http://fabrice.bellard.free.fr/qemu/ \
 		http://qemu.org/ \
Index: files/patch-tssworkaround
===================================================================
RCS file: /home/pcvs/ports/emulators/kqemu-kmod/files/patch-tssworkaround,v
retrieving revision 1.4
diff -u -p -r1.4 patch-tssworkaround
--- files/patch-tssworkaround	18 May 2008 20:23:40 -0000	1.4
+++ files/patch-tssworkaround	3 Jun 2008 20:08:24 -0000
@@ -83,20 +83,21 @@ Index: common/kernel.c
  #endif
      
  #ifdef PROFILE
-@@ -1188,6 +1191,13 @@
-             apic_restore_nmi(s, apic_nmi_mask);
+@@ -1096,6 +1099,14 @@
+             apic_nmi_mask = apic_save_and_disable_nmi(s);
          }
-         profile_record(s);
+ 
 +#ifdef __FreeBSD__
 +#ifdef __x86_64__
 +        spin_lock(&g->lock);
++        asm volatile ("sgdt %0" : : "m" (s->kernel_gdt));
 +        kqemu_tss_fixup(s->kernel_gdt.base);
 +        spin_unlock(&g->lock);
 +#endif
 +#endif
- 
-         if (s->mon_req == MON_REQ_IRQ) {
-             struct kqemu_exception_regs *r;
+         /* load breakpoint registers and avoid setting them if in the
+            monitor address space. We suppose that no breakpoints are
+            set by the host OS for this process */
 Index: kqemu-kernel.h
 @@ -48,4 +48,10 @@
  


More information about the freebsd-emulation mailing list