• 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
qemu-runlinux 1.07 KB