明日にはでっかい太陽が昇るかもしれません。

「覚悟」とは!! 暗闇の荒野に!!進むべき道を切り開く事だッ!

VirtualBox + Secure Boot + Ubuntu = fail

最近の PC では Secure Boot (UEFI) が有効な状態で Linux (今回は Ubuntu) をインストールできますが、その場合に VirtualBox がインストールできない問題が発生したので、解決策をメモしておく。

stegard.net

要は、 Secure Boot が有効な場合は署名されたドライバしかロードできないため、別途インストールした VirtualBox のドライバがロードできず、エラーになるということらしい。

確かに、知らないところで知らないドライバをロードされたらセキュリティも何もないので、当然の機能にも思える。

とはいえ、VirtualBox が使えないのも困るので、解決策を探したのだが、最初は「Secure Boot を無効にしてください」しか出てこなかったので焦った。

Secure Boot の出始めならいざ知らず、2019 年に Secure Boot を無効にしないと VirtualBox もインストール出来ないとかありえないだろ、と思っていたら、ちゃんと見つかったので一安心。

ls1046ardb emulated by qemu まとめ

github.com

何する?

以前対応していた ls1046ardb emulated by qemu の動作手順をまとめる。

なんで?

最近仕事で久しぶりに ls1046a ベースボードの u-boot を qemu で動かそうとしたら上手く動かなかったことと、海外の大学生の方から "ls1046ardb 向けカーネルを動かしたいがハングする" と言うような相談があったので、改めて完成形のコードをベースに作業環境の構築を行ってみる。

何が必要?

準備

ビルド環境

QorIQ Linux SDK はインストールして、ターゲットビルドができる状態にしておく。

emmc イメージ

動作確認用に emmc イメージを作成しておきます。

$ truncate -s 8G emmc.img
$ sudo losetup -f -P --show emmc.img
/dev/loop0
$  sudo fdisk /dev/loop0
...

Device       Boot Start      End  Sectors Size Id Type
/dev/loop0p1       2048     6143     4096   2M 83 Linux
/dev/loop0p2       6144 16777215 16771072   8G 83 Linux

Command (m for help): w

$ sudo mkfs.ext2 /dev/loop0p1
$ sudo mkfs.ext4 /dev/loop0p2
$ sudo mount /dev/loop0p1 mnt/
$ sudo echo test | sudo tee mnt/test.txt
test
$ sudo umount mnt

現在の状態を確認する

改めて qemu を動かしたところ、たしかに u-boot がハングすることが確認できた。

以前開発していたときは qemu-v2.10 ベースで、今は qemu-v3.0 にリベースしているのだが、どうやらリベースしたことで動かなくなったらしい。 (qemu-v2.10 ベースのモジュールで動作させたところ、ハングしないことを確認した)

qemu-v2.10 ベースのモジュールでの動作

Breakpoint 1, fsl_ocram_clear_ecc_err () at /home/t-kenji/Workspace/playground/qoriq/u-boot-fsl-sdk/arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S:280
280             mov     w1, #0x60
(gdb) info reg w1 x0
w1             0x10020000       268566528
x0             0x10020000       268566528
(gdb) s
281             ldr     x0, =DCSR_DCFG_SBEESR2
(gdb) info reg w1 x0
w1             0x60     96
x0             0x10020000       268566528
(gdb) s
282             str     w1, [x0]
(gdb) info reg w1 x0
w1             0x60     96
x0             0x20140534       538182964
(gdb) s
283             ldr     x0, =DCSR_DCFG_MBEESR2
(gdb) info reg w1 x0
w1             0x60     96
x0             0x20140534       538182964

qemu-v3.0 ベースのモジュールでの動作

Breakpoint 1, fsl_ocram_clear_ecc_err () at /home/t-kenji/Workspace/playground/qoriq/u-boot-fsl-sdk/arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S:280
280             mov     w1, #0x60
(gdb) info reg w1 x0
w1             0x10020000       268566528LSDK-17.09-update-103017
x0             0x10020000       268566528
(gdb) s
281             ldr     x0, =DCSR_DCFG_SBEESR2
(gdb) info reg w1 x0
w1             0x60     96
x0             0x10020000       268566528
(gdb) s
282             str     w1, [x0]
(gdb) info reg w1 x0
w1             0x60     96
x0             0x20140534       538182964
(gdb) s
103             exception_entry

デバッグを進めると、未定義メモリ領域へのアクセスで例外が発生するようになったっぽい。 (DCSR, IFC, CPLDqemu に未実装だった)

qemu の修正

不足しているデバイスを追加する

DCSR、IFC と CPLDqemu に実装した。

とりあえず処理はなしで、メモリ領域を確保しただけ。

CPLD については、実機と同じ情報を返すようにはしたいな。

あとは細々とした修正を行って、 u-boot が起動するところまで確認できた。

動作確認に使用した起動オプションは以下の通り。

#!/bin/bash

WORKDIR=$(cd $(dirname $0); pwd)
KERNEL=$WORKDIR/build_u-boot-qoriq_emmc/u-boot.elf
MEMORY=2048
CORES=4
EXTRA="-drive if=sd,cache=unsafe,format=raw,file=$WORKDIR/emmc.img"
APPEND=""

QEMU=$WORKDIR/build_qemu/aarch64-softmmu/qemu-system-aarch64
#QEMU="gdb --args $WORKDIR/build_qemu/aarch64-softmmu/qemu-system-aarch64"
$QEMU -machine ls1046ardb \
      -smp $CORES \
      -m $MEMORY \
      -kernel $KERNEL \
      -nographic \
      $EXTRA \
      --append "$APPEND" \
      $@

引き続き、linux の起動を確認していく。


3/28 追記

NXP-SDK 2.0 の 設定ファイルのまま としたが、rootfs のマウントでハングしてしまった。

以前の正常起動時のログと比べて、違いがないか確認していく。

---- 3/29 追記

initramfs を cpld に変更したら init まで到達できたが、以前と違いコンソールが使用可能になるところまでは到達しなかった。

ハングの原因を解決していく必要がありそう。

