Einzelnen Beitrag anzeigen

hathor
(Gast)

n/a Beiträge
 
#8

Re: Hardwarevirtualisierung verfügbar? (Intel-VT/AMD-V)

  Alt 3. Okt 2009, 13:17
Code:
#define IA32_FEATURE_CONTROL 0x003a

#define CPUID_VMX (1 << 5)
#define CPUID_SMX (1 << 6)
static void enable_vmx(void)
{
        struct cpuid_result regs;
        msr_t msr;

        msr = rdmsr(IA32_FEATURE_CONTROL);

        if (msr.lo & (1 << 0)) {
                /* VMX locked. If we set it again we get an illegal
                 * instruction
                 */
                return;
        }

        regs = cpuid(1);
        if (regs.ecx & CPUID_VMX) {
                msr.lo |= (1 << 2);
                if (regs.ecx & CPUID_SMX)
                        msr.lo |= (1 << 1);
        }

        wrmsr(IA32_FEATURE_CONTROL, msr);

        msr.lo |= (1 << 0); /* Set lock bit */

        wrmsr(IA32_FEATURE_CONTROL, msr);
}
Infos:
coreboot ? Wikipedia
coreboot
Supported Motherboards - coreboot
Supported Chipsets and Devices - coreboot
Download coreboot - coreboot
QEMU - coreboot
FILO - coreboot
Libpayload - coreboot

Flashrom - coreboot
Flashrom Live CD - coreboot
Nvramtool - coreboot

Ectool - coreboot
  Mit Zitat antworten Zitat