Subversion Repositories HelenOS-historic

Rev

Rev 1150 | Rev 1179 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
703 jermar 1
/*
2
 * Copyright (C) 2001-2006 Jakub Jermar
3
 * All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 *
9
 * - Redistributions of source code must retain the above copyright
10
 *   notice, this list of conditions and the following disclaimer.
11
 * - Redistributions in binary form must reproduce the above copyright
12
 *   notice, this list of conditions and the following disclaimer in the
13
 *   documentation and/or other materials provided with the distribution.
14
 * - The name of the author may not be used to endorse or promote products
15
 *   derived from this software without specific prior written permission.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 */
28
 
29
/*
30
 * This file contains address space manipulation functions.
31
 * Roughly speaking, this is a higher-level client of
32
 * Virtual Address Translation (VAT) subsystem.
33
 */
34
 
35
#include <mm/as.h>
756 jermar 36
#include <arch/mm/as.h>
703 jermar 37
#include <mm/page.h>
38
#include <mm/frame.h>
814 palkovsky 39
#include <mm/slab.h>
703 jermar 40
#include <mm/tlb.h>
41
#include <arch/mm/page.h>
42
#include <genarch/mm/page_pt.h>
1108 jermar 43
#include <genarch/mm/page_ht.h>
727 jermar 44
#include <mm/asid.h>
703 jermar 45
#include <arch/mm/asid.h>
46
#include <arch/types.h>
47
#include <typedefs.h>
48
#include <synch/spinlock.h>
49
#include <config.h>
788 jermar 50
#include <adt/list.h>
1147 jermar 51
#include <adt/btree.h>
703 jermar 52
#include <panic.h>
53
#include <arch/asm.h>
54
#include <debug.h>
55
#include <memstr.h>
1070 jermar 56
#include <macros.h>
703 jermar 57
#include <arch.h>
58
#include <print.h>
59
 
756 jermar 60
as_operations_t *as_operations = NULL;
703 jermar 61
 
823 jermar 62
/** Address space lock. It protects inactive_as_with_asid_head. */
63
SPINLOCK_INITIALIZE(as_lock);
64
 
65
/**
66
 * This list contains address spaces that are not active on any
67
 * processor and that have valid ASID.
68
 */
69
LIST_INITIALIZE(inactive_as_with_asid_head);
70
 
757 jermar 71
/** Kernel address space. */
72
as_t *AS_KERNEL = NULL;
73
 
754 jermar 74
static int get_area_flags(as_area_t *a);
977 jermar 75
static as_area_t *find_area_and_lock(as_t *as, __address va);
1048 jermar 76
static bool check_area_conflicts(as_t *as, __address va, size_t size, as_area_t *avoid_area);
703 jermar 77
 
756 jermar 78
/** Initialize address space subsystem. */
79
void as_init(void)
80
{
81
    as_arch_init();
789 palkovsky 82
    AS_KERNEL = as_create(FLAG_AS_KERNEL);
756 jermar 83
        if (!AS_KERNEL)
84
                panic("can't create kernel address space\n");
85
}
86
 
757 jermar 87
/** Create address space.
88
 *
89
 * @param flags Flags that influence way in wich the address space is created.
90
 */
756 jermar 91
as_t *as_create(int flags)
703 jermar 92
{
93
    as_t *as;
94
 
822 palkovsky 95
    as = (as_t *) malloc(sizeof(as_t), 0);
823 jermar 96
    link_initialize(&as->inactive_as_with_asid_link);
822 palkovsky 97
    spinlock_initialize(&as->lock, "as_lock");
1147 jermar 98
    btree_create(&as->as_area_btree);
822 palkovsky 99
 
100
    if (flags & FLAG_AS_KERNEL)
101
        as->asid = ASID_KERNEL;
102
    else
103
        as->asid = ASID_INVALID;
104
 
823 jermar 105
    as->refcount = 0;
822 palkovsky 106
    as->page_table = page_table_create(flags);
703 jermar 107
 
108
    return as;
109
}
110
 
973 palkovsky 111
/** Free Adress space */
112
void as_free(as_t *as)
113
{
114
    ASSERT(as->refcount == 0);
115
 
116
    /* TODO: free as_areas and other resources held by as */
117
    /* TODO: free page table */
118
    free(as);
119
}
120
 
703 jermar 121
/** Create address space area of common attributes.
122
 *
123
 * The created address space area is added to the target address space.
124
 *
125
 * @param as Target address space.
1026 jermar 126
 * @param flags Flags of the area.
1048 jermar 127
 * @param size Size of area.
703 jermar 128
 * @param base Base address of area.
129
 *
130
 * @return Address space area on success or NULL on failure.
131
 */
1026 jermar 132
as_area_t *as_area_create(as_t *as, int flags, size_t size, __address base)
703 jermar 133
{
134
    ipl_t ipl;
135
    as_area_t *a;
136
 
137
    if (base % PAGE_SIZE)
1048 jermar 138
        return NULL;
139
 
140
    /* Writeable executable areas are not supported. */
141
    if ((flags & AS_AREA_EXEC) && (flags & AS_AREA_WRITE))
142
        return NULL;
703 jermar 143
 
144
    ipl = interrupts_disable();
145
    spinlock_lock(&as->lock);
146
 
1048 jermar 147
    if (!check_area_conflicts(as, base, size, NULL)) {
148
        spinlock_unlock(&as->lock);
149
        interrupts_restore(ipl);
150
        return NULL;
151
    }
703 jermar 152
 
822 palkovsky 153
    a = (as_area_t *) malloc(sizeof(as_area_t), 0);
703 jermar 154
 
822 palkovsky 155
    spinlock_initialize(&a->lock, "as_area_lock");
156
 
1026 jermar 157
    a->flags = flags;
1048 jermar 158
    a->pages = SIZE2FRAMES(size);
822 palkovsky 159
    a->base = base;
160
 
1147 jermar 161
    btree_insert(&as->as_area_btree, base, (void *) a, NULL);
822 palkovsky 162
 
703 jermar 163
    spinlock_unlock(&as->lock);
164
    interrupts_restore(ipl);
704 jermar 165
 
703 jermar 166
    return a;
167
}
168
 
754 jermar 169
/** Initialize mapping for one page of address space.
703 jermar 170
 *
754 jermar 171
 * This functions maps 'page' to 'frame' according
172
 * to attributes of the address space area to
173
 * wich 'page' belongs.
703 jermar 174
 *
840 jermar 175
 * @param as Target address space.
754 jermar 176
 * @param page Virtual page within the area.
177
 * @param frame Physical frame to which page will be mapped.
703 jermar 178
 */
754 jermar 179
void as_set_mapping(as_t *as, __address page, __address frame)
703 jermar 180
{
977 jermar 181
    as_area_t *area;
703 jermar 182
    ipl_t ipl;
183
 
184
    ipl = interrupts_disable();
1044 jermar 185
    page_table_lock(as, true);
703 jermar 186
 
977 jermar 187
    area = find_area_and_lock(as, page);
754 jermar 188
    if (!area) {
189
        panic("page not part of any as_area\n");
190
    }
191
 
756 jermar 192
    page_mapping_insert(as, page, frame, get_area_flags(area));
754 jermar 193
 
194
    spinlock_unlock(&area->lock);
1044 jermar 195
    page_table_unlock(as, true);
703 jermar 196
    interrupts_restore(ipl);
197
}
198
 
199
/** Handle page fault within the current address space.
200
 *
201
 * This is the high-level page fault handler.
202
 * Interrupts are assumed disabled.
203
 *
204
 * @param page Faulting page.
205
 *
704 jermar 206
 * @return 0 on page fault, 1 on success.
703 jermar 207
 */
208
int as_page_fault(__address page)
209
{
1044 jermar 210
    pte_t *pte;
977 jermar 211
    as_area_t *area;
703 jermar 212
    __address frame;
213
 
214
    ASSERT(AS);
1044 jermar 215
 
703 jermar 216
    spinlock_lock(&AS->lock);
977 jermar 217
    area = find_area_and_lock(AS, page);   
703 jermar 218
    if (!area) {
219
        /*
220
         * No area contained mapping for 'page'.
221
         * Signal page fault to low-level handler.
222
         */
223
        spinlock_unlock(&AS->lock);
224
        return 0;
225
    }
226
 
1044 jermar 227
    page_table_lock(AS, false);
228
 
703 jermar 229
    /*
1044 jermar 230
     * To avoid race condition between two page faults
231
     * on the same address, we need to make sure
232
     * the mapping has not been already inserted.
233
     */
234
    if ((pte = page_mapping_find(AS, page))) {
235
        if (PTE_PRESENT(pte)) {
236
            page_table_unlock(AS, false);
237
            spinlock_unlock(&area->lock);
238
            spinlock_unlock(&AS->lock);
239
            return 1;
240
        }
241
    }
242
 
243
    /*
754 jermar 244
     * In general, there can be several reasons that
245
     * can have caused this fault.
246
     *
247
     * - non-existent mapping: the area is a scratch
248
     *   area (e.g. stack) and so far has not been
249
     *   allocated a frame for the faulting page
250
     *
251
     * - non-present mapping: another possibility,
252
     *   currently not implemented, would be frame
253
     *   reuse; when this becomes a possibility,
254
     *   do not forget to distinguish between
255
     *   the different causes
703 jermar 256
     */
814 palkovsky 257
    frame = PFN2ADDR(frame_alloc(ONE_FRAME, 0));
754 jermar 258
    memsetb(PA2KA(frame), FRAME_SIZE, 0);
703 jermar 259
 
260
    /*
261
     * Map 'page' to 'frame'.
262
     * Note that TLB shootdown is not attempted as only new information is being
263
     * inserted into page tables.
264
     */
756 jermar 265
    page_mapping_insert(AS, page, frame, get_area_flags(area));
1044 jermar 266
    page_table_unlock(AS, false);
703 jermar 267
 
268
    spinlock_unlock(&area->lock);
269
    spinlock_unlock(&AS->lock);
270
    return 1;
271
}
272
 
823 jermar 273
/** Switch address spaces.
703 jermar 274
 *
823 jermar 275
 * @param old Old address space or NULL.
276
 * @param new New address space.
703 jermar 277
 */
823 jermar 278
void as_switch(as_t *old, as_t *new)
703 jermar 279
{
280
    ipl_t ipl;
823 jermar 281
    bool needs_asid = false;
703 jermar 282
 
283
    ipl = interrupts_disable();
823 jermar 284
    spinlock_lock(&as_lock);
703 jermar 285
 
286
    /*
823 jermar 287
     * First, take care of the old address space.
288
     */
289
    if (old) {
290
        spinlock_lock(&old->lock);
291
        ASSERT(old->refcount);
292
        if((--old->refcount == 0) && (old != AS_KERNEL)) {
293
            /*
294
             * The old address space is no longer active on
295
             * any processor. It can be appended to the
296
             * list of inactive address spaces with assigned
297
             * ASID.
298
             */
299
             ASSERT(old->asid != ASID_INVALID);
300
             list_append(&old->inactive_as_with_asid_link, &inactive_as_with_asid_head);
301
        }
302
        spinlock_unlock(&old->lock);
303
    }
304
 
305
    /*
306
     * Second, prepare the new address space.
307
     */
308
    spinlock_lock(&new->lock);
309
    if ((new->refcount++ == 0) && (new != AS_KERNEL)) {
310
        if (new->asid != ASID_INVALID)
311
            list_remove(&new->inactive_as_with_asid_link);
312
        else
313
            needs_asid = true;  /* defer call to asid_get() until new->lock is released */
314
    }
315
    SET_PTL0_ADDRESS(new->page_table);
316
    spinlock_unlock(&new->lock);
317
 
318
    if (needs_asid) {
319
        /*
320
         * Allocation of new ASID was deferred
321
         * until now in order to avoid deadlock.
322
         */
323
        asid_t asid;
324
 
325
        asid = asid_get();
326
        spinlock_lock(&new->lock);
327
        new->asid = asid;
328
        spinlock_unlock(&new->lock);
329
    }
330
    spinlock_unlock(&as_lock);
331
    interrupts_restore(ipl);
332
 
333
    /*
703 jermar 334
     * Perform architecture-specific steps.
727 jermar 335
     * (e.g. write ASID to hardware register etc.)
703 jermar 336
     */
823 jermar 337
    as_install_arch(new);
703 jermar 338
 
823 jermar 339
    AS = new;
703 jermar 340
}
754 jermar 341
 
