[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] rdmsr_safe in Linux PV (under Xen) gets an #GP:Re: [Fedora-xen] Running fedora xen on top of KVM?



On Fri, Sep 18, 2015 at 12:04 PM, Borislav Petkov <bp@xxxxxxxxx> 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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.