arch-x86: Expose CR4.osxsave bit

Related to the recent changes with moving CPUID values to python, this
value is needed to enable AVX and needs a way to be exposed to python as
well in order to set the bit and the corresponding CPUID values at the
same time.

Change-Id: I3cadb0fe61ff4ebf6de903018a8d8a411bfdb4e0
This commit is contained in:
Matthew Poremba
2023-07-21 16:17:54 -05:00
parent 3946f7ba2c
commit 3584c3126c
3 changed files with 7 additions and 1 deletions

View File

@@ -65,6 +65,7 @@ class X86FsWorkload(KernelWorkload):
acpi_description_table_pointer = Param.X86ACPIRSDP(
X86ACPIRSDP(), "ACPI root description pointer structure"
)
enable_osxsave = Param.Bool(False, "Enable OSXSAVE in CR4 register")
class X86FsLinux(X86FsWorkload):

View File

@@ -58,7 +58,8 @@ FsWorkload::FsWorkload(const Params &p) : KernelWorkload(p),
smbiosTable(p.smbios_table),
mpFloatingPointer(p.intel_mp_pointer),
mpConfigTable(p.intel_mp_table),
rsdp(p.acpi_description_table_pointer)
rsdp(p.acpi_description_table_pointer),
enable_osxsave(p.enable_osxsave)
{}
void
@@ -295,6 +296,7 @@ FsWorkload::initState()
CR4 cr4 = tc->readMiscRegNoEffect(misc_reg::Cr4);
// Turn on pae.
cr4.pae = 1;
cr4.osxsave = enable_osxsave;
tc->setMiscReg(misc_reg::Cr4, cr4);
// Point to the page tables.

View File

@@ -106,6 +106,9 @@ class FsWorkload : public KernelWorkload
Addr &fpSize, Addr &tableSize, Addr table=0);
void writeOutACPITables(Addr begin, Addr &size);
private:
bool enable_osxsave;
};
} // namespace X86ISA