All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ijc@debian.org>
To: Stephan Seitz <stse+debianbugs@fsing.rootsland.net>
Cc: 785187@bugs.debian.org, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Pkg-xen-devel] Bug#785187: xen-hypervisor-4.5-amd64: Option ucode=scan is not working
Date: Fri, 15 May 2015 08:26:42 +0100	[thread overview]
Message-ID: <1431674802.5748.39.camel@debian.org> (raw)
In-Reply-To: <20150514T224249.GA.bb576.stse@fsing.rootsland.net>

On Thu, 2015-05-14 at 22:45 +0200, Stephan Seitz wrote:
> On Wed, May 13, 2015 at 11:57:55AM -0400, Konrad Rzeszutek Wilk wrote:
> >> > according to the documentation the option ucode=scan should tell XEN to
> >> > look for a microcode update in an uncompressed initrd.
> >> >
> >> > While I don’t use the Debian kernel the tools to generate the initrd are
> >> > part of Debian. The command „cpio -i < /boot/initrd.img-4.0.2-Dom0”
> >> > creates the directory structure „kernel/x86/microcode/GenuineIntel.bin”,
> >> > so I think the initrd is allright.
> >Is the initramfs compressed? The scanning code can't deal if the 
> 
> [stse@osgiliath]: file /boot/initrd.img-4.0.2-Dom0 
> /boot/initrd.img-4.0.2-Dom0: ASCII cpio archive (SVR4 with no CRC)
> 
> I don’t think the initrd is compressed.
> 
> http://lists.xen.org/archives/html/xen-users/2014-05/msg00053.html says 
> that I have to use „cpio -H newc” not „cpio -o c”, but I don’t know how 
> the Debian tools create the initrd.

The intel-microcode package contains:
/usr/share/initramfs-tools/hooks/intel_microcode
which will be called during initamfs generation.

It seems to call iucode_tool, from the iucode-tool package. That's a
binary tool which seems to include its own cpio writer implementation,
I've no idea if that is like a 'newc' or not.

However:
ijc@dagon:tmp$ find iucode-tool/ | cpio -o > normal.cpio
828 blocks
ijc@dagon:tmp$ find iucode-tool/ | cpio -o -H newc > newc.cpio
840 blocks
ijc@dagon:tmp$ file *.cpio
newc.cpio:   ASCII cpio archive (SVR4 with no CRC)
normal.cpio: cpio archive

So the fact that yours reports the same as newc.cpio makes me reasonably
confident it is in the correct form.

So I think the issue must be elsewhere.

In iucode_tool.c I found:
        /* Gross hack to work around a Linux kernel bug: for file
         * entries, force file data into a 16-byte alignment by
         * appending NULs to the file name.  Verified to be compatible
         * with GNU pax, and GNU cpio */
        s = (size) ? (16 - (*pos + bufsize) % 16) % 16 : 0;

I wonder if perhaps this confuses Xen? I doubt it somehow.

Here's an idea. First extract the real initrd from the back half of the
initrd:
        ijc@dagon:tmp$ cat /boot/initrd.img | ( cpio -t >&2 ; cat ) > initrd.real
        kernel
        kernel/x86
        kernel/x86/microcode
        kernel/x86/microcode/GenuineIntel.bin
        16 blocks
        ijc@dagon:tmp$ file initrd.real 
        initrd.real: gzip compressed data, last modified: Sun Apr 19 16:31:17 2015, from Unix
        ijc@dagon:tmp$ zcat initrd.real | cpio -t | head -n 5
        .
        etc
        etc/ld.so.conf.d
        etc/ld.so.conf.d/fakeroot-x86_64-linux-gnu.conf
        etc/ld.so.conf.d/x86_64-linux-gnu.conf

Now you can experiment with regenerating the ucode bit with whatever
commands are recommended and reconcatenating the two. If that works then
we know there is some incompatibility between iucode-tools's output and
Xen's cpio reader (could be a bug in either or both I think). 

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2015-05-15  7:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20150513T101737.GA.80186.stse@fsing.rootsland.net>
2015-05-13 13:41 ` [Pkg-xen-devel] Bug#785187: xen-hypervisor-4.5-amd64: Option ucode=scan is not working Ian Campbell
2015-05-13 15:57   ` Konrad Rzeszutek Wilk
2015-05-13 18:03     ` Ian Campbell
2015-05-14 20:45     ` Stephan Seitz
     [not found]     ` <20150514T224249.GA.bb576.stse@fsing.rootsland.net>
2015-05-15  7:26       ` Ian Campbell [this message]
2015-05-19 11:31         ` Stephan Seitz
     [not found]         ` <20150519T132815.GA.6f97a.stse@fsing.rootsland.net>
2015-05-19 11:47           ` Ian Campbell
     [not found]           ` <1432036071.12989.89.camel@debian.org>
2015-05-27 20:43             ` Stephan Seitz
2015-07-01 11:09             ` Stephan Seitz
2015-05-13 20:11   ` Atom2
2015-05-14  8:41     ` Ian Campbell
2015-05-14 20:56       ` Atom2

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1431674802.5748.39.camel@debian.org \
    --to=ijc@debian.org \
    --cc=785187@bugs.debian.org \
    --cc=stse+debianbugs@fsing.rootsland.net \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.