From patchwork Fri Jul 1 13:04:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 12903275 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 867FCC433EF for ; Fri, 1 Jul 2022 13:06:55 +0000 (UTC) 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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pBk+arp6kcqSmRgs/HdocUneJD9KmgLFQpr/Ce2BhZk=; b=qMEoPewt8+yx9I t4JErYPgF9vIH94A/D1W85wwI1Hl5uTWU22NiLb+SOI5d4/6CzK3ACgFtOPTfOL6nJrzKucIET2U/ kxZYzwQbFW6Wog++Lf/JtTFYaCussIDAh8p9zZ3ITeU+luCUzorLEAFy9VFInkrSCCnsKqMnw/4f4 TZSMf9ljyUi4wrgmLIkYq/NDCjAI04zg9ne6BhtlKDC4SeBcZqm8bOXMoTt2oGJtGpFBhmAG4G/CR T7hQPOcRKP2wOrRPY0QOa29zhHWn7B6VRT4nzoMpBTUOejX0BtMWfwj/W1ymkGUZLmTSdkvOhtrFF TA84brPrtTL4b/yc+lXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7GLF-004w1k-RD; Fri, 01 Jul 2022 13:05:50 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7GKX-004viF-RU for linux-arm-kernel@lists.infradead.org; Fri, 01 Jul 2022 13:05:07 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 80876B83025; Fri, 1 Jul 2022 13:05:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55692C36AEA; Fri, 1 Jul 2022 13:05:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656680703; bh=gv4vToX5S3SHG6gF5v87rlxSnkOzVml/j7rg1HABKBM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sjB8VyrH6+OklOMiVv6YrXXw6OWcqA+oiROhzGJ4RniyR8y3oNgb45my76fMoQp6i SYeWbQRlid/i6KQk0L4wdUWhvo09uZMZlftQp2Yd+eXQGVbNajd+9huRkQzFCZm/gL 3+atLzM4HPpqFiL0OmcVhv5ngcqISpdwLjTYhoe8HvRXWOizbuyCknp2QHZkQIha7R SQ9Zs4XCX2bAp4cj3s671usvQpS9Iwy/ueyPXulo/GaYVX99ZsfjJf9ds8iSMxx86Z 1cl/Hs1MZEl5H93U8GWf8glEQlMRPcbCQMTEctiN+y6WorK96FdxZraBk5K34rBY/W jaHeZL+nJVRIw== From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Cc: Ard Biesheuvel , Marc Zyngier , Will Deacon , Mark Rutland , Kees Cook , Catalin Marinas , Mark Brown , Anshuman Khandual Subject: [PATCH v6 3/9] arm64: kaslr: drop special case for ThunderX in kaslr_requires_kpti() Date: Fri, 1 Jul 2022 15:04:38 +0200 Message-Id: <20220701130444.2945106-4-ardb@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220701130444.2945106-1-ardb@kernel.org> References: <20220701130444.2945106-1-ardb@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1358; h=from:subject; bh=gv4vToX5S3SHG6gF5v87rlxSnkOzVml/j7rg1HABKBM=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBivvDhw5K9a1Y+nGte5BZ3WyB0q+g79ErgqS0rLct/ +O4OXE2JAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYr7w4QAKCRDDTyI5ktmPJJhIC/ 4xL4oppyYSw3m51TdEROuolmd0XCe1Ggp0wB3DuTN1sbF7yn8qSyyzG1o5WN97TUHx17TOATzfqlXW sZx89W1Fc8Hdi0iSuuh7oXQq1cIMbujdXfrXvAO/YLDKaF7kul5aoYhp+iOPR9db6u8rwTo7KWMLHw GGTTQd1G5IxuUT4hbbRXTp4gavye3UHzWHue7Z9aufVJ11iFZbcjrVddQGygS25k1Vja3kAS6L7RXS 48hKQ9ijoFJm5Tbg7PprbhMBEBnPRZQryj0dAAL6Wk9xb96pAVt3IAeUxyZMNFzSGCsKZpoQ46uu0L nIqk5mdvZVM/Uc6whK5IF6dQJ7tyJ/whutEio1HjL1FevI68T3HvewXNbtsDGV/04opJ/B+0HqUXFy vJGdfdnObr0Sqv1Y9TjiYGCOOerm+i1VOFgwrqw+ygM7SL8sCnzXG2axPzDMKd2UrpsJ4GvA/Hkrw1 GR5t1Vcg44J95gWendv1B7qYo3xywF2dUrPUbKWlcQPdE= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220701_060506_083741_D397BFE8 X-CRM114-Status: GOOD ( 13.35 ) 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 ThunderX is an obsolete platform that shipped without support for the EFI_RNG_PROTOCOL in its firmware. Now that we no longer misidentify small KASLR offsets as randomization being enabled, we can drop the explicit check for ThunderX as well, given that KASLR is known to be unavailable on these systems. Note that we never enable KPTI on these systems, in spite of what this function returns. The only penalty for getting it wrong (i.e., returning true here on a ThunderX system) is that we will end up using non-global mappings for the kernel pointlessly. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/cpufeature.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 22e3604aee02..af46ca0da994 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1550,18 +1550,6 @@ bool kaslr_requires_kpti(void) return false; } - /* - * Systems affected by Cavium erratum 24756 are incompatible - * with KPTI. - */ - if (IS_ENABLED(CONFIG_CAVIUM_ERRATUM_27456)) { - extern const struct midr_range cavium_erratum_27456_cpus[]; - - if (is_midr_in_range_list(read_cpuid_id(), - cavium_erratum_27456_cpus)) - return false; - } - return kaslr_enabled(); }