xfs
[Top] [All Lists]

Re: [uml-devel] uml with xfs support

To: linux-xfs@xxxxxxxxxxx
Subject: Re: [uml-devel] uml with xfs support
From: thomas graichen <list-linux.sgi.xfs@xxxxxxxxxxx>
Date: Tue, 2 Oct 2001 02:30:02 +0200
Distribution: local
Organization: spoiled dot org
References: <news2mail-20010930131247.2999C021.NOFFLE@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <200110010354.WAA04600@xxxxxxxxxxxxxxxx> <news2mail-20011001233255.E3E9486.NOFFLE@xxxxxxxxxxxxxxxxxx>
Reply-to: thomas graichen <tgr@xxxxxxxxxxx>
Reply-to: thomas graichen <tgr@xxxxxxxxxxx>
Sender: owner-linux-xfs@xxxxxxxxxxx
User-agent: tin/1.4.4-20000803 ("Vet for the Insane") (UNIX) (Linux/2.4.10-xfs (i686))
just because i also asked around here and it has something to do with
xfs too i put it here too if someone is interested to run user-mode-
linux with the xfs kernel (maybe useful for debugging too?) ...

t

thomas graichen <list-linux.uml.devel@xxxxxxxxxxx> wrote:
> Jeff Dike <jdike@xxxxxxxxxx> wrote:
>> So, it looks like gdb is sane and the value of physmem isn't.

> that one brought me to the right direction: physmem really was wrong
> due to my own change - i assumed that the physmem in uml and the one
> from xfs are the same and thus declared one of them as external to
> avoid the conflicting symbols while linking the kernel - but that
> assumption was wrong - the physmem in xfs has nothing directly to do
> with the physmem in uml - so we have some real namecollision between
> those two projects here which have to be resolved somehow ... even
> more: the eicon isdn driver in the kernel also seems to use physmem
> for itself - i'll mail this posting to the three maintainers of the
> respective projects to coordinate how to solve this in a clean way
> (cc'ed to alan cox - maybe it would be a good idea to put this some-
> where central into the kernel so that anyone who needs it may use it
> if all those physmems are meaning the same - did not look very close
> at it - because i think the name really calles for further trouble :-)

> my solution so far was to rename the physmem of uml to uml_physmem
> and a kernel build that way booted without any problems ...

> # cat /proc/version
> Linux version 2.4.9-xfs-8um (root@xxxxxxxxxxxxxxxxxx) (gcc version
> egcs-2.91.66
> 19990314/Linux (egcs-1.1.2 release / Linux-Mandrake 8.0)) #16 Mon Oct 1
> 22:02:24 CEST 2001
> # cat /proc/filesystems
> nodev   proc
> nodev   sockfs
> nodev   tmpfs
> nodev   pipefs
> ext2
> nodev   devfs
> nodev   devpts
>         xfs
> #

> ... and i assume it to work without problems now too - it's too late
> now to try it out

> ok here are the patches which made xfs and uml coexisting happy to-
> gether - maybe someone else likes to have them and it would be nice
> if they might in some way go into further uml releases (at least the
> __clear_user addition to uaccess.h which is required for xfs) and
> the conflicts regarding physmem will be solved ...

> t

