From: Andy Lutomirski <luto@amacapital.net>
To: Borislav Petkov <bp@alien8.de>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Cole Robinson <crobinso@redhat.com>,
	Xen Devel <xen-devel@lists.xensource.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	kvm list <kvm@vger.kernel.org>,
	M A Young <m.a.young@durham.ac.uk>,
	xen <xen@lists.fedoraproject.org>
Subject: Re: rdmsr_safe in Linux PV (under Xen) gets an #GP:Re: [Fedora-xen] Running fedora xen on top of KVM?
Date: Sun, 20 Sep 2015 21:49:04 -0700	[thread overview]
Message-ID: <CALCETrUg2PzZ9gyQnvPF6mZdJJZ++dfAOxOEUs8_pdE8stfqrw@mail.gmail.com> (raw)
In-Reply-To: <20150918190447.GA26823@nazgul.tnic>
On Fri, Sep 18, 2015 at 12:04 PM, Borislav Petkov <bp@alien8.de> wrote:
> On Fri, Sep 18, 2015 at 08:20:46AM -0700, Andy Lutomirski wrote:
>> In any event, Borislav, you must have typed rdmsr_safe for a reason :)
>
> Wasn't me:
>
> 6c62aa4a3c12 ("x86: make amd.c have 64bit support code")
>
> I think the error handling of rdmsrl_safe() was needed to do the pfn
> games which are done in the if-clause.
I just tried it.  rdmsrl_safe and friends definitely work fine in that
code.  I think that Linux's Xen startup code is buggy and fails to set
up early exception handling.
Try this (horribly whitespace damaged):
 static void __init early_identify_cpu(struct cpuinfo_x86 *c)
 {
+       u64 tmp;
 #ifdef CONFIG_X86_64
        c->x86_clflush_size = 64;
        c->x86_phys_bits = 36;
@@ -752,6 +753,9 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
        c->cpu_index = 0;
        filter_cpuid_features(c, false);
+       pr_err("trying to crash\n");
+       rdmsrl_safe(0x12345678, &tmp);
+
It works fine.  I bet it crashes on a Xen guest, though.  I assume
that Xen just works in most cases by luck.
--Andy
next prev parent reply	other threads:[~2015-09-21  4:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <55F87984.7030903@redhat.com>
     [not found] ` <alpine.DEB.2.00.1509152223140.16001@procyon.dur.ac.uk>
     [not found]   ` <55F9C792.8070205@redhat.com>
     [not found]     ` <alpine.DEB.2.00.1509162056260.3899@procyon.dur.ac.uk>
     [not found]       ` <55F9D95F.9040401@redhat.com>
     [not found]         ` <20150916210814.GA4643@l.oracle.com>
     [not found]           ` <55F9EF87.7030407@redhat.com>
2015-09-17 20:10             ` [Fedora-xen] rdmsr_safe in Linux PV (under Xen) gets an #GP:Re: Running fedora xen on top of KVM? Konrad Rzeszutek Wilk
2015-09-17 20:23               ` rdmsr_safe in Linux PV (under Xen) gets an #GP:Re: [Fedora-xen] " Andy Lutomirski
2015-09-17 21:29                 ` Andrew Cooper
2015-09-18 13:54                 ` Borislav Petkov
2015-09-18 15:20                   ` Andy Lutomirski
2015-09-18 19:04                     ` Borislav Petkov
2015-09-18 19:15                       ` Cole Robinson
2015-09-21  4:49                       ` Andy Lutomirski [this message]
2015-09-22 18:23                         ` [Fedora-xen] rdmsr_safe in Linux PV (under Xen) gets an #GP:Re: " Konrad Rzeszutek Wilk
2015-09-22 18:32                           ` rdmsr_safe in Linux PV (under Xen) gets an #GP:Re: [Fedora-xen] " Andy Lutomirski
2015-09-18 15:27                   ` Paolo Bonzini
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=CALCETrUg2PzZ9gyQnvPF6mZdJJZ++dfAOxOEUs8_pdE8stfqrw@mail.gmail.com \
    --to=luto@amacapital.net \
    --cc=bp@alien8.de \
    --cc=crobinso@redhat.com \
    --cc=konrad.wilk@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=m.a.young@durham.ac.uk \
    --cc=pbonzini@redhat.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=xen@lists.fedoraproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).