Ignore:
Timestamp:
2007-03-26T19:35:28Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5d7daff
Parents:
4638401
Message:

Reworked handling of illegal virtual aliases caused by frame reuse.
We moved the incomplete handling from backend's frame method to
backend's page_fault method. The page_fault method is the one that
can create an illegal alias if it writes the userspace frame using
kernel address with a different page color than the page to which is
this frame mapped in userspace. When we detect this, we do D-cache
shootdown on all processors (!!!).

If we add code that accesses userspace memory from kernel address
space, we will have to check for illegal virtual aliases at all such
places.

I tested this on a 4-way simulated E6500 and a real-world Ultra 5,
which has unfortunatelly only one processor.

This solves ticket #26.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/include/mm/cache.h

    r4638401 r454f1da  
    4444        dcache_flush_tag(PAGE_COLOR((p)), ADDR2PFN((f)));
    4545
     46/**
     47 * Enumerations to differentiate among different scopes of D-Cache
     48 * invalidation.
     49 */
     50typedef enum {
     51        DCACHE_INVL_INVALID,
     52        DCACHE_INVL_ALL,
     53        DCACHE_INVL_COLOR,
     54        DCACHE_INVL_FRAME
     55} dcache_invalidate_type_t;
     56
     57/**
     58 * Number of messages that can be queued in the cpu_arch_t structure at a time.
     59 */
     60#define DCACHE_MSG_QUEUE_LEN    10
     61
     62/** D-cache shootdown message type. */
     63typedef struct {
     64        dcache_invalidate_type_t type;
     65        int color;
     66        uintptr_t frame;
     67} dcache_shootdown_msg_t;
     68
    4669extern void dcache_flush(void);
    4770extern void dcache_flush_color(int c);
    4871extern void dcache_flush_tag(int c, pfn_t tag);
     72
     73#ifdef CONFIG_SMP
     74extern void dcache_shootdown_start(dcache_invalidate_type_t type, int color,
     75    uintptr_t frame);
     76extern void dcache_shootdown_finalize(void);
     77extern void dcache_shootdown_ipi_recv(void);
     78#else
     79#define dcache_shootdown_start(t, c, f)
     80#define dcache_shootdown_finalize()
     81#define dcache_shootdown_ipi_recv()
     82#endif /* CONFIG_SMP */
    4983
    5084#endif
Note: See TracChangeset for help on using the changeset viewer.