Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3972646pxp; Tue, 15 Mar 2022 09:49:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmBiDbuSQ4hbvUlrJnoX31geMoEI/Gdv1Q6pN9KxViqGsFH3R26+hrmh2dMI1nPnPozRaT X-Received: by 2002:a65:6b8c:0:b0:380:4725:2e26 with SMTP id d12-20020a656b8c000000b0038047252e26mr24539471pgw.78.1647362940251; Tue, 15 Mar 2022 09:49:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647362940; cv=none; d=google.com; s=arc-20160816; b=Hyn2NFJ9MTkYwZxQ6MsF37XVmzZ41lPJAz39Ciw6aqijx7Hut2FdyGEjYi5CbSOpPL K0iSVXSCCJnctN7gz3XbDm5y4siwFzveS3UVNmQ0XigwLovmqEvpZCeL7qii+B77Lrze DBKy/QcjcOrSUAhYxdaJVDlFBYEnYYZM4M7ZimfuZXU+O77+0heRVjuVVrI4/uz6UqbM bzbLcc2zrBt2+/3cuPNM+X/t9nMzgKRmZeFDnax01c9LaXPYAT8c5vZ9uyOlvPwL3bGb LjmvTIJNUYWg/Qwiqe4u1vhIRie7giX8Yol6SlesgzYmj6TgD3sWVMWKzykACDCJPw70 qHaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=u7Epb3cnTCSfvYNXZ5vpqB8tHEr+Nb7BMFDhb7yyEL0=; b=rWCr7zqcmOZqUqzSK8b14PSp82aafcfUyF01rYfU4J+26rJGgEKcsXoY30Ocd0k2S9 vJlMYqpNfLQ8uG0XGIOHcny6r5uDDqt9OR7QFMgdBNF9fUZFGBWIxbpqp7FQnc2Bv6QK hv8wSSzQ5sTB+75lACTtbnGnxu6qmA6ZImElHtjypTHmYMK1djeCBORIZw29DGeh9k9j iu4Y+bNxiCNcuFLV39HLa1ZKP7nV/1nDCCSa7QBrTvah3SvlsidB7k+r+pQ3HT6jApqr gbqmsTABDJBBrVLhWdxYU3IbB0o5axVS+tLXRk7zAIgveRVyXb4570NswytlhtYpwdHy g0Bg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=adelielinux.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x14-20020a17090a530e00b001bf1cbbcb9fsi2366336pjh.131.2022.03.15.09.48.46; Tue, 15 Mar 2022 09:49:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=adelielinux.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238305AbiCNKEU convert rfc822-to-8bit (ORCPT + 99 others); Mon, 14 Mar 2022 06:04:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238284AbiCNKEQ (ORCPT ); Mon, 14 Mar 2022 06:04:16 -0400 Received: from mail.wilcox-tech.com (mail.wilcox-tech.com [45.32.83.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50E40EB1 for ; Mon, 14 Mar 2022 03:03:05 -0700 (PDT) Received: (qmail 5988 invoked from network); 14 Mar 2022 10:03:03 -0000 Received: from localhost (HELO smtpclient.apple) (AWilcox@Wilcox-Tech.com@127.0.0.1) by localhost with ESMTPA; 14 Mar 2022 10:03:03 -0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.60.0.1.1\)) Subject: Re: [BUG] arm64/m1: Accessing SYS_ID_AA64ISAR2_EL1 causes early boot failure on 5.15.28, 5.16.14, 5.17 From: "A. Wilcox" In-Reply-To: <1f0b74caa45a1d73af68eab8dcc15485@misterjones.org> Date: Mon, 14 Mar 2022 05:03:02 -0500 Cc: Greg KH , linux-kernel@vger.kernel.org, stable@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: <2498FEAE-DE38-46C5-A50A-93396BB0938A@adelielinux.org> References: <32EA0FE1-5254-4A41-B684-AA2DEC021110@adelielinux.org> <1f0b74caa45a1d73af68eab8dcc15485@misterjones.org> To: Marc Zyngier X-Mailer: Apple Mail (2.3693.60.0.1.1) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_FAIL, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mar 14, 2022, at 4:08 AM, Marc Zyngier wrote: > On 2022-03-14 06:35, Greg KH wrote: >> On Sun, Mar 13, 2022 at 10:59:01PM -0500, A. Wilcox wrote: >>> Hello, >>> I’ve been testing kernel updates for the Adélie Linux distribution’s >>> ARM64 port using a Parallels VM on a MacBook Pro (13-inch, M1, 2020). >>> When the kernel attempts to access SYS_ID_AA64ISAR2_EL1, it causes a >>> fault as seen here booting 5.17.0-rc8: > > […] > >>> This is because detection of the clearbhb instruction support requires >>> accessing SYS_ID_AA64ISAR2_EL1. Commenting out the two uses of >>> supports_clearbhb in the kernel now yields a successful boot. >>> Qemu developers seem to have found this issue as well[1] when trying to >>> boot 5.17 using HVF, the Apple Hypervisor Framework. This seems to be >>> some sort of platform quirk on M1, or at least in HVF on M1. I’m not >>> sure what the best workaround would be for this. SYS_ID_AA64ISAR2_EL1 >>> seems to be something added in ARMv8.7, so perhaps access to it could be >>> gated on that. >>> Unfortunately, this code was just added to 5.15.28 and 5.16.14, so >>> stable no longer boots on Parallels VM on M1. I am unsure if this >>> affects physical boot on Apple M1 or not. >> What commit causes this problem? It sounds like you narrowed this down >> already, right? > > This really is a Parallels bug. These kernels run fine on bare metal > M1 and in KVM. QEMU was affected as well, and that was fixed in their > HVF handling. HVF itself is fine. > > So this should be punted back to the hypervisor vendor for not properly > implementing the architecture (no ID register is allowed to UNDEF). > > M. > -- > Who you jivin' with that Cosmik Debris? Thanks, I wasn’t able to test native boot. Since this is a bug in the hypervisor, I’ll notify them in the morning. For those of us stuck with Parallels, I’ll assume reverting of these three commits in my own build is the best way forward until it’s fixed. The M1 isn’t going to grow new instruction support in the meantime, so I don’t see a whole lot of harm in it - but the other mitigations in .28 seem useful. Best, -A.