Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Jul 2014 00:08:06 -0700
From:      Neel Natu <neelnatu@gmail.com>
To:        Prakhar Deep <prakhardeep@gmail.com>
Cc:        "freebsd-virtualization@freebsd.org" <freebsd-virtualization@freebsd.org>
Subject:   Re: Panic: 32-bit PAE enabled OS with 4GB RAM and 2 vCPUs on Bhyve
Message-ID:  <CAFgRE9F1Dem3W-z76nxvxz8g%2B%2BZhV9hD9CFR-k=ELT0oqOoW7Q@mail.gmail.com>
In-Reply-To: <CAP6teZd7ZNnUQCtjgahGweed8GWfrumB2cV-SPm8Sb9po5fydQ@mail.gmail.com>
References:  <CAP6teZd7ZNnUQCtjgahGweed8GWfrumB2cV-SPm8Sb9po5fydQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Prakhar,

On Thu, Jul 17, 2014 at 11:15 AM, Prakhar Deep <prakhardeep@gmail.com> wrot=
e:
> Hi,
>
>
> I am facing kernel panic when 2nd processor is executing it's reset
> code while running a 32-bit OS as a VM (with PAE enabled) on =E2=80=98bhy=
ve=E2=80=99 with
> following parameters:
>
> 1.       Number of vCPUs 2 or more,  and
>
> 2.       Memory 4GB or more
>
> When number of vCPU =3D1 and memory > 4GB i.e. PAE mode with only one CPU=
 or
>  vCPU =3D 2 or more and memory < 4GB i.e non-PAE mode then VM comes up
> successfully. The OS is able to bring up the boot processor but it panics
> when AP is executing it's reset code.
>
>
> The OS uses fixed kernel virtual addresses which are mapped by a level 2
> page table which is replicated for each CPU to allow some of these mappin=
gs
> to be different on a
> per-CPU basis. These pages act as storage for many global variables which
> are used when processor is executing reset code. When a second (non-boot)
> CPU comes up, we are seeing that per-CPU pages for this CPU are reset to
> all zeroes when the second CPU sets the PGE flag in CR4. This then leads =
to
> incorrect code paths.
>
> I am not able to understand why the pages mapped to AP are getting set to=
 0
> when PGE flag is set in CR4 as this does not happen for boot processor. I=
f
> i do not set PGE flag then pages are not set to 0 but the code panics som=
e
> where else but not due to zeroed out global values.
>
> I have tried FreeBSD i386 with PAE support compiled into the kernel on
> Bhyve with >4GB RAM and 2 vCPUS and VM came up successfully. Also, the PG=
E
> bit is set in the CR4 register for FreeBSD.
>
>
> It will be helpful if anyone could throw some light on following points:
>
>
>
> 1. Why are the pages mapped to AP are being zeroed when PGE flag is set f=
or
> AP in it's CR4 ?
>

It is hard to say but my guess would be that the 4 PDPTE registers in
the VMCS are not being properly updated during AP spinup. It would be
helpful to see the assembly instructions in the AP spinup code that
modify %cr0, %cr4 and %cr3 to know for sure.

> 2. Are there are any changes required in a 32-bit OS to boot it in PAE mo=
de
> with 4GB or more RAM and 2 or more vCPUS on Bhyve ?
>

No.

> 3. Was FreeBSD (i386) kernel updated to boot on Bhyve with 4GB or more RA=
M
> and 2 or more vCPUS ?
>

No.

best
Neel

> Thanks.
>
> Prakhar
> _______________________________________________
> freebsd-virtualization@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
> To unsubscribe, send any mail to "freebsd-virtualization-unsubscribe@free=
bsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFgRE9F1Dem3W-z76nxvxz8g%2B%2BZhV9hD9CFR-k=ELT0oqOoW7Q>