Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2189034iof; Tue, 7 Jun 2022 22:37:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlAs8o+8vAi3HEZOZqZNfEaArQkduGNa92bSjYHX0WrdiEe5bMjsv7u1oWuXnsMuoXoGk6 X-Received: by 2002:a17:90b:3b92:b0:1e3:16b5:33df with SMTP id pc18-20020a17090b3b9200b001e316b533dfmr35795379pjb.198.1654666674239; Tue, 07 Jun 2022 22:37:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654666674; cv=none; d=google.com; s=arc-20160816; b=vwF5IohVnmLP6lMpAo1k4dstp+AUfqYriZRQA4Usf3JQsmDMwNJEPy41EHNhvE3e1l 1XpqRoSKSXSMceV2qulW6g9C845ZatFMMRoPxrFGULS/dP4hojnEpMMwjdakkU2J9wxf uKSyrFxTlqnUXVFg9PDQc1A8XxJ7EgkyE1wiAq3PAOxSS8h3kardByZza6MrVrS4xNWN aV9Zp8qADFif6qUSKJDOZfgYBdKInXDhpD0CZ3J4p6usyW6AemGqTz23Pm3hP80TrKNc trEqCMFt5v4XIPhy7q7k3Wo18md/9ULHyRx9pHLfYamFxCLZypHlfTu9SFD1c1IlruDK ea6Q== 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=ePL1YDSHYArh2KBu/lZnVoPGKHSsker9/prU64aFmGI=; b=PdQ+M+AAWbx7tbhygW7r+KWSVAxyfBcji0iS03CCEeTkW3WX5FE0Ht2wgp3tyQwfa7 WHFHSGMQHt1rngwyPNfIebXD/9xMQ0WQBsRhatXc6kQ2neDhhCk3Kpjn1kccwwk298nG GPrykgpUWG3Z+h8+Eo5upuyASxzKRAwGqn98fS4vFuKmPsIgGqLI4r5BYzDIWl2i65ZR fs5thRbLcPsCobZuX3ujtrBoRI3R51OLOGYHSWkHxjoC+1GtStS4L81wL9BmdaRIXv54 FG2tPcltLgLp1g+Flhw799i7gZrlqWV3xGOniRka4Q8kV0mh4sMqNywuACHJ2HQgJzu0 3rKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kYmZZLxN; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id v12-20020a63f20c000000b003fd4143cb9dsi15915747pgh.284.2022.06.07.22.37.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:37:54 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kYmZZLxN; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 45BEC49EC70; Tue, 7 Jun 2022 22:13:04 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386734AbiFHAaA (ORCPT + 99 others); Tue, 7 Jun 2022 20:30:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382809AbiFGWD7 (ORCPT ); Tue, 7 Jun 2022 18:03:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F1CA195792; Tue, 7 Jun 2022 12:14:57 -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 7DCF36192C; Tue, 7 Jun 2022 19:14:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E621C385A2; Tue, 7 Jun 2022 19:14:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629293; bh=W+FTR3kkajvWd2nZMl638Zr2vjMDmiXlj6AHR6X5zLQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kYmZZLxNCP+vJALt1oCgoRSwVPNPOL9L5eBEqPuAZoiBh5YQNFhCUbjFvelwTbRZB PcsUp1GyG5iI9PYseSSAN8XJeFQrHOgRTFfGSl3388P3Ma9sVzBIrfe5Pms5zCqua0 5DqMGrSfiZDCFOMtdvgHjiphT78LCntdyUwHVOQY= 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 640/879] powerpc/powernv: Get STF barrier requirements from device-tree Date: Tue, 7 Jun 2022 19:02:38 +0200 Message-Id: <20220607165021.423783578@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 d2a3c131981d4498571908df95c3c9393a00adf5 ] The device-tree property no-need-store-drain-on-priv-state-switch is equivalent to H_CPU_BEHAV_NO_STF_BARRIER from the H_CPU_GET_CHARACTERISTICS hcall on pseries. Since commit 84ed26fd00c5 ("powerpc/security: Add a security feature for STF barrier") powernv systems with this device-tree property have been enabling the STF barrier when they have no need for it. This patch fixes this by clearing the STF barrier feature on those systems. Fixes: 84ed26fd00c5 ("powerpc/security: Add a security feature for STF barrier") Reported-by: Joel Stanley Signed-off-by: Russell Currey Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220404101536.104794-2-ruscur@russell.cc Signed-off-by: Sasha Levin --- arch/powerpc/platforms/powernv/setup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c index 378f7e5f18d2..824c3ad7a0fa 100644 --- a/arch/powerpc/platforms/powernv/setup.c +++ b/arch/powerpc/platforms/powernv/setup.c @@ -102,6 +102,9 @@ static void __init init_fw_feat_flags(struct device_node *np) if (fw_feature_is("enabled", "no-need-l1d-flush-kernel-on-user-access", np)) security_ftr_clear(SEC_FTR_L1D_FLUSH_UACCESS); + + if (fw_feature_is("enabled", "no-need-store-drain-on-priv-state-switch", np)) + security_ftr_clear(SEC_FTR_STF_BARRIER); } static void __init pnv_setup_security_mitigations(void) -- 2.35.1