Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2202771iof; Tue, 7 Jun 2022 23:05:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwk3VECLqfcNvS4V72dUO9MubnKVMBg+Eid1COD0lt/C9rSFS/KwJJmj3AxRncjhyzzwWTJ X-Received: by 2002:a65:67da:0:b0:3fc:6ca7:d58c with SMTP id b26-20020a6567da000000b003fc6ca7d58cmr28729814pgs.562.1654668333315; Tue, 07 Jun 2022 23:05:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668333; cv=none; d=google.com; s=arc-20160816; b=rg2qp2z7jf0UNC1WJuIqUSgTRSHE++fZ/J1iz8wmXg2/On1sbzTL+k1bdbWJ6bcaxH d7BTuXFF5au6Dj5hF+qNgfr1cDnrHp+8IPnbpjMFJwJEtqdd7Hke1IohiNIyI5tP/2NZ MX9cu/fgBS3/0dGD1KhDMXfFOpdEviXXGcaTZw/vGV+xUEkkz2E/OaIjyOxmEHMeoNAz FgfG5p3uPue4ifoiaS8m1GVp1AnWXVGegJ/86ZkZakcONkFHsnYcitOHan1xBy4a5R6F pgbqPrtcFSXyBgQ4BxxuBA8VuK7V/IhIJ8MN0uuVO1TgIvQYQI8oBuT3640PLTipzC1K W/Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ediw9dt87GSLKCadsFG2mYmx11Cmso10HVNtWtxqP4s=; b=FgVVdmwxOEd9e2AjKqlve3ERHwrEqhdA+A6+B6WJV+xpgVspICjBWcTYu10ncFkIq5 l4FYUya0D07WFbNE3+/vNyMcGXBaQvWZjlvZNzmGOq/nlc8SzTvdjmuvDWTUgZSaA9AJ SHbgLBfbhPC/Vre7hSFWn/1a5oOI0mt38n3Bf/SE4ulvGOaBUHfiYPIiQbcEzH4JGwKI GXn7je+aTKG19h8zC8f0NQ22pS+e/7dBf0oMX2k3Jv+n3J3ClfnqBWVanGzSFWQjhYGr ZojMf7COsajnVOoLXhaxWkiqp60gl6zvJBjOyr2ce0x2WyPiXtAC/WmabbQrBmiueC30 1qWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sw5SAKsA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z1-20020aa79901000000b005180f2b05b4si24253094pff.102.2022.06.07.23.05.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:05:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sw5SAKsA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A7D3C1A04A9; Tue, 7 Jun 2022 22:30:58 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443422AbiFHBHL (ORCPT + 99 others); Tue, 7 Jun 2022 21:07:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379863AbiFGWG4 (ORCPT ); Tue, 7 Jun 2022 18:06:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABC4E2534C7; Tue, 7 Jun 2022 12:16:46 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 4697961922; Tue, 7 Jun 2022 19:16:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B733C385A2; Tue, 7 Jun 2022 19:16:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629405; bh=90hcqqTDbuainC8u75Jns7z4qyyeclpWRSFDaglmv18=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sw5SAKsAMQQlmiIFtn/PojJkkR9aK8Mnc5+Xf4W3ZpstcoYRJK9B1J/8qqj24xF5a JWS/V6/IRGVjufXL68f03mS6G3pv/8Z22g+bS1G7rzOC3187tIk1kdUOgmlxrsJ4dr kkZvsJBCghbT/PH4iG/JbittfecUdjow25TbFWNs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joel Stanley , Russell Currey , Michael Ellerman , Sasha Levin Subject: [PATCH 5.18 639/879] powerpc/powernv: Get L1D flush requirements from device-tree Date: Tue, 7 Jun 2022 19:02:37 +0200 Message-Id: <20220607165021.395499836@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Russell Currey [ Upstream commit 2efee6adb56159288bce9d1ab51fc9056d7007d4 ] The device-tree properties no-need-l1d-flush-msr-pr-1-to-0 and no-need-l1d-flush-kernel-on-user-access are the equivalents of H_CPU_BEHAV_NO_L1D_FLUSH_ENTRY and H_CPU_BEHAV_NO_L1D_FLUSH_UACCESS from the H_GET_CPU_CHARACTERISTICS hcall on pseries respectively. In commit d02fa40d759f ("powerpc/powernv: Remove POWER9 PVR version check for entry and uaccess flushes") the condition for disabling the L1D flush on kernel entry and user access was changed from any non-P9 CPU to only checking P7 and P8. Without the appropriate device-tree checks for newer processors on powernv, these flushes are unnecessarily enabled on those systems. This patch corrects this. Fixes: d02fa40d759f ("powerpc/powernv: Remove POWER9 PVR version check for entry and uaccess flushes") Reported-by: Joel Stanley Signed-off-by: Russell Currey Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220404101536.104794-1-ruscur@russell.cc Signed-off-by: Sasha Levin --- arch/powerpc/platforms/powernv/setup.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c index 105d889abd51..378f7e5f18d2 100644 --- a/arch/powerpc/platforms/powernv/setup.c +++ b/arch/powerpc/platforms/powernv/setup.c @@ -96,6 +96,12 @@ static void __init init_fw_feat_flags(struct device_node *np) if (fw_feature_is("disabled", "needs-spec-barrier-for-bound-checks", np)) security_ftr_clear(SEC_FTR_BNDS_CHK_SPEC_BAR); + + if (fw_feature_is("enabled", "no-need-l1d-flush-msr-pr-1-to-0", np)) + security_ftr_clear(SEC_FTR_L1D_FLUSH_ENTRY); + + if (fw_feature_is("enabled", "no-need-l1d-flush-kernel-on-user-access", np)) + security_ftr_clear(SEC_FTR_L1D_FLUSH_UACCESS); } static void __init pnv_setup_security_mitigations(void) -- 2.35.1