From owner-freebsd-arm@freebsd.org Wed Apr 21 03:00:03 2021 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E35D5F29A8 for ; Wed, 21 Apr 2021 03:00:03 +0000 (UTC) (envelope-from freebsd-arm@darkain.com) Received: from MTA-07-4.privateemail.com (mta-07-4.privateemail.com [68.65.122.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FQ4zQ4Rwdz4W1k; Wed, 21 Apr 2021 03:00:02 +0000 (UTC) (envelope-from freebsd-arm@darkain.com) Received: from MTA-07.privateemail.com (localhost [127.0.0.1]) by MTA-07.privateemail.com (Postfix) with ESMTP id 7D8FC6004F; Tue, 20 Apr 2021 22:59:59 -0400 (EDT) Received: from mail-lf1-f51.google.com (unknown [10.20.151.223]) by MTA-07.privateemail.com (Postfix) with ESMTPA id E0E4660034; Tue, 20 Apr 2021 22:59:58 -0400 (EDT) Received: by mail-lf1-f51.google.com with SMTP id d27so7765272lfv.9; Tue, 20 Apr 2021 19:59:58 -0700 (PDT) X-Gm-Message-State: AOAM533H691OSHGw9Zts2cSdj/sPkIAQpPggMUk8+0TOs+YHoHtUE86u oC/B/sUUQmh2NEwz5QfzT5rUYzSTsAs5tO15F+0= X-Google-Smtp-Source: ABdhPJwu4IJLkBH6dmPB/Cgb5EIWYsd4CnnGXRCFlHOTJHH0F8eMofjvniXJEvXrPXlaWJGy+DCvW/o4x3JtnqmmSU4= X-Received: by 2002:a05:6512:2114:: with SMTP id q20mr17802824lfr.1.1618973997292; Tue, 20 Apr 2021 19:59:57 -0700 (PDT) MIME-Version: 1.0 References: <2B7A227B-245F-4F1B-A700-263C3FE56B68@freebsd.org> <13A8B0FE-6300-4980-8DA9-49C7A37840CC@unrelenting.technology> In-Reply-To: <13A8B0FE-6300-4980-8DA9-49C7A37840CC@unrelenting.technology> From: Vincent Milum Jr Date: Tue, 20 Apr 2021 19:59:45 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: gic-v2 and SGI interrupts on boot CPU To: Greg V Cc: freebsd-arm@freebsd.org, Michael Tuexen , Dmitry Skorodumov X-Virus-Scanned: ClamAV using ClamSMTP X-Rspamd-Queue-Id: 4FQ4zQ4Rwdz4W1k X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd-arm@darkain.com designates 68.65.122.27 as permitted sender) smtp.mailfrom=freebsd-arm@darkain.com X-Spamd-Result: default: False [-3.30 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:68.65.122.0/27]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[darkain.com]; RBL_DBL_DONT_QUERY_IPS(0.00)[68.65.122.27:from]; SPAMHAUS_ZRD(0.00)[68.65.122.27:from:127.0.2.255]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_IN_DNSWL_NONE(0.00)[68.65.122.27:from]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:22612, ipnet:68.65.122.0/24, country:US]; RCVD_TLS_LAST(0.00)[]; MAILMAN_DEST(0.00)[freebsd-arm] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Porting FreeBSD to ARM processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 03:00:03 -0000 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! 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) On Tue, Apr 20, 2021 at 5:40 PM Greg V wrote: > > > On April 20, 2021 10:38:44 PM UTC, Michael Tuexen > wrote: > >> On 21. Apr 2021, at 00:02, Dmitry Skorodumov via freebsd-arm < > freebsd-arm@freebsd.org> wrote: > >> > >> Hi > >> > >> > >> It looks like code for gic-v2 in FreeBSD not quite correctly relies on > implementation defined behaviour of GIC. > >> > >> The > gic > 2.0 spec https://developer.arm.com/documentation/ihi0048/bb chapter 3.2.2 > "Interrupt controls in the GIC" states the following: > >> > >> "Whether SGIs are permanently enabled, or can be enabled and disabled > by writes to the GICD_ISENABLERn and GICD_ICENABLERn, is IMPLEMENTATION > DEFINED." > >> > >> 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(). > >> > >> 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. > > 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. > > 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" >