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 X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F4CFC433EF for ; Tue, 21 Sep 2021 21:11:30 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D4CA760F38 for ; Tue, 21 Sep 2021 21:11:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D4CA760F38 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2pc8l0ZaG2Zq/SvU80birF7DWTGJ2U3yaBXtCBWytI4=; b=yX8myxNLuBHOMJDxRP/pcAEGr2 j7+vzlEPoVr33Ark5fFoiAd6OY4uCdBxghKu/yz0ItEL4O8DWpiIxGoDbk0qY830Bbg9u+EEOCd7n q5WOodLzbzoqTan7OWh2BaThXHmo6+GGJaj7yxPIU+Xvn7gEJaDf4H5AEGJdWAfyopBqc/Ss1xEBf tXCTE4C6aqvybk8lzearx5UcBMtEGlTOTlqHzUgbWWsS1dsG1Fw84P0FCTo64hqpzxdPw/y2O4N+y JVY3GtcRVS9s2UT19+dUr+ASiOQWJeoheR6+6+u4UsZcfiYqpz7FZNKupcBQWE6uMSHW3AKnefTqP PWtbl/uQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSn13-005nMd-8C; Tue, 21 Sep 2021 21:09:25 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSn0y-005nM5-Rs for linux-arm-kernel@lists.infradead.org; Tue, 21 Sep 2021 21:09:22 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0A33E113E; Tue, 21 Sep 2021 14:09:15 -0700 (PDT) Received: from [10.57.95.67] (unknown [10.57.95.67]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 315863F40C; Tue, 21 Sep 2021 14:09:14 -0700 (PDT) Subject: Re: [PATCH] arm64: Generate cpucaps.h To: Mark Brown , dann frazier Cc: Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org References: <20210428121231.11219-1-broonie@kernel.org> <20210921183552.GC9990@sirena.org.uk> From: Suzuki K Poulose Message-ID: Date: Tue, 21 Sep 2021 22:09:12 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20210921183552.GC9990@sirena.org.uk> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210921_140921_009776_DEBA7E7E X-CRM114-Status: GOOD ( 16.76 ) 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: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 21/09/2021 19:35, Mark Brown wrote: > On Tue, Sep 21, 2021 at 12:08:11PM -0600, dann frazier wrote: >> On Wed, Apr 28, 2021 at 01:12:31PM +0100, Mark Brown wrote: > >>> This will result in a renumbering and reordering of the existing constants, >>> since they are all internal only the values should not be important. The >>> reordering will impact the order in which some steps in enumeration handle >>> features but the algorithm is not intended to depend on this and I haven't >>> seen any issues when testing. > >> Unfortunately I believe I've hit a regression[*] due to such an >> ordering dependency. UNMAP_KERNEL_AT_EL0 currently needs to be >> processed after WORKAROUND_CAVIUM_27456. ThunderX systems are >> incompatible with KPTI, so unmap_kernel_at_el0() bails if >> WORKAROUND_CAVIUM_27456 is set. Because of the sorting, >> WORKAROUND_CAVIUM_27456 will not yet have been considered when >> unmap_kernel_at_el0() checks for it, so the kernel tries to >> run w/ KPTI - and quickly falls over. > >> I've verified that reordering cpucaps to move WORKAROUND_CAVIUM_27456 >> just above UNMAP_KERNEL_AT_EL0 restores the old behavior. I'm not sure >> of the right way to address this - perhaps unmap_kernel_at_el0() could >> check cavium_erratum_27456_cpus[] directly instead of keying on the >> ARM64_WORKAROUND_CAVIUM_27456 cap? Given that these capabilities are LOCAL_CPU scope, and the systems in question never have heterogeneous CPUs, you could replace cpus_have_const_cap() => this_cpu_has_cap() in unmap_kernel_at_el0(). If they were heterogeneous, we would fail anyway, no matter what the order was. Suzuki _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel