Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44296C636D4 for ; Tue, 14 Feb 2023 00:45:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229873AbjBNApW (ORCPT ); Mon, 13 Feb 2023 19:45:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229729AbjBNApS (ORCPT ); Mon, 13 Feb 2023 19:45:18 -0500 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27E1FD527 for ; Mon, 13 Feb 2023 16:45:17 -0800 (PST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 05AAD5C01B4; Mon, 13 Feb 2023 19:45:14 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 13 Feb 2023 19:45:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1676335514; x=1676421914; bh=hI 9/H5GdSVgaQFUGitMAPNmojGQjNuRA1r4Ss6CnjlY=; b=n1vq18dJqgqJTYGbxY WgRtHS9sccoeaUI1uLKCXEkrnti7H4huyQBS/xugygLZFy7syCNdJayGR+5yc4by QEBdx7PlLd5G9jZwgRhMTMsBZJp9LCRZSNAL5vJXG/S0S6xSkQ7MARcBuNyRRzy3 /txHRSXCzYULiA8sDwGYklVs2wczsT356CplzPhLkg3vAwvCWASSINUycHZTxxS+ myjJEf/OoBr+Y0nj/v6NhFpRh7gAFOmAANTQ+erxRwsgPtqg7bFXzKc/IsCoKwBA 0z4Qu3ls1IHHJWeiT+cac2opU2yqY7pFTTLO1rMQ9ZeVyH3tSaiSc5EfinFbTX+m cVUA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1676335514; x=1676421914; bh=hI9/H5GdSVgaQFUGitMAPNmojGQj NuRA1r4Ss6CnjlY=; b=aXPFmS6ZYVWVosJ7oF/HNlr3MNdDBVtBqYf3FLecg+BN c7cK9xw9ucZXLIZWbh59Qj0l2yh3D2XL7P+gJT4Dn8d9C5fRS2HvQGkgdl1x5Hpd KtOza695tprwg7Ph2pgX1wBIgvHkATKexaOe1hs1aLAcu+Qizw3tirHmyPDftsto ho99T+NwcrZtV9ld7+ZqBYEU72RQuEiZBi2vppq+SvDWZWTm9nqc8W9A4ynp53FZ h1qJi4wvMAGx5R2z48fsukPBt/OkuhOUTlL3Dx3wiaVT9Mek73ymv4WaFY+9/giU MakwqWCt7jl8cdbUKul3m8ugmGiToAPb65ef3YOe/Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudeivddgvdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdttddttddtvdenucfhrhhomhepfdfmihhr ihhllhcutedrucfuhhhuthgvmhhovhdfuceokhhirhhilhhlsehshhhuthgvmhhovhdrnh grmhgvqeenucggtffrrghtthgvrhhnpefhieeghfdtfeehtdeftdehgfehuddtvdeuheet tddtheejueekjeegueeivdektdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehkihhrihhllhesshhhuhhtvghmohhvrdhnrghmvg X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 13 Feb 2023 19:45:12 -0500 (EST) Received: by box.shutemov.name (Postfix, from userid 1000) id 11B2D10BD99; Tue, 14 Feb 2023 03:45:10 +0300 (+03) Date: Tue, 14 Feb 2023 03:45:10 +0300 From: "Kirill A. Shutemov" To: Juergen Gross Cc: Borislav Petkov , linux-kernel@vger.kernel.org, x86@kernel.org, lists@nerdbynature.de, mikelley@microsoft.com, torvalds@linux-foundation.org, Thomas Gleixner , Ingo Molnar , Dave Hansen , "H. Peter Anvin" Subject: Re: [PATCH v2 2/8] x86/mtrr: support setting MTRR state for software defined MTRRs Message-ID: <20230214004510.4qfcsxjy3sqbzl5z@box.shutemov.name> References: <20230209072220.6836-1-jgross@suse.com> <20230209072220.6836-3-jgross@suse.com> <6257114d-a957-f586-145c-d2a885417360@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6257114d-a957-f586-145c-d2a885417360@suse.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 13, 2023 at 03:07:07PM +0100, Juergen Gross wrote: > > So this here needs to check: > > > > if (!cpu_feature_enabled(X86_FEATURE_HYPERVISOR) && > > !(cpu_feature_enabled(X86_FEATURE_SEV_SNP) || > > cpu_feature_enabled(X86_FEATURE_XENPV))) { > > WARN_ON_ONCE(1); > > return; > > } > > > > as we don't want this to be called somewhere or by something else. > > Wouldn't !cpu_feature_enabled(X86_FEATURE_HYPERVISOR) be enough? > > I'm not sure we won't need that for TDX guests, too. TDX guests are covered by X86_FEATURE_HYPERVISOR. -- Kiryl Shutsemau / Kirill A. Shutemov