<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>154634</bug_id>
          
          <creation_ts>2006-11-09 21:35 0000</creation_ts>
          <short_desc>sys-apps/microcode-ctl-1.15: &quot;Bad data in microcode data file&quot;</short_desc>
          <delta_ts>2006-11-20 08:55:33 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Core system</component>
          <version>2006.1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          <bug_file_loc>http://www2.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=bd8e39f9e4c0960541c8c69e1f7cb321574d7c90</bug_file_loc>
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>birder@ozemail.com.au</reporter>
          <assigned_to>dsd@gentoo.org</assigned_to>
          <cc>casta@xwing.info</cc>
    
    <cc>help@imtrappedininter.net</cc>
    
    <cc>iyosifov@gmail.com</cc>
    
    <cc>kernel@gentoo.org</cc>
    
    <cc>zeekec@mad.scientist.com</cc>

      

      
          <long_desc isprivate="0">
            <who>birder@ozemail.com.au</who>
            <bug_when>2006-11-09 21:35:04 0000</bug_when>
            <thetext>After upgrading to microcode-ctl-1.15, the microcode update fails with the following error; 1.14 was not affected:

# /etc/init.d/microcode_ctl start
 * Updating microcode ...
/usr/sbin/microcode_ctl: error writing to &apos;/dev/cpu/microcode&apos; errno=22 (Invalid argument)
/usr/sbin/microcode_ctl: there may be messages from the driver in your system log.
 * Failed to update microcode via &apos;/dev/cpu/microcode&apos;                    [ !! ]


# tail /var/log/messages
Nov 10 16:23:30 oxygen microcode: error! Bad data in microcode data file
Nov 10 16:23:30 oxygen microcode: Error in the microcode data
Nov 10 16:23:30 oxygen rc-scripts: Failed to update microcode via &apos;/dev/cpu/microcode&apos;


# emerge --info
Portage 2.1.2_rc1-r5 (default-linux/x86/2006.1/desktop, gcc-4.1.1, glibc-2.5-r0, 2.6.18-gentoo-r2 i686)
=================================================================
System uname: 2.6.18-gentoo-r2 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz
Gentoo Base System version 1.12.6
Last Sync: Fri, 10 Nov 2006 02:50:01 +0000
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     2.4.4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r1
ACCEPT_KEYWORDS=&quot;x86 ~x86&quot;
AUTOCLEAN=&quot;yes&quot;
CBUILD=&quot;i686-pc-linux-gnu&quot;
CFLAGS=&quot;-march=pentium4 -mtune=pentium4 -O2 -pipe -msse -mfpmath=sse -msse2 -fomit-frame-pointer&quot;
CHOST=&quot;i686-pc-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config&quot;
CONFIG_PROTECT_MASK=&quot;/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo&quot;
CXXFLAGS=&quot;-march=pentium4 -mtune=pentium4 -O2 -pipe -msse -mfpmath=sse -msse2 -fomit-frame-pointer&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;autoconfig distlocks metadata-transfer sandbox sfperms strict&quot;
GENTOO_MIRRORS=&quot;http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo&quot;
MAKEOPTS=&quot;-j2&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_RSYNC_OPTS=&quot;--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
SYNC=&quot;rsync://rsync.au.gentoo.org/gentoo-portage&quot;
USE=&quot;x86 X a52 aac alsa arts asf berkdb bitmap-fonts bzlib cairo cdparanoia cdr chroot cli cracklib crypt cups dbus dlloader dri dts dv dvd dvdr dvdread eds elibc_glibc emboss encode expat fam fbcon ffmpeg firefox flac foomaticdb fortran gdbm gif gimpprint glitz glut gpgme gpm gstreamer gtk hal i8x0 iconv imap imlib input_devices_keyboard input_devices_mouse ipv6 isdnlog java jpeg jpeg2k kde kernel_linux kqemu lcms libg++ lm_sensors lzo mad mikmod mjpeg mmap mmx mng mp3 mpeg mpeg4 musepack ncurses nls nptl nptlonly nsplugin ogg opengl pam pcre pdf perl png ppds pppd python qt3 qt4 quicktime readline reflection sdl session smp sndfile speex spell spl sse sse2 ssl svg symlink tcpd theora threads tiff truetype truetype-fonts type1-fonts udev unicode userland_GNU userlocales vcd video_cards_i810 vidix vorbis vorbis-psy win32codecs wmf x264 xml xorg xprint xscreensaver xv xvid yvl12 zlib&quot;
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>casta@xwing.info</who>
            <bug_when>2006-11-10 01:04:20 0000</bug_when>
            <thetext>I confirm this problem on 3 differents machines.

