Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1017613rwb; Fri, 18 Nov 2022 11:23:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf5srnabToeOmjP4G0T5zN8aeBDGsnJ5BLsOcBDhcDloCTWtswpXQhL/a7Zn+XA4mBBRczHN X-Received: by 2002:a17:903:44b:b0:188:fc3a:3f9e with SMTP id iw11-20020a170903044b00b00188fc3a3f9emr832200plb.158.1668799436079; Fri, 18 Nov 2022 11:23:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668799436; cv=none; d=google.com; s=arc-20160816; b=BO9Amvof9kNpYCjkmXSBtYnXJkNJPjdnBFiMv+AmXBn1vr3h2rJ6VB1wVPAfvngPVZ +I2iauj0LdiFThFDG8qxIvNP8gpvsMQzgIjXmTmfSnBgXfYT0NdKmarnATZeRnkDFZ13 sQgp3zw/ASj548RJ0sV0FECUJ0I/JkPDPVsH9Qogg15saf0FKTFFhnE5a6uQDbGzuFOx 1iIuriV15vzhBiZeQznZkXf+ELk3M/FiE+EyLvdQo52B8G0lGfYkOVTRMKfM1tNsyxB+ moO48Kx6DQI6u0Bf08H1s+aa24Zb8/ZRvjFE+i2XU297wkjyXGys6KLGXR0+YLyXN6oy lD+g== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=m9QUiZzVSfqYL8YH8Tz8z63OcU/Acnk0NHzgnzi7H78=; b=mf7yUPW88mrDxlPjDJUyOaTxT+hhR7FjDbz4hwWq+OLnpqljfKIBJTil5Xt1T5XikD jS+TtxKKLV5ecPeeu4QD0XXb+tFBw8N1YXuHj96Vbj9HGSu8R23DWOt9zzUoIbzKOCq0 WmZcbtG7REb9aQR2PAxpXDwCfWzjRM3yMabSDRPGHR6KLynotXRngXbruwpbqlmEZ4n0 PQ7cL7RwRFIFJO+Ej3wnLvsXFZdyDLRLBxn0viK+hGGEAgXHcOE8zjywfG5N7cm89Rpd M1cEj6N02D35yxA9VBoPoALnPPfyBL1whfeJwlgpzXlOQmNCufZxvcZ0O7MprahsufB+ ahEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Gf5GJ0D7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l14-20020a170902f68e00b0017d8a86e524si5360250plg.506.2022.11.18.11.23.44; Fri, 18 Nov 2022 11:23:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Gf5GJ0D7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242815AbiKRS3o (ORCPT + 91 others); Fri, 18 Nov 2022 13:29:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242772AbiKRS3R (ORCPT ); Fri, 18 Nov 2022 13:29:17 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4879976EF; Fri, 18 Nov 2022 10:27:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668796075; x=1700332075; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=mqjewkRpUIDxGJT0uKLmbhczG2Cqq27+ixwZGMtIhdE=; b=Gf5GJ0D7NS5WqrS89mlV82ZTta2DMF22TE1aiIVwS0R4MQNoLOKUd9NX wnQcxC+tdAfP+mnhaul9QbpRqxcbVsPiaVh57Hc+IjOa7EP2qxJDvJdAH 6CIE6QZlcfcItAFxatlk/qdkTB1EVBIGsbJ4ouNfxSasykaccx7qElAwk QpkexkXUPmybPn2a4KsVHnHA2m9fHLJhR/Zu7uvdfaM9LhFuVCxLc8Mwn eFxjmwJ6h81yd9YDUxcGNhIFJKPQH+QvwirqYx3TAVGVEH46+60uq4f23 UoBsP7rY7R9EplJluKHTpXu4AeSdG+n+ITA5YauMB/gIBNtiZaRqE/w0I g==; X-IronPort-AV: E=McAfee;i="6500,9779,10535"; a="315022109" X-IronPort-AV: E=Sophos;i="5.96,175,1665471600"; d="scan'208";a="315022109" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2022 10:27:55 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10535"; a="703834773" X-IronPort-AV: E=Sophos;i="5.96,175,1665471600"; d="scan'208";a="703834773" Received: from bfan1-mobl1.amr.corp.intel.com (HELO desk) ([10.209.78.213]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2022 10:27:54 -0800 Date: Fri, 18 Nov 2022 10:27:52 -0800 From: Pawan Gupta To: Dave Hansen Cc: Andrew Cooper , thomas.lendacky@amd.com, "H. Peter Anvin" , hdegoede@redhat.com, Ingo Molnar , "Rafael J. Wysocki" , Thomas Gleixner , x86@kernel.org, Pavel Machek , Dave Hansen , David.Kaplan@amd.com, Borislav Petkov , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Daniel Sneddon , antonio.gomez.iglesias@linux.intel.com Subject: Re: [PATCH v3 2/2] x86/pm: Add enumeration check before spec MSRs save/restore setup Message-ID: <20221118182752.7ovqckwwle3azzrc@desk> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 18, 2022 at 10:12:32AM -0800, Dave Hansen wrote: >On 11/15/22 11:17, Pawan Gupta wrote: >> To fix this, add the corresponding X86_FEATURE bit for each MSR. Avoid >> trying to manipulate the MSR when the feature bit is clear. This >> required adding a X86_FEATURE bit for MSRs that do not have one already, >> but it's a small price to pay. >> >> Fixes: 73924ec4d560 ("x86/pm: Save the MSR validity status at context setup") >> Reported-by: Hans de Goede >> Signed-off-by: Pawan Gupta >> Cc: stable@kernel.org > >Thanks for fixing this up. The X86_FEATURE approach is a good one. The >"poking at random MSRs" always seemed a bit wonky. > >Reviewed-by: Dave Hansen Thanks.