提交 d2a3c131 编写于 作者: R Russell Currey 提交者: Michael Ellerman

powerpc/powernv: Get STF barrier requirements from device-tree

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 84ed26fd ("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: 84ed26fd ("powerpc/security: Add a security feature for STF barrier")
Reported-by: NJoel Stanley <joel@jms.id.au>
Signed-off-by: NRussell Currey <ruscur@russell.cc>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220404101536.104794-2-ruscur@russell.cc
上级 2efee6ad
...@@ -102,6 +102,9 @@ static void __init init_fw_feat_flags(struct device_node *np) ...@@ -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)) if (fw_feature_is("enabled", "no-need-l1d-flush-kernel-on-user-access", np))
security_ftr_clear(SEC_FTR_L1D_FLUSH_UACCESS); 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) static void __init pnv_setup_security_mitigations(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册