Reverting to 1.14 or using the http://urbanmyth.org/microcode/ucode/intel-ia32microcode-10May2006.txt.bz2 microcode.dat file solved the problem.

http://urbanmyth.org/microcode/ucode/intel-ia32microcode-07Sep2006.txt.bz2 included in 1.15 seems to be buggy...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>birder@ozemail.com.au</who>
            <bug_when>2006-11-10 01:25:00 0000</bug_when>
            <thetext>I found this kernel patch is supposed to fix the problem:
  http://linux.bkbits.net:8080/linux-2.6/gnupatch@451a9864jKk9Jk5CliEBE9pB86swnw
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>robbat2@gentoo.org</who>
            <bug_when>2006-11-10 01:36:21 0000</bug_when>
            <thetext>It works here on a newer kernel 2.6.19-rc4.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2006-11-11 00:26:31 0000</bug_when>
            <thetext>not a bug in userspace</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>casta@xwing.info</who>
            <bug_when>2006-11-11 01:17:52 0000</bug_when>
            <thetext>(In reply to comment #4)
&gt; not a bug in userspace
&gt; 

Sorry, but if this version need a 2.6.19_rc kernel version, there is a missing dependancy. And ~x86 gentoo-sources does not provide a sufficient version to run ~x86 microcode-ctl (we can think that 2 different ~x86 packages of the tree should be in line).

So my position is : you should at least mask it untill ~x86 has an official kernel that have the patch that correct this problem, and probably better add a dependency asking for a minimal kernel version.

But this is only my opinion :)

Regards,</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>robbat2@gentoo.org</who>
            <bug_when>2006-11-11 01:22:34 0000</bug_when>
            <thetext>Guillaume Castagnino: there&apos;s one major flaw with dependancies on kernels.
Namely they exist to require that the kernel sources is of a sufficent version for a task. It says absolutely nothing about the kernel that is actually running.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>birder@ozemail.com.au</who>
            <bug_when>2006-11-11 01:27:38 0000</bug_when>
            <thetext>Agreed - a bug in non-userspace is still a bug.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2006-11-11 01:32:25 0000</bug_when>
            <thetext>feel free to waste the kernel team&apos;s time then ... the bug will just stagnant anyways until 2.6.19 hits portage, but whatever</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>iyosifov@gmail.com</who>
            <bug_when>2006-11-11 04:47:27 0000</bug_when>
            <thetext>If the problem is to be fixed by the simple patch pointed by Paul Taylor* why wait for 2.6.19 ?

* http://linux.bkbits.net:8080/linux-2.6/gnupatch%40451a9864jKk9Jk5CliEBE9pB86swnw</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2006-11-12 20:33:42 0000</bug_when>
            <thetext>nothing is stopping you from applying it to your own kernel</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dsd@gentoo.org</who>
            <bug_when>2006-11-14 11:39:30 0000</bug_when>
            <thetext>Mike, this seems like a legitimate kernel bug to me, but I don&apos;t have much knowledge in this area.

