[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120530171754.GA5115@phenom.dumpdata.com>
Date: Wed, 30 May 2012 13:17:54 -0400
From: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To: Jacob Shin <jacob.shin@....com>
Cc: Andre Przywara <andre.przywara@....com>, jeremy@...p.org,
xen-devel@...ts.xensource.com, linux-kernel@...r.kernel.org,
Jan Beulich <JBeulich@...e.com>, hpa@...or.com, mingo@...e.hu,
tglx@...utronix.de
Subject: Re: [Xen-devel] [PATCH] x86/amd: fix crash as Xen Dom0 on AMD
Trinity systems
> Yes, the following patch also fixed the crash for us:
>
> Implement rdmsr_regs and wrmsr_regs for Xen pvops.
That needs more data. Such as the reason for it, the crash
tombstone, and an analysis of the bug.
But at this point I am not sure what we are going to do.
I think Peter leans towards ripping the .rdmsr_regs/wdmsr_regs
function out altogether (so altering the amd_rdmsr... to use the
.rdmsr/.wrdmsr). At which point I think this would all work
just fine?
I am tempted to write a patch that checks all the pv-cpu-ops
to see if there are any that are NULL and throw a warning so
that this does not hit us in the future - to be at least more
proactive about this sort of thing.
>
> Signed-off-by: Jacob Shin <jacob.shin@....com>
> Cc: stable@...r.kernel.org # 3.4+
>
> diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
> index 75f33b2..f3ae5ec 100644
> --- a/arch/x86/xen/enlighten.c
> +++ b/arch/x86/xen/enlighten.c
> @@ -945,9 +945,12 @@ static void xen_write_cr4(unsigned long cr4)
> native_write_cr4(cr4);
> }
>
> -static int xen_write_msr_safe(unsigned int msr, unsigned low, unsigned high)
> +static int xen_wrmsr_safe_regs(u32 regs[8])
> {
> int ret;
> + unsigned int msr = regs[1];
> + unsigned low = regs[0];
> + unsigned high = regs[2];
>
> ret = 0;
>
> @@ -985,12 +988,23 @@ static int xen_write_msr_safe(unsigned int msr, unsigned low, unsigned high)
> break;
>
> default:
> - ret = native_write_msr_safe(msr, low, high);
> + ret = native_wrmsr_safe_regs(regs);
> }
>
> return ret;
> }
>
> +static int xen_write_msr_safe(unsigned int msr, unsigned low, unsigned high)
> +{
> + u32 regs[8] = { 0 };
> +
> + regs[0] = low;
> + regs[1] = msr;
> + regs[2] = high;
> +
> + return xen_wrmsr_safe_regs(regs);
> +}
> +
> void xen_setup_shared_info(void)
> {
> if (!xen_feature(XENFEAT_auto_translated_physmap)) {
> @@ -1116,7 +1130,9 @@ static const struct pv_cpu_ops xen_cpu_ops __initconst = {
> .wbinvd = native_wbinvd,
>
> .read_msr = native_read_msr_safe,
> + .rdmsr_regs = native_rdmsr_safe_regs,
> .write_msr = xen_write_msr_safe,
> + .wrmsr_regs = xen_wrmsr_safe_regs,
> .read_tsc = native_read_tsc,
> .read_pmc = native_read_pmc,
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@...ts.xen.org
> http://lists.xen.org/xen-devel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists