Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Apr 2021 08:49:41 +0200
From:      Michael Tuexen <tuexen@freebsd.org>
To:        Vincent Milum Jr <freebsd-arm@darkain.com>
Cc:        Greg V <greg@unrelenting.technology>, freebsd-arm@freebsd.org, Dmitry Skorodumov <sdmitry@parallels.com>
Subject:   Re: gic-v2 and SGI interrupts on boot CPU
Message-ID:  <4EC14700-BDC9-4447-8895-370AE82D5DC7@freebsd.org>
In-Reply-To: <CAOWUMWH=tqnAVkMP2vL6=Pub54N-wkrZrGBSYDyeotpovpXSJQ@mail.gmail.com>
References:  <YQXPR01MB4691AB59B8CFBE3521B8002EA1489@YQXPR01MB4691.CANPRD01.PROD.OUTLOOK.COM> <2B7A227B-245F-4F1B-A700-263C3FE56B68@freebsd.org> <13A8B0FE-6300-4980-8DA9-49C7A37840CC@unrelenting.technology> <CAOWUMWES6EoD%2B6K=2ijsSiMoupas=8vi=pii-Hd00o-8b9zk=Q@mail.gmail.com> <CAOWUMWH=tqnAVkMP2vL6=Pub54N-wkrZrGBSYDyeotpovpXSJQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> On 21. Apr 2021, at 06:34, Vincent Milum Jr <freebsd-arm@darkain.com> =
wrote:
>=20
> Doing some more digging, I came across this post from a while ago.
>=20
> https://reviews.freebsd.org/D26975
>=20
> I just built a kernel with this patch, and am now running 8 vCPUs =
under Parallels on my MacBook Air M1.
I can also confirm that the patch fixes the issue. Thanks a lot for =
finding the patch!

Best regards
Michael
>=20
> You can see evidence of it here!
>=20
> https://twitter.com/DarkainMX/status/1384724684902600706
>=20
> On Tue, Apr 20, 2021 at 7:59 PM Vincent Milum Jr =
<freebsd-arm@darkain.com> wrote:
> This may actually be related to the Parallels issue. We had a similar =
issue with ESXi ARM Fling initially where it would only work on 1 vCPU =
but not more, and it was related to the GIC code. This very much is =
worth investigating for getting FreeBSD functional under Parallels!
>=20
> Oh, and yes, I've bothered Parallels a lot... I unofficially got a =
reply essentially stating that the bug "isn't a priority" (they =
primarily care about Windows VMs and seems to only marginally care about =
Linux, with FreeBSD and other OSes not even remotely in their sights)
>=20
> On Tue, Apr 20, 2021 at 5:40 PM Greg V <greg@unrelenting.technology> =
wrote:
>=20
>=20
> On April 20, 2021 10:38:44 PM UTC, Michael Tuexen <tuexen@freebsd.org> =
wrote:
> >> On 21. Apr 2021, at 00:02, Dmitry Skorodumov via freebsd-arm =
<freebsd-arm@freebsd.org> wrote:
> >>=20
> >> Hi
> >>=20
> >>=20
> >> It looks like code for gic-v2 in FreeBSD not quite correctly relies =
on implementation defined behaviour of GIC.
> >>=20
> >> The  =
g<file:///Users/sdmitry/Downloads/IHI0048B_b_gic_architecture_specificatio=
n.pdf>ic 2.0 spec https://developer.arm.com/documentation/ihi0048/bb =
chapter 3.2.2 "Interrupt controls in the GIC" states the following:
> >>=20
> >> "Whether SGIs are permanently enabled, or can be enabled and =
disabled by writes to the GICD_ISENABLERn and GICD_ICENABLERn, is =
IMPLEMENTATION DEFINED."
> >>=20
> >> But code in sys/arm/arm/gic.c assumes that SGI are always enabled =
and doesn't configure them at initialization. They are initialized only =
for secondary CPUs - in arm_gic_init_secondary().
> >>=20
> >> For sure it is a rather minor issue, since all appears to be ok in =
gic-v3 (v3 code enables SGIs for all CPUs, including the boot one). And =
even if platform supports only gic-v2, likely SGIs are always enabled =
anyway. So, my post is rather pedantic notice without real life case.
> >Dear all,
> >
> >if I understand things correctly, the problem described is the cause =
which does not
> >allow to use more than one CPU core in FreeBSD when running on =
Parallels Desktop on
> >an M1 based Mac. It runs perfectly well with one core, but with =
multiple cores it
> >locks up during boot.
>=20
> Hmm if I'm reading it correctly, the gicv2 driver *does* do this on =
secondary CPUs, just not on the boot one. Which doesn't sound like =
something that would cause SMP boot to break but single-core to still =
work.
>=20
> Seems like people using QEMU with Hypervisor.framework patches do have =
SMP working fine:
> https://gist.github.com/ctsrc/a1f57933a2cde9abc0f07be12889f97f so go =
bother Parallels about their bugs ;)
> _______________________________________________
> freebsd-arm@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-arm
> To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4EC14700-BDC9-4447-8895-370AE82D5DC7>