[   51.958522] Freeing unused kernel memory: 480K (ffff800000b30000 - ffff800000ba8000)
[   51.959610] Freeing alternatives memory: 48K (ffff800000ba8000 - ffff800000bb4000)
INIT: version 2.88 booting
Starting udev
[   59.211164] udevd[1000]: starting version 182
[   62.665707] udevd[1004]: unhandled level 2 translation fault (11) at 0x00000000, esr 0x92000006
[   62.667975] pgd = ffff80002ac0b000
[   62.669399] [00000000] *pgd=00000000d456a003, *pud=00000000d456b003, *pmd=0000000000000000
[   62.673269]
[   62.675148] CPU: 3 PID: 1004 Comm: udevd Not tainted 4.1.35-rt41-176717-gb14540ee315f #1
[   62.677222] Hardware name: LS1046A RDB Board (DT)
[   62.684331] task: ffff80005478cf80 ti: ffff80002ac10000 task.ti: ffff80002ac10000
[   62.687661] PC is at 0xffff93633b5c
[   62.688420] LR is at 0x4152e4
[   62.689746] pc : [<0000ffff93633b5c>] lr : [<00000000004152e4>] pstate: 60000000
[   62.692371] sp : 0000fffff14cf330
[   62.692968] x29: 0000fffff14cf330 x28: 0000000000420128
[   62.699551] x27: 000000000041f000 x26: 0000fffff14d8c60
[   62.705670] x25: 0000000000000000 x24: 00000000004211d0
[   62.707525] x23: 0000fffff14cf3a0 x22: 0000fffff14cf3a8
[   62.712872] x21: 0000000000000005 x20: 0000000022160350
[   62.717154] x19: 000000002216bda0 x18: 0000000000000000
[   62.718066] x17: 0000ffff93633b48 x16: 00000000004325a0
[   62.718788] x15: ffffffffffffffff x14: ffff000000000000
[   62.719448] x13: ffffffffffffffff x12: 0000000000000020
[   62.721810] x11: 0000000000000038 x10: 0101010101010101
[   62.723436] x9 : fefefeff211516cf x8 : 7f7f7f7f7f7f7f7f
[   62.725418] x7 : ff444c404d5e454e x6 : 0000000000000080
[   62.735132] x5 : 0000000000000000 x4 : 8000000000000000
[   62.736329] x3 : 00000000221605b0 x2 : 0000000000000000
[   62.737630] x1 : 0000000022179a68 x0 : 00000000221605b0
[   62.738585]
[   62.782259] swap_free: Bad swap file entry 200018006000080
[   62.784433] BUG: Bad page map in process udevd  pte:1800600008006 pmd:f0328003
[   62.786604] addr:0000ffff93600000 vm_flags:00000075 anon_vma:          (null) mapping:ffff800062287360 index:42
[   62.789854] file:libc-2.20-2014.11.so fault:filemap_fault mmap:generic_file_mmap readpage:simple_readpage
以降も様々なハングのログが出続ける

Java の synchronized ブロックのようなことを C で実現する

職業柄、組込みをやっているので、 C で排他制御を行う機会は多い。

でも、毎回 ***_lock, ***_unlock で囲むのも面倒だし、解放漏れなどによるデッドロックとかわかりにくい割に初歩的なバグに悩まされることも多く、 Java の synchronized ブロックが羨ましいなーと思っていた。 (レビューで対応を見るのも面倒ってのが最近は多い)

そこで、以前は以下のようなマクロを作って、擬似的な synchronized ブロックを構築していたけど、不満な点もいくつかあった。

/* 擬似 synchronized ブロック */
#define SYNCHRONIZED1(obj, ...)                                            \
    do {                                                                   \
        pthread_mutex_lock(obj);                                           \
        pthread_cleanup_push((void (*)(void *))pthread_mutex_unlock, obj); \
        __VA_ARGS__;                                                       \
        pthread_mutex_unlock(obj);                                         \
        pthread_cleanup_pop(0);                                            \
    } while(0)

/* 使用方法 */
void *old_type(void *arg)
{
    for (int i; i < 5000; ++i) {
        SYNCHRONIZED1(&mutex, {
            counter++;
        });
    }
    return NULL;
}

動作上は問題ないけど、以下のような点が不満だった。

  1. 全体がワンライナーになるため、 __LINE__ マクロが期待する通りにならない。 (デバッグ時に困る。。)
  2. () の中に {} が入るのは C の規格上無いため、エディタのハイライトが期待通りにならない。 (vim は構文エラー扱いにする)
  3. 見た目が C っぽくない。

最近、ユニットテストフレームワーク Catch2 のコードを見ていて「できるかも!?」と思って試してみたのが以下のコード。

#define CAT_I(a, b) a ## b
#define CAT(a, b) CAT_I(a, b)
 
/* 擬似 synchronized ブロック */
#define synchronized2(obj)                                \
    void CAT(__caller__, __LINE__)(void (*fn)(void)) {    \
        pthread_mutex_lock(obj);                          \
        fn();                                             \
        pthread_mutex_unlock(obj);                        \
    }                                                     \
    auto void CAT(__callee__, __LINE__)(void);            \
    CAT(__caller__, __LINE__)(CAT(__callee__, __LINE__)); \
    void CAT(__callee__, __LINE__)(void)

/* 使用方法 */
void *new_type(void *arg)
{
    for (int i; i < 5000; ++i) {
        synchronized2(&mutex) {
            counter++;
        }                                                                                                                                                              
    }
    return NULL;
}

旧式の問題点はすべて解決され、かつ、ブロックは関数として実行されるため、 pthread_cleanup_push を使用しなくても排他の解放漏れが発生しなくなった。

nested function を使用しているため、 gcc 専用になるが、 scan-buildoclint を行う際は空にすればロジックに影響を与えずに排除することもできる。

というわけで動作確認。

上で使用方法として示した関数を 4 スレッド起動して排他が効いているか確認する。

# synchronized ブロック未使用
$ make test
gcc -MMD -MP -Wall -Werror  -c -o sync.o sync.c
gcc  -o synchronized sync.o -lpthread
./synchronized
counter: 14977

# synchronized ブロック使用 (synchronized2)
$ make test
gcc -MMD -MP -Wall -Werror  -c -o sync.o sync.c
gcc  -o synchronized sync.o -lpthread
./synchronized
counter: 20000

未使用時は排他を行っていないため期待通りインクリメントできておらず、使用時は正しくインクリメントできることを確認した。

これまで旧式で書いていたコードをすべて新しくしよう!

以下、テストコードの全文。

#include <stdio.h>
#include <unistd.h>
#include <pthread.h>

#define SYNCHRONIZED1(obj, ...)                                            \
    do {                                                                   \
        pthread_mutex_lock(obj);                                           \
        pthread_cleanup_push((void (*)(void *))pthread_mutex_unlock, obj); \
        __VA_ARGS__;                                                       \
        pthread_mutex_unlock(obj);                                         \
        pthread_cleanup_pop(0);                                            \
    } while(0)

#define CAT_I(a, b) a ## b
#define CAT(a, b) CAT_I(a, b)

#define synchronized2(obj)                                \
    void CAT(__caller__, __LINE__)(void (*fn)(void)) {    \
        pthread_mutex_lock(obj);                          \
        fn();                                             \
        pthread_mutex_unlock(obj);                        \
    }                                                     \
    auto void CAT(__callee__, __LINE__)(void);            \
    CAT(__caller__, __LINE__)(CAT(__callee__, __LINE__)); \
    void CAT(__callee__, __LINE__)(void)

static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
static unsigned long counter = 0;

void *old_type(void *arg)
{
    /* 開始タイミングを合わせる */
    pthread_mutex_lock(&mutex);
    pthread_cond_wait(&cond, &mutex);
    pthread_mutex_unlock(&mutex);                                                                                                                                  [0/5190]

    for (int i; i < 5000; ++i) {
        SYNCHRONIZED1(&mutex, {
            counter++;
        });
    }
    return NULL;
}

void *new_type(void *arg)
{
    /* 開始タイミングを合わせる */
    pthread_mutex_lock(&mutex);
    pthread_cond_wait(&cond, &mutex);
    pthread_mutex_unlock(&mutex);

    for (int i; i < 5000; ++i) {
        synchronized2(&mutex) {
            counter++;
        }
    }
    return NULL;
}

int main(int argc, char **argv)
{
    pthread_t thrd_ids[4];

    for (int i = 0; i < 2; ++i) {
        pthread_create(&thrd_ids[i], NULL, old_type, NULL);
    }
    for (int i = 2; i < 4; ++i) {
        pthread_create(&thrd_ids[i], NULL, new_type, NULL);
    }
    sleep(1);
    pthread_cond_broadcast(&cond);

    for (int i = 0; i < 4; ++i) {
        pthread_join(thrd_ids[i], NULL);
    }
    printf("counter: %ld\n", counter);

    return 0;
}

