debuggers.hg

changeset 20959:5b895c3f4386

Dump machine check context for fatal machine check

This small patches enable Xen hypervisor to always dump machine check
ontext, previously it will not print anything if fatal MCE happens. It
also add checking for NULL pointer.

It also change the address passing to guest to always use guest
mfn. It should benifit non-translated guest.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Feb 08 10:18:51 2010 +0000 (2010-02-08)
parents 391cb20b6ea9
children 6dd69b92d131
files xen/arch/x86/cpu/mcheck/mce_intel.c
line diff
     1.1 --- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Mon Feb 08 10:18:14 2010 +0000
     1.2 +++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Mon Feb 08 10:18:51 2010 +0000
     1.3 @@ -370,7 +370,7 @@ static void intel_UCR_handler(struct mci
     1.4                            }
     1.5  
     1.6                            gfn =
     1.7 -                              mfn_to_gmfn(d, ((bank->mc_addr) >> PAGE_SHIFT));
     1.8 +                              get_gpfn_from_mfn((bank->mc_addr) >> PAGE_SHIFT);
     1.9                            bank->mc_addr =  gfn << PAGE_SHIFT |
    1.10                                          (bank->mc_addr & (PAGE_SIZE -1 ));
    1.11                            if (fill_vmsr_data(bank, global->mc_gstatus) == -1)
    1.12 @@ -663,6 +663,10 @@ static void intel_machine_check(struct c
    1.13      mctc = mcheck_mca_logout(MCA_MCE_SCAN, mca_allbanks, &bs, &clear_bank);
    1.14  
    1.15      if (bs.errcnt) {
    1.16 +        /* dump MCE error */
    1.17 +        if (mctc != NULL)
    1.18 +            x86_mcinfo_dump(mctelem_dataptr(mctc));
    1.19 +
    1.20          /*
    1.21           * Uncorrected errors must be dealth with in softirq context.
    1.22           */
    1.23 @@ -690,9 +694,6 @@ static void intel_machine_check(struct c
    1.24          mce_printk(MCE_CRITICAL, "MCE: clear_bank map %lx on CPU%d\n",
    1.25                  *((unsigned long*)clear_bank), smp_processor_id());
    1.26          mcheck_mca_clearbanks(clear_bank);
    1.27 -       /* Print MCE error */
    1.28 -        x86_mcinfo_dump(mctelem_dataptr(mctc));
    1.29 -
    1.30      } else {
    1.31          if (mctc != NULL)
    1.32              mctelem_dismiss(mctc);