Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp208304lqg; Wed, 10 Apr 2024 23:22:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUtp0u3xjvPtwAEBNs9fSQPyws0+tB8n9qPkeaQZf2VebV3KNl6watSzXbzAzyrlIS9Orchl+yKGcFn3ZY0kq//xxVAmQHrQiKyUhiVjQ== X-Google-Smtp-Source: AGHT+IEgcym3C8Y+zu38JgWDev7dmfI0sXEB1tObZiMx0Mfn6DUnqRP9dkCq+x9cFB0EKjwS3tCX X-Received: by 2002:a05:6830:93:b0:6ea:15de:c3ad with SMTP id a19-20020a056830009300b006ea15dec3admr5234246oto.13.1712816541511; Wed, 10 Apr 2024 23:22:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712816541; cv=pass; d=google.com; s=arc-20160816; b=YGfz9aeBXilpoi5KOs5C16PITmhx3wPPgJdq823LwDp1thdLR7eRNZ8Ce+nfNgrX3g ZjLTJRoa30Fyma0wpJILyJL3/V06O1Bk27i0zMjt7mWLGfz+f60S+nqpXA2FCMp/CzhV ga5sDAuTGJ9wAeNferd/ApHdEbmVE0d7ZmY3oZ3VesaSFTI8QY9u1aUITfe+aV8u73Fs ZvNoI20l0Ixad5NfmZ0nLdGmXn4ajQ2/5i27FKD8ID3HqJ5aMl2GcO0V0Tya8iL4107w M+9NSFzA+vc5MUv85IvLBwX6sJjcGW0h5qsREnNQYkhboAXtje6sjNSyrPGBeoXVBW4X 3IVg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=QlIgB0jwM0VnB5Ngxou2lnVrqnfVxHRzX+mAfelLC68=; fh=/1Zbo5cC0kztJy3aAg31JyMsD7dNAWBDvzo4WIDtWtE=; b=lF4d+yBdVhUb0IsdHptBEkIoSzsEWCJ6M6u6DAjVUJfz8pe170cKZo2BxB3A8SzC8Z VTAM/1YjuxjAlNPcNqm8eBxWR2LD+HKdAlvFfuxxs6cAHUTdmvUfowuqYzVTfYznvI81 lmIMoyTot/mrlVUtDfGsRgZht9SgPdXYrxguE6Wgi2Xja2HWgP8JMvXlEVdb00fV6HS1 kNlp6uVjUNxf2qjmivaPybX0AFv5DaNNmprrDaO+pOmy/UWH/1G8RugMvflCn7vBoogu eUZNJPHnA1WL1UM/EqPq8d8mFL9U4Rn+4kH316mDGTkucmn1M4QXorlOtJTUXoBWZyFO 4tKw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b="b2fPo4/Q"; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-139845-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139845-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bv130-20020a632e88000000b005dc76f56a18si675774pgb.559.2024.04.10.23.22.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 23:22:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139845-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b="b2fPo4/Q"; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-139845-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139845-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2A4E4281BCD for ; Thu, 11 Apr 2024 06:22:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1EF0513CAAD; Thu, 11 Apr 2024 06:22:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="b2fPo4/Q" Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3822613CA86 for ; Thu, 11 Apr 2024 06:22:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712816536; cv=none; b=fq1aMoQyy8LCZkgsZcPKwFsH1Bkb0M6AyZclAfWITGGw4o9c8EYjbDeglsk6mZOdbI5j1nwx4OEqpdqYG0zzNPx32p4JdJP3M0CZtmlnp1StSy4WKuFei3K3ulf9KmgsF7ASWNdsTsYeqUZH05Rz9JNQJ0YGQZ4la1lMqNDenxA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712816536; c=relaxed/simple; bh=61mGfleN9b9hdGxn+KoWtdZ07L8Dqx7oPBIXuPLrCAg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=P7z+QaQNJqTXXB6CQTatUfafIIivSBfQ950dKLglQ0MCPubLVqK0euMSvgkuqSeG4SVi6/I3XFXNmcgrX4lob5X9Rouu1nEthU0TtwCkJZLok6jfgF/cacyUzwG3MWHGbzeRe8b0ypXwjM6WcMZn0nh71aQXKK/UwodHLnI9QII= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=b2fPo4/Q; arc=none smtp.client-ip=209.85.208.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-56e346224bdso5575667a12.1 for ; Wed, 10 Apr 2024 23:22:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1712816532; x=1713421332; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=QlIgB0jwM0VnB5Ngxou2lnVrqnfVxHRzX+mAfelLC68=; b=b2fPo4/Qa7krzVqS4WRzR7NFitr9nFlDzZ7PsaJU0HNOgSiz6iq4aUufPkdhPTMigR pE5SUBXYZNjzxkRQ4/j+ly2dELqj6IApYvfrGA0/kfVH/hZyp7jyw3kTiWH+jT6c0KHY yYj0NN4n0+i8xonGC7Fqb2wAQVF4jY4tYDPUhtQiFHXjaCgs/l249Nv7ESAkWF3UV+jm 7aScnPPYJMVe7HF6IVEdj1MwFUPbxmyO6419ZIdzrEBnn65/qNXXPDycZIkncCPVl4LC XBfN9+Ot41c1EE26UCXl2MANQ/qLNGsHTGdQwXQ861B6GvowhEfkZ9KrTN4QFwJ6qfXm GfdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712816532; x=1713421332; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QlIgB0jwM0VnB5Ngxou2lnVrqnfVxHRzX+mAfelLC68=; b=c7a1Az/sVymNdPQAvfbQFQfHbl1/FJMjvw0tuhkvgmAsWBSFYILDczVRK1jQ7mcDYp i9/3l2/9yBUs5mY0oNwctSKzz/TBRFKhdX30ieU5h8KKsbuOPXMYJ5vqr6GNwJ2aJWd6 RayGOv6LNWTvcQc/TtDw4q/5MGZpCZXztXfggKYCOuttMRs0PNgKs79dbQhWRJAp2vXJ QwofECjV3p5VtdtCajktky8u6wEOzO6hAp/UG8GAESTegybxEdBaJmQIbkIWXeUrC2nu u1exQupBR9hvwrVOZpTtBchXgg3rco/tFwssUdOwiuJHr9+DOOVU+aK/0L+M7PsVq3Qw hXQA== X-Gm-Message-State: AOJu0YzoD+OShWK4rSs6QlctVVqGcj3Yks37APJZcBG6GGQmyfBtpJki 02YOthmabLPxcGhuACY4cThnhekynSCtq9g6AZmhC0E8hQSruJhigum19qUnBmI= X-Received: by 2002:a50:bae5:0:b0:56d:f637:451c with SMTP id x92-20020a50bae5000000b0056df637451cmr2639331ede.32.1712816532469; Wed, 10 Apr 2024 23:22:12 -0700 (PDT) Received: from ?IPV6:2a10:bac0:b000:7318:7285:c2ff:fedd:7e3a? ([2a10:bac0:b000:7318:7285:c2ff:fedd:7e3a]) by smtp.gmail.com with ESMTPSA id x12-20020aa7d6cc000000b0056ddcbd9362sm378247edr.51.2024.04.10.23.22.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Apr 2024 23:22:12 -0700 (PDT) Message-ID: <0503ff9b-afb7-43a5-b9eb-f6c9d9945638@suse.com> Date: Thu, 11 Apr 2024 09:22:10 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/7] x86/bugs: Cache the value of MSR_IA32_ARCH_CAPABILITIES To: Josh Poimboeuf , x86@kernel.org Cc: linux-kernel@vger.kernel.org, Linus Torvalds , Daniel Sneddon , Pawan Gupta , Thomas Gleixner , Alexandre Chartre , Konrad Rzeszutek Wilk , Peter Zijlstra , Greg Kroah-Hartman , Sean Christopherson , Andrew Cooper , Dave Hansen , KP Singh , Waiman Long , Borislav Petkov References: <9592a18a814368e75f8f4b9d74d3883aa4fd1eaf.1712813475.git.jpoimboe@kernel.org> From: Nikolay Borisov Content-Language: en-US In-Reply-To: <9592a18a814368e75f8f4b9d74d3883aa4fd1eaf.1712813475.git.jpoimboe@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 11.04.24 г. 8:40 ч., Josh Poimboeuf wrote: > There's no need to keep reading MSR_IA32_ARCH_CAPABILITIES over and > over. It's even read in the BHI sysfs function which is a big no-no. > Just read it once and cache it. > > Fixes: ec9404e40e8f ("x86/bhi: Add BHI mitigation knob") > Signed-off-by: Josh Poimboeuf Reviewed-by: Nikolay Borisov