clang と gcc の両方でラムダ式のようなことをする

Web アプリ開発の方は、牛歩ながら janus-webrtc-gateway のデモ画面を Django+Vue.js with Bootstrap に移植していっている。

echotest, videocall, audiobridge となんとか動作するものが移植できたが、 videoroom での複数リモートフィードをシンプルに扱うにはどうしたものか、と考えているところで手が止まっている。。

それはさておき、仕事で gcc 拡張の nested function を使用していたところ、 clang static analyzer でエラーになる問題があったので、とりあえずの回避策をメモしておく。

#if !defined(__clang__)                               
#define LAMBDA(ret_type, ...)       \                    
    __extension__                   \                    
    ({                              \                    
        ret_type __fn__ __VA_ARGS__ \                    
        __fn__;                     \                    
    })                                                
typedef int (*CALLBACK)(int);                         
#else                                                 
#define LAMBDA(ret_type, ...) \                       
    ^ret_type __VA_ARGS__                             
typedef int (^CALLBACK)(int);                         
#endif                                                
                                                      
void dummy(CALLBACK cb, int arg)                      
{                                                     
    printf("%d", cb(arg));                             
}                                                     
                                                      
int main(int argc, char **argv)
{
    dummy(LAMBDA(int, (int arg) { return arg; }), 999);
    dummy(LAMBDA(int, (int arg) { return arg; }), -1);                                                                                                                                
                                                      
    return 0;                                   
}

仕掛けは、 gcc では nested function で実現しているところを、 clang では Apple 拡張の blocks で置き換えている。

ただ、 blocks は関数ではないので関数ポインタを渡せないし、あくまでも今回のコードに対する回避策としての意味しかない。 (そして、コンパイルフラグに -fblocks が必要になり、 libBlocksRuntime in libblocksruntime-dev をリンクする必要がでる。)

簡単なコールバック程度はラムダ式が使いたいけど、ラムダ式と定義済み関数ポインタを渡す処理が混在すると clang static analyer が使用できなくなる。。。

将来的にでも、 C 言語の標準仕様でなんとか解決できないかなー。

Web アプリをつくろう

ついこの間まで Qemu でブートまわりを見ていたが、それが終わったら、と思っていたのが Web アプリ作成だ。

いきなり上層まで吹っ飛んだが、興味がある分野を順に並べたらこうなってしまった。

とりあえず目標がないと手が進まないので、 Janus WebRTC Gateway のフロントエンドを作ることにする。

理由は、仕事で使っている Web サービスで唯一デモ機能の域を出ていないため。 (デモ画面を Trac プラグインに移植して使っている)

Web アプリは本格的に自作はしたことないので、いろんなフレームワークを使ってみようとは思う。

使用言語は使い慣れているということで Python 一択で、フレームワークDjango から初めてみる。

まずは、 Djangoチュートリアルを順に進めていこうと思う。

最終的には OpenID Connect の OP / RP にも対応して、つかっているいろんなサービスの認証サーバも兼ねたいな。

Linux (aarch64) on Qemu を動作させたい (3)

github.com

いろいろ変更を加え、 LS1046ARDB 向けの u-boot と kernel でシステムを立ち上げることができるようになった。

U-Boot 2017.07-00001-g62e8baa7b2-dirty (Jan 01 2018 - 08:37:01 +0000)

SoC:  LS1046AE Rev1.0 (0x87070010)
Clock Configuration:
       CPU0(A72):800  MHz  CPU1(A72):800  MHz  CPU2(A72):800  MHz
       CPU3(A72):800  MHz
       Bus:      600  MHz  DDR:      2100 MT/s  FMAN:     800  MHz
Reset Configuration Word (RCW):
       00000000: 0c150010 0e000000 00000000 00000000
       00000010: 11335559 40000012 60040000 c1000000
       00000020: 00000000 00000000 00000000 00238800
       00000030: 20124000 00003000 00000096 00000001
Model: LS1046A RDB Board
Board: LS1046ARDB, boot from Invalid setting of SW5
CPLD:  V0.0
PCBA:  V0.0
SERDES Reference Clocks:
SD1_CLK1 = 100.00MHZ, SD1_CLK2 = 100.00MHZ
I2C:   ready
DRAM:  Detected UDIMM
1.9 GiB (DDR4, 32-bit, CL=1, ECC off)
Waking secondary cores to start from fbd0e000
All (4) cores are up.
Using SERDES1 Protocol: 4403 (0x1133)
Using SERDES2 Protocol: 21849 (0x5559)
ERROR: Stopped after 0 portals
NAND:  fsl_ifc_run_command: Flash Time Out Error
fsl_ifc_run_command: Write Protect Error
fsl_ifc_run_command: Flash Time Out Error
fsl_ifc_run_command: Write Protect Error
fsl_ifc_run_command: Flash Time Out Error
fsl_ifc_run_command: Write Protect Error
fsl_ifc_run_command: Flash Time Out Error
fsl_ifc_run_command: Write Protect Error
fsl_ifc_run_command: Flash Time Out Error
fsl_ifc_run_command: Write Protect Error
0 MiB
MMC:   FSL_SDHC: 0
*** Warning - bad CRC, using default environment

EEPROM: NXID v1
In:    serial
Out:   serial
Err:   serial
controller reset failed (0x1)
Found 0 device(s).
SCSI:  Net:
MMC read: dev # 0, block # 18432, count 128 ...
Fman1: Data at 00000000fbc15470 is not a firmware
PCIe0: pcie@3400000 Endpoint: no link
PCIe1: pcie@3500000 Endpoint: no link
PCIe2: pcie@3600000 Endpoint: no link
No ethernet found.
Hit any key to stop autoboot:  0
Trying load from eMMC ..
Device: FSL_SDHC
Manufacturer ID: aa
OEM: 5859
Name: QEMU!
Tran Speed: 25000000
Rd Block Len: 512
SD version 1.0
High Capacity: Yes
Capacity: 4 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
187484907 bytes read in 42353 ms (4.2 MiB/s)
## Loading kernel from FIT Image at a0000000 ...
   Using 'config@1' configuration
   Trying 'kernel@1' kernel subimage
     Description:  ARM64 Linux kernel
     Type:         Kernel Image
     Compression:  gzip compressed
     Data Start:   0xa00000dc
     Data Size:    5110461 Bytes = 4.9 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x80080000
     Entry Point:  0x80080000
   Verifying Hash Integrity ... OK
## Loading ramdisk from FIT Image at a0000000 ...
   Using 'config@1' configuration
   Trying 'ramdisk@1' ramdisk subimage
     Description:  LS1046 Ramdisk
     Type:         RAMDisk Image
     Compression:  gzip compressed
     Data Start:   0xa04e6138
     Data Size:    182347366 Bytes = 173.9 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: unavailable
     Entry Point:  unavailable
   Verifying Hash Integrity ... OK
