Changeset d0485c6 in mainline


Ignore:
Timestamp:
2006-12-01T22:10:40Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3d76996
Parents:
7bf7ef7
Message:

Introduce page colors. So far, only sparc64 uses correct page color bits. Other architectures have a dummy define
specifying zero bits for a page color.

There is a new check of page color in as_area_share(). Because of lack of support for this in the userspace, the
check has been #ifef'ed out.

Location:
kernel
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/include/mm/page.h

    r7bf7ef7 rd0485c6  
    5252#define PAGE_WIDTH      FRAME_WIDTH
    5353#define PAGE_SIZE       FRAME_SIZE
     54
     55#define PAGE_COLOR_BITS 0                       /* dummy */
    5456
    5557#ifdef KERNEL
  • kernel/arch/ia32/include/mm/page.h

    r7bf7ef7 rd0485c6  
    4040#define PAGE_WIDTH      FRAME_WIDTH
    4141#define PAGE_SIZE       FRAME_SIZE
     42
     43#define PAGE_COLOR_BITS 0                       /* dummy */
    4244
    4345#ifdef KERNEL
  • kernel/arch/ia32xen/include/mm/page.h

    r7bf7ef7 rd0485c6  
    4141#define PAGE_SIZE       FRAME_SIZE
    4242
     43#define PAGE_COLOR_BITS 0                       /* dummy */
     44
    4345#ifdef KERNEL
    4446
  • kernel/arch/ia64/include/mm/page.h

    r7bf7ef7 rd0485c6  
    4242#define PAGE_WIDTH      FRAME_WIDTH
    4343
     44#define PAGE_COLOR_BITS 0                       /* dummy */
    4445
    4546#ifdef KERNEL
    4647
    4748/** Bit width of the TLB-locked portion of kernel address space. */
    48 #define KERNEL_PAGE_WIDTH       28      /* 256M */
     49#define KERNEL_PAGE_WIDTH               28      /* 256M */
    4950
    5051#define PPN_SHIFT                       12
     
    6566#define PA2KA(x)        ((uintptr_t) (x+(VRN_KERNEL<<VRN_SHIFT)))
    6667
    67 #define VHPT_WIDTH                      20              /* 1M */
     68#define VHPT_WIDTH                      20      /* 1M */
    6869#define VHPT_SIZE                       (1 << VHPT_WIDTH)
    6970
  • kernel/arch/mips32/include/mm/page.h

    r7bf7ef7 rd0485c6  
    4040#define PAGE_WIDTH      FRAME_WIDTH
    4141#define PAGE_SIZE       FRAME_SIZE
     42
     43#define PAGE_COLOR_BITS 0                       /* dummy */
    4244
    4345#ifndef __ASM__
  • kernel/arch/ppc32/include/mm/page.h

    r7bf7ef7 rd0485c6  
    4040#define PAGE_WIDTH      FRAME_WIDTH
    4141#define PAGE_SIZE       FRAME_SIZE
     42
     43#define PAGE_COLOR_BITS 0                       /* dummy */
    4244
    4345#ifdef KERNEL
  • kernel/arch/ppc64/include/mm/page.h

    r7bf7ef7 rd0485c6  
    4040#define PAGE_WIDTH      FRAME_WIDTH
    4141#define PAGE_SIZE       FRAME_SIZE
     42
     43#define PAGE_COLOR_BITS 0                       /* dummy */
    4244
    4345#ifdef KERNEL
  • kernel/arch/sparc64/include/mm/page.h

    r7bf7ef7 rd0485c6  
    4141#define PAGE_SIZE       FRAME_SIZE
    4242
     43#define PAGE_COLOR_BITS 1                       /**< 14 - 13; 2^14 == 16K == alias boundary. */
     44
    4345#ifdef KERNEL
    4446
  • kernel/genarch/src/mm/asid_fifo.c

    r7bf7ef7 rd0485c6  
    6464        int i;
    6565
    66         #if (!FIFO_STATIC)
     66#if (!FIFO_STATIC)
    6767        fifo_create(free_asids);
    68         #endif
     68#endif
    6969               
    7070        for (i = 0; i < ASIDS_ALLOCABLE; i++) {
  • kernel/generic/include/mm/page.h

    r7bf7ef7 rd0485c6  
    6767#define PAGE_GLOBAL             (1<<PAGE_GLOBAL_SHIFT)
    6868
     69
     70/**
     71 * Macro for computing page color.
     72 */
     73#define PAGE_COLOR(va)          (((va) >> PAGE_WIDTH) & ((1 << PAGE_COLOR_BITS) - 1))
     74
    6975/** Page fault access type. */
    7076enum pf_access {
  • kernel/generic/src/mm/as.c

    r7bf7ef7 rd0485c6  
    551551 * @param dst_flags_mask Destination address space area flags mask.
    552552 *
    553  * @return Zero on success or ENOENT if there is no such task or
    554  *         if there is no such address space area,
    555  *         EPERM if there was a problem in accepting the area or
    556  *         ENOMEM if there was a problem in allocating destination
    557  *         address space area. ENOTSUP is returned if an attempt
    558  *         to share non-anonymous address space area is detected.
     553 * @return Zero on success or ENOENT if there is no such task or if there is no
     554 * such address space area, EPERM if there was a problem in accepting the area
     555 * or ENOMEM if there was a problem in allocating destination address space
     556 * area. ENOTSUP is returned if the address space area backend does not support
     557 * sharing. It can be also returned if the architecture uses virtually indexed
     558 * caches and the source and destination areas start at pages with different
     559 * page colors.
    559560 */
    560561int as_area_share(as_t *src_as, uintptr_t src_base, size_t acc_size,
     
    581582        }
    582583       
     584#if 0   /* disable the check for now */
     585#ifdef CONFIG_VIRT_IDX_CACHE
     586        if (PAGE_COLOR(src_area->base) != PAGE_COLOR(dst_base)) {
     587                /*
     588                 * Refuse to create illegal address alias.
     589                 */
     590                mutex_unlock(&src_area->lock);
     591                mutex_unlock(&src_as->lock);
     592                interrupts_restore(ipl);
     593                return ENOTSUP;
     594        }
     595#endif /* CONFIG_VIRT_IDX_CACHE */
     596#endif
     597
    583598        if (!src_area->backend || !src_area->backend->share) {
    584599                /*
Note: See TracChangeset for help on using the changeset viewer.