xen/23153-x86-amd-clear-DramModEn.patch
Charles Arnold 4c73609012 - Upstream patches from Jan
22998-x86-get_page_from_l1e-retcode.patch
  22999-x86-mod_l1_entry-retcode.patch
  23000-x86-mod_l2_entry-retcode.patch
  23096-x86-hpet-no-cpumask_lock.patch
  23099-x86-rwlock-scalability.patch
  23103-x86-pirq-guest-eoi-check.patch
  23127-vtd-bios-settings.patch
  23153-x86-amd-clear-DramModEn.patch
  23154-x86-amd-iorr-no-rdwr.patch
  23199-amd-iommu-unmapped-intr-fault.patch
  23200-amd-iommu-intremap-sync.patch
  23228-x86-conditional-write_tsc.patch

- update xenalyze to revision 98
  * Unify setting of vcpu data type
  * Unify record size checks
  * Fix cr3_switch not to access hvm struct before it's initialized
- add xenalyze.gcc46.patch to fix unused-but-set-variable errors

- bnc#688473 - VUL-0: potential buffer overflow in tools
  cve-2011-1583-4.0.patch

- hotplug.losetup.patch
  correct dev:inode detection and use variable expansion

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=115
2011-05-03 17:51:18 +00:00

58 lines
1.6 KiB
Diff

# HG changeset patch
# User Wei Huang <wei.huang2@amd.com>
# Date 1302076891 -3600
# Node ID 8fb61c9ebe499b576687907d164da07802414925
# Parent 97763efc41f9b664cf6f7db653c9c3f51e50b358
x86, amd, MTRR: correct DramModEn bit of SYS_CFG MSR
Some buggy BIOS might set SYS_CFG DramModEn bit to 1, which can cause
unexpected behavior on AMD platforms. This patch clears DramModEn bit
if it is 1.
Signed-off-by: Wei Huang <wei.huang2@amd.com>
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -318,6 +318,32 @@ static void check_disable_c1e(unsigned i
on_each_cpu(disable_c1e, NULL, 1);
}
+/*
+ * BIOS is expected to clear MtrrFixDramModEn bit. According to AMD BKDG :
+ * "The MtrrFixDramModEn bit should be set to 1 during BIOS initalization of
+ * the fixed MTRRs, then cleared to 0 for operation."
+ */
+static void check_syscfg_dram_mod_en(void)
+{
+ uint64_t syscfg;
+ static bool_t printed = 0;
+
+ if (!((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) &&
+ (boot_cpu_data.x86 >= 0x0f)))
+ return;
+
+ rdmsrl(MSR_K8_SYSCFG, syscfg);
+ if (!(syscfg & K8_MTRRFIXRANGE_DRAM_MODIFY))
+ return;
+
+ if (!test_and_set_bool(printed))
+ printk(KERN_ERR "MTRR: SYSCFG[MtrrFixDramModEn] not "
+ "cleared by BIOS, clearing this bit\n");
+
+ syscfg &= ~K8_MTRRFIXRANGE_DRAM_MODIFY;
+ wrmsrl(MSR_K8_SYSCFG, syscfg);
+}
+
static void __devinit init_amd(struct cpuinfo_x86 *c)
{
u32 l, h;
@@ -587,6 +613,8 @@ static void __devinit init_amd(struct cp
disable_c1_ramping();
set_cpuidmask(c);
+
+ check_syscfg_dram_mod_en();
}
static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 * c, unsigned int size)