## Loading fdt from FIT Image at a0000000 ...
   Using 'config@1' configuration
   Trying 'fdt@1' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0xa04dfc50
     Data Size:    25695 Bytes = 25.1 KiB
     Architecture: AArch64
   Verifying Hash Integrity ... OK
   Loading fdt from 0xa04dfc50 to 0x90000000
   Booting using the fdt blob at 0x90000000
   Uncompressing Kernel Image ... OK
   Using Device Tree in place at 0000000090000000, end 000000009001945e

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 4.1.35-rt41 (tkenji@633840ca74ff) (gcc version 4.9.3 20150311 (prerelease) (Linaro GCC 4.9-2015.03) ) #47 SMP Tue Jan 2 15:16:32 UTC 2018
[    0.000000] CPU: AArch64 Processor [411fd070] revision 0
[    0.000000] Detected PIPT I-cache on CPU0
[    0.000000] alternatives: enabling workaround for ARM erratum 832075
[    0.000000] alternatives: enabling workaround for ARM erratum 834220
[    0.000000] earlycon: Early serial console at MMIO 0x21c0500 (options '')
[    0.000000] bootconsole [uart0] enabled
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] Reserved memory: initialized node bman-fbpr, compatible id fsl,bman-fbpr
[    0.000000] Reserved memory: initialized node qman-fqd, compatible id fsl,qman-fqd
[    0.000000] Reserved memory: initialized node qman-pfdr, compatible id fsl,qman-pfdr
[    0.000000] cma: Reserved 16 MiB at 0x00000000f7000000
[    0.000000] PERCPU: Embedded 18 pages/cpu @ffff80007bd81000 s34880 r8192 d30656 u73728
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 499464
[    0.000000] Kernel command line: console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 mtdparts=1550000.quadspi:1m(rcw),15m(u-boot),48m(kernel.itb);7e800000.flash:16m(nand_uboot),48m(nand_kernel),448m(nand_free) init=/sbin/init
[    0.000000] log_buf_len individual max cpu contribution: 4096 bytes
[    0.000000] log_buf_len total cpu_extra contributions: 12288 bytes
[    0.000000] log_buf_len min size: 16384 bytes
[    0.000000] log_buf_len: 32768 bytes
[    0.000000] early log buf free: 14376(87%)
[    0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
[    0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
[    0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.000000] software IO TLB [mem 0xf1200000-0xf5200000] (64MB) mapped at [ffff800071200000-ffff8000751fffff]
[    0.000000] Memory: 1662404K/2029568K available (7906K kernel code, 582K rwdata, 3124K rodata, 488K init, 757K bss, 350780K reserved, 16384K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vmalloc : 0xffff000000000000 - 0xffff7bffbfff0000   (126974 GB)
[    0.000000]     vmemmap : 0xffff7bffc0000000 - 0xffff7fffc0000000   (  4096 GB maximum)
[    0.000000]               0xffff7bffc0000000 - 0xffff7bffc1ef8000   (    30 MB actual)
[    0.000000]     fixed   : 0xffff7ffffabfd000 - 0xffff7ffffac00000   (    12 KB)
[    0.000000]     PCI I/O : 0xffff7ffffae00000 - 0xffff7ffffbe00000   (    16 MB)
[    0.000000]     modules : 0xffff7ffffc000000 - 0xffff800000000000   (    64 MB)
[    0.000000]     memory  : 0xffff800000000000 - 0xffff80007be00000   (  1982 MB)
[    0.000000]       .init : 0xffff800000b48000 - 0xffff800000bc2000   (   488 KB)
[    0.000000]       .text : 0xffff800000080000 - 0xffff800000b47a54   ( 11039 KB)
[    0.000000]       .data : 0xffff800000bd4000 - 0xffff800000c65800   (   582 KB)
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  Additional per-CPU info printed with stalls.
[    0.000000]  RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=4.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS:64 nr_irqs:64 0
[    0.000000] Architected cp15 timer(s) running at 62.50MHz (virt).
[    0.000000] clocksource arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1cd42e208c, max_idle_ns: 881590405314 ns
[    0.002463] sched_clock: 56 bits at 62MHz, resolution 16ns, wraps every 4398046511096ns
[    0.213960] Console: colour dummy device 80x25
[    0.239571] Calibrating delay loop (skipped), value calculated using timer frequency.. 125.00 BogoMIPS (lpj=625000)
[    0.272167] pid_max: default: 32768 minimum: 301
[    0.292607] Security Framework initialized
[    0.329354] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes)
[    0.354451] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes)
[    0.524640] Initializing cgroup subsys memory
[    0.537831] Initializing cgroup subsys hugetlb
[    0.739184] hw perfevents: enabled with arm/armv8-pmuv3 PMU driver, 1 counters available
[    0.758835] EFI services will not be available.
[    0.995980] CPU1: Booted secondary processor
[    0.997040] Detected PIPT I-cache on CPU1
[    0.997777] SANITY CHECK: Unexpected variation in cntfrq. Boot CPU: 0x00000003b9aca0, CPU1: 0x000000017d7840
[    1.000116] ------------[ cut here ]------------
[    1.000865] WARNING: CPU: 1 PID: 0 at ../arch/arm64/kernel/cpuinfo.c:199 cpuinfo_store_cpu+0x3d4/0x3f0()
[    1.009154] Unsupported CPU feature variation.
[    1.009794] Modules linked in:
[    1.015840] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.1.35-rt41 #47
[    1.016033] Hardware name: LS1046A RDB Board (DT)
[    1.030747] Call trace:
[    1.031754] [<ffff800000089894>] dump_backtrace+0x0/0x10c
[    1.032118] [<ffff800000089a8c>] show_stack+0x14/0x1c
[    1.032401] [<ffff800000322838>] dump_stack+0x8c/0xac
[    1.032604] [<ffff8000000b3c10>] warn_slowpath_common+0xac/0xd4
[    1.032773] [<ffff8000000b3cdc>] warn_slowpath_fmt_taint+0x4c/0x54
[    1.032870] [<ffff80000008df58>] cpuinfo_store_cpu+0x3d4/0x3f0
[    1.032967] [<ffff80000008ffbc>] secondary_start_kernel+0xe4/0x128
[    1.062332] ---[ end trace f173f86d6ac2600b ]---
[    1.159977] CPU2: Booted secondary processor
[    1.163201] Detected PIPT I-cache on CPU2
[    1.163553] SANITY CHECK: Unexpected variation in cntfrq. Boot CPU: 0x00000003b9aca0, CPU2: 0x000000017d7840
[    1.202462] CPU3: Booted secondary processor
[    1.203003] Detected PIPT I-cache on CPU3
[    1.203180] SANITY CHECK: Unexpected variation in cntfrq. Boot CPU: 0x00000003b9aca0, CPU3: 0x000000017d7840
[    1.208947] Brought up 4 CPUs
[    1.244540] SMP: Total of 4 processors activated.
[    1.245231] CPU: All CPU(s) started at EL1
[    1.296783] alternatives: patching kernel code
[    1.424440] devtmpfs: initialized
[    1.661849] DMI not present or invalid.
[    1.694198] clocksource jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    1.847526] pinctrl core: initialized pinctrl subsystem
[    2.002574] NET: Registered protocol family 16
[    2.136361] cpuidle: using governor ladder
[    2.174769] cpuidle: using governor menu
[    2.179854] fsl-mc bus type registered
[    2.185463] MC object device driver fsl_mc_dprc registered
[    2.193242] MC object device driver fsl_mc_allocator registered
[    2.199335] Bman ver:0000,00,00
[    2.200239] unknown Bman version, default to rev1.0
[    2.270321] qman-fqd addr 0x00000000fb000000 size 0x800000
[    2.272008] qman-pfdr addr 0x00000000f8000000 size 0x2000000
[    2.274877] Qman ver:0000,00,00,00
[    2.276537] unknown Qman version, default to rev1.1
[    2.285663] vdso: 2 pages (1 code @ ffff800000bd9000, 1 data @ ffff800000bd8000)
[    2.292818] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    2.353700] DMA: preallocated 256 KiB pool for atomic allocations
[    2.384210] Serial: AMBA PL011 UART driver
[    2.795706] Machine: LS1046A RDB Board
[    2.800774] SoC family: QorIQ LS1046A
[    2.801758] SoC ID: svr:0x87070010, Revision: 1.0
[    4.304871] RCPM: layerscape_rcpm_init: The RCPM driver initialized.
[    4.372132] vgaarb: loaded
[    4.402088] SCSI subsystem initialized
[    4.456503] usbcore: registered new interface driver usbfs
[    4.471751] usbcore: registered new interface driver hub
[    4.476685] usbcore: registered new device driver usb
[    4.530612] i2c i2c-0: IMX I2C adapter registered
[    4.540210] i2c i2c-0: can't use DMA
[    4.558772] i2c i2c-1: IMX I2C adapter registered
[    4.564546] i2c i2c-1: can't use DMA
[    4.574908] pps_core: LinuxPPS API ver. 1 registered
[    4.588712] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    4.595818] PTP clock support registered
[    4.619976] bman-fbpr addr 0x00000000fa000000 size 0x1000000
[    4.636199] Bman err interrupt handler present
[    4.647532] unknown BMan version in portal node,default to rev1.0
[    4.652998] unknown BMan version in portal node,default to rev1.0
[    4.659383] unknown BMan version in portal node,default to rev1.0
[    4.662188] unknown BMan version in portal node,default to rev1.0
[    4.667028] unknown BMan version in portal node,default to rev1.0
[    4.670040] unknown BMan version in portal node,default to rev1.0
[    4.672932] unknown BMan version in portal node,default to rev1.0
[    4.676520] unknown BMan version in portal node,default to rev1.0
[    4.680058] unknown BMan version in portal node,default to rev1.0
[    4.699803] Bman portal initialised, cpu 0
[    4.707872] Bman portal initialised, cpu 1
[    4.716818] Bman portal initialised, cpu 2
[    4.722468] Bman portal initialised, cpu 3
[    4.724234] Bman portals initialised
[    4.734674] Unexpected result from MCR_INIT_PFDR: 00
[    4.740044] Qman err interrupt handler present
[    4.774657] QMan: Allocated lookup table at ffff00000024d000, entry count 131073
[    4.787427] unknown QMan version in portal node,default to rev1.1
[    4.826345] Qman portal initialised, cpu 0
[    4.835371] Qman portal initialised, cpu 1
[    4.845039] Qman portal initialised, cpu 2
[    4.852880] Qman portal initialised, cpu 3
[    4.854145] Qman portals initialised
[    4.865027] Bman: BPID allocator includes range 32:32
[    4.870803] Qman: FQID allocator includes range 256:256
[    4.872773] Qman: FQID allocator includes range 32768:32768
[    4.879221] Qman: CGRID allocator includes range 0:256
[    4.893165] Qman: pool channel allocator includes range 1025:15
[    4.903892] No USDPAA memory, no 'fsl,usdpaa-mem' in device-tree
[    4.908763] fsl-ifc 1530000.ifc: Freescale Integrated Flash Controller
[    4.915669] fsl-ifc 1530000.ifc: IFC version 0.0, 8 banks
[    5.070779] Switched to clocksource arch_sys_counter
[    5.821905] NET: Registered protocol family 2
[    5.892757] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[    5.900429] TCP bind hash table entries: 16384 (order: 6, 262144 bytes)
[    5.905713] TCP: Hash tables configured (established 16384 bind 16384)
[    5.923881] UDP hash table entries: 1024 (order: 3, 32768 bytes)
[    5.929742] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes)
[    5.953056] NET: Registered protocol family 1
[    5.990297] RPC: Registered named UNIX socket transport module.
[    5.993178] RPC: Registered udp transport module.
[    5.995098] RPC: Registered tcp transport module.
[    5.997389] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    6.048812] Trying to unpack rootfs image as initramfs...
[  173.442592] Freeing initrd memory: 178068K (ffff8000204e7000 - ffff80002b2cc000)
[  173.459824] kvm [1]: HYP mode not available
[  173.664526] futex hash table entries: 1024 (order: 4, 65536 bytes)
[  173.683605] audit: initializing netlink subsys (disabled)
[  173.699599] audit: type=2000 audit(172.430:1): initialized
[  173.758824] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[  173.831518] VFS: Disk quotas dquot_6.6.0
[  173.836440] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[  173.964076] NFS: Registering the id_resolver key type
[  173.974926] Key type id_resolver registered
[  173.976703] Key type id_legacy registered
[  173.994814] fuse init (API version 7.23)
[  174.019183] 9p: Installing v9fs 9p2000 file system support
[  174.134214] io scheduler noop registered
[  174.143555] io scheduler cfq registered (default)
[  174.155589] ls-scfg-msi soc:msi-controller: ibs_shift:2 msir_irqs:32 msir_base:0x4
[  174.191723] Find msi-controller /soc/msi-controller
[  174.361186] ls-pcie-ep 3400000.pcie: in EP mode
[  174.368386] ls-pcie-ep 3500000.pcie: in EP mode
[  174.372227] ls-pcie-ep 3600000.pcie: in EP mode
[  174.424533] Freescale LS2 console driver
[  174.451146] fsl-ls2-console: device fsl_mc_console registered
[  174.459395] fsl-ls2-console: device fsl_aiop_console registered
[  174.746038] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[  174.828954] msm_serial: driver initialized
[  174.952698] console [ttyS0] disabled
[  174.969494] 21c0500.serial: ttyS0 at MMIO 0x21c0500 (irq = 19, base_baud = 18750000) is a 16550A
[  174.984238] console [ttyS0] enabled
[  174.984238] console [ttyS0] enabled
[  174.991707] bootconsole [uart0] disabled
[  174.991707] bootconsole [uart0] disabled
[  175.022961] 21c0600.serial: ttyS1 at MMIO 0x21c0600 (irq = 19, base_baud = 18750000) is a 16550A
[  175.051836] 21d0500.serial: ttyS2 at MMIO 0x21d0500 (irq = 20, base_baud = 18750000) is a 16550A
[  175.072879] 21d0600.serial: ttyS3 at MMIO 0x21d0600 (irq = 20, base_baud = 18750000) is a 16550A
[  175.633702] brd: module loaded
[  175.854360] loop: module loaded
[  175.892292] at24 0-0052: 65536 byte 24c512 EEPROM, writable, 1 bytes/write
[  175.894760] at24 0-0053: 65536 byte 24c512 EEPROM, writable, 1 bytes/write
[  175.955242] ahci-qoriq 3200000.sata: forcing PORTS_IMPL to 0x1
[  176.967362] ahci-qoriq 3200000.sata: controller reset failed (0x80000001)
[  176.973038] ahci-qoriq: probe of 3200000.sata failed with error -5
[  177.518071] fsl,ifc-nand 7e800000.nand: Controller is not responding
[  178.017182] fsl,ifc-nand 7e800000.nand: Controller is not responding
[  178.517365] fsl,ifc-nand 7e800000.nand: Controller is not responding
[  179.017754] fsl,ifc-nand 7e800000.nand: Controller is not responding
[  179.518852] fsl,ifc-nand 7e800000.nand: Controller is not responding
[  179.521297] nand: No NAND device found
[  180.547645] fsl-quadspi 1550000.quadspi: cmd 0x9f timeout, addr@00000000, FR:0xffffffff, SR:0x00000000
[  181.547530] fsl-quadspi 1550000.quadspi: cmd 0x9f timeout, addr@00000000, FR:0xffffffff, SR:0x00000000
[  181.548801] fsl-quadspi 1550000.quadspi: Freescale QuadSPI probe failed
[  181.554510] fsl-quadspi: probe of 1550000.quadspi failed with error -2
[  181.605965] libphy: Fixed MDIO Bus: probed
[  181.613783] tun: Universal TUN/TAP device driver, 1.6
[  181.614639] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[  181.689460] libphy: Freescale XGMAC MDIO Bus: probed
[  183.383698] libphy: Freescale XGMAC MDIO Bus: probed
[  183.693295] libphy: Freescale XGMAC MDIO Bus: probed
[  183.701213] libphy: Freescale XGMAC MDIO Bus: probed
[  183.708638] libphy: Freescale XGMAC MDIO Bus: probed
[  183.713684] libphy: Freescale XGMAC MDIO Bus: probed
[  183.720399] libphy: Freescale XGMAC MDIO Bus: probed
[  183.727568] libphy: Freescale XGMAC MDIO Bus: probed
[  183.734099] libphy: Freescale XGMAC MDIO Bus: probed
[  183.745526] libphy: Freescale XGMAC MDIO Bus: probed
[  183.803564] cpu 3: ! MAJOR FM Error [CPU03, ../drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/fm.c:137 CheckFmParameters]: Invalid Value;
[  183.809921] cpu 3: dma_aid_mode not supported by this integration.[  183.811504] cpu 3:
[  183.812269] cpu 3: ! MAJOR FM Error [CPU03, ../drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/fm.c:3512 FM_Init]: Invalid Value;
[  183.814587] cpu 3: [  183.815377] cpu 3:
[  183.817805] cpu 3: ! MAJOR FM Error [CPU03, ../drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm.c:1099 InitFmDev]: Invalid State;
[  183.824491] cpu 3: FM[  183.825278] cpu 3:
[  183.829432] fsl-fman: probe of 1a00000.fman failed with error -5
[  183.835574] Freescale FM module, FMD API version 21.1.0
[  183.844579] fsl-fman-port: probe of 1a82000.port failed with error -5
[  183.850946] fsl-fman-port: probe of 1a83000.port failed with error -5
[  183.854313] fsl-fman-port: probe of 1a84000.port failed with error -5
[  183.856616] fsl-fman-port: probe of 1a85000.port failed with error -5
[  183.861868] fsl-fman-port: probe of 1a86000.port failed with error -5
[  183.864358] fsl-fman-port: probe of 1a87000.port failed with error -5
[  183.869159] fsl-fman-port: probe of 1a88000.port failed with error -5
[  183.871775] fsl-fman-port: probe of 1aa8000.port failed with error -5
[  183.874054] fsl-fman-port: probe of 1a89000.port failed with error -5
[  183.879965] fsl-fman-port: probe of 1aa9000.port failed with error -5
[  183.881931] fsl-fman-port: probe of 1a8a000.port failed with error -5
[  183.883747] fsl-fman-port: probe of 1aaa000.port failed with error -5
[  183.888476] fsl-fman-port: probe of 1a8b000.port failed with error -5
[  183.890161] fsl-fman-port: probe of 1aab000.port failed with error -5
[  183.892123] fsl-fman-port: probe of 1a8c000.port failed with error -5
[  183.894525] fsl-fman-port: probe of 1aac000.port failed with error -5
[  183.900630] fsl-fman-port: probe of 1a8d000.port failed with error -5
[  183.903143] fsl-fman-port: probe of 1aad000.port failed with error -5
[  183.905586] fsl-fman-port: probe of 1a90000.port failed with error -5
[  183.911865] fsl-fman-port: probe of 1ab0000.port failed with error -5
[  183.914582] fsl-fman-port: probe of 1a91000.port failed with error -5
[  183.919196] fsl-fman-port: probe of 1ab1000.port failed with error -5
[  183.925529] Freescale FM Ports module
[  183.930926] fsl_mac: fsl_mac: FSL FMan MAC API based driver
[  183.941196] fsl_dpa: FSL DPAA Ethernet driver
[  183.955834] fsl_dpa fsl,dpaa:ethernet@2: of_find_device_by_node(/soc/fman@1a00000/ethernet@e4000) failed
[  183.964765] fsl_dpa: probe of fsl,dpaa:ethernet@2 failed with error -22
[  183.972278] fsl_dpa fsl,dpaa:ethernet@3: of_find_device_by_node(/soc/fman@1a00000/ethernet@e6000) failed
[  183.974914] fsl_dpa: probe of fsl,dpaa:ethernet@3 failed with error -22
[  183.980941] fsl_dpa fsl,dpaa:ethernet@4: of_find_device_by_node(/soc/fman@1a00000/ethernet@e8000) failed
[  183.984175] fsl_dpa: probe of fsl,dpaa:ethernet@4 failed with error -22
[  183.990184] fsl_dpa fsl,dpaa:ethernet@5: of_find_device_by_node(/soc/fman@1a00000/ethernet@ea000) failed
[  183.991728] fsl_dpa: probe of fsl,dpaa:ethernet@5 failed with error -22
[  183.994398] fsl_dpa fsl,dpaa:ethernet@8: of_find_device_by_node(/soc/fman@1a00000/ethernet@f0000) failed
[  183.995925] fsl_dpa: probe of fsl,dpaa:ethernet@8 failed with error -22
[  184.000515] fsl_dpa fsl,dpaa:ethernet@9: of_find_device_by_node(/soc/fman@1a00000/ethernet@f2000) failed
[  184.002661] fsl_dpa: probe of fsl,dpaa:ethernet@9 failed with error -22
[  184.005407] fsl_advanced: FSL DPAA Advanced drivers:
[  184.009913] fsl_proxy: FSL DPAA Proxy initialization driver
[  184.019760] fsl_dpa_shared: FSL DPAA Shared Ethernet driver
[  184.030854] fsl_dpa_macless: FSL DPAA MACless Ethernet driver
[  184.040941] fsl_oh: FSL FMan Offline Parsing port driver
[  184.050421] e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI
[  184.052395] e1000: Copyright (c) 1999-2006 Intel Corporation.
[  184.060637] e1000e: Intel(R) PRO/1000 Network Driver - 2.3.2-k
[  184.063402] e1000e: Copyright(c) 1999 - 2014 Intel Corporation.
[  184.065917] sky2: driver version 1.30
[  184.138477] VFIO - User Level meta-driver version: 0.3
[  184.209155] vfio_fsl_mc_driver_init: Driver registration fails as no fsl_mc_bus found
[  184.264459] dwc3 2f00000.usb: this is not a DesignWare USB3 DRD Core
[  184.269841] dwc3 2f00000.usb: failed to initialize core
[  184.281393] dwc3 3000000.usb: this is not a DesignWare USB3 DRD Core
[  184.284622] dwc3 3000000.usb: failed to initialize core
[  184.291060] dwc3 3100000.usb: this is not a DesignWare USB3 DRD Core
[  184.292759] dwc3 3100000.usb: failed to initialize core
[  184.364841] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[  184.389252] ehci-pci: EHCI PCI platform driver
[  184.403425] ehci-platform: EHCI generic platform driver
[  184.424526] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[  184.433852] ohci-pci: OHCI PCI platform driver
[  184.460716] ohci-platform: OHCI generic platform driver
[  184.540858] usbcore: registered new interface driver usb-storage
[  184.590346] mousedev: PS/2 mouse device common for all mice
[  184.671105] rtc-pcf2127 1-0051: chip found, driver version 0.0.1
[  184.829317] rtc-pcf2127 1-0051: pcf2127_get_datetime: read error
[  184.910663] rtc-pcf2127 1-0051: rtc core: registered rtc-pcf2127 as rtc0
[  184.947195] i2c /dev entries driver
[  185.148716] ina2xx 0-0040: error configuring the device: -110
[  185.155213] 0-004c supply vcc not found, using dummy regulator
[  185.257520] lm90 0-004c: Register 0x4 read failed (-110)
[  185.258221] lm90 0-004c: Failed to read convrate register!
[  185.457230] lm90 0-004c: Register 0x3 read failed (-110)
[  185.457832] lm90 0-004c: Initialization failed!
[  185.508164] imx2-wdt 2ad0000.watchdog: timeout 60 sec (nowayout=0)
[  185.583901] qoriq_cpufreq: Freescale QorIQ CPU frequency scaling driver
[  185.590108] CPUidle arm: CPU 0 failed to init idle CPU ops
[  185.594340] sdhci: Secure Digital Host Controller Interface driver
[  185.595819] sdhci: Copyright(c) Pierre Ossman
[  185.600877] sdhci-pltfm: SDHCI platform and OF driver helper
[  185.658996] sdhci-esdhc 1560000.esdhc: No vmmc regulator found
[  185.660924] sdhci-esdhc 1560000.esdhc: No vqmmc regulator found
[  185.741316] mmc0: SDHCI controller on 1560000.esdhc [1560000.esdhc] using ADMA
ls1_mmci_wakequeues: rsplen 0 (< 4)
ls1_mmci_wakequeues: rsplen 0 (< 4)
ls1_mmci_wakequeues: rsplen 0 (< 4)
ls1_mmci_wakequeues: rsplen 0 (< 4)
ls1_mmci_wakequeues: rsplen 0 (< 4)
ls1_mmci_wakequeues: rsplen 0 (< 4)
[  185.835651] MC object device driver fsl_dpaa2_caam registered
[  185.893201] usbcore: registered new interface driver usbhid
[  185.894812] usbhid: USB HID core driver
[  185.904297] fsl-mc bus not found, restool driver registration failed
[  185.919269] MC object device driver fsl_dpio_drv registered
[  186.010281] Freescale USDPAA process driver
[  186.013941] fsl-usdpaa: no region found
[  186.024451] Freescale USDPAA process IRQ driver
[  186.043962] mmc0: new SDHC card at address 4567
[  186.049181] MC object device driver fsl_dpaa2_eth registered
[  186.051419] MC object device driver dpaa2_mac registered
[  186.064761] MC object device driver dpaa2_ethsw registered
[  186.071612] MC object device driver dpaa2_evb registered
[  186.075404] MC object device driver fsl_dce_api registered
[  186.085006] MC object device driver dpaa2_rtc registered
[  186.114675] Initializing XFRM netlink socket
[  186.133725] NET: Registered protocol family 10
[  186.140022] mmcblk0: mmc0:4567 QEMU! 4.00 GiB
[  186.249599] sit: IPv6 over IPv4 tunneling driver
[  186.269010]  mmcblk0: p1
[  186.293846] NET: Registered protocol family 17
[  186.299097] NET: Registered protocol family 15
[  186.308584] 8021q: 802.1Q VLAN Support v1.8
[  186.324297] 9pnet: Installing 9P2000 support
[  186.359469] Key type dns_resolver registered
[  186.416481] registered taskstats version 1
[  186.452709] fsl_generic: FSL DPAA Generic Ethernet driver
[  186.557572] rtc-pcf2127 1-0051: pcf2127_get_datetime: read error
[  186.558484] rtc-pcf2127 1-0051: hctosys: unable to read the hardware clock
[  186.902861] Freeing unused kernel memory: 488K (ffff800000b48000 - ffff800000bc2000)
[  186.905327] Freeing alternatives memory: 52K (ffff800000bc2000 - ffff800000bcf000)
INIT: version 2.88 booting
[  187.384848] hrtimer: interrupt took 48617776 ns
Starting udev
[  199.993140] udevd[996]: starting version 182
[  208.549759] mmcblk0: r/w command failed, status = 0x40000b00
[  208.676654] mmc0: tried to reset card
[  208.685602] mmcblk0: r/w command failed, status = 0x40000b00
[  208.689433] blk_update_request: I/O error, dev mmcblk0, sector 8388600
[  208.738275] mmcblk0: r/w command failed, status = 0x40000b00
[  208.742510] blk_update_request: I/O error, dev mmcblk0, sector 8388600
[  208.755810] Buffer I/O error on dev mmcblk0, logical block 1048575, async page read
udevd[999]: timeout: killing '/etc/udev/scripts/mount.sh' [1021]

