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=-5.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 53AE9C433F5 for ; Wed, 22 Sep 2021 13:48:37 +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 1E0C2610A1 for ; Wed, 22 Sep 2021 13:48:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1E0C2610A1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=canonical.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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=njPgOOsdJuH/h9dw4CnRWVhy4DvIgsO6BmhwvoQ75Qo=; b=mW5haTyGaFD09o 7TAEFVYszaosf3itzmAwbQJp5K3hQqELlVaekfDcCmrln8o2u88WpL1Z6rLTorLJm/fVhoyrvncKz +kK1h3+4liCpsLM1lZNnAKR0He/6Eo9kT9kf08mIy+UIA5XaUVhORnqt8hu27Ddj4R33E6Svvo+kQ kh1A5iRrBfOLFFne9BZROHYVdg92AkI00djZBzbAHeY+zXzjQUblK4kZgrLjh7oeAfzRbYf7cP/d5 QYafo/jSWe1buGtaEcRdQA3R3+avtq6+2XpETx0bx04b1tjEmPo/Dar/anX0i+c6SHxlVy2FYFLBo LIvqdgQt8qlCXC7w+sSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT2a0-008g4P-3W; Wed, 22 Sep 2021 13:46:32 +0000 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT2ZX-008g0Z-6C for linux-arm-kernel@lists.infradead.org; Wed, 22 Sep 2021 13:46:07 +0000 Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id A453D3F302 for ; Wed, 22 Sep 2021 13:45:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1632318359; bh=Gv9McO3faLsGgFbcRgSRHrpJSw0yYSSlzoo1ufxC2OU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=QQAG/aa0BNORnZZYTnLbqDUBo0BRY3JUHutm4yn1kGq5PPqLD2+5W06Pv5MlQpEc5 ektNskhQtyU1dP5fUguKAFf3D6/Xb6pv6icOiEvcMrbDXmkh9csQESxZtDhAaKKyzg paCPR1yzOHgwkt9EuXVACLC8VC5PRlJMIXxC2vCYOgMjmQh05iQM43OF5HleCkzjCl jNr9voXQR5n00MZxSpSXgeoR8zl7lhlHYj/jPA1O9oIeiT5m4mMmQCa+ARVXjGz4iv Umrl3/z0Sv7+Crlc9kR0+Pz0Jq4q6WHiEx/rm5ETMhqoP5HecPkm+xUQtIb4jinXG6 gBt0c0HDaCZ+A== Received: by mail-io1-f72.google.com with SMTP id i11-20020a056602134b00b005be82e3028bso2739260iov.18 for ; Wed, 22 Sep 2021 06:45:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Gv9McO3faLsGgFbcRgSRHrpJSw0yYSSlzoo1ufxC2OU=; b=s5JMh0M/KiSSdezApQM+H0/zdTQqNwgbTzXTIHBzlrQhUWorfct6gSdiKTy//ozqA6 8Jiv98LByeXeUaE5zj1aBCohVtovgh/9asuyJ41xj/DclWZOcDMsrgAVZA5j534svMFJ a7P8YOCStNSylRPR5gEZOQSqz3T54sR9eYpwrcS3ddW9iSRSlvwvwT1PK73l3S7QzGxu KovrrSUhp8abSFl+vnr390ogd9BYeagMgZ6WQyk+YBi3NGdu/W1A93BHSvTkmWtlYBcC Drp7N7L7LtdlTpcLeqeQMjScrIZCmy6eQWSON9BB13bHvqsMe8xA5reHku+OrjyeBNjh 6PwA== X-Gm-Message-State: AOAM532VxnOrmTdvdknux3+UGhwa/L3xnAk3V8GVQHOpCRwa7m9cxGfz JPGPcOQUOuniFjlSta8TjMq0orMGS64kQPVHnc1Wm2J+qwAiiabuh0vPtdaofz3RFzZkfFnvxF+ 0FYW6LCv/ywmxvizE++YcfvCZul0CrYjNTQ6Voae/2Q1219AwH3Xy X-Received: by 2002:a05:6e02:1212:: with SMTP id a18mr37853ilq.68.1632318358282; Wed, 22 Sep 2021 06:45:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKGzEp47aDYCkryKj8ev+ijmCTKHgQvmFqZmQF7U68fykKQ9RAcf8jjyHcF8gI/nrAkz1NMw== X-Received: by 2002:a05:6e02:1212:: with SMTP id a18mr37842ilq.68.1632318358081; Wed, 22 Sep 2021 06:45:58 -0700 (PDT) Received: from xps13.dannf (c-71-56-235-36.hsd1.co.comcast.net. [71.56.235.36]) by smtp.gmail.com with ESMTPSA id p14sm1071007ilc.78.2021.09.22.06.45.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Sep 2021 06:45:56 -0700 (PDT) Date: Wed, 22 Sep 2021 07:45:54 -0600 From: dann frazier To: Suzuki K Poulose Cc: Mark Brown , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] arm64: Generate cpucaps.h Message-ID: References: <20210428121231.11219-1-broonie@kernel.org> <20210921183552.GC9990@sirena.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210922_064603_527384_333AF202 X-CRM114-Status: GOOD ( 27.48 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Sep 21, 2021 at 10:09:12PM +0100, Suzuki K Poulose wrote: > 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. That seems to me to be the simplest approach, and I've verified it addresses the problem. I'll prepare a patch. Thanks Suzuki. -dann _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel