Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset d9ee2ea in mainline


Ignore:
Timestamp:
2010-01-10T20:48:38Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
52cdcbc
Parents:
0ff9e67
Message:

Change the way how RIDs are mapped onto ASIDs. Instead of 7 RIDs per ASID, now
there will be 8 RIDs per one ASID. This will slightly reduce the number of
available ASIDs, but not significantly.

The kernel will now have all 8 RIDs instead of only one. RID 0 - 7 belong to the
kernel, but only RID 7 accessible from VRN 7 is actually used by the kernel.
This allows us to use RID 0 for VRN 0 and differentiate thus between
0x0000000000000000 and 0xe000000000000000 in a more elegant way. test fault1
will now associate the kernel bad trap with RID 0 which maps to ASID_KERNEL.

User tasks will also be given 8 RIDs, but will use only the lower 7 that fit
into VRN 0 - 6, because the last VRN needs to be reserved for the kernel. The
eighth RID will be unused for now. It can be used for something completely
different one day or if the task needs to establish some special mappings.

So with this change, the kernel now has a 64-bit address space compared to
previous 61 bits, but still makes use only of the highest 1/8 (i.e. 61-bits).
Applications continue to have an address space composed of 7 61-bit blocks which
are arranged in a consecutive way. Each application now has one hidden and
currently unused 61-bit segment.

Location:
kernel/arch/ia64
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia64/include/mm/asid.h

    r0ff9e67 rd9ee2ea  
    5050 * but those extra bits are not used by the kernel.
    5151 */
    52 #define RIDS_PER_ASID           7
     52#define RIDS_PER_ASID           8
    5353
    5454#define RID_MAX                 262143          /* 2^18 - 1 */
    55 #define RID_KERNEL              0
    56 #define RID_INVALID             1
     55#define RID_KERNEL7             7
    5756
    58 #define ASID2RID(asid, vrn)     (((asid)>RIDS_PER_ASID)?(((asid)*RIDS_PER_ASID)+(vrn)):(asid))
    59 #define RID2ASID(rid)           ((rid)/RIDS_PER_ASID)
     57#define ASID2RID(asid, vrn) \
     58        ((asid) * RIDS_PER_ASID + (vrn))
    6059
    61 #define ASID_MAX_ARCH           (RID_MAX/RIDS_PER_ASID)
     60#define RID2ASID(rid) \
     61        ((rid) / RIDS_PER_ASID)
     62
     63#define ASID_MAX_ARCH           (RID_MAX / RIDS_PER_ASID)
    6264
    6365#endif
  • kernel/arch/ia64/src/mm/as.c

    r0ff9e67 rd9ee2ea  
    7070                rr.word = rr_read(i);
    7171                rr.map.ve = false;              /* disable VHPT walker */
    72                 if (as == AS_KERNEL)
    73                         rr.map.rid = RID_INVALID;
    74                 else
    75                         rr.map.rid = ASID2RID(as->asid, i);
     72                rr.map.rid = ASID2RID(as->asid, i);
    7673                rr.map.ps = PAGE_WIDTH;
    7774                rr_write(i, rr.word);
  • kernel/arch/ia64/src/mm/page.c

    r0ff9e67 rd9ee2ea  
    7171
    7272        /*
    73          * First set up kernel region register.
    74          * This is redundant (see start.S) but we keep it here just for sure.
    75          */
    76         rr.word = rr_read(VRN_KERNEL);
    77         rr.map.ve = 0;                  /* disable VHPT walker */
    78         rr.map.ps = PAGE_WIDTH;
    79         rr.map.rid = ASID2RID(ASID_KERNEL, VRN_KERNEL);
    80         rr_write(VRN_KERNEL, rr.word);
    81         srlz_i();
    82         srlz_d();
    83 
    84         /*
    85          * And setup the rest of region register.
     73         * Set up kernel region registers.
     74         * VRN_KERNEL has already been set in start.S.
     75         * For paranoia reasons, we set it again.
    8676         */
    8777        for(i = 0; i < REGION_REGISTERS; i++) {
    88                 /* skip kernel rr */
    89                 if (i == VRN_KERNEL)
    90                         continue;
    91        
    9278                rr.word = rr_read(i);
    9379                rr.map.ve = 0;          /* disable VHPT walker */
    94                 rr.map.rid = RID_INVALID;
     80                rr.map.rid = ASID2RID(ASID_KERNEL, i);
    9581                rr.map.ps = PAGE_WIDTH;
    9682                rr_write(i, rr.word);
  • kernel/arch/ia64/src/start.S

    r0ff9e67 rd9ee2ea  
    7474        movl r10 = (RR_MASK)
    7575        and r9 = r10, r9
    76         movl r10 = ((RID_KERNEL << RID_SHIFT) | (KERNEL_PAGE_WIDTH << PS_SHIFT))
     76        movl r10 = (((RID_KERNEL7) << RID_SHIFT) | (KERNEL_PAGE_WIDTH << PS_SHIFT))
    7777        or r9 = r10, r9
    7878       
Note: See TracChangeset for help on using the changeset viewer.