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

[Xen-devel] [PATCH RFC] x86/AMD: write PAT after ucode update

The increased number of messages (spec_ctrl.c:print_details()) within a
certain time window made me notice some slowness of boot time screen
output. Experimentally I've narrowed the time window to be from
immediately after the early ucode update on the BSP to the PAT write in
cpu_init(). For that reason, as a workaround, write PAT with its
designated value immediately after the ucode load.

Similar slowness cannot be observed on APs.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
RFC: Preferably to be confirmed by AMD.
Will need re-basing on top of Andrew's patch eliminating host_pat, if
that goes in earlier.

--- a/xen/arch/x86/microcode_amd.c
+++ b/xen/arch/x86/microcode_amd.c
@@ -226,6 +226,13 @@ static int apply_microcode(unsigned int
         return -EIO;
+    /*
+     * Experimentally this helps with performance issues on at least certain
+     * Fam15 models. Oddly enough only the BSP is affected, but to be on the
+     * safe side, do the write uniformly.
+     */
+    wrmsrl(MSR_IA32_CR_PAT, host_pat);
     printk(KERN_WARNING "microcode: CPU%d updated from revision %#x to %#x\n",
            cpu, uci->cpu_sig.rev, hdr->patch_id);

Xen-devel mailing list



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