342
/** Compute flags for virtual address translation subsytem.
343
 *
344
 * The address space area must be locked.
345
 * Interrupts must be disabled.
346
 *
347
 * @param a Address space area.
348
 *
349
 * @return Flags to be used in page_mapping_insert().
350
 */
351
int get_area_flags(as_area_t *a)
352
{
353
    int flags;
354
 
1178 jermar 355
    flags = PAGE_USER | PAGE_PRESENT;
754 jermar 356
 
1026 jermar 357
    if (a->flags & AS_AREA_READ)
358
        flags |= PAGE_READ;
359
 
360
    if (a->flags & AS_AREA_WRITE)
361
        flags |= PAGE_WRITE;
362
 
363
    if (a->flags & AS_AREA_EXEC)
364
        flags |= PAGE_EXEC;
365
 
1178 jermar 366
    if (!(a->flags & AS_AREA_DEVICE))
367
        flags |= PAGE_CACHEABLE;
368
 
754 jermar 369
    return flags;
370
}
756 jermar 371
 
372
/** Create page table.
373
 *
374
 * Depending on architecture, create either address space
375
 * private or global page table.
376
 *
377
 * @param flags Flags saying whether the page table is for kernel address space.
378
 *
379
 * @return First entry of the page table.
380
 */
381
pte_t *page_table_create(int flags)
382
{
383
        ASSERT(as_operations);
384
        ASSERT(as_operations->page_table_create);
385
 
386
        return as_operations->page_table_create(flags);
387
}
977 jermar 388
 
1044 jermar 389
/** Lock page table.
390
 *
391
 * This function should be called before any page_mapping_insert(),
392
 * page_mapping_remove() and page_mapping_find().
393
 *
394
 * Locking order is such that address space areas must be locked
395
 * prior to this call. Address space can be locked prior to this
396
 * call in which case the lock argument is false.
397
 *
398
 * @param as Address space.
399
 * @param as_locked If false, do not attempt to lock as->lock.
400
 */
401
void page_table_lock(as_t *as, bool lock)
402
{
403
    ASSERT(as_operations);
404
    ASSERT(as_operations->page_table_lock);
405
 
406
    as_operations->page_table_lock(as, lock);
407
}
408
 
409
/** Unlock page table.
410
 *
411
 * @param as Address space.
412
 * @param as_locked If false, do not attempt to unlock as->lock.
413
 */
414
void page_table_unlock(as_t *as, bool unlock)
415
{
416
    ASSERT(as_operations);
417
    ASSERT(as_operations->page_table_unlock);
418
 
419
    as_operations->page_table_unlock(as, unlock);
420
}
421
 
977 jermar 422
/** Find address space area and change it.
423
 *
424
 * @param as Address space.
425
 * @param address Virtual address belonging to the area to be changed. Must be page-aligned.
426
 * @param size New size of the virtual memory block starting at address.
427
 * @param flags Flags influencing the remap operation. Currently unused.
428
 *
429
 * @return address on success, (__address) -1 otherwise.
430
 */
