Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp2477693pxb; Sun, 5 Sep 2021 20:41:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwV15hf0iYSIl5g3Xyd+SvOGbPQUxfvuazsilime0BoRJaC7nZIeFzMAYewcDNwqQ2zwdJ7 X-Received: by 2002:a92:c8ce:: with SMTP id c14mr3197130ilq.232.1630899692447; Sun, 05 Sep 2021 20:41:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630899692; cv=none; d=google.com; s=arc-20160816; b=thqQ9x/k/4Uw0/9Eoe5S+vFbWGgLG6+g11QwiQEFVLEm3PMoNsWLOeI1tfvtaL4RQj zkDIrdw5NgmeWXirVXfuw4JjNGZwD6yDU7vqjUCCnX2+hkQ+o6JpV1T/9M/rzIonUnkj 0PN/fAgRNf8+AgAR33svXz3NN0vWJtocqMEH5JJ32RybiMhkOkkjlwY2X/Y0gNoBhQUu xkiznHG0968uhfFeEllFh5j4vh5jdQ9dR3QrYGxHfoa5wZZpCglHV8uRrSIZPLMPOTKq DKVeFHnEy6Frn/qaaB2Pui5Z1xDb3H+9keYGBQqunZdXlCWuSRgsx2ahqDqE6J9Vsz/G owXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:mime-version:dkim-signature; bh=MgUySBovIyB1X0E7FpCE6nnUAjF6Qp4KmJCfh6F+1W4=; b=q3A97k/eXumkhQMnmZaumMW/UIoSW2fvkYj6nalPTfikF+nQypGuo08KbJIWdpv9ge 4XIVX3/5J0sl6G74oRZ4kz3qOaVrsbM/4ob8Qre61YVsldN4SKBsi1alz+SABXt3LiDT QIrX2Fm4mSwAnKSkuxRovkj41i0OwzEqRGcPgLXmLDmUr4VsBTLkrgPZrh+fts4lKz/o rwyV/cpwZCGB9fe1UXeCSSpv/BgE3DyMicNFzK4IVY4FWA0U8PwDMEn9dbdINf1qgfZS x3f1KyksinJSZIeDCa7D+QJ1PNyOkvwq8v8DNuE6cjZ9zG+eCJBdyZjiW5Wve0Um9dAd R6gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OZneJFvD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o6si5690965ilh.124.2021.09.05.20.41.19; Sun, 05 Sep 2021 20:41:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OZneJFvD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239016AbhIFCri (ORCPT + 99 others); Sun, 5 Sep 2021 22:47:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238950AbhIFCrh (ORCPT ); Sun, 5 Sep 2021 22:47:37 -0400 Received: from mail-vs1-xe2d.google.com (mail-vs1-xe2d.google.com [IPv6:2607:f8b0:4864:20::e2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA95FC061575 for ; Sun, 5 Sep 2021 19:46:33 -0700 (PDT) Received: by mail-vs1-xe2d.google.com with SMTP id f6so4389578vsr.3 for ; Sun, 05 Sep 2021 19:46:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to:cc :content-transfer-encoding; bh=MgUySBovIyB1X0E7FpCE6nnUAjF6Qp4KmJCfh6F+1W4=; b=OZneJFvD8hWgmscKheorMMIU5k3cOKO9vdEHa70vC5dDLJcCthO/3j/5SAxu5FHYzE HaFcJSxXy8wuNggVGN4mITSBrlf0rT5e0MLkoIyd8lBt3LepUQvXaWKp6Ki/71AcdIBC 7SldepKmbj4cGs/b8Vj/GtqMgMiRp40ThJw0b+Do/8rK3Q1OtcQS72Oza9dTSW3ARuVF Po8o/dNgF99Z5v1QmOY/+Ve7PLnLJo16LYCf/ilAE402xRjD3guABqbRilVQug3c3O+g P9q3/0rfmCcTbY1cKTppZh75TKgr0j17ftV6ysGc8LJmLsN/M32rflqzrLhYwLClpS6B tmng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc :content-transfer-encoding; bh=MgUySBovIyB1X0E7FpCE6nnUAjF6Qp4KmJCfh6F+1W4=; b=iTfDGWidKakbPUNAYQwiW/84GCzITCcb9xgxj5qd701GWQ0whxZKvgP42UkF1NZp4C Q41TZ/4TNewUq0G911nDCAYfTviVKCqQxjZNZe8wcWCYfXbbELU4JEYs9KYCv5AOILrn N821FXPPBH5Qu7w3x5o6LOszirSlv+nH8LPXS7d1GPYcu1o28aHYe1lGDMYUhOyl/Cj7 TNksk22TtdUHVoo9KESz7kS5UBuwaI69e1uC/72O9WjoaJufzKYPOXubFDUh+SaDXHwC tZVOtFX6wt2H57ADr2FPm8VcIsAbS4ta9QAc0JQb2V6kfHbBXeHpCdQaTFo9QGLPn7RP DG/A== X-Gm-Message-State: AOAM532PA5k7Jr5gHQX+LOcwpdbMCmlty5LvaLihh1jx5cTtchVn4a/J nlSklQ5OfQE+1weky/xsFi5KYn0ai4LjdN8DlfwgWP4FcCMm6w== X-Received: by 2002:a67:cb83:: with SMTP id h3mr4583283vsl.8.1630896392471; Sun, 05 Sep 2021 19:46:32 -0700 (PDT) MIME-Version: 1.0 From: Hao Peng Date: Mon, 6 Sep 2021 10:46:05 +0800 Message-ID: Subject: [PATCH] x86/tsx: clear RTM and HLE when MSR_IA32_TSX_CTRL is not supported To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de Cc: x86@kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If hypervisor does not support MSR_IA32_TSX_CTRL, but guest supports RTM and HLE features, it will affect TAA mitigation. Signed-off-by: Peng Hao --- arch/x86/kernel/cpu/tsx.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/kernel/cpu/tsx.c b/arch/x86/kernel/cpu/tsx.c index 9c7a5f049292..5e852c14fef2 100644 --- a/arch/x86/kernel/cpu/tsx.c +++ b/arch/x86/kernel/cpu/tsx.c @@ -122,6 +122,13 @@ void __init tsx_init(void) if (!tsx_ctrl_is_supported()) { tsx_ctrl_state =3D TSX_CTRL_NOT_SUPPORTED; + + /* If hypervisor does not support MSR_IA32_TSX_CTRL emulati= on, + * but guest supports RTM and HLE features, it will affect = TAA + * =EF=BC=88tsx_async_abort=EF=BC=89mitigation. + */ + setup_clear_cpu_cap(X86_FEATURE_RTM); + setup_clear_cpu_cap(X86_FEATURE_HLE); return; } -- 2.27.0