udevd[999]: '/etc/udev/scripts/mount.sh' [1021] terminated by signal 9 (Killed)

udevd[1009]: timeout: killing '/etc/udev/scripts/mount.sh' [1026]

udevd[1017]: timeout: killing '/etc/udev/scripts/mount.sh' [1039]

udevd[1011]: timeout: killing '/etc/udev/scripts/mount.sh' [1034]

udevd[1014]: timeout: killing '/etc/udev/scripts/mount.sh' [1038]

udevd[1025]: timeout: killing '/etc/udev/scripts/mount.sh' [1041]

udevd[1001]: timeout: killing '/etc/udev/scripts/mount.sh' [1032]
udevd[1013]: timeout: killing '/etc/udev/scripts/mount.sh' [1030]
udevd[1002]: timeout: killing '/etc/udev/scripts/mount.sh' [1042]

udevd[1012]: timeout: killing '/etc/udev/scripts/mount.sh' [1027]

udevd[1005]: timeout: killing '/etc/udev/scripts/mount.sh' [1043]

udevd[1007]: timeout: killing '/etc/udev/scripts/mount.sh' [1029]

udevd[1016]: timeout: killing '/etc/udev/scripts/mount.sh' [1036]


udevd[1003]: timeout: killing '/etc/udev/scripts/mount.sh' [1045]

