xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: xen <xen@lists.fedoraproject.org>,
	Xen Devel <xen-devel@lists.xensource.com>,
	kvm list <kvm@vger.kernel.org>,
	Cole Robinson <crobinso@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Fedora-xen] rdmsr_safe in Linux PV (under Xen) gets an #GP:Re: Running fedora xen on top of KVM?
Date: Tue, 22 Sep 2015 14:23:53 -0400	[thread overview]
Message-ID: <20150922182353.GC32544@l.oracle.com> (raw)
In-Reply-To: <CALCETrUg2PzZ9gyQnvPF6mZdJJZ++dfAOxOEUs8_pdE8stfqrw@mail.gmail.com>

On Sun, Sep 20, 2015 at 09:49:04PM -0700, Andy Lutomirski wrote:
> 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.

(d31) mapping kernel into physical memory
(d31) about to get started...
(XEN) traps.c:3151: GPF (0000): ffff82d0801a31ed -> ffff82d08023c77b
(XEN) traps.c:459:d31v0 Unhandled general protection fault fault/trap [#13] on VCPU 0 [ec=0000]
(XEN) domain_crash_sync called from entry.S: fault at ffff82d080238213 create_bounce_frame+0x12b/0x13a
(XEN) Domain 31 (vcpu#0) crashed on cpu#35:
(XEN) ----[ Xen-4.5.0  x86_64  debug=n  Not tainted ]----
(XEN) CPU:    35
(XEN) RIP:    e033:[<ffffffff81041b64>]
(XEN) RFLAGS: 0000000000000246   EM: 1   CONTEXT: pv guest
(XEN) rax: 0000000000000000   rbx: ffffffff81c03e64   rcx: 0000000012345678
(XEN) rdx: ffffffff81c03de8   rsi: ffffffff81c03dec   rdi: 0000000012345278
(XEN) rbp: ffffffff81c03e48   rsp: ffffffff81c03dd0   r8:  7420676e69797274
(XEN) r9:  6873617263206f74   r10: 0000000000000000   r11: 0000000000000000
(XEN) r12: 0000000012345678   r13: ffffffff81c03f00   r14: 0000000000000000
(XEN) r15: 0000000000000000   cr0: 000000008005003b   cr4: 00000000001526f0
(XEN) cr3: 00000014e8c97000   cr2: 0000000000000000
(XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: e02b   cs: e033
(XEN) Guest stack trace from rsp=ffffffff81c03dd0:
(XEN)    0000000012345678 0000000000000000 0000000000000000 ffffffff81041b64
(XEN)    000000010000e030 0000000000010046 ffffffff81c03e18 000000000000e02b
(XEN)    ffffffff81041b5d ffffffff81c03e48 0000000000811809 0000000000000000
(XEN)    00000000000001a0 0000000001000000 ffffffff82009000 ffffffff81c03e68
(XEN)    ffffffff81d211ea 0000000000000000 0000000000000000 ffffffff81c03ed8
(XEN)    ffffffff81d1be59 ffffffff81c03ed8 ffffffff811892ab 0000000000000010
(XEN)    ffffffff81c03ee8 ffffffff81c03ea8 697a696c61697469 ffffffff81f15442
(XEN)    ffffffffffffffff ffffffff81db3900 0000000000000000 0000000000000000
(XEN)    0000000000000000 ffffffff81c03f28 ffffffff81d10f0a 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 ffffffff81c03f38
(XEN)    ffffffff81d10603 ffffffff81c03ff8 ffffffff81d15f5c 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 ffd83a031f898b75 0000000022400800 0000000000000001
(XEN)    0000000000000000 0000000000000000 00010102464c457f 0000000000000000
(XEN)    00000001003e0003 0000000000000940 0000000000000040 00000000000012a0
(XEN)    0038004000000000 0011001200400004 0000000500000001 0000000000000000
[root@ovs107 ~]# 

(gdb) x/20i 0xffffffff81041b64
   0xffffffff81041b64:  rdmsr  

> 
> --Andy
--
xen mailing list
xen@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/xen

  reply	other threads:[~2015-09-22 18:23 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
2015-09-22 18:23                         ` Konrad Rzeszutek Wilk [this message]
2015-09-22 18:32                           ` 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=20150922182353.GC32544@l.oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=bp@alien8.de \
    --cc=crobinso@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=luto@amacapital.net \
    --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).