Re: [BUG] x86: failed to boot a kernel on a Ryzen machine

From: Satoru Takeuchi
Date: Mon Apr 24 2017 - 08:39:39 EST


At Mon, 24 Apr 2017 13:07:53 +0200,
Borislav Petkov wrote:
>
> On Mon, Apr 24, 2017 at 03:58:05PM +0900, Satoru Takeuchi wrote:
> > Recently I bought a new Ryzen machine. When I tried to test v4.11-rc8 on it, it failed to boot
> > with the following panic log.
> >
> > ```
> > ...
> > [ 0.227720] raid6: sse2x1 gen() 7985 MB/s
> > [ 0.295709] raid6: sse2x1 xor() 8181 MB/s
> > [ 0.363706] raid6: sse2x2 gen() 17531 MB/s
> > [ 0.431699] raid6: sse2x2 xor() 11098 MB/s
> > [ 0.499693] raid6: sse2x4 gen() 18509 MB/s
> > [ 0.567688] raid6: sse2x4 xor() 10177 MB/s
> > [ 0.571692] invalid opcode: 0000 [#1] SMP
> > [ 0.572312] Modules linked in:
> > [ 0.572822] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.11.0-rc8-ktest #1
> > [ 0.573734] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014
> ^^^^^^^^^^^^^^
>
> Next time your report a bug, say it is a guest on the *very* first line
> of your report.

I'm very sorry.

>
> Now, how do you start your guest exactly? Full cmdline pls.

I used the following auto-test tool (its backend is ktest).

https://github.com/satoru-takeuchi/elkdat

This problem can be reproduced by the following command on Ubuntu 16.04.

```
$ sudo apt-get install git vagrant libvirt-bin libvirt-dev kernel-package qemu-kvm libssl-dev libncurses5-dev
...
$ sudo usermod -aG libvirt <username>
```

Log out and back in here.

```
$ sudo sed -i'' "s/Specification.all = nil/Specification.reset/" /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb # See https://github.com/vagrant-libvirt/vagrant-libvirt/issues/575 for more details about this patching
$ vagrant plugin install vagrant-libvirt
$ git clone https://github.com/satoru-takeuchi/elkdat.git
...
$ cp -r /path/to/linux/source elkdat/linux
$ cd elkdat
$ ./init # start guest
...
$ pushd linux
...
$ git checkout v4.11-rc8
...
$ popd
...
$ ./test boot # build and boot v4.11-rc8
... # kernel panic happens here
```

The core of the starting guest process of above mentioned tools is as follows.

1. Add the vagrant box for the guest VM

```
$ vagrant box add elastic/ubuntu-16.04-x86_64 --provider libvirt
...
```

2. Start the VM with the following Vagrantfile.

```
$ cd elkdat
$ vagrant up
```

The summary of Vagrantfile is here.

```
Vagrant.configure("2") do |config|
...
config.vm.define :ktest do |vm|
vm.vm.box = "elastic/ubuntu-16.04-x86_64"
vm.vm.synced_folder './', '/vagrant', type: 'rsync'
vm.vm.provider :libvirt do |domain|
domain.cpus = 2
end
end
...
end

```

Thanks,
Satoru


>
> --
> Regards/Gruss,
> Boris.
>
> Good mailing practices for 400: avoid top-posting and trim the reply.