gem5 v24.0.0.0
Loading...
Searching...
No Matches
process.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2014 Advanced Micro Devices, Inc.
3 * Copyright (c) 2007 The Hewlett-Packard Development Company
4 * All rights reserved.
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating
9 * to a hardware implementation of the functionality of the software
10 * licensed hereunder. You may use the software subject to the license
11 * terms below provided that you ensure that this notice is replicated
12 * unmodified and in its entirety in all distributions of the software,
13 * modified or unmodified, in source code or in binary form.
14 *
15 * Copyright (c) 2003-2006 The Regents of The University of Michigan
16 * All rights reserved.
17 *
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions are
20 * met: redistributions of source code must retain the above copyright
21 * notice, this list of conditions and the following disclaimer;
22 * redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the
24 * documentation and/or other materials provided with the distribution;
25 * neither the name of the copyright holders nor the names of its
26 * contributors may be used to endorse or promote products derived from
27 * this software without specific prior written permission.
28 *
29 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 */
41
42#include "arch/x86/process.hh"
43
44#include <string>
45#include <vector>
46
48#include "arch/x86/page_size.hh"
49#include "arch/x86/regs/int.hh"
50#include "arch/x86/regs/misc.hh"
53#include "arch/x86/types.hh"
56#include "base/logging.hh"
57#include "base/trace.hh"
58#include "cpu/thread_context.hh"
59#include "debug/Stack.hh"
61#include "mem/page_table.hh"
62#include "params/Process.hh"
63#include "sim/aux_vector.hh"
64#include "sim/byteswap.hh"
65#include "sim/process_impl.hh"
66#include "sim/syscall_desc.hh"
67#include "sim/syscall_return.hh"
68#include "sim/system.hh"
69
70namespace gem5
71{
72
73using namespace X86ISA;
74
75template class MultiLevelPageTable<LongModePTE<47, 39>,
76 LongModePTE<38, 30>,
77 LongModePTE<29, 21>,
78 LongModePTE<20, 12> >;
79typedef MultiLevelPageTable<LongModePTE<47, 39>,
80 LongModePTE<38, 30>,
81 LongModePTE<29, 21>,
83
84X86Process::X86Process(const ProcessParams &params,
85 loader::ObjectFile *objFile) :
86 Process(params, params.useArchPT ?
87 static_cast<EmulationPageTable *>(
88 new ArchPageTable(params.name, params.pid,
89 params.system, PageBytes)) :
90 new EmulationPageTable(params.name, params.pid,
91 PageBytes),
92 objFile)
93{
94}
95
98{
99 Process::clone(old_tc, new_tc, p, flags);
100 X86Process *process = (X86Process*)p;
101 *process = *this;
102}
103
104X86_64Process::X86_64Process(const ProcessParams &params,
105 loader::ObjectFile *objFile) :
106 X86Process(params, objFile)
107{
108 vsyscallPage.base = 0xffffffffff600000ULL;
112
113 Addr brk_point = roundUp(image.maxAddr(), PageBytes);
114 Addr stack_base = 0x7FFFFFFFF000ULL;
115 Addr max_stack_size = params.maxStackSize;
116 Addr next_thread_stack_base = stack_base - max_stack_size;
117 Addr mmap_end = 0x7FFFF7FFF000ULL;
118
119 memState = std::make_shared<MemState>(
120 this, brk_point, stack_base, max_stack_size,
121 next_thread_stack_base, mmap_end);
122}
123
124
125I386Process::I386Process(const ProcessParams &params,
126 loader::ObjectFile *objFile) :
127 X86Process(params, objFile)
128{
129 if (kvmInSE)
130 panic("KVM CPU model does not support 32 bit processes");
131
132 _gdtStart = 0xffffd000ULL;
134
135 vsyscallPage.base = 0xffffe000ULL;
139
140 Addr brk_point = roundUp(image.maxAddr(), PageBytes);
141 Addr stack_base = _gdtStart;
142 Addr max_stack_size = 8 * 1024 * 1024;
143 Addr next_thread_stack_base = stack_base - max_stack_size;
144 Addr mmap_end = 0xB7FFF000ULL;
145
146 memState = std::make_shared<MemState>(
147 this, brk_point, stack_base, max_stack_size,
148 next_thread_stack_base, mmap_end);
149}
150
151void
153{
155
156 if (useForClone)
157 return;
158
160
161 // Set up the vsyscall page for this process.
162 memState->mapRegion(vsyscallPage.base, vsyscallPage.size, "vsyscall");
163 uint8_t vtimeBlob[] = {
164 0x48,0xc7,0xc0,0xc9,0x00,0x00,0x00, // mov $0xc9,%rax
165 0x0f,0x05, // syscall
166 0xc3 // retq
167 };
169 vtimeBlob, sizeof(vtimeBlob));
170
171 uint8_t vgettimeofdayBlob[] = {
172 0x48,0xc7,0xc0,0x60,0x00,0x00,0x00, // mov $0x60,%rax
173 0x0f,0x05, // syscall
174 0xc3 // retq
175 };
176 initVirtMem->writeBlob(
178 vgettimeofdayBlob, sizeof(vgettimeofdayBlob));
179
180 if (kvmInSE) {
181 PortProxy physProxy = system->physProxy;
182
183 Addr syscallCodePhysAddr = seWorkload->allocPhysPages(1);
184 Addr gdtPhysAddr = seWorkload->allocPhysPages(1);
185 Addr idtPhysAddr = seWorkload->allocPhysPages(1);
186 Addr istPhysAddr = seWorkload->allocPhysPages(1);
187 Addr tssPhysAddr = seWorkload->allocPhysPages(1);
188 Addr pfHandlerPhysAddr = seWorkload->allocPhysPages(1);
189
190 /*
191 * Set up the gdt.
192 */
193 uint8_t numGDTEntries = 0;
194 uint64_t nullDescriptor = 0;
195 physProxy.writeBlob(gdtPhysAddr + numGDTEntries * 8,
196 &nullDescriptor, 8);
197 numGDTEntries++;
198
199 SegDescriptor initDesc = 0;
200 initDesc.type.codeOrData = 0; // code or data type
201 initDesc.type.c = 0; // conforming
202 initDesc.type.r = 1; // readable
203 initDesc.dpl = 0; // privilege
204 initDesc.p = 1; // present
205 initDesc.l = 1; // longmode - 64 bit
206 initDesc.d = 0; // operand size
207 initDesc.g = 1;
208 initDesc.s = 1; // system segment
209 initDesc.limit = 0xFFFFFFFF;
210 initDesc.base = 0;
211
212 //64 bit code segment
213 SegDescriptor csLowPLDesc = initDesc;
214 csLowPLDesc.type.codeOrData = 1;
215 csLowPLDesc.dpl = 0;
216 uint64_t csLowPLDescVal = csLowPLDesc;
217 physProxy.writeBlob(gdtPhysAddr + numGDTEntries * 8,
218 &csLowPLDescVal, 8);
219
220 numGDTEntries++;
221
222 SegSelector csLowPL = 0;
223 csLowPL.si = numGDTEntries - 1;
224 csLowPL.rpl = 0;
225
226 //64 bit data segment
227 SegDescriptor dsLowPLDesc = initDesc;
228 dsLowPLDesc.type.codeOrData = 0;
229 dsLowPLDesc.dpl = 0;
230 uint64_t dsLowPLDescVal = dsLowPLDesc;
231 physProxy.writeBlob(gdtPhysAddr + numGDTEntries * 8,
232 &dsLowPLDescVal, 8);
233
234 numGDTEntries++;
235
236 SegSelector dsLowPL = 0;
237 dsLowPL.si = numGDTEntries - 1;
238 dsLowPL.rpl = 0;
239
240 //64 bit data segment
241 SegDescriptor dsDesc = initDesc;
242 dsDesc.type.codeOrData = 0;
243 dsDesc.dpl = 3;
244 uint64_t dsDescVal = dsDesc;
245 physProxy.writeBlob(gdtPhysAddr + numGDTEntries * 8,
246 &dsDescVal, 8);
247
248 numGDTEntries++;
249
250 SegSelector ds = 0;
251 ds.si = numGDTEntries - 1;
252 ds.rpl = 3;
253
254 //64 bit code segment
255 SegDescriptor csDesc = initDesc;
256 csDesc.type.codeOrData = 1;
257 csDesc.dpl = 3;
258 uint64_t csDescVal = csDesc;
259 physProxy.writeBlob(gdtPhysAddr + numGDTEntries * 8,
260 &csDescVal, 8);
261
262 numGDTEntries++;
263
264 SegSelector cs = 0;
265 cs.si = numGDTEntries - 1;
266 cs.rpl = 3;
267
268 SegSelector scall = 0;
269 scall.si = csLowPL.si;
270 scall.rpl = 0;
271
272 SegSelector sret = 0;
273 sret.si = dsLowPL.si;
274 sret.rpl = 3;
275
276 /* In long mode the TSS has been extended to 16 Bytes */
277 TSSlow TSSDescLow = 0;
278 TSSDescLow.type = 0xB;
279 TSSDescLow.dpl = 0; // Privelege level 0
280 TSSDescLow.p = 1; // Present
281 TSSDescLow.limit = 0xFFFFFFFF;
282 TSSDescLow.base = bits(TSSVirtAddr, 31, 0);
283
284 TSShigh TSSDescHigh = 0;
285 TSSDescHigh.base = bits(TSSVirtAddr, 63, 32);
286
287 struct TSSDesc
288 {
289 uint64_t low;
290 uint64_t high;
291 } tssDescVal = {TSSDescLow, TSSDescHigh};
292
293 physProxy.writeBlob(gdtPhysAddr + numGDTEntries * 8,
294 &tssDescVal, sizeof(tssDescVal));
295
296 numGDTEntries++;
297
298 SegSelector tssSel = 0;
299 tssSel.si = numGDTEntries - 1;
300
301 uint64_t tss_base_addr = (TSSDescHigh.base << 32) | TSSDescLow.base;
302 uint64_t tss_limit = TSSDescLow.limit;
303
304 SegAttr tss_attr = 0;
305
306 tss_attr.type = TSSDescLow.type;
307 tss_attr.dpl = TSSDescLow.dpl;
308 tss_attr.present = TSSDescLow.p;
309 tss_attr.granularity = TSSDescLow.g;
310 tss_attr.unusable = 0;
311
312 for (int i = 0; i < contextIds.size(); i++) {
313 ThreadContext *tc = system->threads[contextIds[i]];
314
315 tc->setMiscReg(misc_reg::Cs, cs);
321
322 // LDT
324 SegAttr tslAttr = 0;
325 tslAttr.unusable = 1;
326 tslAttr.present = 0;
327 tslAttr.type = 2;
328 tc->setMiscReg(misc_reg::TslAttr, tslAttr);
329
331 tc->setMiscReg(misc_reg::TsgLimit, 8 * numGDTEntries - 1);
332
333 tc->setMiscReg(misc_reg::Tr, tssSel);
334 tc->setMiscReg(misc_reg::TrBase, tss_base_addr);
335 tc->setMiscReg(misc_reg::TrEffBase, tss_base_addr);
336 tc->setMiscReg(misc_reg::TrLimit, tss_limit);
337 tc->setMiscReg(misc_reg::TrAttr, tss_attr);
338
339 //Start using longmode segments.
340 installSegDesc(tc, segment_idx::Cs, csDesc, true);
341 installSegDesc(tc, segment_idx::Ds, dsDesc, true);
342 installSegDesc(tc, segment_idx::Es, dsDesc, true);
343 installSegDesc(tc, segment_idx::Fs, dsDesc, true);
344 installSegDesc(tc, segment_idx::Gs, dsDesc, true);
345 installSegDesc(tc, segment_idx::Ss, dsDesc, true);
346
347 Efer efer = 0;
348 efer.sce = 1; // Enable system call extensions.
349 efer.lme = 1; // Enable long mode.
350 efer.lma = 1; // Activate long mode.
351 efer.nxe = 1; // Enable nx support.
352 efer.svme = 0; // Disable svm support for now.
353 efer.ffxsr = 0; // Disable fast fxsave and fxrstor.
354 tc->setMiscReg(misc_reg::Efer, efer);
355
356 //Set up the registers that describe the operating mode.
357 CR0 cr0 = 0;
358 cr0.pg = 1; // Turn on paging.
359 cr0.cd = 0; // Don't disable caching.
360 cr0.nw = 0; // This is bit is defined to be ignored.
361 cr0.am = 0; // No alignment checking
362 cr0.wp = 0; // Supervisor mode can write read only pages
363 cr0.ne = 1;
364 cr0.et = 1; // This should always be 1
365 cr0.ts = 0; // We don't do task switching, so causing fp exceptions
366 // would be pointless.
367 cr0.em = 0; // Allow x87 instructions to execute natively.
368 cr0.mp = 1; // This doesn't really matter, but the manual suggests
369 // setting it to one.
370 cr0.pe = 1; // We're definitely in protected mode.
371 tc->setMiscReg(misc_reg::Cr0, cr0);
372
373 CR0 cr2 = 0;
374 tc->setMiscReg(misc_reg::Cr2, cr2);
375
376 CR3 cr3 = dynamic_cast<ArchPageTable *>(pTable)->basePtr();
377 tc->setMiscReg(misc_reg::Cr3, cr3);
378
379 CR4 cr4 = 0;
380 //Turn on pae.
381 cr4.osxsave = 0; // Disable XSAVE and Proc Extended States
382 cr4.osxmmexcpt = 0; // Operating System Unmasked Exception
383 cr4.osfxsr = 1; // Operating System FXSave/FSRSTOR Support
384 cr4.pce = 0; // Performance-Monitoring Counter Enable
385 cr4.pge = 0; // Page-Global Enable
386 cr4.mce = 0; // Machine Check Enable
387 cr4.pae = 1; // Physical-Address Extension
388 cr4.pse = 0; // Page Size Extensions
389 cr4.de = 0; // Debugging Extensions
390 cr4.tsd = 0; // Time Stamp Disable
391 cr4.pvi = 0; // Protected-Mode Virtual Interrupts
392 cr4.vme = 0; // Virtual-8086 Mode Extensions
393
394 tc->setMiscReg(misc_reg::Cr4, cr4);
395
396 CR8 cr8 = 0;
397 tc->setMiscReg(misc_reg::Cr8, cr8);
398
399 tc->setMiscReg(misc_reg::Mxcsr, 0x1f80);
400 tc->setMiscReg(misc_reg::Ftw, 0xffff);
401 tc->setMiscReg(misc_reg::Fcw, 0x037f);
402
403 tc->setMiscReg(misc_reg::ApicBase, 0xfee00900);
404
406 tc->setMiscReg(misc_reg::TsgLimit, 0xffff);
407
409 tc->setMiscReg(misc_reg::IdtrLimit, 0xffff);
410
411 /* enabling syscall and sysret */
412 RegVal star = ((RegVal)sret << 48) | ((RegVal)scall << 32);
413 tc->setMiscReg(misc_reg::Star, star);
415 tc->setMiscReg(misc_reg::Lstar, lstar);
416 RegVal sfmask = (1 << 8) | (1 << 10); // TF | DF
417 tc->setMiscReg(misc_reg::SfMask, sfmask);
418 }
419
420 /* Set up the content of the TSS and write it to physical memory. */
421
422 struct
423 {
424 uint32_t reserved0; // +00h
425 uint32_t RSP0_low; // +04h
426 uint32_t RSP0_high; // +08h
427 uint32_t RSP1_low; // +0Ch
428 uint32_t RSP1_high; // +10h
429 uint32_t RSP2_low; // +14h
430 uint32_t RSP2_high; // +18h
431 uint32_t reserved1; // +1Ch
432 uint32_t reserved2; // +20h
433 uint32_t IST1_low; // +24h
434 uint32_t IST1_high; // +28h
435 uint32_t IST2_low; // +2Ch
436 uint32_t IST2_high; // +30h
437 uint32_t IST3_low; // +34h
438 uint32_t IST3_high; // +38h
439 uint32_t IST4_low; // +3Ch
440 uint32_t IST4_high; // +40h
441 uint32_t IST5_low; // +44h
442 uint32_t IST5_high; // +48h
443 uint32_t IST6_low; // +4Ch
444 uint32_t IST6_high; // +50h
445 uint32_t IST7_low; // +54h
446 uint32_t IST7_high; // +58h
447 uint32_t reserved3; // +5Ch
448 uint32_t reserved4; // +60h
449 uint16_t reserved5; // +64h
450 uint16_t IO_MapBase; // +66h
451 } tss;
452
454 uint64_t IST_start = ISTVirtAddr + PageBytes;
455 tss.IST1_low = IST_start;
456 tss.IST1_high = IST_start >> 32;
457 tss.RSP0_low = tss.IST1_low;
458 tss.RSP0_high = tss.IST1_high;
459 tss.RSP1_low = tss.IST1_low;
460 tss.RSP1_high = tss.IST1_high;
461 tss.RSP2_low = tss.IST1_low;
462 tss.RSP2_high = tss.IST1_high;
463 physProxy.writeBlob(tssPhysAddr, &tss, sizeof(tss));
464
465 /* Setting IDT gates */
466 GateDescriptorLow PFGateLow = 0;
467 PFGateLow.offsetHigh = bits(PFHandlerVirtAddr, 31, 16);
468 PFGateLow.offsetLow = bits(PFHandlerVirtAddr, 15, 0);
469 PFGateLow.selector = csLowPL;
470 PFGateLow.p = 1;
471 PFGateLow.dpl = 0;
472 PFGateLow.type = 0xe; // gate interrupt type
473 PFGateLow.IST = 0; // setting IST to 0 and using RSP0
474
475 GateDescriptorHigh PFGateHigh = 0;
476 PFGateHigh.offset = bits(PFHandlerVirtAddr, 63, 32);
477
478 struct
479 {
480 uint64_t low;
481 uint64_t high;
482 } PFGate = {PFGateLow, PFGateHigh};
483
484 physProxy.writeBlob(idtPhysAddr + 0xE0, &PFGate, sizeof(PFGate));
485
486 /* System call handler */
487 // First, we write to the MMIO m5ops range (0xffffc90000007000)
488 // to trap out of the VM back into gem5 to emulate the system
489 // call. Upon re-entering the VM, we need to flush the TLB in
490 // case the system call modified existing page mappings (e.g.,
491 // munmap, mremap, brk). To do this, we can simply read/write
492 // cr3; however, doing so requires saving the value to an
493 // intermediate GPR (%rax, in this case). We save/restore the
494 // value of %rax in the scratch region syscallDataBuf.
495 const Addr syscallDataBuf = syscallCodeVirtAddr + 0x100;
496 uint8_t syscallBlob[] = {
497 // mov %rax, (0xffffc90000007000)
498 0x48, 0xa3, 0x00, 0x70, 0x00,
499 0x00, 0x00, 0xc9, 0xff, 0xff,
500 // mov %rax, (syscallDataBuf)
501 0x48, 0xa3, 0x00, 0x00, 0x00,
502 0x00, 0x00, 0x00, 0x00, 0x00,
503 // mov %cr3, %rax
504 0x0f, 0x20, 0xd8,
505 // mov %rax, %cr3
506 0x0f, 0x22, 0xd8,
507 // mov (syscallDataBuf), %rax
508 0x48, 0xa1, 0x00, 0x00, 0x00,
509 0x00, 0x00, 0x00, 0x00, 0x00,
510 // sysret
511 0x48, 0x0f, 0x07
512 };
513 assert(syscallDataBuf >= syscallCodePhysAddr + sizeof syscallBlob);
514 std::memcpy(&syscallBlob[12], &syscallDataBuf, sizeof syscallDataBuf);
515 std::memcpy(&syscallBlob[28], &syscallDataBuf, sizeof syscallDataBuf);
516
517 physProxy.writeBlob(syscallCodePhysAddr,
518 syscallBlob, sizeof(syscallBlob));
519
521 uint8_t faultBlob[] = {
522 // mov %rax, (0xffffc90000007000)
523 0x48, 0xa3, 0x00, 0x70, 0x00,
524 0x00, 0x00, 0xc9, 0xff, 0xff,
525 // add $0x8, %rsp # skip error
526 0x48, 0x83, 0xc4, 0x08,
527 // iretq
528 0x48, 0xcf
529 };
530
531 physProxy.writeBlob(pfHandlerPhysAddr, faultBlob, sizeof(faultBlob));
532
533 /* Syscall handler */
534 pTable->map(syscallCodeVirtAddr, syscallCodePhysAddr,
535 PageBytes, false);
536 /* GDT */
537 pTable->map(GDTVirtAddr, gdtPhysAddr, PageBytes, false);
538 /* IDT */
539 pTable->map(IDTVirtAddr, idtPhysAddr, PageBytes, false);
540 /* TSS */
541 pTable->map(TSSVirtAddr, tssPhysAddr, PageBytes, false);
542 /* IST */
543 pTable->map(ISTVirtAddr, istPhysAddr, PageBytes, false);
544 /* PF handler */
545 pTable->map(PFHandlerVirtAddr, pfHandlerPhysAddr, PageBytes, false);
546 /* MMIO region for m5ops */
547 auto m5op_range = system->m5opRange();
548 if (m5op_range.size()) {
549 pTable->map(MMIORegionVirtAddr, m5op_range.start(),
550 m5op_range.size(), false);
551 }
552 } else {
553 for (int i = 0; i < contextIds.size(); i++) {
554 ThreadContext * tc = system->threads[contextIds[i]];
555
556 SegAttr dataAttr = 0;
557 dataAttr.dpl = 3;
558 dataAttr.unusable = 0;
559 dataAttr.defaultSize = 1;
560 dataAttr.longMode = 1;
561 dataAttr.avl = 0;
562 dataAttr.granularity = 1;
563 dataAttr.present = 1;
564 dataAttr.type = 3;
565 dataAttr.writable = 1;
566 dataAttr.readable = 1;
567 dataAttr.expandDown = 0;
568 dataAttr.system = 1;
569
570 // Initialize the segment registers.
571 for (int seg = 0; seg < segment_idx::NumIdxs; seg++) {
575 }
576
577 SegAttr csAttr = 0;
578 csAttr.dpl = 3;
579 csAttr.unusable = 0;
580 csAttr.defaultSize = 0;
581 csAttr.longMode = 1;
582 csAttr.avl = 0;
583 csAttr.granularity = 1;
584 csAttr.present = 1;
585 csAttr.type = 10;
586 csAttr.writable = 0;
587 csAttr.readable = 1;
588 csAttr.expandDown = 0;
589 csAttr.system = 1;
590
592
593 Efer efer = 0;
594 efer.sce = 1; // Enable system call extensions.
595 efer.lme = 1; // Enable long mode.
596 efer.lma = 1; // Activate long mode.
597 efer.nxe = 1; // Enable nx support.
598 efer.svme = 0; // Disable svm support for now. It isn't implemented.
599 efer.ffxsr = 1; // Turn on fast fxsave and fxrstor.
600 tc->setMiscReg(misc_reg::Efer, efer);
601
602 // Set up the registers that describe the operating mode.
603 CR0 cr0 = 0;
604 cr0.pg = 1; // Turn on paging.
605 cr0.cd = 0; // Don't disable caching.
606 cr0.nw = 0; // This is bit is defined to be ignored.
607 cr0.am = 0; // No alignment checking
608 cr0.wp = 0; // Supervisor mode can write read only pages
609 cr0.ne = 1;
610 cr0.et = 1; // This should always be 1
611 cr0.ts = 0; // We don't do task switching, so causing fp exceptions
612 // would be pointless.
613 cr0.em = 0; // Allow x87 instructions to execute natively.
614 cr0.mp = 1; // This doesn't really matter, but the manual suggests
615 // setting it to one.
616 cr0.pe = 1; // We're definitely in protected mode.
617 tc->setMiscReg(misc_reg::Cr0, cr0);
618
619 tc->setMiscReg(misc_reg::Mxcsr, 0x1f80);
620 tc->setMiscReg(misc_reg::Ftw, 0xffff);
621 tc->setMiscReg(misc_reg::Fcw, 0x037f);
622
623 // Setting CR3 to the process pid so that concatinated
624 // page addr with lower 12 bits of CR3 can be used in SE
625 // mode as well to avoid conflicts between tlb entries with
626 // same virtual addresses belonging to different processes
628
629 // Setting pcide bit in CR4
630 CR4 cr4 = tc->readMiscRegNoEffect(misc_reg::Cr4);
631 cr4.pcide = 1;
632 tc->setMiscReg(misc_reg::Cr4, cr4);
633 }
634 }
635}
636
637void
639{
641
643
644 /*
645 * Set up a GDT for this process. The whole GDT wouldn't really be for
646 * this process, but the only parts we care about are.
647 */
649 uint64_t zero = 0;
650 assert(_gdtSize % sizeof(zero) == 0);
651 for (Addr gdtCurrent = _gdtStart;
652 gdtCurrent < _gdtStart + _gdtSize; gdtCurrent += sizeof(zero)) {
653 initVirtMem->write(gdtCurrent, zero);
654 }
655
656 // Set up the vsyscall page for this process.
657 memState->mapRegion(vsyscallPage.base, vsyscallPage.size, "vsyscall");
658 uint8_t vsyscallBlob[] = {
659 0x51, // push %ecx
660 0x52, // push %edp
661 0x55, // push %ebp
662 0x89, 0xe5, // mov %esp, %ebp
663 0x0f, 0x34 // sysenter
664 };
666 vsyscallBlob, sizeof(vsyscallBlob));
667
668 uint8_t vsysexitBlob[] = {
669 0x5d, // pop %ebp
670 0x5a, // pop %edx
671 0x59, // pop %ecx
672 0xc3 // ret
673 };
675 vsysexitBlob, sizeof(vsysexitBlob));
676
677 for (int i = 0; i < contextIds.size(); i++) {
678 ThreadContext * tc = system->threads[contextIds[i]];
679
680 SegAttr dataAttr = 0;
681 dataAttr.dpl = 3;
682 dataAttr.unusable = 0;
683 dataAttr.defaultSize = 1;
684 dataAttr.longMode = 0;
685 dataAttr.avl = 0;
686 dataAttr.granularity = 1;
687 dataAttr.present = 1;
688 dataAttr.type = 3;
689 dataAttr.writable = 1;
690 dataAttr.readable = 1;
691 dataAttr.expandDown = 0;
692 dataAttr.system = 1;
693
694 // Initialize the segment registers.
695 for (int seg = 0; seg < segment_idx::NumIdxs; seg++) {
696 tc->setMiscRegNoEffect(misc_reg::segBase(seg), 0);
697 tc->setMiscRegNoEffect(misc_reg::segEffBase(seg), 0);
698 tc->setMiscRegNoEffect(misc_reg::segAttr(seg), dataAttr);
699 tc->setMiscRegNoEffect(misc_reg::segSel(seg), 0xB);
700 tc->setMiscRegNoEffect(misc_reg::segLimit(seg), (uint32_t)(-1));
701 }
702
703 SegAttr csAttr = 0;
704 csAttr.dpl = 3;
705 csAttr.unusable = 0;
706 csAttr.defaultSize = 1;
707 csAttr.longMode = 0;
708 csAttr.avl = 0;
709 csAttr.granularity = 1;
710 csAttr.present = 1;
711 csAttr.type = 0xa;
712 csAttr.writable = 0;
713 csAttr.readable = 1;
714 csAttr.expandDown = 0;
715 csAttr.system = 1;
716
717 tc->setMiscRegNoEffect(misc_reg::CsAttr, csAttr);
718
719 tc->setMiscRegNoEffect(misc_reg::TsgBase, _gdtStart);
720 tc->setMiscRegNoEffect(misc_reg::TsgEffBase, _gdtStart);
721 tc->setMiscRegNoEffect(misc_reg::TsgLimit, _gdtStart + _gdtSize - 1);
722
723 // Set the LDT selector to 0 to deactivate it.
724 tc->setMiscRegNoEffect(misc_reg::Tsl, 0);
725 SegAttr attr = 0;
726 attr.unusable = 1;
727 tc->setMiscRegNoEffect(misc_reg::TslAttr, attr);
728
729 Efer efer = 0;
730 efer.sce = 1; // Enable system call extensions.
731 efer.lme = 1; // Enable long mode.
732 efer.lma = 0; // Deactivate long mode.
733 efer.nxe = 1; // Enable nx support.
734 efer.svme = 0; // Disable svm support for now. It isn't implemented.
735 efer.ffxsr = 1; // Turn on fast fxsave and fxrstor.
736 tc->setMiscReg(misc_reg::Efer, efer);
737
738 // Set up the registers that describe the operating mode.
739 CR0 cr0 = 0;
740 cr0.pg = 1; // Turn on paging.
741 cr0.cd = 0; // Don't disable caching.
742 cr0.nw = 0; // This is bit is defined to be ignored.
743 cr0.am = 0; // No alignment checking
744 cr0.wp = 0; // Supervisor mode can write read only pages
745 cr0.ne = 1;
746 cr0.et = 1; // This should always be 1
747 cr0.ts = 0; // We don't do task switching, so causing fp exceptions
748 // would be pointless.
749 cr0.em = 0; // Allow x87 instructions to execute natively.
750 cr0.mp = 1; // This doesn't really matter, but the manual suggests
751 // setting it to one.
752 cr0.pe = 1; // We're definitely in protected mode.
753 tc->setMiscReg(misc_reg::Cr0, cr0);
754
755 tc->setMiscReg(misc_reg::Mxcsr, 0x1f80);
756 tc->setMiscReg(misc_reg::Ftw, 0xffff);
757 tc->setMiscReg(misc_reg::Fcw, 0x037f);
758 }
759}
760
761template<class IntType>
762void
765{
766 int intSize = sizeof(IntType);
767
769
770 std::string filename;
771 if (argv.size() < 1)
772 filename = "";
773 else
774 filename = argv[0];
775
776 // We want 16 byte alignment
777 uint64_t align = 16;
778
779 enum X86CpuFeature
780 {
781 X86_OnboardFPU = 1 << 0,
782 X86_VirtualModeExtensions = 1 << 1,
783 X86_DebuggingExtensions = 1 << 2,
784 X86_PageSizeExtensions = 1 << 3,
785
786 X86_TimeStampCounter = 1 << 4,
787 X86_ModelSpecificRegisters = 1 << 5,
788 X86_PhysicalAddressExtensions = 1 << 6,
789 X86_MachineCheckExtensions = 1 << 7,
790
791 X86_CMPXCHG8Instruction = 1 << 8,
792 X86_OnboardAPIC = 1 << 9,
793 X86_SYSENTER_SYSEXIT = 1 << 11,
794
795 X86_MemoryTypeRangeRegisters = 1 << 12,
796 X86_PageGlobalEnable = 1 << 13,
797 X86_MachineCheckArchitecture = 1 << 14,
798 X86_CMOVInstruction = 1 << 15,
799
800 X86_PageAttributeTable = 1 << 16,
801 X86_36BitPSEs = 1 << 17,
802 X86_ProcessorSerialNumber = 1 << 18,
803 X86_CLFLUSHInstruction = 1 << 19,
804
805 X86_DebugTraceStore = 1 << 21,
806 X86_ACPIViaMSR = 1 << 22,
807 X86_MultimediaExtensions = 1 << 23,
808
809 X86_FXSAVE_FXRSTOR = 1 << 24,
810 X86_StreamingSIMDExtensions = 1 << 25,
811 X86_StreamingSIMDExtensions2 = 1 << 26,
812 X86_CPUSelfSnoop = 1 << 27,
813
814 X86_HyperThreading = 1 << 28,
815 X86_AutomaticClockControl = 1 << 29,
816 X86_IA64Processor = 1 << 30
817 };
818
819 // Setup the auxiliary vectors. These will already have endian
820 // conversion. Auxiliary vectors are loaded only for elf formatted
821 // executables; the auxv is responsible for passing information from
822 // the OS to the interpreter.
823 auto *elfObject = dynamic_cast<loader::ElfObject *>(objFile);
824 if (elfObject) {
825 uint64_t features =
826 X86_OnboardFPU |
827 X86_VirtualModeExtensions |
828 X86_DebuggingExtensions |
829 X86_PageSizeExtensions |
830 X86_TimeStampCounter |
831 X86_ModelSpecificRegisters |
832 X86_PhysicalAddressExtensions |
833 X86_MachineCheckExtensions |
834 X86_CMPXCHG8Instruction |
835 X86_OnboardAPIC |
836 X86_SYSENTER_SYSEXIT |
837 X86_MemoryTypeRangeRegisters |
838 X86_PageGlobalEnable |
839 X86_MachineCheckArchitecture |
840 X86_CMOVInstruction |
841 X86_PageAttributeTable |
842 X86_36BitPSEs |
843// X86_ProcessorSerialNumber |
844 X86_CLFLUSHInstruction |
845// X86_DebugTraceStore |
846// X86_ACPIViaMSR |
847 X86_MultimediaExtensions |
848 X86_FXSAVE_FXRSTOR |
849 X86_StreamingSIMDExtensions |
850 X86_StreamingSIMDExtensions2 |
851// X86_CPUSelfSnoop |
852// X86_HyperThreading |
853// X86_AutomaticClockControl |
854// X86_IA64Processor |
855 0;
856
857 // Bits which describe the system hardware capabilities
858 // XXX Figure out what these should be
859 auxv.emplace_back(gem5::auxv::Hwcap, features);
860 // The system page size
861 auxv.emplace_back(gem5::auxv::Pagesz, X86ISA::PageBytes);
862 // Frequency at which times() increments
863 // Defined to be 100 in the kernel source.
864 auxv.emplace_back(gem5::auxv::Clktck, 100);
865 // This is the virtual address of the program header tables if they
866 // appear in the executable image.
867 auxv.emplace_back(gem5::auxv::Phdr, elfObject->programHeaderTable());
868 // This is the size of a program header entry from the elf file.
869 auxv.emplace_back(gem5::auxv::Phent, elfObject->programHeaderSize());
870 // This is the number of program headers from the original elf file.
871 auxv.emplace_back(gem5::auxv::Phnum, elfObject->programHeaderCount());
872 // This is the base address of the ELF interpreter; it should be
873 // zero for static executables or contain the base address for
874 // dynamic executables.
875 auxv.emplace_back(gem5::auxv::Base, getBias());
876 // XXX Figure out what this should be.
877 auxv.emplace_back(gem5::auxv::Flags, 0);
878 // The entry point to the program
879 auxv.emplace_back(gem5::auxv::Entry, objFile->entryPoint());
880 // Different user and group IDs
881 auxv.emplace_back(gem5::auxv::Uid, uid());
882 auxv.emplace_back(gem5::auxv::Euid, euid());
883 auxv.emplace_back(gem5::auxv::Gid, gid());
884 auxv.emplace_back(gem5::auxv::Egid, egid());
885 // Whether to enable "secure mode" in the executable
886 auxv.emplace_back(gem5::auxv::Secure, 0);
887 // The address of 16 "random" bytes.
888 auxv.emplace_back(gem5::auxv::Random, 0);
889 // The name of the program
890 auxv.emplace_back(gem5::auxv::Execfn, 0);
891 // The platform string
892 auxv.emplace_back(gem5::auxv::Platform, 0);
893 }
894
895 // Figure out how big the initial stack needs to be
896
897 // A sentry NULL void pointer at the top of the stack.
898 int sentry_size = intSize;
899
900 // This is the name of the file which is present on the initial stack
901 // It's purpose is to let the user space linker examine the original file.
902 int file_name_size = filename.size() + 1;
903
904 const int numRandomBytes = 16;
905 int aux_data_size = numRandomBytes;
906
907 std::string platform = "x86_64";
908 aux_data_size += platform.size() + 1;
909
910 int env_data_size = 0;
911 for (int i = 0; i < envp.size(); ++i)
912 env_data_size += envp[i].size() + 1;
913 int arg_data_size = 0;
914 for (int i = 0; i < argv.size(); ++i)
915 arg_data_size += argv[i].size() + 1;
916
917 // The info_block needs to be padded so its size is a multiple of the
918 // alignment mask. Also, it appears that there needs to be at least some
919 // padding, so if the size is already a multiple, we need to increase it
920 // anyway.
921 int base_info_block_size =
922 sentry_size + file_name_size + env_data_size + arg_data_size;
923
924 int info_block_size = roundUp(base_info_block_size, align);
925
926 int info_block_padding = info_block_size - base_info_block_size;
927
928 // Each auxiliary vector is two 8 byte words
929 int aux_array_size = intSize * 2 * (auxv.size() + 1);
930
931 int envp_array_size = intSize * (envp.size() + 1);
932 int argv_array_size = intSize * (argv.size() + 1);
933
934 int argc_size = intSize;
935
936 // Figure out the size of the contents of the actual initial frame
937 int frame_size =
938 aux_array_size +
939 envp_array_size +
940 argv_array_size +
941 argc_size;
942
943 // There needs to be padding after the auxiliary vector data so that the
944 // very bottom of the stack is aligned properly.
945 int partial_size = frame_size + aux_data_size;
946 int aligned_partial_size = roundUp(partial_size, align);
947 int aux_padding = aligned_partial_size - partial_size;
948
949 int space_needed =
950 info_block_size +
951 aux_data_size +
952 aux_padding +
953 frame_size;
954
955 Addr stack_base = memState->getStackBase();
956
957 Addr stack_min = stack_base - space_needed;
958 stack_min = roundDown(stack_min, align);
959
960 unsigned stack_size = stack_base - stack_min;
961 stack_size = roundUp(stack_size, pageSize);
962 memState->setStackSize(stack_size);
963
964 // map memory
965 Addr stack_end = roundDown(stack_base - stack_size, pageSize);
966
967 DPRINTF(Stack, "Mapping the stack: 0x%x %dB\n", stack_end, stack_size);
968 memState->mapRegion(stack_end, stack_size, "stack");
969
970 // map out initial stack contents
971 IntType sentry_base = stack_base - sentry_size;
972 IntType file_name_base = sentry_base - file_name_size;
973 IntType env_data_base = file_name_base - env_data_size;
974 IntType arg_data_base = env_data_base - arg_data_size;
975 IntType aux_data_base = arg_data_base - info_block_padding - aux_data_size;
976 IntType auxv_array_base = aux_data_base - aux_array_size - aux_padding;
977 IntType envp_array_base = auxv_array_base - envp_array_size;
978 IntType argv_array_base = envp_array_base - argv_array_size;
979 IntType argc_base = argv_array_base - argc_size;
980
981 DPRINTF(Stack, "The addresses of items on the initial stack:\n");
982 DPRINTF(Stack, "0x%x - file name\n", file_name_base);
983 DPRINTF(Stack, "0x%x - env data\n", env_data_base);
984 DPRINTF(Stack, "0x%x - arg data\n", arg_data_base);
985 DPRINTF(Stack, "0x%x - aux data\n", aux_data_base);
986 DPRINTF(Stack, "0x%x - auxv array\n", auxv_array_base);
987 DPRINTF(Stack, "0x%x - envp array\n", envp_array_base);
988 DPRINTF(Stack, "0x%x - argv array\n", argv_array_base);
989 DPRINTF(Stack, "0x%x - argc \n", argc_base);
990 DPRINTF(Stack, "0x%x - stack min\n", stack_min);
991
992 // write contents to stack
993
994 // figure out argc
995 IntType argc = argv.size();
996 IntType guestArgc = htole(argc);
997
998 // Write out the sentry void *
999 IntType sentry_NULL = 0;
1000 initVirtMem->writeBlob(sentry_base, &sentry_NULL, sentry_size);
1001
1002 // Write the file name
1003 initVirtMem->writeString(file_name_base, filename.c_str());
1004
1005 // Fix up the aux vectors which point to data
1006 assert(auxv[auxv.size() - 3].type == gem5::auxv::Random);
1007 auxv[auxv.size() - 3].val = aux_data_base;
1008 assert(auxv[auxv.size() - 2].type == gem5::auxv::Execfn);
1009 auxv[auxv.size() - 2].val = argv_array_base;
1010 assert(auxv[auxv.size() - 1].type == gem5::auxv::Platform);
1011 auxv[auxv.size() - 1].val = aux_data_base + numRandomBytes;
1012
1013
1014 // Copy the aux stuff
1015 Addr auxv_array_end = auxv_array_base;
1016 for (const auto &aux: auxv) {
1017 initVirtMem->write(auxv_array_end, aux, ByteOrder::little);
1018 auxv_array_end += sizeof(aux);
1019 }
1020 // Write out the terminating zeroed auxiliary vector
1021 const gem5::auxv::AuxVector<uint64_t> zero(0, 0);
1022 initVirtMem->write(auxv_array_end, zero);
1023 auxv_array_end += sizeof(zero);
1024
1025 initVirtMem->writeString(aux_data_base + numRandomBytes,
1026 platform.c_str());
1027
1028 copyStringArray(envp, envp_array_base, env_data_base,
1029 ByteOrder::little, *initVirtMem);
1030 copyStringArray(argv, argv_array_base, arg_data_base,
1031 ByteOrder::little, *initVirtMem);
1032
1033 initVirtMem->writeBlob(argc_base, &guestArgc, intSize);
1034
1036 // Set the stack pointer register
1037 tc->setReg(int_reg::Rsp, stack_min);
1038
1039 // There doesn't need to be any segment base added in since we're dealing
1040 // with the flat segmentation model.
1041 tc->pcState(getStartPC());
1042
1043 // Align the "stack_min" to a page boundary.
1044 memState->setStackMin(roundDown(stack_min, pageSize));
1045}
1046
1047void
1049{
1051 extraAuxvs.emplace_back(auxv::SysinfoEhdr, vsyscallPage.base);
1052 X86Process::argsInit<uint64_t>(pageSize, extraAuxvs);
1053}
1054
1055void
1057{
1059 //Tell the binary where the vsyscall part of the vsyscall page is.
1060 extraAuxvs.emplace_back(auxv::Sysinfo,
1062 extraAuxvs.emplace_back(auxv::SysinfoEhdr, vsyscallPage.base);
1063 X86Process::argsInit<uint32_t>(pageSize, extraAuxvs);
1064}
1065
1066void
1069{
1070 X86Process::clone(old_tc, new_tc, p, flags);
1071 ((X86_64Process*)p)->vsyscallPage = vsyscallPage;
1072}
1073
1074void
1077{
1078 X86Process::clone(old_tc, new_tc, p, flags);
1079 ((I386Process*)p)->vsyscallPage = vsyscallPage;
1080}
1081
1082} // namespace gem5
#define DPRINTF(x,...)
Definition trace.hh:210
virtual void map(Addr vaddr, Addr paddr, int64_t size, uint64_t flags=0)
Maps a virtual memory region to a physical memory region.
Definition page_table.cc:48
uint64_t pid() const
Definition page_table.hh:86
This object is a proxy for a port or other object which implements the functional response protocol,...
Definition port_proxy.hh:87
void writeBlob(Addr addr, const void *p, uint64_t size) const
Same as tryWriteBlob, but insists on success.
loader::MemoryImage image
Definition process.hh:224
void allocateMem(Addr vaddr, int64_t size, bool clobber=false)
Definition process.cc:317
uint64_t egid()
Definition process.hh:85
SEWorkload * seWorkload
Definition process.hh:175
std::unique_ptr< SETranslatingPortProxy > initVirtMem
Definition process.hh:187
virtual void clone(ThreadContext *old_tc, ThreadContext *new_tc, Process *new_p, RegVal flags)
Definition process.cc:167
std::shared_ptr< MemState > memState
Definition process.hh:289
uint64_t uid()
Definition process.hh:82
std::vector< std::string > argv
Definition process.hh:226
bool useForClone
Definition process.hh:182
std::vector< ContextID > contextIds
Definition process.hh:170
System * system
Definition process.hh:173
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
Definition process.cc:288
std::vector< std::string > envp
Definition process.hh:227
uint64_t gid()
Definition process.hh:84
Addr getStartPC()
Definition process.cc:497
loader::ObjectFile * objFile
Definition process.hh:223
Addr getBias()
Definition process.cc:489
uint64_t euid()
Definition process.hh:83
EmulationPageTable * pTable
Definition process.hh:184
Addr allocPhysPages(int npages, int pool_id=0)
Threads threads
Definition system.hh:310
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual void setMiscReg(RegIndex misc_reg, RegVal val)=0
virtual void setMiscRegNoEffect(RegIndex misc_reg, RegVal val)=0
virtual void setReg(const RegId &reg, RegVal val)
virtual const PCStateBase & pcState() const =0
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
void clone(ThreadContext *old_tc, ThreadContext *new_tc, Process *process, RegVal flags) override
Definition process.cc:1075
VSyscallPage vsyscallPage
Definition process.hh:162
I386Process(const ProcessParams &params, loader::ObjectFile *objFile)
Definition process.cc:125
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
void argsInit(int pageSize)
Definition process.cc:1056
void clone(ThreadContext *old_tc, ThreadContext *new_tc, Process *process, RegVal flags) override
Definition process.cc:96
void argsInit(int pageSize, std::vector< gem5::auxv::AuxVector< IntType > > extraAuxvs)
Definition process.cc:763
X86Process(const ProcessParams &params, loader::ObjectFile *objFile)
Definition process.cc:84
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
Definition process.cc:152
void clone(ThreadContext *old_tc, ThreadContext *new_tc, Process *process, RegVal flags) override
Definition process.cc:1067
X86_64Process(const ProcessParams &params, loader::ObjectFile *objFile)
Definition process.cc:104
void argsInit(int pageSize)
Definition process.cc:1048
STL vector class.
Definition stl.hh:37
static constexpr T roundDown(const T &val, const U &align)
This function is used to align addresses in memory.
Definition intmath.hh:279
static constexpr T roundUp(const T &val, const U &align)
This function is used to align addresses in memory.
Definition intmath.hh:260
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Definition bitfield.hh:79
#define panic(...)
This implements a cprintf based panic() function.
Definition logging.hh:188
const Params & params() const
uint8_t flags
Definition helpers.cc:87
Declaration of a multi-level page table.
Bitfield< 7 > i
Definition misc_types.hh:67
const Addr PageBytes
Definition page_size.hh:53
Bitfield< 15, 13 > ds
constexpr RegId Rsp
Definition int.hh:136
static RegIndex segSel(int index)
Definition misc.hh:515
static RegIndex segAttr(int index)
Definition misc.hh:543
static RegIndex segBase(int index)
Definition misc.hh:522
static RegIndex segLimit(int index)
Definition misc.hh:536
static RegIndex segEffBase(int index)
Definition misc.hh:529
Bitfield< 15 > system
Definition misc.hh:1032
const Addr MMIORegionVirtAddr
const Addr GDTVirtAddr
Bitfield< 2, 0 > seg
Definition types.hh:87
const Addr ISTVirtAddr
void installSegDesc(ThreadContext *tc, int seg, SegDescriptor desc, bool longmode)
Bitfield< 0 > p
Definition pagetable.hh:151
const Addr TSSVirtAddr
const Addr syscallCodeVirtAddr
const Addr IDTVirtAddr
const Addr PFHandlerVirtAddr
const Addr PageBytes
Definition page_size.hh:49
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
uint64_t RegVal
Definition types.hh:173
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
MultiLevelPageTable< LongModePTE< 47, 39 >, LongModePTE< 38, 30 >, LongModePTE< 29, 21 >, LongModePTE< 20, 12 > > ArchPageTable
Definition process.cc:82
T htole(T value)
Definition byteswap.hh:172
void copyStringArray(std::vector< std::string > &strings, AddrType array_ptr, AddrType data_ptr, const ByteOrder bo, PortProxy &memProxy)
Declarations of a non-full system Page Table.
const std::string & name()
Definition trace.cc:48

Generated on Tue Jun 18 2024 16:24:06 for gem5 by doxygen 1.11.0