47 #include "params/X86FsWorkload.hh"
54 smbiosTable(
p->smbios_table),
55 mpFloatingPointer(
p->intel_mp_pointer),
56 mpConfigTable(
p->intel_mp_table),
57 rsdp(
p->acpi_description_table_pointer)
62 SegDescriptor desc,
bool longmode)
73 attr.defaultSize = desc.d;
74 attr.longMode = desc.l;
76 attr.granularity = desc.g;
77 attr.present = desc.p;
79 attr.type = desc.type;
81 if (desc.type.codeOrData) {
84 attr.readable = desc.type.r;
88 attr.expandDown = desc.type.e;
90 attr.writable = desc.type.w;
112 if (tc->contextId() == 0) {
125 "Loading a 32 bit x86 kernel is not supported.");
138 const int NumPDTs = 4;
140 const Addr PageMapLevel4 = 0x70000;
141 const Addr PageDirPtrTable = 0x71000;
142 const Addr PageDirTable[NumPDTs] =
143 {0x72000, 0x73000, 0x74000, 0x75000};
144 const Addr GDTBase = 0x76000;
146 const int PML4Bits = 9;
147 const int PDPTBits = 9;
148 const int PDTBits = 9;
153 uint8_t numGDTEntries = 0;
155 uint64_t nullDescriptor = 0;
156 phys_proxy.
writeBlob(GDTBase + numGDTEntries * 8, &nullDescriptor, 8);
159 SegDescriptor initDesc = 0;
160 initDesc.type.codeOrData = 0;
169 initDesc.limit = 0xFFFFFFFF;
173 SegDescriptor csDesc = initDesc;
174 csDesc.type.codeOrData = 1;
180 uint64_t csDescVal = csDesc;
181 phys_proxy.writeBlob(GDTBase + numGDTEntries * 8, (&csDescVal), 8);
186 cs.si = numGDTEntries - 1;
191 SegDescriptor dsDesc = initDesc;
192 uint64_t dsDescVal = dsDesc;
193 phys_proxy.writeBlob(GDTBase + numGDTEntries * 8, (&dsDescVal), 8);
198 ds.si = numGDTEntries - 1;
210 SegDescriptor tssDesc = initDesc;
211 uint64_t tssDescVal = tssDesc;
212 phys_proxy.writeBlob(GDTBase + numGDTEntries * 8, (&tssDescVal), 8);
217 tss.si = numGDTEntries - 1;
239 uint64_t pml4e = htole<uint64_t>(0x6);
241 phys_proxy.writeBlob(PageMapLevel4 +
offset, (&pml4e), 8);
243 pml4e = htole<uint64_t>(0x7 | PageDirPtrTable);
244 phys_proxy.writeBlob(PageMapLevel4, (&pml4e), 8);
249 uint64_t pdpe = htole<uint64_t>(0x6);
251 phys_proxy.writeBlob(PageDirPtrTable +
offset, &pdpe, 8);
253 for (
int table = 0; table < NumPDTs; table++) {
254 pdpe = htole<uint64_t>(0x7 | PageDirTable[table]);
255 phys_proxy.writeBlob(PageDirPtrTable + table * 8, &pdpe, 8);
261 const Addr pageSize = 2 << 20;
262 for (
int table = 0; table < NumPDTs; table++) {
266 phys_proxy.writeBlob(PageDirTable[table] +
offset, &pdte, 8);
311 Addr ebdaPos = 0xF0000;
316 ebdaPos += (fixed + table);
317 ebdaPos =
roundUp(ebdaPos, 16);
321 ebdaPos += (fixed + table);
362 assert(
fp > table ||
fp + fpSize <= table);
363 assert(table >
fp || table + tableSize <=
fp);
364 assert(fpSize == 0x10);
370 X86FsWorkloadParams::create()