All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Schopp <joel.schopp@amd.com>
To: "Luck, Tony" <tony.luck@intel.com>,
	"jesse.larrew@amd.com" <jesse.larrew@amd.com>,
	"x86@kernel.org" <x86@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mce: use safe MSR accesses
Date: Thu, 12 Mar 2015 12:20:07 -0500	[thread overview]
Message-ID: <5501CAC7.6090306@amd.com> (raw)
In-Reply-To: <3908561D78D1C84285E8C5FCA982C28F32A0E42D@ORSMSX113.amr.corp.intel.com>



On 03/11/2015 05:47 PM, Luck, Tony wrote:
>> When running as a guest under kvm, it's possible that the MSR
>> being accessed may not be implemented. All MSR accesses should
>> be prepared to handle exceptions.
> Isn't that a KVM bug?  The code here first checks family/model before accessing the MSR:
>
>                  if (c->x86 == 0x15 &&
>                      (c->x86_model >= 0x10 && c->x86_model <= 0x1f)) {
>
> If kvm tells the guest that it is running on one of these models, shouldn't it provide
> complete coverage for that model?
These MSRs don't make sense in guest mode.  The real question is if we
fix that in KVM, here, or both.  I'm a fan of fixing it in both places. 
Xen's behavior is to return a value of 0 if the guest tries to access
these, that seems like a reasonable thing to do in KVM as well.  I am
volunteering myself to write that patch for KVM, but I would encourage
accepting an updated version of this patch as well.
>
> If that isn't possible - then you should still do more than just s/rdmsrl/rdmsrl_safe/ ... like
> check the return value to see whether you got an exception .. and thus should skip past
> code that uses the "val" that you thought you read from the non-existent MSR.
Initializing val to 0 where it is declared should have the desired effect.

  reply	other threads:[~2015-03-12 17:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-11 22:09 [PATCH] mce: use safe MSR accesses jesse.larrew
2015-03-11 22:47 ` Luck, Tony
2015-03-12 17:20   ` Joel Schopp [this message]
2015-03-12 17:30     ` Borislav Petkov

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=5501CAC7.6090306@amd.com \
    --to=joel.schopp@amd.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=jesse.larrew@amd.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --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.