Rev 46 | Rev 54 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 46 | Rev 47 | ||
---|---|---|---|
Line 68... | Line 68... | ||
68 | <section> |
68 | <section> |
69 | <title>Address space areas</title> |
69 | <title>Address space areas</title> |
70 | 70 | ||
71 | <para>Each address space consists of mutually disjunctive continuous |
71 | <para>Each address space consists of mutually disjunctive continuous |
72 | address space areas. Address space area is precisely defined by its |
72 | address space areas. Address space area is precisely defined by its |
73 | base address and the number of frames is contains.</para> |
73 | base address and the number of frames/pages is contains.</para> |
74 | 74 | ||
75 | <para>Address space area also has special flags, that define behaviour |
75 | <para>Address space area , that define behaviour and permissions on |
76 | and permissions on the particular area. <itemizedlist> |
76 | the particular area. <itemizedlist> |
77 | <listitem> |
77 | <listitem> |
78 | 78 | ||
79 | 79 | ||
80 | <emphasis>AS_AREA_READ</emphasis> |
80 | <emphasis>AS_AREA_READ</emphasis> |
81 | 81 | ||
Line 114... | Line 114... | ||
114 | <section> |
114 | <section> |
115 | <title>Address Space ID (ASID)</title> |
115 | <title>Address Space ID (ASID)</title> |
116 | 116 | ||
117 | <para>When switching to the different task, kernel also require to |
117 | <para>When switching to the different task, kernel also require to |
118 | switch mappings to the different address space. In case TLB cannot |
118 | switch mappings to the different address space. In case TLB cannot |
119 | distinguish address space mappings, all mappings from the old address |
119 | distinguish address space mappings, all mapping information in TLB |
120 | space should be flushed, which can create certain uncessary |
120 | from the old address space must be flushed, which can create certain |
121 | overhead.</para> |
- | |
122 | - | ||
123 | <para>To avoid this, some architectures have capability to segregate |
121 | uncessary overhead during the task switching. To avoid this, some |
124 | different address spaces on HW level introducing the ASID (address |
122 | architectures have capability to segregate different address spaces on |
125 | space ID). On those architectures each TLB record contains an address |
123 | hardware level introducing the address space identifier as a part of |
126 | space identifier, that tells to which address space this record is |
124 | TLB record, telling the virtual address space translation unit to |
127 | applicable.</para> |
125 | which address space this record is applicable.</para> |
128 | 126 | ||
129 | <para>HelenOS kernel can take advantage of this hardware supported |
127 | <para>HelenOS kernel can take advantage of this hardware supported |
130 | identifier by having an ASID abstraction which is connected to the |
128 | identifier by having an ASID abstraction which is somehow related to |
131 | corresponding architecture identifier. I.e. on ia64 kernel ASID is |
129 | the corresponding architecture identifier. I.e. on ia64 kernel ASID is |
132 | built from RID (region identifier) and on the mips32 kernel ASID is |
130 | derived from RID (region identifier) and on the mips32 kernel ASID is |
133 | actually the hardware identifier.</para> |
131 | actually the hardware identifier. As expected, this ASID information |
- | 132 | record is the part of <emphasis>as_t</emphasis> structure.</para> |
|
134 | 133 | ||
135 | <para>Due to the hardware limitations ASID has limited length from 8 |
134 | <para>Due to the hardware limitations, hardware ASID has limited |
136 | bits on ia64 to 24 bits on mips32, which makes it impossible to use as |
135 | length from 8 bits on ia64 to 24 bits on mips32, which makes it |
137 | unique address space identifier for all tasks running in the system. |
136 | impossible to use it as unique address space identifier for all tasks |
138 | In such situations special ASID stealing algoritm is used, which takes |
137 | running in the system. In such situations special ASID stealing |
- | 138 | algoritm is used, which takes ASID from inactive task and assigns it |
|
- | 139 | to the active task.</para> |
|
- | 140 | ||
139 | ASID from inactive task and assigns it to the active task.</para> |
141 | <para><classname>ASID stealing algoritm here.</classname></para> |
140 | </section> |
142 | </section> |
141 | </section> |
143 | </section> |
142 | 144 | ||
143 | <section> |
145 | <section> |
144 | <title>Virtual address translation</title> |
146 | <title>Virtual address translation</title> |
Line 147... | Line 149... | ||
147 | <title>Page tables</title> |
149 | <title>Page tables</title> |
148 | 150 | ||
149 | <para>HelenOS kernel has two different approaches to the paging |
151 | <para>HelenOS kernel has two different approaches to the paging |
150 | implementation: <emphasis>4 level page tables</emphasis> and |
152 | implementation: <emphasis>4 level page tables</emphasis> and |
151 | <emphasis>global hash tables</emphasis>, which are accessible via |
153 | <emphasis>global hash tables</emphasis>, which are accessible via |
152 | generic paging abstraction layer. This division was caused by the |
154 | generic paging abstraction layer. Such different functionality was |
153 | major architectural differences between different platforms.</para> |
155 | caused by the major architectural differences between supported |
- | 156 | platforms. This abstraction is implemented with help of the global |
|
- | 157 | structure of pointers to basic mapping functions |
|
- | 158 | <emphasis>page_mapping_operations</emphasis>. To achieve different |
|
- | 159 | functionality of page tables, corresponding layer must implement |
|
- | 160 | functions, declared in |
|
- | 161 | <emphasis>page_mapping_operations</emphasis></para> |
|
154 | 162 | ||
155 | <formalpara> |
163 | <formalpara> |
156 | <title>4-level page tables</title> |
164 | <title>4-level page tables</title> |
157 | 165 | ||
158 | <para>4-level page tables are the generalization of the hardware |
166 | <para>4-level page tables are the generalization of the hardware |
159 | capabilities of the certain platforms. <itemizedlist> |
167 | capabilities of several architectures.<itemizedlist> |
160 | <listitem> |
168 | <listitem> |
161 | ia32 uses 2-level page tables, with full hardware support. |
169 | ia32 uses 2-level page tables, with full hardware support. |
162 | </listitem> |
170 | </listitem> |
163 | 171 | ||
164 | <listitem> |
172 | <listitem> |