1. 03 May, 2019 1 commit
    • Kirill Smelkov's avatar
      t/qemu-runlinux: Issue terminal init before running program · 89fb8992
      Kirill Smelkov authored
      This continues 6ab95220 (t/qemu-runlinux: Issue terminal resize before
      running program) and fully initializes terminal before spawning user
      application.
      
      This has practical effect to restore line wrapping for xterm, as kernel,
      initially assuming it has "linux" type terminal, somehow messes xterm
      settings: before the patch lines that were wider than terminal width were
      not wrapped and characters in the last position were printed over each
      other. After the patch printed lines are automatically wrapped and test
      output is not lost.
      
      Tput hint found here:
      
      	https://unix.stackexchange.com/questions/105958
      89fb8992
  2. 17 Mar, 2019 1 commit
    • Kirill Smelkov's avatar
      t/qemu-runlinux: Kernel verbosity control via -v · 208aca62
      Kirill Smelkov authored
      	0: ERROR+ on boot/run
      	1: INFO+  on      run
      	2: INFO+  on boot/run
      	3: DEBUG+ on boot/run
      
      It is convenient not to see large kernel boot log on every test run. "1"
      (single -v) is also convenient: one can skip the boot log but still see
      details of what is going on when test workload is run. -vv and -vvv are
      there to see full picture.
      208aca62
  3. 27 Feb, 2019 3 commits
  4. 13 Feb, 2019 1 commit
    • Kirill Smelkov's avatar
      t/qemu-runlinux: Update · fe541453
      Kirill Smelkov authored
      Continuing 76d8f76d (Script to run compiled linux kernel with root fs
      mounted from host) update the script to run/debug linux inside QEMU:
      
      - teach it to run specified program + args, instead of hardcoded /bin/sh;
      - before tailing to user program, builtin init mounts /proc, /sys, ...
        inside - previously it was /proc, /sys from host seen on those
        mountpoints and it was very misleading - e.g. ps was showing processes
        from host, not inside, etc.
      - builtin init also cares to run specified program with the same current
        directory that was current on host, and environments such as $HOME,
        $PATH, $TERM, ... are also propagated.
      - allow to optionally run QEMU with graphics, instead of stdout only;
      - increase available RAM from 128M to 512M (with 128M running py.test
        inside is failing with fork: not enough memory).
      
      This updated version was useful to debug WCFS(*) & FUSE issues by running
      
      	kirr@deco:~/src/wendelin/wendelin.core/wcfs$ ../t/qemu-runlinux ~/src/linux/linux/arch/x86_64/boot/bzImage py.test -vsx -k test_wcfs
      
      See https://marc.info/?l=linux-fsdevel&m=155000277921155&w=2 for details.
      
      (*) WCFS is still being draft and worked on t branch.
      fe541453
  5. 03 Apr, 2015 1 commit
    • Kirill Smelkov's avatar
      Script to run compiled linux kernel with root fs mounted from host · 76d8f76d
      Kirill Smelkov authored
      Useful to debug (via either printk or gdb) the kernel - one can boot it,
      and tweak compile test program on host and be ready to test it inside
      qemu on tested kernel. Another use case is to add tracing printk to
      kernel and to boot it on each iteration. Booting via qemu means the
      workflow is not disrupted as would with rebooting the hardware.
      
      With this tool it was straightforward to find out why mmap-alias through
      mremap does not work for huge pages:
      
      static struct vm_area_struct *vma_to_resize(unsigned long addr,
              unsigned long old_len, unsigned long new_len, unsigned long *p)
      {
              struct mm_struct *mm = current->mm;
              struct vm_area_struct *vma = find_vma(mm, addr);
      
              if (!vma || vma->vm_start > addr)
                      goto Efault;
      
              if (is_vm_hugetlb_page(vma))            <--
                      goto Einval;
      
      mremap_to(...)
      {
              /* lots of checks, then */
              vma_to_resize(...)
      76d8f76d