udevd[1011]: '/etc/udev/scripts/mount.sh' [1034] terminated by signal 9 (Killed)

udevd[1017]: '/etc/udev/scripts/mount.sh' [1039] terminated by signal 9 (Killed)


udevd[1008]: timeout: killing '/etc/udev/scripts/mount.sh' [1031]

udevd[1010]: timeout: killing '/etc/udev/scripts/mount.sh' [1028]

udevd[1004]: timeout: killing '/etc/udev/scripts/mount.sh' [1047]

udevd[1006]: timeout: killing '/etc/udev/scripts/mount.sh' [1049]
udevd[1016]: '/etc/udev/scripts/mount.sh' [1036] terminated by signal 9 (Killed)

udevd[1000]: timeout: killing '/etc/udev/scripts/mount.sh' [1046]


udevd[1003]: '/etc/udev/scripts/mount.sh' [1045] terminated by signal 9 (Killed)

udevd[1001]: timeout: killing '/etc/udev/scripts/mount.sh' [1032]

udevd[1009]: '/etc/udev/scripts/mount.sh' [1026] terminated by signal 9 (Killed)

udevd[1014]: '/etc/udev/scripts/mount.sh' [1038] terminated by signal 9 (Killed)

udevd[1008]: '/etc/udev/scripts/mount.sh' [1031] terminated by signal 9 (Killed)

