From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CD4C4C3ABB2 for ; Mon, 16 Sep 2024 16:26:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QNGAscY89spos90KeV3lVrKQOCpirqeeQdiGtvmiPzE=; b=vJQfPuv13JX+j8dtXYcQmlr7i9 NRkeMjUYkypfkTWtGG3jBU+Ojx4a5zF2EAIBssHGABlqsSTE9NqmOyIZaHdwURCiLpyNg4ORXutBp yKj2k995Pd1Tg7eyiAvkiA2qvEl920FJlWmNELi2rwYTLrq5Wi4RzVvNSnznMyLxC3M6/k6Iu46qR 4e/jkUE+2QCBlfJosEkQuXkTwN4pntyn8jIEicXihe/ePZwKUoK7dIRr0GRyxlVtVrdufi1MCL7gG dWyT+AjtVyYw/o97dRIcLervze4ym3O60+cl0WFNeDte281m+kLfAvsY/v7SENd/6h9TAq9jc/sBZ ZYsHSl4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sqEYk-00000004S9M-1KyJ; Mon, 16 Sep 2024 16:26:42 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sqEXO-00000004S02-3xRm for linux-arm-kernel@lists.infradead.org; Mon, 16 Sep 2024 16:25:20 +0000 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-7191ee537cbso3316239b3a.2 for ; Mon, 16 Sep 2024 09:25:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726503918; x=1727108718; darn=lists.infradead.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=QNGAscY89spos90KeV3lVrKQOCpirqeeQdiGtvmiPzE=; b=WFrROyx/5oYw+YvfJLx+Rn+l8b5zfTlkZuKPrs6w1MILP3Unlc2aXI9GONbBC2XX3f 19HsjDoUC4M9dXRrI4/eiXiizJgd6rd+g4TFp9LAfZAenszhp8pwhonz81FkWGGIR/65 PYzilza0GWAouPn4iXco6yrhNAdM57x5M66xNqCLmjZAP+BEm58AB5d6mX40n9knR2eU mWcaM8Jp+WSoz8uWXxLGsfvWtrCOFb3pT1VMg5eUQ2vLLFcHP24aRNH5sG4gm1DIzN9n bH9mS85oW9jARdzbYkeJ2me19d2Xl/TdX1NrLA1JLadeYaSamL5x+47RZFSM4GVHmH1I TYfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726503918; x=1727108718; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QNGAscY89spos90KeV3lVrKQOCpirqeeQdiGtvmiPzE=; b=Ls7gW9/m53t2PTNJq07lEXKSEYTUWqSaEapixDFuvFSfnZbtETdtbZsybZ9oQABIqS zYZCP2xw6zaOlSmTTHS0eYSIgwOsf3jQjY716KC3nL/ITkTZK2w5P6xiV7AqF3ktmHw1 EDTiiMuPC5g2g+WO64oQFPWwIffxZxVzrK6+ZH1eegSJybQAPdJL6Dej5NFt2uiJUzpL XKiEgwlbuqWQH38xJkySJloumgg5urZOrqnZfUANvonI8WHMYg1i+9I8I9xWs2b209IR Vtw/MJ8XXOdM2s5YhxFbwZEpt/T50w3WQjOrkule6oge8zIlvve46p5zcjfe3h/Hd4m5 X9ew== X-Forwarded-Encrypted: i=1; AJvYcCUeKbboJHI1ohWvTnjz5xHR3A6R0p4LyfPSi4TLz12DBBzcUY+ZlSu8En+tHHLtMZplS/donATdm0PAIowKxH87@lists.infradead.org X-Gm-Message-State: AOJu0YwovNnfVcMlOFc8CM4B646PE2rxl5hJDfoYoXhUpg4PiRZdzQ8G JBcaGWr9JTBeeYsR28WEXQbj/XFxTcusIPFyVlfF71nInr4+MhgF+w4Z2r23 X-Google-Smtp-Source: AGHT+IEGKIXuDbJQCCB5TuWpGJZvTObpH6f7clkm5fgDiOimQFedACIetFrXdE6vcQkAOCKT02LUSQ== X-Received: by 2002:a05:6871:3a06:b0:260:fb01:5651 with SMTP id 586e51a60fabf-27c3f253ae6mr10872804fac.12.1726502418233; Mon, 16 Sep 2024 09:00:18 -0700 (PDT) Received: from [192.168.0.101] ([59.188.211.160]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71944b97581sm3875919b3a.151.2024.09.16.09.00.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Sep 2024 09:00:17 -0700 (PDT) Message-ID: <110df06f-a598-4ffc-97c9-372a0fb858dc@gmail.com> Date: Tue, 17 Sep 2024 00:00:10 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/2] arm64: cpufeature: Pretend that Apple A10 family does not support 32-bit EL0 To: Catalin Marinas Cc: Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, asahi@lists.linux.dev, Marc Zyngier References: <20240909091425.16258-1-towinchenmi@gmail.com> <20240909091425.16258-3-towinchenmi@gmail.com> Content-Language: en-US From: Nick Chan In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240916_092518_991441_5A604DFB X-CRM114-Status: GOOD ( 19.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Catalin Marinas 於 2024/9/16 晚上11:30 寫道: > On Mon, Sep 16, 2024 at 09:41:12PM +0800, Nick Chan wrote: >> On 9/9/2024 17:10, Nick Chan wrote: >>> The Apple A10 family consists of physical performance and efficiency >>> cores, and only one of them can be active at a given time depending on >>> the current p-state. However, only the performance cores can execute >>> 32-bit EL0. This results in logical cores that can only execute 32-bit >>> EL0 in high p-states. >> >> Further research shows that the MPIDR_EL1 values between the two core >> types are different. And whether the two core type have any extra >> differences is anyone's guess right now. So far, nothing seems to break >> horribly without special workarounds for the MPIDR value (with cpufreq >> enabled downstream) as: >> 1. There are no KVM, GIC, ACPI, PSCI or cpuidle >> 2. All CPUs switch P-mode and E-mode together >> >> However, all of this is broken enough that this piece of code should go >> into arch/arm64/kernel/cpu_errata.c, and also generate a >> TAINT_CPU_OUT_OF_SPEC for these cursed CPUs. > > I wouldn't carry any additional logic in the kernel for such > configuration (long time ago Arm had something similar, the big.LITTLE > switcher, but the CPUs were fairly similar from a feature perspective). This is fine from a functionality perspective, currently nothing that accesses MPIDR after boot is used on A10(X). However, it does not sound right either to not note that the kernel is running on a cursed CPU. > >>> Trying to support 32-bit EL0 on a CPU that can only execute it in certain >>> states is a bad idea. The A10 family only supports 16KB page size anyway >>> so many AArch32 executables won't run anyways. Pretend that it does not >>> support 32-bit EL0 at all. > > CONFIG_COMPAT depends on ARM64_4K_PAGES || EXPERT. Do we really need > these patches in case one enables EXPERT and tries to run 32-bit > binaries that never ran on 16K pages before? The worst thing that can happen is the 32-bit process crashes with illegal instruction, the kernel will still be fine. > Nick Chan