From: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
To: Dave Hansen <dave.hansen@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Pavel Machek <pavel@ucw.cz>,
Andrew Cooper <Andrew.Cooper3@citrix.com>,
degoede@redhat.com, linux-kernel@vger.kernel.org,
linux-pm@vger.kernel.org,
Daniel Sneddon <daniel.sneddon@linux.intel.com>,
antonio.gomez.iglesias@linux.intel.com
Subject: Re: [PATCH 3/3] x86/pm: Add enumeration check before spec MSRs save/restore setup
Date: Tue, 8 Nov 2022 14:09:31 -0800 [thread overview]
Message-ID: <20221108220931.3bavijj6adclj4sj@desk> (raw)
In-Reply-To: <98ec85df-cbf8-83b7-df79-12ff379eae9b@intel.com>
On Tue, Nov 08, 2022 at 10:40:06AM -0800, Dave Hansen wrote:
>On 9/12/22 16:41, Pawan Gupta wrote:
>> On an Intel Atom N2600 (and presumable other Cedar Trail models)
>> MSR_IA32_TSX_CTRL can be read, causing saved_msr.valid to be set for it
>> by msr_build_context().
>
>This changelog needs some help. Shouldn't it be something like this?
>
>pm_save_spec_msr() keeps a list of all the MSRs which _might_ need to be
>saved and restored at hibernate?? and resume??. However, it has zero
>awareness of CPU support for these MSRs. It mostly works by
>unconditionally attempting to manipulate these MSRs and relying on
>rdmsrl_safe() being able to handle a #GP on CPUs where the support is
>unavailable.
>
>However, it's possible for reads (RDMSR) to be supported for a given MSR
>while writes (WRMSR) are not. In this case, msr_build_context() sees a
>successful read (RDMSR) and marks the MSR as 'valid'. Then, later, a
>write (WRMSR) fails, producing a nasty (but harmless) error message.
>
>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.
Yes, that's a lot better. Thanks.
next prev parent reply other threads:[~2022-11-08 22:09 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-12 23:38 [PATCH 0/3] Check enumeration before MSR save/restore Pawan Gupta
2022-09-12 23:39 ` [PATCH 1/3] x86/tsx: Add feature bit for TSX control MSR support Pawan Gupta
2022-11-08 18:27 ` Dave Hansen
2022-11-08 22:06 ` Pawan Gupta
2022-09-12 23:40 ` [PATCH 2/3] x86/cpu/amd: Add feature bit for MSR_AMD64_LS_CFG enumeration Pawan Gupta
2022-11-08 18:54 ` Borislav Petkov
2022-11-08 22:51 ` Pawan Gupta
2022-11-08 23:10 ` Borislav Petkov
2022-11-09 0:45 ` Andrew Cooper
2022-11-09 17:37 ` Pawan Gupta
2022-11-09 18:34 ` Borislav Petkov
2022-11-09 21:41 ` Pawan Gupta
2022-11-10 0:00 ` Andrew Cooper
2022-11-10 6:09 ` Pawan Gupta
2022-11-09 2:18 ` Pawan Gupta
2022-09-12 23:41 ` [PATCH 3/3] x86/pm: Add enumeration check before spec MSRs save/restore setup Pawan Gupta
2022-11-08 18:40 ` Dave Hansen
2022-11-08 22:09 ` Pawan Gupta [this message]
2022-09-13 0:50 ` [PATCH 0/3] Check enumeration before MSR save/restore Pawan Gupta
2022-09-17 11:42 ` Hans de Goede
2022-09-19 16:56 ` Pawan Gupta
2022-11-08 18:16 ` Hans de Goede
2022-11-08 18:26 ` Borislav Petkov
2022-11-08 18:55 ` Borislav Petkov
2022-11-08 22:07 ` Pawan Gupta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221108220931.3bavijj6adclj4sj@desk \
--to=pawan.kumar.gupta@linux.intel.com \
--cc=Andrew.Cooper3@citrix.com \
--cc=antonio.gomez.iglesias@linux.intel.com \
--cc=bp@alien8.de \
--cc=daniel.sneddon@linux.intel.com \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=degoede@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pavel@ucw.cz \
--cc=rafael@kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.