431
__address as_remap(as_t *as, __address address, size_t size, int flags)
432
{
433
    as_area_t *area = NULL;
434
    ipl_t ipl;
435
    size_t pages;
436
 
437
    ipl = interrupts_disable();
438
    spinlock_lock(&as->lock);
439
 
440
    /*
441
     * Locate the area.
442
     */
443
    area = find_area_and_lock(as, address);
444
    if (!area) {
445
        spinlock_unlock(&as->lock);
1048 jermar 446
        interrupts_restore(ipl);
977 jermar 447
        return (__address) -1;
448
    }
449
 
450
    pages = SIZE2FRAMES((address - area->base) + size);
1048 jermar 451
    if (pages < area->pages) {
977 jermar 452
        int i;
453
 
454
        /*
455
         * Shrinking the area.
1147 jermar 456
         * No need to check for overlaps.
977 jermar 457
         */
1048 jermar 458
        for (i = pages; i < area->pages; i++) {
977 jermar 459
            pte_t *pte;
460
 
461
            /*
462
             * Releasing physical memory.
463
             * This depends on the fact that the memory was allocated using frame_alloc().
1044 jermar 464
             */
465
            page_table_lock(as, false);
977 jermar 466
            pte = page_mapping_find(as, area->base + i*PAGE_SIZE);
980 palkovsky 467
            if (pte && PTE_VALID(pte)) {
1044 jermar 468
                __address frame;
469
 
977 jermar 470
                ASSERT(PTE_PRESENT(pte));
1044 jermar 471
                frame = PTE_GET_FRAME(pte);
983 palkovsky 472
                page_mapping_remove(as, area->base + i*PAGE_SIZE);
1044 jermar 473
                page_table_unlock(as, false);
474
 
475
                frame_free(ADDR2PFN(frame));
476
            } else {
477
                page_table_unlock(as, false);
977 jermar 478
            }
479
        }
480
        /*
481
         * Invalidate TLB's.
482
         */
1048 jermar 483
        tlb_shootdown_start(TLB_INVL_PAGES, AS->asid, area->base + pages*PAGE_SIZE, area->pages - pages);
484
        tlb_invalidate_pages(AS->asid, area->base + pages*PAGE_SIZE, area->pages - pages);
977 jermar 485
        tlb_shootdown_finalize();
1147 jermar 486
    } else {
487
        /*
488
         * Growing the area.
489
         * Check for overlaps with other address space areas.
490
         */
491
        if (!check_area_conflicts(as, address, pages * PAGE_SIZE, area)) {
492
            spinlock_unlock(&area->lock);
493
            spinlock_unlock(&as->lock);    
494
            interrupts_restore(ipl);
495
            return (__address) -1;
496
        }
983 palkovsky 497
    }
498
 
1048 jermar 499
    area->pages = pages;
977 jermar 500
 
501
    spinlock_unlock(&area->lock);
502
    spinlock_unlock(&as->lock);
503
    interrupts_restore(ipl);
504
 
505
    return address;
506
}
507
 
508
/** Find address space area and lock it.
509
 *
510
 * The address space must be locked and interrupts must be disabled.
511
 *
512
 * @param as Address space.
513
 * @param va Virtual address.
514
 *
515
 * @return Locked address space area containing va on success or NULL on failure.
516
 */
517
as_area_t *find_area_and_lock(as_t *as, __address va)
518
{
519
    as_area_t *a;
1147 jermar 520
    btree_node_t *leaf, *lnode;
521
    int i;
977 jermar 522
 
1147 jermar 523
    a = (as_area_t *) btree_search(&as->as_area_btree, va, &leaf);
524
    if (a) {
525
        /* va is the base address of an address space area */
977 jermar 526
        spinlock_lock(&a->lock);
1147 jermar 527
        return a;
528
    }
529
 
530
    /*
1150 jermar 531
     * Search the leaf node and the righmost record of its left neighbour
1147 jermar 532
     * to find out whether this is a miss or va belongs to an address
533
     * space area found there.
534
     */
535
 
536
    /* First, search the leaf node itself. */
537
    for (i = 0; i < leaf->keys; i++) {
538
        a = (as_area_t *) leaf->value[i];
539
        spinlock_lock(&a->lock);
540
        if ((a->base <= va) && (va < a->base + a->pages * PAGE_SIZE)) {
541
            return a;
542
        }
543
        spinlock_unlock(&a->lock);
544
    }
977 jermar 545
 
1147 jermar 546
    /*
1150 jermar 547
     * Second, locate the left neighbour and test its last record.
1148 jermar 548
     * Because of its position in the B+tree, it must have base < va.
1147 jermar 549
     */
1150 jermar 550
    if ((lnode = btree_leaf_node_left_neighbour(&as->as_area_btree, leaf))) {
1147 jermar 551
        a = (as_area_t *) lnode->value[lnode->keys - 1];
552
        spinlock_lock(&a->lock);
553
        if (va < a->base + a->pages * PAGE_SIZE) {
1048 jermar 554
            return a;
1147 jermar 555
        }
977 jermar 556
        spinlock_unlock(&a->lock);
557
    }
558
 
559
    return NULL;
560
}
1048 jermar 561
 