If you apply that patch to 2.6.18, can anyone confirm that both microcode-ctl-1.15 and microcode-ctl-1.16 work fine with 2.6.18?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>iyosifov@gmail.com</who>
            <bug_when>2006-11-14 12:12:50 0000</bug_when>
            <thetext>The patch per se does not seem to apply cleanly to 2.6.18. I tried bringing only  /arch/i386/kernel/microcode.c up to date with 2.6.19-rc5, the resulting kernel built ok but crashed with a backtrace on boot. I am no kernel programmer so it is very possible that I just messed up the patching.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dsd@gentoo.org</who>
            <bug_when>2006-11-16 14:25:58 0000</bug_when>
            <thetext>Created an attachment (id=102154)
backport to 2.6.18

please run the above tests with this patch</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>casta@xwing.info</who>
            <bug_when>2006-11-16 14:38:38 0000</bug_when>
            <thetext>microcode-ctl-1.14 works always fine with this patch applied, and microcode-ctl-1.15 also works fine.

This patch seems to be OK
Thanks !</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dsd@gentoo.org</who>
            <bug_when>2006-11-16 15:00:41 0000</bug_when>
            <thetext>Thanks for the speedy testing</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>casta@xwing.info</who>
            <bug_when>2006-11-16 23:12:41 0000</bug_when>
            <thetext>Just performed the same test on hardened-sources-2.6.18 patched with this patch : same result, it&apos;s all fine with both version.

Thanks</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>iyosifov@gmail.com</who>
            <bug_when>2006-11-18 15:19:48 0000</bug_when>
            <thetext>(In reply to comment #13)
&gt; Created an attachment (id=102154) [edit]
&gt; backport to 2.6.18
&gt; 
&gt; please run the above tests with this patch
&gt; 
I&apos;ve applied the patch, the resulting kernel builds, boots and works fine. Microcode updates ( with both 1.15 and 1.14) appear to work:

home ~ # microcode_ctl -u
microcode_ctl: writing microcode (length: 265216)
microcode_ctl: microcode successfuly written to /dev/cpu/microcode
home ~ #  

However:

home ~ # dmesg | grep -i microcode
IA-32 Microcode Update Driver: v1.14a &lt;tigran@veritas.com&gt;
home ~ #    

I fail to see any confirmation message in the kernel log. Is this normal ?
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jakub@gentoo.org</who>
            <bug_when>2006-11-19 04:46:52 0000</bug_when>
            <thetext>*** Bug 155659 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dsd@gentoo.org</who>
            <bug_when>2006-11-20 08:55:33 0000</bug_when>
            <thetext>Fixed in gentoo-sources-2.6.18-r3 (genpatches-2.6.18-4)</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>102154</attachid>
            <date>2006-11-16 14:25 0000</date>
            <desc>backport to 2.6.18</desc>
            <filename>microcode.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">SW5kZXg6IGxpbnV4LTIuNi4xOC1nZW50b28tcjIvYXJjaC9pMzg2L2tlcm5lbC9taWNyb2NvZGUu
Ywo9P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wogCQkJZXJyb3IgPSAtRUlOVkFMOwogCQkJZ290byBvdXQ7CkBA
IC00NjAsMTEgKzQ2MCw2IEBAIHN0YXRpYyBzc2l6ZV90IG1pY3JvY29kZV93cml0ZSAoc3RydWN0
IGYKIHsKIAlzc2l6ZV90IHJldDsKIAotCWlmIChsZW4gPCBERUZBVUxUX1VDT0RFX1RPVEFMU0la
RSkgewotCQlwcmludGsoS0VSTl9FUlIgIm1pY3JvY29kZTogbm90IGVub3VnaCBkYXRhXG4iKTsg
Ci0JCXJldHVybiAtRUlOVkFMOwotCX0KLQogCWlmICgobGVuID4+IFBBR0VfU0hJRlQpID4gbnVt
X3BoeXNwYWdlcykgewogCQlwcmludGsoS0VSTl9FUlIgIm1pY3JvY29kZTogdG9vIG11Y2ggZGF0
YSAobWF4ICVsZCBwYWdlcylcbiIsIG51bV9waHlzcGFnZXMpOwogCQlyZXR1cm4gLUVJTlZBTDsK
</data>        

          </attachment>
    </bug>

</bugzilla>