udevd[1013]: '/etc/udev/scripts/mount.sh' [1030] terminated by signal 9 (Killed)

udevd[1006]: '/etc/udev/scripts/mount.sh' [1049] terminated by signal 9 (Killed)
udevd[1005]: '/etc/udev/scripts/mount.sh' [1043] terminated by signal 9 (Killed)

udevd[1001]: '/etc/udev/scripts/mount.sh' [1032] terminated by signal 9 (Killed)

udevd[1004]: '/etc/udev/scripts/mount.sh' [1047] terminated by signal 9 (Killed)


udevd[1010]: '/etc/udev/scripts/mount.sh' [1028] terminated by signal 9 (Killed)
udevd[1025]: '/etc/udev/scripts/mount.sh' [1041] terminated by signal 9 (Killed)

udevd[1002]: '/etc/udev/scripts/mount.sh' [1042] terminated by signal 9 (Killed)

[  248.590907] mmcblk0: r/w command failed, status = 0x40000b00

udevd[1007]: '/etc/udev/scripts/mount.sh' [1029] terminated by signal 9 (Killed)

udevd[1012]: '/etc/udev/scripts/mount.sh' [1027] terminated by signal 9 (Killed)
udevd[1033]: timeout: killing '/etc/udev/scripts/mount.sh' [1052]

[  248.802594] mmc0: tried to reset card
[  248.813772] mmcblk0: r/w command failed, status = 0x40000b00
[  248.820798] blk_update_request: I/O error, dev mmcblk0, sector 8388600
[  248.872319] mmcblk0: r/w command failed, status = 0x40000b00
[  248.877792] blk_update_request: I/O error, dev mmcblk0, sector 8388600

[  248.898861] Buffer I/O error on dev mmcblk0p1, logical block 1048319, async page read
udevd[1000]: '/etc/udev/scripts/mount.sh' [1046] terminated by signal 9 (Killed)

udevd[1033]: '/etc/udev/scripts/mount.sh' [1052] terminated by signal 9 (Killed)

udevd[1035]: timeout: killing '/etc/udev/scripts/mount.sh' [1057]

udevd[1037]: timeout: killing '/etc/udev/scripts/mount.sh' [1060]

udevd[1035]: '/etc/udev/scripts/mount.sh' [1057] terminated by signal 9 (Killed)

udevd[1037]: '/etc/udev/scripts/mount.sh' [1060] terminated by signal 9 (Killed)

udevd[1040]: timeout: killing '/etc/udev/scripts/mount.sh' [1056]

udevd[1040]: '/etc/udev/scripts/mount.sh' [1056] terminated by signal 9 (Killed)

udevd[1044]: timeout: killing '/etc/udev/scripts/mount.sh' [1062]

udevd[1044]: '/etc/udev/scripts/mount.sh' [1062] terminated by signal 9 (Killed)

udevd[1048]: timeout: killing '/etc/udev/scripts/mount.sh' [1063]

udevd[1048]: '/etc/udev/scripts/mount.sh' [1063] terminated by signal 9 (Killed)

[  271.695304] random: dd urandom read with 15 bits of entropy available
Populating dev cache
ALSA: Restoring mixer settings...
/usr/sbin/alsactl: load_state:1735: No soundcards found...
[  435.774983] rtc-pcf2127 1-0051: pcf2127_get_datetime: read error
hwclock: RTC_RD_TIME: Input/output error
Sun Dec 31 02:52:31 UTC 2017
[  437.847766] rtc-pcf2127 1-0051: pcf2127_set_datetime: err=-110
hwclock: RTC_SET_TIME: Input/output error
[  437.949039] rtc-pcf2127 1-0051: pcf2127_get_datetime: read error
Running postinst /etc/rpm-postinsts/100-sysvinit-inittab...
update-rc.d: /etc/init.d/run-postinsts exists during rc.d purge (continuing)
 Removing any system startup links for run-postinsts ...
  /etc/rcS.d/S99run-postinsts
INIT: Entering runlevel: 5
Configuring network interfaces... done.
Starting system message bus: dbus.
Starting OpenBSD Secure Shell server: sshd
  generating ssh RSA key...
  generating ssh ECDSA key...
  generating ssh DSA key...
  generating ssh ED25519 key...
done.
Starting rpcbind daemon...done.
starting statd: done
[  497.508169] rtc-pcf2127 1-0051: pcf2127_get_datetime: read error
hwclock: RTC_RD_TIME: Input/output error
exportfs: can't open /etc/exports for reading
NFS daemon support not enabled in kernel
starting rsyslogd ... done
Starting internet superserver: xinetd.

QorIQ SDK (FSL Reference Distro) 2.0 ls1046ardb /dev/ttyS0

ls1046ardb login: root
root@ls1046ardb:~# cat /proc/cpuinfo
processor       : 0
BogoMIPS        : 125.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x1
CPU part        : 0xd07
CPU revision    : 0

processor       : 1
BogoMIPS        : 125.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x1
CPU part        : 0xd07
CPU revision    : 0

processor       : 2
BogoMIPS        : 125.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x1
CPU part        : 0xd07
CPU revision    : 0

processor       : 3
BogoMIPS        : 125.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x1
CPU part        : 0xd07
CPU revision    : 0

root@ls1046ardb:~# QEMU: Terminated

去年内に起動させられなかったのは心残りだが、正月休みのうちにログインできるところまで持っていけたのは良かった。

一区切りにはなったけど、以下の改善は行っておきたい。

  • 山ほど出ている起動時エラーの低減
  • qemu の追加デバイスネームスペースの統一 (qoriq / ls1 → layerscape or ls1)

それができれば、 qemu に仕事で使っているカスタムボードのエミュレーションを追加していきたい。

initramfs を再構築する

Qemu 上での Kernel デバッグにおいて、 init が正常に動作しないという問題 (こちらは Qemu の UART デバイスに対する割り込み線の設定ミスだった) を調査するため、 initramfs をいじっていたので、 cpio の展開 / 再圧縮手順をまとめておく。

cpio の展開

### gz を展開する (ホントは cpio とまとめてワンライナーにしたいけど調査不足)
$ gzip -d initramfs.cpio.gz
$ ls
initramfs.cpio

### cpio を展開する
$ mkdir initramfs
$ cd initramfs
$ cpio -ivd < ../initramfs.cpio

cpio の再構築

$ cd initramfs
$ find . | cpio -H newc -o | gzip > ../initramfs.cpio.gz