> --- ./arch/um/include/user_util.h.physmem     Mon Oct  1 21:06:01 2001
> +++ ./arch/um/include/user_util.h     Mon Oct  1 21:06:36 2001
> @@ -32,7 +32,7 @@
>  
>  extern unsigned long low_physmem;
>  extern unsigned long high_physmem;
> -extern unsigned long physmem;
> +extern unsigned long uml_physmem;
>  extern unsigned long end_vm;
>  extern unsigned long start_vm;
>  
> --- ./arch/um/kernel/mem.c.physmem    Mon Oct  1 21:12:39 2001
> +++ ./arch/um/kernel/mem.c    Mon Oct  1 21:12:53 2001
> @@ -66,7 +66,7 @@
>       for(i=0;i<sizeof(zones_size)/sizeof(zones_size[0]);i++) 
>               zones_size[i] = 0;
>       zones_size[1] = (high_physmem >> PAGE_SHIFT) - 
> -             (physmem >> PAGE_SHIFT) - zones_size[0];
> +             (uml_physmem >> PAGE_SHIFT) - zones_size[0];
>       free_area_init(zones_size);
>  }
>  
> --- ./arch/um/kernel/exec_kern.c.physmem      Mon Oct  1 21:11:49 2001
> +++ ./arch/um/kernel/exec_kern.c      Mon Oct  1 21:55:42 2001
> @@ -59,7 +59,7 @@
>  
>          current->thread.extern_pid = new_pid;
>       free_page(stack);
> -     protect(physmem, high_physmem - physmem, 1, 1, 0);
> +     protect(uml_physmem, high_physmem - uml_physmem, 1, 1, 0);
>       task_protections((unsigned long) current);
>       force_flush_all();
>       unblock_signals();
> --- ./arch/um/kernel/um_arch.c.physmem        Mon Oct  1 21:15:13 2001
> +++ ./arch/um/kernel/um_arch.c        Mon Oct  1 21:15:35 2001
> @@ -115,7 +115,7 @@
>  #define START 0xa0000000
>  #endif
>  
> -unsigned long physmem;
> +unsigned long uml_physmem;
>  
>  unsigned long start_vm;
>  unsigned long end_vm;
> @@ -234,7 +234,7 @@
>       remap_data(ROUND_DOWN(&__bss_start), ROUND_UP(brk_start));
>  
>       /* Start physical memory at least 4M after the current brk */
> -     physmem = ROUND_4M(brk_start) + (1 << 22);
> +     uml_physmem = ROUND_4M(brk_start) + (1 << 22);
>  
>       /* Create fake command line from argv[]. */
>       have_root = 0;
> @@ -299,7 +299,7 @@
>        * of physical memory or the remaining space left in the kernel
>        * area of the address space, whichever is smaller.
>        */
> -     start_vm = physmem + physmem_size + VMALLOC_OFFSET;
> +     start_vm = uml_physmem + physmem_size + VMALLOC_OFFSET;
>       if(start_vm >= get_kmem_end())
>               panic("Physical memory too large to allow any kernel "
>                     "virtual memory");
> @@ -313,16 +313,16 @@
>               printk(KERN_INFO "Kernel virtual memory size shrunk to %ld "
>                      "bytes\n", virtmem_size);
>  
> -     setup_range(-1, NULL, physmem, physmem_size, 
> +     setup_range(-1, NULL, uml_physmem, physmem_size, 
>                   physmem_size + VMALLOC_OFFSET + virtmem_size);
>       setup_memory();
> -     high_physmem = physmem + physmem_size;
> +     high_physmem = uml_physmem + physmem_size;
>  
> -     start_pfn = PFN_UP(__pa(physmem));
> +     start_pfn = PFN_UP(__pa(uml_physmem));
>       end_pfn = PFN_DOWN(__pa(high_physmem));
>       bootmap_size = init_bootmem(start_pfn, end_pfn - start_pfn);
> -     free_bootmem(__pa(physmem) + bootmap_size, 
> -                  high_physmem - physmem - bootmap_size);
> +     free_bootmem(__pa(uml_physmem) + bootmap_size, 
> +                  high_physmem - uml_physmem - bootmap_size);
>  #ifdef CONFIG_BLK_DEV_INITRD
>       if(initrd != NULL) read_initrd(initrd);
>  #endif
> --- ./arch/um/kernel/ksyms.c.physmem  Mon Oct  1 21:12:09 2001
> +++ ./arch/um/kernel/ksyms.c  Mon Oct  1 21:12:18 2001
> @@ -10,7 +10,7 @@
>  
>  EXPORT_SYMBOL(stop);
>  EXPORT_SYMBOL(strtok);
> -EXPORT_SYMBOL(physmem);
> +EXPORT_SYMBOL(uml_physmem);
>  EXPORT_SYMBOL(current_task);
>  EXPORT_SYMBOL(set_signals);
>  EXPORT_SYMBOL(kernel_thread);
> --- ./arch/um/kernel/process_kern.c.physmem   Mon Oct  1 21:14:10 2001
> +++ ./arch/um/kernel/process_kern.c   Mon Oct  1 21:14:14 2001
> @@ -521,7 +521,7 @@
>  {
>       force_flush_all();
>       if(current->mm != current->p_pptr->mm)
> -             protect(physmem, high_physmem - physmem, 1, 1, 0);
> +             protect(uml_physmem, high_physmem - uml_physmem, 1, 1, 0);
>       task_protections((unsigned long) current);
>       if(current->thread.request.u.fork_finish.from)
>               schedule_tail(current->thread.request.u.fork_finish.from);
> @@ -748,7 +748,7 @@
>  
>       start_stack = (unsigned long) current;
>       end_stack = start_stack + PAGE_SIZE * 4;
> -     protect(physmem, start_stack - physmem, 1, 1, 1);
> +     protect(uml_physmem, start_stack - uml_physmem, 1, 1, 1);
>       protect(end_stack, high_physmem - end_stack, 1, 1, 1);
>  }
>  
> @@ -758,7 +758,7 @@
>  
>       start_stack = (unsigned long) current;
>       end_stack = start_stack + PAGE_SIZE * 4;
> -     protect(physmem, start_stack - physmem, 1, 1, 1);
> +     protect(uml_physmem, start_stack - uml_physmem, 1, 1, 1);
>       protect(end_stack, high_physmem - end_stack, 1, 1, 1);
>  }
>  
> --- ./include/asm-um/dma.h.physmem    Mon Oct  1 21:07:05 2001
> +++ ./include/asm-um/dma.h    Mon Oct  1 21:30:45 2001
> @@ -5,6 +5,6 @@
>  
>  #undef MAX_DMA_ADDRESS
>  
> -#define MAX_DMA_ADDRESS (physmem)
> +#define MAX_DMA_ADDRESS (uml_physmem)
>  
>  #endif
> --- ./include/asm-um/page.h.physmem   Mon Oct  1 21:08:01 2001
> +++ ./include/asm-um/page.h   Mon Oct  1 21:08:37 2001
> @@ -28,14 +28,14 @@
>  
>  #endif /* __ASSEMBLY__ */
>  
> -extern unsigned long physmem;
> +extern unsigned long uml_physmem;
>  
> -#define PAGE_OFFSET     (physmem)
> +#define PAGE_OFFSET     (uml_physmem)
>  
>  #define __va_space (8*1024*1024)
>  
> -#define __pa(x)      ((unsigned long) (x) - (physmem))
> -#define __va(x)      ((void *) ((unsigned long) (x) + (physmem)))
> +#define __pa(x)      ((unsigned long) (x) - (uml_physmem))
> +#define __va(x)      ((void *) ((unsigned long) (x) + (uml_physmem)))
>  
>  #define virt_to_page(kaddr)  (mem_map + (__pa(kaddr) >> PAGE_SHIFT))
>  #define VALID_PAGE(page)     ((page - mem_map) < max_mapnr)
> --- ./include/asm-um/uaccess.h.physmem        Tue Oct  2 01:15:50 2001
> +++ ./include/asm-um/uaccess.h        Mon Oct  1 21:30:43 2001
> @@ -35,7 +35,7 @@
>  #define set_fs(x)    (current->addr_limit = (x))
>  
>  extern unsigned long end_vm;
> -extern unsigned long physmem;
> +extern unsigned long uml_physmem;
>  
>  #define under_task_size(addr, size) \
>       (((unsigned long) (addr) < TASK_SIZE) && \
> @@ -146,6 +146,14 @@
>                          void **fault_catcher);
>  
>  static inline int clear_user(void *mem, int len)
> +{
> +     return(access_ok(VERIFY_WRITE, mem, len) ? 
> +            __do_clear_user(mem, len, 
> +                            &current->thread.fault_addr,
> +                            &current->thread.fault_catcher) : len);
> +}
> +
> +static inline int __clear_user(void *mem, int len)
>  {
>       return(access_ok(VERIFY_WRITE, mem, len) ? 
>              __do_clear_user(mem, len, 

> -- 
> thomas graichen <tgr@xxxxxxxxxxx> ... perfection is reached, not
> when there is no longer anything to add, but when there is no
> longer anything to take away. --- antoine de saint-exupery

> _______________________________________________
> User-mode-linux-devel mailing list
> User-mode-linux-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


-- 
thomas graichen <tgr@xxxxxxxxxxx> ... perfection is reached, not
when there is no longer anything to add, but when there is no
longer anything to take away. --- antoine de saint-exupery


<Prev in Thread] Current Thread [Next in Thread>
  • Re: [uml-devel] uml with xfs support, thomas graichen <=