From: Kurt Garloff Subject: [PATCH] Support newer microcode Date: Mon, 15 Jan 2007 10:54:44 +0100 Message-ID: <20070115095444.GB6464@tpkurt.garloff.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2118903873==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Xen development list Cc: Clyde Griffin , Shaohua Li , Jan Beulich List-Id: xen-devel@lists.xenproject.org --===============2118903873== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qtZFehHsKgwS5rPz" Content-Disposition: inline --qtZFehHsKgwS5rPz Content-Type: multipart/mixed; boundary="St7VIuEGZ6dlpu13" Content-Disposition: inline --St7VIuEGZ6dlpu13 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, intel docs say that default microcode size is 2000+48 bytes;=20 however shorter sizes are legal. Actually, with microcode_ctl-1.15, such shorter u-codes are actually out there in the wild. The Linux kernel rejected this until 2.6.19rc; Xen still does. Here's the port to Xen. Best, --=20 Kurt Garloff, Head Architect and acting VP SUSE R&D, Novell Inc. --St7VIuEGZ6dlpu13 Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="microcode-xen-13079.diff" Content-Transfer-Encoding: quoted-printable # HG changeset patch # User Kurt Garloff # Node ID b1752c878a7845d812c9b15e721f401d786394b2 # Parent 469478194aef6e987f9281efbc0756749be6eb80 Microcode does not need to have the default size of 2000+48 bytes. A corresponding patch has gone into Linux 2.6.19; this is the port to Xen. Signed-off-by: Kurt Garloff Reference: Patch to linux kernel from Sep 27 2006 > # User Shaohua Li > # Node ID 45898b908138b5d93c2cc7353f061ce54af145dc > # Parent f962eab7b82c9bf1a6da69571046e764f5128395 > [PATCH] x86 microcode: don't check the size >=20 > IA32 manual says if micorcode update's size is 0, then the size is > default size (2048 bytes). But this doesn't suggest all microcode > update's size should be above 2048 bytes to me. We actually had a > microcode update whose size is 1024 bytes. The patch just removed the > check. >=20 > Signed-off-by: Shaohua Li > Cc: Tigran Aivazian > Signed-off-by: Andrew Morton > Signed-off-by: Linus Torvalds >=20 > committer: Linus Torvalds 1159370778 -0700 diff -r 469478194aef -r b1752c878a78 xen/arch/x86/microcode.c --- a/xen/arch/x86/microcode.c Mon Dec 18 00:14:40 2006 +0000 +++ b/xen/arch/x86/microcode.c Sun Dec 24 17:06:23 2006 +0100 @@ -249,14 +249,14 @@ static int find_matching_ucodes (void) } =20 total_size =3D get_totalsize(&mc_header); - if ((cursor + total_size > user_buffer_size) || (total_size < DEFAULT_UC= ODE_TOTALSIZE)) { + if (cursor + total_size > user_buffer_size) { printk(KERN_ERR "microcode: error! Bad data in microcode data file\n"); error =3D -EINVAL; goto out; } =20 data_size =3D get_datasize(&mc_header); - if ((data_size + MC_HEADER_SIZE > total_size) || (data_size < DEFAULT_UC= ODE_DATASIZE)) { + if (data_size + MC_HEADER_SIZE > total_size) { printk(KERN_ERR "microcode: error! Bad data in microcode data file\n"); error =3D -EINVAL; goto out; @@ -459,11 +459,6 @@ int microcode_update(XEN_GUEST_HANDLE(vo { int ret; =20 - if (len < DEFAULT_UCODE_TOTALSIZE) { - printk(KERN_ERR "microcode: not enough data\n"); - return -EINVAL; - } - if (len !=3D (typeof(user_buffer_size))len) { printk(KERN_ERR "microcode: too much data\n"); return -E2BIG; --St7VIuEGZ6dlpu13 Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="microcode-xen-linux.diff" Content-Transfer-Encoding: quoted-printable =46rom: Kurt Garloff Subject: The microcode may be smaller than the default size. Patch-mainline: Never (but patch to non-xen microcode in 2.6.19rc) This is the needed piece to the dom0 xen kernel to allow microcode updates of non default size (2000+48 bytes); a patch is needed to the Xen hypervisor itself as well. Signed-off-by: Kurt Garloff This corresponds to a patch to the microcode driver in 2.6.19rc =66rom Sep 27 2006: > # User Shaohua Li > # Node ID 45898b908138b5d93c2cc7353f061ce54af145dc > # Parent f962eab7b82c9bf1a6da69571046e764f5128395 > [PATCH] x86 microcode: don't check the size >=20 > IA32 manual says if micorcode update's size is 0, then the size is > default size (2048 bytes). But this doesn't suggest all microcode > update's size should be above 2048 bytes to me. We actually had a > microcode update whose size is 1024 bytes. The patch just removed the > check. >=20 > Signed-off-by: Shaohua Li > Cc: Tigran Aivazian > Signed-off-by: Andrew Morton > Signed-off-by: Linus Torvalds >=20 > committer: Linus Torvalds 1159370778 -0700 --- linux-2.6.16-SLES10_GA_BRANCH/arch/i386/kernel/microcode-xen.c.orig 200= 6-09-25 22:04:41.000000000 +0200 +++ linux-2.6.16-SLES10_GA_BRANCH/arch/i386/kernel/microcode-xen.c 2006-12-= 24 17:08:37.000000000 +0100 @@ -85,7 +85,7 @@ { ssize_t ret; =20 - if (len < DEFAULT_UCODE_TOTALSIZE) { + if (len < MC_HEADER_SIZE) { printk(KERN_ERR "microcode: not enough data\n");=20 return -EINVAL; } --St7VIuEGZ6dlpu13-- --qtZFehHsKgwS5rPz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQFFq09kxmLh6hyYd04RAiu0AJ9nBx1BhZloROcjZFO7XfyIMu4thQCfSTyM YNb9KDIBCSpW0cL8ofxsOmI= =nL6J -----END PGP SIGNATURE----- --qtZFehHsKgwS5rPz-- --===============2118903873== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============2118903873==--