Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp2711291pxb; Mon, 6 Sep 2021 03:43:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGpNTTMw7k1mDJIKuXsf35d2n5oFz8QivOwSgkt12Z0MgSKwCmBYHaWydXHSG5f5k+9ROG X-Received: by 2002:a05:6402:2210:: with SMTP id cq16mr12648166edb.348.1630925018300; Mon, 06 Sep 2021 03:43:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630925018; cv=none; d=google.com; s=arc-20160816; b=kV/rmShGl3j8dqISbJ9OYczZdttOcR4+5LKppQk6riuzC5GaXgX0ybZE7Ckhs3sB5Y 5hi88nJcP4btb84uFOOhXHpWGi2WvrnLJbhbLmDJSmeckDjpVIPwtKychMyVKt3pqMFP RLtERdpYEE1eXwIUBbszJaeEvnsbE5/h1FbEn/1uXxI7MYHAqukeeRSmtxxyKExHpPD0 NOsdLMKZsNgcyeTplp1/TzPoXA+seJUXoKLnmodSn20WfJBH60bjNh8+UmlKfl7gI/BE kNEJ5bk4bv53YVBINjQarhnQWdFuPxUdNV+3FmMNt1Sj3qT54xbTnbfJhICYBd8xLutU z2ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=n1HSM8YrKqN1A8cBHayWCuJLrO98T8taynt/2Ecj/p4=; b=0EvuJ0mJ/Pu2ac5BGd8COtCj6q5zk712i6uMrEn/hMlDzoC9/D7pEJDjoRzgs/oGnt ZH0fjqbytW05SC2Y1N2fjik5tGd+FYlim9CzyCy3WABZHMYZ2eVIstMDE1ImOTIYg8uV tkvilhHwD2NzkbShT1Ly1ex1TrvrbUcJv0QIlDkQTFTWz5VAvQN+6e406RjTiu7pKm78 LntyxSRcCOqpYyoSUUihfRbMeIKKJzCbAlAGWgEGKsi6d5s9vhlE3gn1igoV/8JS1iVJ +WP3DQ/U7TI0ezw+pWeqGdkGixeWC5EouDDdR2j38cygfq96P3HwzSf631R4LVZY8qQo 3zuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="khLOXp/6"; 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=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b17si7472628ejl.499.2021.09.06.03.43.12; Mon, 06 Sep 2021 03:43:38 -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=@alien8.de header.s=dkim header.b="khLOXp/6"; 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=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241312AbhIFJbM (ORCPT + 99 others); Mon, 6 Sep 2021 05:31:12 -0400 Received: from mail.skyhub.de ([5.9.137.197]:54084 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241313AbhIFJbJ (ORCPT ); Mon, 6 Sep 2021 05:31:09 -0400 Received: from zn.tnic (p200300ec2f0c2400e3336e9341833586.dip0.t-ipconnect.de [IPv6:2003:ec:2f0c:2400:e333:6e93:4183:3586]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id D96501EC04D1; Mon, 6 Sep 2021 11:30:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1630920603; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n1HSM8YrKqN1A8cBHayWCuJLrO98T8taynt/2Ecj/p4=; b=khLOXp/6KvfYyqQj1w2mTd9JUhUeg6l9ESMQubY/wvdTH4hAHhq3J18qt6hX7gtKrXepD5 5gBoIKzSE7Sib3p5MMAu8MZwcU2fvOlqJjNKai2voOLD7S2bcX4vMZ9rUu9J+CWydi5IdF 3xspFkUYNO6ClUsgns5A9XD5/dn7UU4= Date: Mon, 6 Sep 2021 11:30:01 +0200 From: Borislav Petkov To: Hao Peng Cc: tglx@linutronix.de, mingo@redhat.com, x86@kernel.org, linux-kernel@vger.kernel.org, Pawan Gupta Subject: Re: [PATCH] x86/tsx: clear RTM and HLE when MSR_IA32_TSX_CTRL is not supported Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 06, 2021 at 10:46:05AM +0800, Hao Peng wrote: > 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 = TSX_CTRL_NOT_SUPPORTED; > + > + /* If hypervisor does not support MSR_IA32_TSX_CTRL emulation, > + * but guest supports RTM and HLE features, it will affect TAA > + * (tsx_async_abort)mitigation. > + */ > + setup_clear_cpu_cap(X86_FEATURE_RTM); > + setup_clear_cpu_cap(X86_FEATURE_HLE); > return; > } How does that even happen - the hypervisor does not support the MSR but "guest supports" TSX features?! I guess the guest is detecting it wrong. What hypervisor, what guest, how do I reproduce? Please give full details. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette