Coder Social home page Coder Social logo

bobuhiro11 / gokvm Goto Github PK

View Code? Open in Web Editor NEW
186.0 6.0 20.0 6.25 MB

KVM based tiny x86 hypervisor written in pure golang, which can boot Linux

Home Page: https://blog.bobuhiro11.net/tags/gokvm.html

License: MIT License

Makefile 1.15% Go 96.88% Shell 1.79% Assembly 0.18%
go kvm linux kernel golang hypervisor vmm

gokvm's People

Contributors

bobuhiro11 avatar chrimarme avatar cs8425 avatar rminnich avatar rminnichcodeu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gokvm's Issues

Need vhost / vsock support

In some environments, the only available network is vhost / vsock. It would be wonderful to have this in gokvm.

Create a new release

It would be helpful to create a new release, since Go tests now run git to test ./...

Discussion: What modes of booting to support.

Moin,

I want to start a discussion about the supported modes of booting the VM.

We have:

  • classic Linux bzImage + initramfs
  • classic Linux ELF file + initramfs

Incoming PVH boot ABI support for

  • EDK2/CloudHv firmware

PVH can be extended to load Kernel+initramfs as well.

Do you want to keep the classic style of loading kernel and initramfs or should we reduce it to PVH as soon as the support of PVH to load a Kernel and initramfs is implemented?

shutdown command got hung

Thanks for this nice project!

I've created the initrd and vmlinux file, and start the VM successfully! Then when I run shutdown command, it just got hung and not respond anymore. Do you have any idea?

1999/11/30 00:00:01 Welcome to u-root!
                              _
   _   _      _ __ ___   ___ | |_
  | | | |____| '__/ _ \ / _ \| __|
  | |_| |____| | | (_) | (_) | |_
   \__,_|    |_|  \___/ \___/ \__|

loading .bashrc started.
1999/11/30 00:00:01 ip: Link not found
1999/11/30 00:00:01 ip: Link not found
nohup: PID TTY            TIME CMD
appending output to 'nohup.out'
31 console    00:00:00 defaultsh
51 null       00:00:00 nohup
52 console    00:00:00 ps
loading .bashrc finished.
defaultsh-5.0# exit
exit
sh-5.0# shutdown
[ 1125.322811][   T60] reboot: System halted

Panic: unexpected kvm exit reason 8

Hi, I was trying out your project but haven't been able to get it to boot Linux. I ran make bzImage and make initrd (after installing libmnl static libraries from source), and then ./gokvm. This appears to start booting, but then gokvm crashes:

early console in extract_kernel
input_data: 0x00000000025f82bf
input_len: 0x00000000001fb058
output: 0x0000000001000000
output_len: 0x0000000000fe2740
kernel_total_size: 0x0000000001818000
needed_size: 0x0000000001a00000
trampoline_32bit: 0x000000000009d000

...

[    0.186781][    T0]   ---------------------
[    0.187026][    T0]           local_lock inversion  2:  ok  |
[    0.187532][    T0]           local_lock inversion 3A:  ok  |
[    0.188051][    T0]           local_lock inversion 3B:  ok  |
[    0.188569][    T0]       hardirq_unsafe_softirq_safe:  ok  |
[    0.189121][    T0] -------------------------------------------------------
[    0.189522][    T0] Good, all 349 testcases passed! |
[    0.189816][    T0] ---------------------------------
[    0.190162][    T0] APIC: Switch to symmetric I/O mode setup
[    0.190491][    T0] Not enabling interrupt remapping due to skipped IO-APIC setup
[    0.190922][    T0] Switched APIC routing to physical flat.
[    0.191258][    T0] enabled ExtINT on CPU#0
[    0.191515][    T0] Calibrating delay loop (skipped), value calculated using timer frequency.. 5606.27 BogoMIPS (lpj=11212544)
[    0.192173][    T0] pid_max: default: 32768 minimum: 512
[    0.192521][    T0] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.192997][    T0] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.193919][    T0] Disabled fast string operations
[    0.195568][    T0] Last level iTLB entries: 4KB 0, 2MB 0, 4MB 0
[    0.195922][    T0] Last level dTLB entries: 4KB 0, 2MB 0, 4MB 0, 1GB 0
[    0.196305][    T0] Speculative Store Bypass: Vulnerable
panic: unexpected kvm exit reason: 8

                                    goroutine 10 [running]:
                                                           main.main.func1(0x0?)
                                                                               /home/zyedidia/programming/gokvm/main.go:30 +0x6e
                                                created by main.main
                                                                    	/home/zyedidia/programming/gokvm/main.go:28 +0x185

I think this exit reason corresponds to KVM_EXIT_SHUTDOWN, but I'm not sure why KVM would return a shutdown code at this point in execution. Thanks for any insight you might have!

flaky tests in kvm package

In cdd4683 ("Merge pull request #135 from bobuhiro11/add_travis_retry"),
repeated tests against the kvm package occasionally fail.
On my machine it fails 8 times out of 100.

ubuntu2004thinkpad:~/gokvm$  \
for i in `seq 100`; do 
  sudo env "PATH=$PATH" go test ./kvm/...  -count=1 -p=1 2>&1 >/dev/null
  echo -n $?
done

# 0 means success, 1 means faillure.
0000000000000001100100000000000000000000000001000000000001010000000010000000100000000000000000000000

Although the failing test cases were varied,
the message was all the same: "strings: illegal use of non-zero builder copied by value."

--- FAIL: TestGetSetSRegs2 (0.00s)
panic: strings: illegal use of non-zero Builder copied by value [recovered]
        panic: strings: illegal use of non-zero Builder copied by value

goroutine 40 [running]:
testing.tRunner.func1.2({0x515780, 0x568db0})
        /home/bobuhiro11/.goenv/versions/1.19.0/src/testing/testing.go:1396 +0x24e
testing.tRunner.func1()
        /home/bobuhiro11/.goenv/versions/1.19.0/src/testing/testing.go:1399 +0x39f
panic({0x515780, 0x568db0})
        /home/bobuhiro11/.goenv/versions/1.19.0/src/runtime/panic.go:884 +0x212
strings.(*Builder).copyCheck(...)
        /home/bobuhiro11/.goenv/versions/1.19.0/src/strings/builder.go:42
strings.(*Builder).WriteString(...)
        /home/bobuhiro11/.goenv/versions/1.19.0/src/strings/builder.go:123
testing.(*common).decorate(0x28?, {0xc0002294d0, 0x28}, 0x1000000000010?)
        /home/bobuhiro11/.goenv/versions/1.19.0/src/testing/testing.go:670 +0x6f8
testing.(*common).logDepth(0xc000136b60, {0xc0002294d0, 0x28}, 0x3)
        /home/bobuhiro11/.goenv/versions/1.19.0/src/testing/testing.go:907 +0x1f5
testing.(*common).log(...)
        /home/bobuhiro11/.goenv/versions/1.19.0/src/testing/testing.go:876
testing.(*common).Skipf(0xc000136b60, {0x53fbd6?, 0x2?}, {0x0?, 0x0?, 0x0?})
        /home/bobuhiro11/.goenv/versions/1.19.0/src/testing/testing.go:968 +0x5a
github.com/bobuhiro11/gokvm/kvm_test.TestGetSetSRegs2(0xc000136b60)
        /home/bobuhiro11/gokvm/kvm/kvm_test.go:1316 +0x2a7
testing.tRunner(0xc000136b60, 0x543e98)
        /home/bobuhiro11/.goenv/versions/1.19.0/src/testing/testing.go:1446 +0x10b
created by testing.(*T).Run
        /home/bobuhiro11/.goenv/versions/1.19.0/src/testing/testing.go:1493 +0x35f

data race in virtio net

Go can detect race conditions by giving the -race option.
According to the results, there is apparently a data race for virtio net in
cdd4683 ("Merge pull request #135 from bobuhiro11/add_travis_retry").

We may need to implement some locking mechanism (e.g. sync.Mutex) for virtio data.

ubuntu2004thinkpad:~/gokvm$ sudo env "PATH=$PATH" go test ./machine/... -race

...

==================
WARNING: DATA RACE
Read at 0x00c00038e048 by goroutine 14:
  github.com/bobuhiro11/gokvm/virtio.(*Net).IOInHandler()
      <autogenerated>:1 +0x85
  github.com/bobuhiro11/gokvm/pci.Device.IOInHandler-fm()
      <autogenerated>:1 +0x81
  github.com/bobuhiro11/gokvm/machine.(*Machine).RunOnce()
      /home/bobuhiro11/gokvm/machine/machine.go:683 +0x9a2
  github.com/bobuhiro11/gokvm/machine.(*Machine).RunInfiniteLoop()
      /home/bobuhiro11/gokvm/machine/machine.go:648 +0xaa
  github.com/bobuhiro11/gokvm/machine_test.testNewAndLoadLinux.func1()
      /home/bobuhiro11/gokvm/machine/machine_test.go:63 +0x44

Previous write at 0x00c00038e048 by goroutine 12:
  github.com/bobuhiro11/gokvm/virtio.(*Net).Rx()
      /home/bobuhiro11/gokvm/virtio/net.go:169 +0x335
  github.com/bobuhiro11/gokvm/virtio.(*Net).RxThreadEntry()
      /home/bobuhiro11/gokvm/virtio/net.go:101 +0x84
  github.com/bobuhiro11/gokvm/machine.(*Machine).AddTapIf.func2()
      /home/bobuhiro11/gokvm/machine/machine.go:196 +0x39

Goroutine 14 (running) created at:
  github.com/bobuhiro11/gokvm/machine_test.testNewAndLoadLinux()
      /home/bobuhiro11/gokvm/machine/machine_test.go:62 +0x989
  github.com/bobuhiro11/gokvm/machine_test.TestNewAndLoadLinuxWithBzImage()
      /home/bobuhiro11/gokvm/machine/machine_test.go:99 +0x71
  testing.tRunner()
      /home/bobuhiro11/.goenv/versions/1.19.0/src/testing/testing.go:1446 +0x216
  testing.(*T).Run.func1()
      /home/bobuhiro11/.goenv/versions/1.19.0/src/testing/testing.go:1493 +0x47

Goroutine 12 (running) created at:
  github.com/bobuhiro11/gokvm/machine.(*Machine).AddTapIf()
      /home/bobuhiro11/gokvm/machine/machine.go:196 +0x1b3
  github.com/bobuhiro11/gokvm/machine_test.testNewAndLoadLinux()
      /home/bobuhiro11/gokvm/machine/machine_test.go:28 +0x255
  github.com/bobuhiro11/gokvm/machine_test.TestNewAndLoadLinuxWithBzImage()
      /home/bobuhiro11/gokvm/machine/machine_test.go:99 +0x71
  testing.tRunner()
      /home/bobuhiro11/.goenv/versions/1.19.0/src/testing/testing.go:1446 +0x216
  testing.(*T).Run.func1()
      /home/bobuhiro11/.goenv/versions/1.19.0/src/testing/testing.go:1493 +0x47
==================

CI credits: Whoopsie

Hi, I guess I pushed to the repo too much and TravisCI blocks further builds.

Is there anything I can do?

a poweroff command should result in an exit

If you run a poweroff command in (e.g.) qemu or cloud hypervisor, the vmm exits. This is very convenient.

It would be nice if gokvm did too. I will try to see why it does not.

panic when experiment gokvm with custom init binary

Hi,

We are testing the ability to start a VM with gokvm and custom built init static library here in Create a minimal initramfs with only a Go binary section

  • kernel image: 5.10.12 (using make bzImage)
  • go version: go1.16.7
  • init static binary: build from above example

Result

$ ./gokvm -k ./bzImage -i initramfs.cpio.gz
[    0.000000][    T0] Linux version 5.10.12 (gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, GNU ld (GNU Binutils for Ubuntu) 2.30) #3 Tue Sep 14 15:45:14 +07 2021
[    0.000000][    T0] Command line: console=ttyS0
[    0.000000][    T0] Disabled fast string operations
[    0.000000][    T0] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[    0.000000][    T0] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[    0.000000][    T0] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[    0.000000][    T0] x86/fpu: Supporting XSAVE feature 0x008: 'MPX bounds registers'
[    0.000000][    T0] x86/fpu: Supporting XSAVE feature 0x010: 'MPX CSR'
[    0.000000][    T0] x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256
[    0.000000][    T0] x86/fpu: xstate_offset[3]:  832, xstate_sizes[3]:   64
[    0.000000][    T0] x86/fpu: xstate_offset[4]:  896, xstate_sizes[4]:   64
[    0.000000][    T0] x86/fpu: Enabled xstate features 0x1f, context size is 960 bytes, using 'compacted' format.
[    0.000000][    T0] BIOS-provided physical RAM map:
[    0.000000][    T0] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[    0.000000][    T0] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
[    0.000000][    T0] BIOS-e820: [mem 0x00000000000f0000-0x00000000000ffffe] reserved
[    0.000000][    T0] BIOS-e820: [mem 0x0000000000100000-0x000000003fffffff] usable
[    0.000000][    T0] NX (Execute Disable) protection: active
[    0.000000][    T0] tsc: Fast TSC calibration using PIT
[    0.000000][    T0] tsc: Detected 3600.049 MHz processor
[    0.000110][    T0] e820: remove [mem 0x000a0000-0x000fffff] usable
[    0.000112][    T0] last_pfn = 0x40000 max_arch_pfn = 0x400000000
[    0.000116][    T0] x86/PAT: Configuration [0-7]: WB  WT  UC- UC  WB  WT  UC- UC  
[    0.008027][    T0] Using GB pages for direct mapping
[    0.008077][    T0] RAMDISK: [mem 0x0f000000-0x0f103fff]
[    0.015562][    T0] Zone ranges:
[    0.015568][    T0]   DMA32    [mem 0x0000000000000000-0x000000003fffffff]
[    0.015569][    T0]   Normal   empty
[    0.015570][    T0] Movable zone start for each node
[    0.015570][    T0] Early memory node ranges
[    0.015571][    T0]   node   0: [mem 0x0000000000000000-0x000000000009efff]
[    0.015574][    T0]   node   0: [mem 0x0000000000100000-0x000000003fffffff]
[    0.015576][    T0] Zeroed struct page in unavailable ranges: 97 pages
[    0.015576][    T0] Initmem setup node 0 [mem 0x0000000000000000-0x000000003fffffff]
[    0.015578][    T0] On node 0 totalpages: 262047
[    0.015580][    T0]   DMA32 zone: 3584 pages used for memmap
[    0.015581][    T0]   DMA32 zone: 22 pages reserved
[    0.015582][    T0]   DMA32 zone: 262047 pages, LIFO batch:63
[    0.016540][    T0] [mem 0x40000000-0xffffffff] available for PCI devices
[    0.016542][    T0] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645519600211568 ns
[    0.016571][    T0] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.016572][    T0] pcpu-alloc: [0] 0 
[    0.016578][    T0] Built 1 zonelists, mobility grouping on.  Total pages: 258441
[    0.016579][    T0] Kernel command line: console=ttyS0
[    0.017066][    T0] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.017301][    T0] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.017328][    T0] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.019157][    T0] Memory: 1020592K/1048188K available (4097K kernel code, 765K rwdata, 268K rodata, 480K init, 796K bss, 27340K reserved, 0K cma-reserved)
[    0.019190][    T0] NR_IRQS: 4352, nr_irqs: 24, preallocated irqs: 16
[    0.019432][    T0] Console: colour dummy device 80x25
[    0.035635][    T0] printk: console [ttyS0] enabled
[    0.035874][    T0] APIC: ACPI MADT or MP tables are not detected
[    0.036184][    T0] APIC: Switch to virtual wire mode setup with no configuration
[    0.036544][    T0] Not enabling interrupt remapping due to skipped IO-APIC setup
[    0.036948][    T0] clocksource: tsc-early: mask: 0xffffffffffffffff max_cycles: 0x33e481a905d, max_idle_ns: 440795228934 ns
[    0.037485][    T0] Calibrating delay loop (skipped), value calculated using timer frequency.. 7200.09 BogoMIPS (lpj=14400196)
[    0.038030][    T0] pid_max: default: 4096 minimum: 301
[    0.038300][    T0] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.038697][    T0] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.039246][    T0] Disabled fast string operations
[    0.039501][    T0] Last level iTLB entries: 4KB 128, 2MB 8, 4MB 8
[    0.039798][    T0] Last level dTLB entries: 4KB 64, 2MB 0, 4MB 0, 1GB 4
[    0.040119][    T0] CPU: Intel 06/9e (family: 0x6, model: 0x9e, stepping: 0xd)
[    0.041487][    T0] Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization
[    0.041927][    T0] Spectre V2 : Mitigation: Enhanced IBRS
[    0.042176][    T0] Spectre V2 : Spectre v2 / SpectreRSB mitigation: Filling RSB on context switch
[    0.042582][    T0] Spectre V2 : mitigation: Enabling conditional Indirect Branch Prediction Barrier
[    0.042996][    T0] Speculative Store Bypass: Mitigation: Speculative Store Bypass disabled via prctl
[    0.043418][    T0] unchecked MSR access error: RDMSR from 0x123 at rIP: 0xffffffff8101734c (0xffffffff8101734c)
[    0.043922][    T0] Call Trace:
[    0.044067][    T0]  ? 0xffffffff81017744
[    0.044253][    T0]  ? 0xffffffff818cb8aa
[    0.044439][    T0]  ? 0xffffffff81076599
[    0.044623][    T0]  ? 0xffffffff818c1dd0
[    0.044815][    T0]  ? 0xffffffff81000107
[    0.045003][    T0] unchecked MSR access error: WRMSR to 0x123 (tried to write 0x0000000000000001) at rIP: 0xffffffff81017361 (0xffffffff81017361)
[    0.045486][    T0] Call Trace:
[    0.045632][    T0]  ? 0xffffffff818cb8aa
[    0.045816][    T0]  ? 0xffffffff81076599
[    0.045998][    T0]  ? 0xffffffff818c1dd0
[    0.046177][    T0]  ? 0xffffffff81000107
[    0.046354][    T0] SRBDS: Mitigation: TSX disabled
[    0.046774][    T1] Performance Events: Skylake events, 32-deep LBR, Intel PMU driver.
[    0.047146][    T1] ... version:                2
[    0.047362][    T1] ... bit width:              48
[    0.047581][    T1] ... generic registers:      8
[    0.047797][    T1] ... value mask:             0000ffffffffffff
[    0.048070][    T1] ... max period:             000000007fffffff
[    0.048344][    T1] ... fixed-purpose events:   3
[    0.048560][    T1] ... event mask:             00000007000000ff
[    0.048958][    T1] NMI watchdog: Enabled. Permanently consumes one hw-PMU counter.
[    0.275169][    T1] devtmpfs: initialized
[    0.275460][    T1] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.276318][    T1] clocksource: Switched to clocksource tsc-early
[    0.277094][    T1] Unpacking initramfs...
[    0.281148][    T1] Freeing initrd memory: 1040K
[    0.281485][    T1] platform rtc_cmos: registered platform RTC device (no PNP device found)
[    0.282019][    T1] workingset: timestamp_bits=62 max_order=18 bucket_order=0
[    0.286623][    T1] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.287070][    T1] serial8250: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 8250
[    0.799450][    T1] i8042: Can't read CTR while initializing i8042
[    0.799750][    T1] i8042: probe of i8042 failed with error -5
[    0.800075][    T1] random: get_random_bytes called from 0xffffffff81026e47 with crng_init=0
[    0.800076][    T1] sched_clock: Marking stable (781355937, 18089626)->(805023533, -5577970)
[    0.807111][    T1] Freeing unused kernel image (initmem) memory: 480K
[    0.809411][    T1] Write protecting the kernel read-only data: 8192k
[    0.812401][    T1] Freeing unused kernel image (text/rodata gap) memory: 2044K
[    0.815220][    T1] Freeing unused kernel image (rodata/data gap) memory: 1780K
[    0.817546][    T1] Run /init as init process
[    0.819758][    T1]   with arguments:
[    0.822194][    T1]     /init
[    0.824403][    T1]   with environment:
[    0.826835][    T1]     HOME=/
[    0.829027][    T1]     TERM=linux
futexwakeup addr=Hello from your custom built Linux kernel.
0x54b690 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38[    1.792229][   T13] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x33e481a905d, max_idle_ns: 440795228934 ns
[    1.794957][   T13] clocksource: Switched to clocksource tsc

futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38[    2.555973][    C0] random: fast init done

futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
futexwakeup addr=0x578308 returned -38
fatal: morestack on g0
[   10.510610][   T15] traps: init[15] trap int3 ip:4641a2 sp:c000038378 error:0 in init[400000+98000]
SIGTRAP: trace trap
PC=0x4641a2 m=2 sigcode=128

goroutine 0 [idle]:
runtime.abort()
  /usr/local/go/src/runtime/asm_amd64.s:854 +0x2
runtime.morestack()
  /usr/local/go/src/runtime/asm_amd64.s:425 +0x25

goroutine 1 [syscall]:
syscall.Syscall(0x1, 0x1, 0xc00006a030, 0x2b, 0x2b, 0x2b, 0x0)
  /usr/local/go/src/syscall/asm_linux_amd64.s:20 +0x5
syscall.write(0x1, 0xc00006a030, 0x2b, 0x30, 0x0, 0xc00005cc30, 0x4c1187)
  /usr/local/go/src/syscall/zsyscall_linux_amd64.go:914 +0x5a
syscall.Write(...)
  /usr/local/go/src/syscall/syscall_unix.go:212
internal/poll.ignoringEINTRIO(...)
  /usr/local/go/src/internal/poll/fd_unix.go:581
internal/poll.(*FD).Write(0xc00003c0c0, 0xc00006a030, 0x2b, 0x30, 0x0, 0x0, 0x0)
  /usr/local/go/src/internal/poll/fd_unix.go:274 +0x13a
os.(*File).write(...)
  /usr/local/go/src/os/file_posix.go:48
os.(*File).Write(0xc00000e020, 0xc00006a030, 0x2b, 0x30, 0x7f521a801280, 0x1, 0x10100c00003a058)
  /usr/local/go/src/os/file.go:174 +0x8e
fmt.Fprintln(0x4da038, 0xc00000e020, 0xc000056f68, 0x1, 0x1, 0x4056e5, 0xc000050058, 0x417901)
  /usr/local/go/src/fmt/print.go:265 +0x8b
fmt.Println(...)
  /usr/local/go/src/fmt/print.go:274
main.main()
  /home/dongnguyen/gokvm/source/main.go:9 +0x79

rax    0x17
rbx    0xc000028400
rcx    0x465a75
rdx    0x17
rdi    0x2
rsi    0x4bdb8e
rbp    0xc0000383c0
rsp    0xc000038378
r8     0x0
r9     0x0
r10    0x0
r11    0x206
r12    0xf2
r13    0x0
r14    0x4ba8e1
r15    0x0
rip    0x4641a2
rflags 0x206
cs     0x33
fs     0x0
gs     0x0
[   22.919139][   T17] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000200
[   22.919810][   T17] Kernel Offset: disabled
[   22.920013][   T17] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000200 ]---

any ideas what the problem could be or insights would be appreciate, thank you

add virtio for console

I suspect the serial power emulation, using interrupt injection, is a major overhead. It would be interesting to see if we could add virtio consolel

[BUG] Shutdown does not exits the VM

If inside VM linux:
u-root does provide shutdown command, and it shuts down the system, but does not exit the VM.

shutdown -r for rebooting leads to proper VMexit.

Which is kinda weird behaviour.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.