562
/** Check area conflicts with other areas.
563
 *
564
 * The address space must be locked and interrupts must be disabled.
565
 *
566
 * @param as Address space.
567
 * @param va Starting virtual address of the area being tested.
568
 * @param size Size of the area being tested.
569
 * @param avoid_area Do not touch this area.
570
 *
571
 * @return True if there is no conflict, false otherwise.
572
 */
573
bool check_area_conflicts(as_t *as, __address va, size_t size, as_area_t *avoid_area)
574
{
575
    as_area_t *a;
1147 jermar 576
    btree_node_t *leaf, *node;
577
    int i;
1048 jermar 578
 
1070 jermar 579
    /*
580
     * We don't want any area to have conflicts with NULL page.
581
     */
582
    if (overlaps(va, size, NULL, PAGE_SIZE))
583
        return false;
584
 
1147 jermar 585
    /*
586
     * The leaf node is found in O(log n), where n is proportional to
587
     * the number of address space areas belonging to as.
588
     * The check for conflicts is then attempted on the rightmost
1150 jermar 589
     * record in the left neighbour, the leftmost record in the right
590
     * neighbour and all records in the leaf node itself.
1147 jermar 591
     */
1048 jermar 592
 
1147 jermar 593
    if ((a = (as_area_t *) btree_search(&as->as_area_btree, va, &leaf))) {
594
        if (a != avoid_area)
595
            return false;
596
    }
597
 
598
    /* First, check the two border cases. */
1150 jermar 599
    if ((node = btree_leaf_node_left_neighbour(&as->as_area_btree, leaf))) {
1147 jermar 600
        a = (as_area_t *) node->value[node->keys - 1];
601
        spinlock_lock(&a->lock);
602
        if (overlaps(va, size, a->base, a->pages * PAGE_SIZE)) {
603
            spinlock_unlock(&a->lock);
604
            return false;
605
        }
606
        spinlock_unlock(&a->lock);
607
    }
1150 jermar 608
    if ((node = btree_leaf_node_right_neighbour(&as->as_area_btree, leaf))) {
1147 jermar 609
        a = (as_area_t *) node->value[0];
610
        spinlock_lock(&a->lock);
611
        if (overlaps(va, size, a->base, a->pages * PAGE_SIZE)) {
612
            spinlock_unlock(&a->lock);
613
            return false;
614
        }
615
        spinlock_unlock(&a->lock);
616
    }
617
 
618
    /* Second, check the leaf node. */
619
    for (i = 0; i < leaf->keys; i++) {
620
        a = (as_area_t *) leaf->value[i];
621
 
1048 jermar 622
        if (a == avoid_area)
623
            continue;
1147 jermar 624
 
1048 jermar 625
        spinlock_lock(&a->lock);
1147 jermar 626
        if (overlaps(va, size, a->base, a->pages * PAGE_SIZE)) {
627
            spinlock_unlock(&a->lock);
628
            return false;
629
        }
1048 jermar 630
        spinlock_unlock(&a->lock);
631
    }
632
 
1070 jermar 633
    /*
634
     * So far, the area does not conflict with other areas.
635
     * Check if it doesn't conflict with kernel address space.
636
     */  
637
    if (!KERNEL_ADDRESS_SPACE_SHADOWED) {
638
        return !overlaps(va, size,
639
            KERNEL_ADDRESS_SPACE_START, KERNEL_ADDRESS_SPACE_END-KERNEL_ADDRESS_SPACE_START);
640
    }
641
 
1048 jermar 642
    return true;
643
}