- Timestamp:
- Apr 15, 2013 3:04:43 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 85039
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r45367 r45553 872 872 } 873 873 874 if (fOsXGuest) 875 InsertConfigInteger(pCPUM, "EnableHVP", 1); 876 877 /* Synthetic CPU */ 878 BOOL fSyntheticCpu = false; 879 hrc = pMachine->GetCPUProperty(CPUPropertyType_Synthetic, &fSyntheticCpu); H(); 880 InsertConfigInteger(pCPUM, "SyntheticCpu", fSyntheticCpu); 881 882 /* Physical Address Extension (PAE) */ 883 BOOL fEnablePAE = false; 884 hrc = pMachine->GetCPUProperty(CPUPropertyType_PAE, &fEnablePAE); H(); 885 InsertConfigInteger(pRoot, "EnablePAE", fEnablePAE); 886 887 874 888 /* 875 889 * Hardware virtualization extensions. 876 890 */ 891 BOOL fIsGuest64Bit; 892 hrc = guestOSType->COMGETTER(Is64Bit)(&fIsGuest64Bit); H(); 893 BOOL fSupportsLongMode; 894 hrc = host->GetProcessorFeature(ProcessorFeature_LongMode, &fSupportsLongMode); H(); 895 if (!fSupportsLongMode && fIsGuest64Bit) 896 { 897 LogRel(("WARNING! 64-bit guest type selected but the host CPU does NOT support 64-bit.\n")); 898 fIsGuest64Bit = FALSE; 899 } 900 877 901 BOOL fHWVirtExEnabled; 878 BOOL fHwVirtExtForced = false; 902 hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_Enabled, &fHWVirtExEnabled); H(); 903 if (cCpus > 1 && !fHWVirtExEnabled) 904 { 905 LogRel(("Forced fHWVirtExEnabled to TRUE by SMP guest.\n")); 906 fHWVirtExEnabled = TRUE; 907 } 908 if (!fHWVirtExEnabled && fIsGuest64Bit) 909 { 910 LogRel(("WARNING! 64-bit guest type selected on host without hardware virtualization (VT-x or AMD-V).\n")); 911 fIsGuest64Bit = FALSE; 912 } 913 914 BOOL fHwVirtExtForced; 879 915 #ifdef VBOX_WITH_RAW_MODE 880 hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_Enabled, &fHWVirtExEnabled); H(); 881 if (cCpus > 1) /** @todo SMP: This isn't nice, but things won't work on mac otherwise. */ 882 fHWVirtExEnabled = TRUE; 916 /* - With more than 4GB PGM will use different RAMRANGE sizes for raw 917 mode and hv mode to optimize lookup times. 918 - With more than one virtual CPU, raw-mode isn't a fallback option. 919 - With a 64-bit guest, raw-mode isn't a fallback option either. */ 920 fHwVirtExtForced = fHWVirtExEnabled 921 && ( cbRam + cbRamHole > _4G 922 || cCpus > 1 923 || fIsGuest64Bit); 883 924 # ifdef RT_OS_DARWIN 884 925 fHwVirtExtForced = fHWVirtExEnabled; 885 # else886 /* - With more than 4GB PGM will use different RAMRANGE sizes for raw887 mode and hv mode to optimize lookup times.888 - With more than one virtual CPU, raw-mode isn't a fallback option. */889 fHwVirtExtForced = fHWVirtExEnabled890 && ( cbRam + cbRamHole > _4G891 || cCpus > 1);892 926 # endif 927 if (fHwVirtExtForced) 928 { 929 if (cbRam + cbRamHole > _4G) 930 LogRel(("fHwVirtExtForced=TRUE - Lots of RAM\n")); 931 if (cCpus > 1) 932 LogRel(("fHwVirtExtForced=TRUE - SMP\n")); 933 if (fIsGuest64Bit) 934 LogRel(("fHwVirtExtForced=TRUE - 64-bit guest\n")); 935 # ifdef RT_OS_DARWIN 936 LogRel(("fHwVirtExtForced=TRUE - Darwin host\n")); 937 # endif 938 } 893 939 #else /* !VBOX_WITH_RAW_MODE */ 894 fHWVirtExEnabled = fHwVirtExtForced = true; 940 fHWVirtExEnabled = fHwVirtExtForced = TRUE; 941 LogRel(("fHwVirtExtForced=TRUE - No raw-mode support in this build!\n")); 895 942 #endif /* !VBOX_WITH_RAW_MODE */ 896 /* only honor the property value if there was no other reason to enable it */ 897 if (!fHwVirtExtForced) 943 if (!fHwVirtExtForced) /* No need to query if already forced above. */ 898 944 { 899 945 hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_Force, &fHwVirtExtForced); H(); 900 } 901 InsertConfigInteger(pRoot, "HwVirtExtForced", fHwVirtExtForced); 902 903 904 /* 905 * MM values. 906 */ 907 PCFGMNODE pMM; 908 InsertConfigNode(pRoot, "MM", &pMM); 909 InsertConfigInteger(pMM, "CanUseLargerHeap", chipsetType == ChipsetType_ICH9); 910 911 /* 912 * Hardware virtualization settings. 913 */ 914 BOOL fIsGuest64Bit = false; 915 PCFGMNODE pHWVirtExt; 946 if (fHwVirtExtForced) 947 LogRel(("fHwVirtExtForced=TRUE - HWVirtExPropertyType_Force\n")); 948 } 949 InsertConfigInteger(pRoot, "HwVirtExtForced", fHwVirtExtForced); 950 951 /* /HWVirtExt/xzy */ 952 PCFGMNODE pHWVirtExt; 916 953 InsertConfigNode(pRoot, "HWVirtExt", &pHWVirtExt); 954 InsertConfigInteger(pHWVirtExt, "Enabled", fHWVirtExEnabled); 917 955 if (fHWVirtExEnabled) 918 956 { 919 InsertConfigInteger(pHWVirtExt, "Enabled", 1);920 921 957 /* Indicate whether 64-bit guests are supported or not. */ 922 958 /** @todo This is currently only forced off on 32-bit hosts only because it 923 * makes a lof of difference there (REM and Solaris performance). 924 */ 925 BOOL fSupportsLongMode = false; 926 hrc = host->GetProcessorFeature(ProcessorFeature_LongMode, 927 &fSupportsLongMode); H(); 928 hrc = guestOSType->COMGETTER(Is64Bit)(&fIsGuest64Bit); H(); 929 930 if (fSupportsLongMode && fIsGuest64Bit) 959 * makes a lof of difference there (REM and Solaris performance). */ 960 if (fIsGuest64Bit) 931 961 { 932 962 InsertConfigInteger(pHWVirtExt, "64bitEnabled", 1); … … 939 969 #if ARCH_BITS == 32 /* 32-bit guests only. */ 940 970 else 941 {942 971 InsertConfigInteger(pHWVirtExt, "64bitEnabled", 0); 943 }944 972 #endif 945 973 … … 979 1007 InsertConfigInteger(pHWVirtExt, "EnableVPID", fEnableVPID); 980 1008 981 /* Physical Address Extension (PAE) */ 982 BOOL fEnablePAE = false; 983 hrc = pMachine->GetCPUProperty(CPUPropertyType_PAE, &fEnablePAE); H(); 984 InsertConfigInteger(pRoot, "EnablePAE", fEnablePAE); 985 986 /* Synthetic CPU */ 987 BOOL fSyntheticCpu = false; 988 hrc = pMachine->GetCPUProperty(CPUPropertyType_Synthetic, &fSyntheticCpu); H(); 989 InsertConfigInteger(pCPUM, "SyntheticCpu", fSyntheticCpu); 990 991 if (fOsXGuest) 992 InsertConfigInteger(pCPUM, "EnableHVP", 1); 993 994 BOOL fPXEDebug; 995 hrc = biosSettings->COMGETTER(PXEDebugEnabled)(&fPXEDebug); H(); 1009 /* 1010 * MM values. 1011 */ 1012 PCFGMNODE pMM; 1013 InsertConfigNode(pRoot, "MM", &pMM); 1014 InsertConfigInteger(pMM, "CanUseLargerHeap", chipsetType == ChipsetType_ICH9); 996 1015 997 1016 /* … … 1420 1439 InsertConfigString(pBiosCfg, "FloppyDevice", "i82078"); 1421 1440 InsertConfigInteger(pBiosCfg, "IOAPIC", fIOAPIC); 1441 BOOL fPXEDebug; 1442 hrc = biosSettings->COMGETTER(PXEDebugEnabled)(&fPXEDebug); H(); 1422 1443 InsertConfigInteger(pBiosCfg, "PXEDebug", fPXEDebug); 1423 1444 InsertConfigBytes(pBiosCfg, "UUID", &HardwareUuid,sizeof(HardwareUuid)); … … 1427 1448 1428 1449 DeviceType_T bootDevice; 1429 if (SchemaDefs::MaxBootPosition > 9) 1430 { 1431 AssertMsgFailed(("Too many boot devices %d\n", 1432 SchemaDefs::MaxBootPosition)); 1433 return VERR_INVALID_PARAMETER; 1434 } 1450 AssertMsgReturn(SchemaDefs::MaxBootPosition <= 9, ("Too many boot devices %d\n", SchemaDefs::MaxBootPosition), 1451 VERR_INVALID_PARAMETER); 1435 1452 1436 1453 for (ULONG pos = 1; pos <= SchemaDefs::MaxBootPosition; ++pos) … … 1533 1550 InsertConfigInteger(pCfg, "DmiExposeMemoryTable", 1); 1534 1551 } 1535 PCFGMNODE pDrv;1536 1552 InsertConfigNode(pInst, "LUN#0", &pLunL0); 1537 1553 InsertConfigString(pLunL0, "Driver", "NvramStorage");
Note:
See TracChangeset
for help on using the changeset viewer.