Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 Jun 2017 05:29:51 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 219882] [SMP][patch] 11.1-PRELEASE panics at CPU detection on a single CPU i386 machine
Message-ID:  <bug-219882-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D219882

            Bug ID: 219882
           Summary: [SMP][patch] 11.1-PRELEASE panics at CPU detection on
                    a single CPU i386 machine
           Product: Base System
           Version: 11.0-STABLE
          Hardware: i386
                OS: Any
            Status: New
          Keywords: patch
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: ota@j.email.ne.jp
          Keywords: patch

Created attachment 183349
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D183349&action=
=3Dedit
SMP kernel panic fix based on no-SMP kernel implementation

atpic_assign_cpu() function calls panic() and kernel fails to boot.

After reading the comment of atpic_assig_cpu(), I wondered if non-SMP kernel
boots.  The result was good - non-SMP kernel booted.

I adjusted atpic_assign_cpu() to mimic non-SMP path.

sys/x86/x86/intr_machdep.c:
static int
intr_assign_cpu(void *arg, int cpu)
{
#ifdef SMP
        struct intsrc *isrc;
        int error;

#ifdef EARLY_AP_STARTUP
        MPASS(mp_ncpus =3D=3D 1 || smp_started);
        if (cpu !=3D NOCPU) {
#else
        /*
         * Don't do anything during early boot.  We will pick up the
         * assignment once the APs are started.
         */
        if (assign_cpu && cpu !=3D NOCPU) {
#endif
                isrc =3D arg;
                sx_xlock(&intrsrc_lock);
                error =3D isrc->is_pic->pic_assign_cpu(isrc, cpu_apic_ids[c=
pu]);
                sx_xunlock(&intrsrc_lock);
        } else
                error =3D 0;
        return (error);
#else
        return (EOPNOTSUPP);
#endif
}

ones in the following files also return EOPNOTSUPP for non-SMP option, too.
sys/x86/xen/xen_intr.c
sys/sparc64/sparc64/intr_machdep.c

dmsg of the machine after applying the patch:


FreeBSD 11.1-PRERELEASE #1065 r319639M: Thu Jun  8 01:05:28 EDT 2017
    ota@localhost:/usr/obj/usr/src/sys/GENERIC i386
FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM
4.0.0
)
VT(vga): text 80x25
CPU: Mobile Intel(R) Celeron(R) CPU 2.40GHz (2394.05-MHz 686-class CPU)
  Origin=3D"GenuineIntel"  Id=3D0xf29  Family=3D0xf  Model=3D0x2  Stepping=
=3D9
=20
Features=3D0xbfebf9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,C=
MOV,P
AT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=3D0x4400<CNXT-ID,xTPR>
real memory  =3D 536870912 (512 MB)
avail memory =3D 477016064 (454 MB)
random: unblocking device.
Timecounter "TSC-low" frequency 1197026036 Hz quality 800
taskqgroup_adjust failed cnt: 1 stride: 1 mp_ncpus: 1 smp_started: 0
taskqgroup_adjust failed cnt: 1 stride: 1 mp_ncpus: 1 smp_started: 0

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-219882-8>