Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp987491pxb; Sun, 21 Feb 2021 07:21:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwOAD3okoNeRlYJyq8GBKPKSmGuTCx6iSRhiiwD/6qkH1PIujj93X7uLidtnil7aAVi4WRO X-Received: by 2002:a05:6402:b1c:: with SMTP id bm28mr18764244edb.354.1613920910299; Sun, 21 Feb 2021 07:21:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613920910; cv=none; d=google.com; s=arc-20160816; b=bF5k3NZGKpcsc7Ds+MlgpH07kAAnEJOD2U5LIVeTdfRZ4Iymu31qCpuCw2PjP+kDWC AXFx86mkCdoQgYr4D9febXjZDqlqldlKfnVI9lplL6WHq6aOAPJKfiLZzvG0z/ZIcGBk kHPDqv9tVjlvB1faXO2v0LGlVfxz0P++4rREILoEyTEuK/nfzzAtEbBzsj1R4MXHqlBo zLklmc67sl2/Ryb+AZtQGdW5Tr2j0KwOY2ggR8ODynXtvs/7niQb4TyEs9b6XfqZsiN6 d/mz/8XshDuuKnYzCyNGxmF61eYExijpSKiO9Ko/LH1j6WTxvKY3FveNCz6YQFXdB8oj b6JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to; bh=1GEHbszICCvUr1/ZvGR0KzCRHCFEN4XIGfNzvycHiQw=; b=EqzTBIJBHilAfyFYAa1+EtpnO/tvUdBAWriVu++e0FGKGmwDNkZ1usMxEs98YLpnox 1w7TBoEKYz4ODCXGDV08i1pqVdXNSlQCgSMEbHvGPbyb/XmgMzWyAUwGuTKAm+foJvKd yExfthqVsQW1XOMbVP8ho0ZLeUznzvPjGJH4++xtTN1iyNg2gEwRrExl3iEYeNIAjtTM RRBJRBoOI5SW7x1Qb1YgZpNdsIbz2jfMVIx1g8Yw3GpY4AlwpIwiNppa1V8CYXIZ3IXV pETlg4meOiKhpjtUKdPVaN/ptuRE4Np0p6h1/qVNM/BytxdJzgXFOl4WreGuzsDT7GU5 BEIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=marcan.st Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h12si7889257edw.487.2021.02.21.07.21.25; Sun, 21 Feb 2021 07:21:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229844AbhBUPVB (ORCPT + 99 others); Sun, 21 Feb 2021 10:21:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229685AbhBUPVB (ORCPT ); Sun, 21 Feb 2021 10:21:01 -0500 Received: from mail.marcansoft.com (marcansoft.com [IPv6:2a01:298:fe:f::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A957C061574; Sun, 21 Feb 2021 07:20:19 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: marcan@marcan.st) by mail.marcansoft.com (Postfix) with ESMTPSA id 8FB74425B9; Sun, 21 Feb 2021 15:20:13 +0000 (UTC) To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, Marc Zyngier , Rob Herring , Arnd Bergmann , Olof Johansson , Krzysztof Kozlowski , Mark Kettenis , Tony Lindgren , Mohamed Mediouni , Stan Skowronek , Alexander Graf , Will Deacon , Linus Walleij , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210215121713.57687-1-marcan@marcan.st> <20210218143644.GC89209@C02TD0UTHF1T.local> From: Hector Martin Subject: Re: [PATCH v2 00/25] Apple M1 SoC platform bring-up Message-ID: Date: Mon, 22 Feb 2021 00:20:11 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210218143644.GC89209@C02TD0UTHF1T.local> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: es-ES Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/02/2021 23.36, Mark Rutland wrote: > IIUC, the CPUs in these parts have some IMP-DEF instructions that can be > used at EL0 which might have some IMP-DEF state. Our general expectation > is that FW should configure such things to trap, but I don't know > whether the M1 FW does that, and I fear that this will end up being a > problem for us -- even if that doesn't affect EL1/EL2, IMP-DEF state is > an interesting covert channel between EL0 tasks, and not generally safe > to use thanks to context-switch and idle, so I'd like to make sure we > can catch usage and make it SIGILL. > > Do you happen to know whether all of that is configured to trap, and if > not, is it possible to adjust the bootloader to ensure it is? Very good point! If only they were IMP-DEF... they're straight in Unallocated space. I spent some time the other day exhaustively searching the chunk of the encoding space where it looks like all these "fun" additions are, at EL2, and I documented what I found here: https://github.com/AsahiLinux/docs/wiki/HW:Apple-Instructions I haven't tested things at EL0 yet, but it looks like the stateful instructions known to be usable in EL0 (AMX) already default to trap on this platform, so we should be safe there. Everything else looks like it probably either shouldn't work in EL0 (I sure hope the address translation one doesn't...) or is probably stateless. I'll dig deeper and test EL0 in the future, but so far things look OK (for some questionable values of OK :) ). -- Hector Martin (marcan@marcan.st) Public Key: https://mrcn.st/pub