Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
9d5fc5f4
O
OpenCorePKG_MOD
项目概览
btwise
/
OpenCorePKG_MOD
通知
26
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
OpenCorePKG_MOD
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9d5fc5f4
编写于
11月 19, 2021
作者:
M
MikeBeaton
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OcCpuLib: Add EnableVmx UEFI quirk
上级
e7623113
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
64 addition
and
0 deletion
+64
-0
Changelog.md
Changelog.md
+1
-0
Docs/Configuration.tex
Docs/Configuration.tex
+10
-0
Docs/Sample.plist
Docs/Sample.plist
+2
-0
Docs/SampleCustom.plist
Docs/SampleCustom.plist
+2
-0
Include/Acidanthera/Library/OcConfigurationLib.h
Include/Acidanthera/Library/OcConfigurationLib.h
+1
-0
Include/Acidanthera/Library/OcCpuLib.h
Include/Acidanthera/Library/OcCpuLib.h
+13
-0
Library/OcConfigurationLib/OcConfigurationLib.c
Library/OcConfigurationLib/OcConfigurationLib.c
+1
-0
Library/OcCpuLib/OcCpuLib.c
Library/OcCpuLib/OcCpuLib.c
+28
-0
Library/OcMainLib/OpenCoreUefi.c
Library/OcMainLib/OpenCoreUefi.c
+6
-0
未找到文件。
Changelog.md
浏览文件 @
9d5fc5f4
...
@@ -13,6 +13,7 @@ OpenCore Changelog
...
@@ -13,6 +13,7 @@ OpenCore Changelog
-
Added
`ReconnectGraphicsOnConnect`
option for enabling alternative UEFI graphics drivers
-
Added
`ReconnectGraphicsOnConnect`
option for enabling alternative UEFI graphics drivers
-
Added BiosVideo.efi driver to use with
`ReconnectGraphicsOnConnect`
-
Added BiosVideo.efi driver to use with
`ReconnectGraphicsOnConnect`
-
Changed
`FadtEnableReset`
to avoid unreliable keyboard controller reset
-
Changed
`FadtEnableReset`
to avoid unreliable keyboard controller reset
-
Added
`EnableVmx`
quirk to allow virtualization in other OS on some Macs
#### v0.7.5
#### v0.7.5
-
Revised OpenLinuxBoot documentation
-
Revised OpenLinuxBoot documentation
...
...
Docs/Configuration.tex
浏览文件 @
9d5fc5f4
...
@@ -7623,6 +7623,16 @@ with the boot menu.
...
@@ -7623,6 +7623,16 @@ with the boot menu.
\textbf
{
Failsafe
}
:
\texttt
{
false
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
false
}
\\
\textbf
{
Description
}
: Enable AVX vector acceleration of SHA
-
512
and SHA
-
384
hashing algorithms.
\textbf
{
Description
}
: Enable AVX vector acceleration of SHA
-
512
and SHA
-
384
hashing algorithms.
\item
\texttt
{
EnableVmx
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
false
}
\\
\textbf
{
Description
}
: Enable Intel virtual machine extensions.
\emph
{
Note
}
: Required to allow virtualization in Windows on some Mac hardware. VMX
is enabled or disabled and locked by BIOS before OpenCore starts on most
firmware. Use BIOS to enable virtualization where possible.
\item
\item
\texttt
{
DisableSecurityPolicy
}
\\
\texttt
{
DisableSecurityPolicy
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
...
...
Docs/Sample.plist
浏览文件 @
9d5fc5f4
...
@@ -1564,6 +1564,8 @@
...
@@ -1564,6 +1564,8 @@
<false/>
<false/>
<key>
EnableVectorAcceleration
</key>
<key>
EnableVectorAcceleration
</key>
<true/>
<true/>
<key>
EnableVmx
</key>
<false/>
<key>
ExitBootServicesDelay
</key>
<key>
ExitBootServicesDelay
</key>
<integer>
0
</integer>
<integer>
0
</integer>
<key>
ForceOcWriteFlash
</key>
<key>
ForceOcWriteFlash
</key>
...
...
Docs/SampleCustom.plist
浏览文件 @
9d5fc5f4
...
@@ -1902,6 +1902,8 @@
...
@@ -1902,6 +1902,8 @@
<false/>
<false/>
<key>
EnableVectorAcceleration
</key>
<key>
EnableVectorAcceleration
</key>
<true/>
<true/>
<key>
EnableVmx
</key>
<false/>
<key>
ExitBootServicesDelay
</key>
<key>
ExitBootServicesDelay
</key>
<integer>
0
</integer>
<integer>
0
</integer>
<key>
ForceOcWriteFlash
</key>
<key>
ForceOcWriteFlash
</key>
...
...
Include/Acidanthera/Library/OcConfigurationLib.h
浏览文件 @
9d5fc5f4
...
@@ -691,6 +691,7 @@ typedef enum {
...
@@ -691,6 +691,7 @@ typedef enum {
_(BOOLEAN , ActivateHpetSupport , , FALSE , ()) \
_(BOOLEAN , ActivateHpetSupport , , FALSE , ()) \
_(BOOLEAN , DisableSecurityPolicy , , FALSE , ()) \
_(BOOLEAN , DisableSecurityPolicy , , FALSE , ()) \
_(BOOLEAN , EnableVectorAcceleration , , FALSE , ()) \
_(BOOLEAN , EnableVectorAcceleration , , FALSE , ()) \
_(BOOLEAN , EnableVmx , , FALSE , ()) \
_(BOOLEAN , ForgeUefiSupport , , FALSE , ()) \
_(BOOLEAN , ForgeUefiSupport , , FALSE , ()) \
_(BOOLEAN , IgnoreInvalidFlexRatio , , FALSE , ()) \
_(BOOLEAN , IgnoreInvalidFlexRatio , , FALSE , ()) \
_(INT8 , ResizeGpuBars , , -1 , ()) \
_(INT8 , ResizeGpuBars , , -1 , ()) \
...
...
Include/Acidanthera/Library/OcCpuLib.h
浏览文件 @
9d5fc5f4
...
@@ -289,6 +289,19 @@ OcCpuCorrectFlexRatio (
...
@@ -289,6 +289,19 @@ OcCpuCorrectFlexRatio (
IN
OC_CPU_INFO
*
Cpu
IN
OC_CPU_INFO
*
Cpu
);
);
/**
Enable VMX in FeatureControl MSR if supported and not already locked by BIOS.
Required to use virtualization in Windows on some Mac hardware.
REF: https://github.com/acidanthera/bugtracker/issues/1870
REF: https://www.thomas-krenn.com/en/wiki/Activating_the_Intel_VT_Virtualization_Feature (via rEFInd)
REF: 'Intel 64 and IA-32 Architectures Software Developer's Manual Volume 3', p.1296 etc.
**/
EFI_STATUS
OcCpuEnableVmx
(
VOID
);
/**
/**
Synchronise TSC on all cores (needed on server chipsets and some laptops).
Synchronise TSC on all cores (needed on server chipsets and some laptops).
This does not fully replace VoodooTscSync or TSCAdjustReset due to
This does not fully replace VoodooTscSync or TSCAdjustReset due to
...
...
Library/OcConfigurationLib/OcConfigurationLib.c
浏览文件 @
9d5fc5f4
...
@@ -686,6 +686,7 @@ mUefiQuirksSchema[] = {
...
@@ -686,6 +686,7 @@ mUefiQuirksSchema[] = {
OC_SCHEMA_BOOLEAN_IN
(
"ActivateHpetSupport"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Quirks
.
ActivateHpetSupport
),
OC_SCHEMA_BOOLEAN_IN
(
"ActivateHpetSupport"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Quirks
.
ActivateHpetSupport
),
OC_SCHEMA_BOOLEAN_IN
(
"DisableSecurityPolicy"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Quirks
.
DisableSecurityPolicy
),
OC_SCHEMA_BOOLEAN_IN
(
"DisableSecurityPolicy"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Quirks
.
DisableSecurityPolicy
),
OC_SCHEMA_BOOLEAN_IN
(
"EnableVectorAcceleration"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Quirks
.
EnableVectorAcceleration
),
OC_SCHEMA_BOOLEAN_IN
(
"EnableVectorAcceleration"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Quirks
.
EnableVectorAcceleration
),
OC_SCHEMA_BOOLEAN_IN
(
"EnableVmx"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Quirks
.
EnableVmx
),
OC_SCHEMA_INTEGER_IN
(
"ExitBootServicesDelay"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Quirks
.
ExitBootServicesDelay
),
OC_SCHEMA_INTEGER_IN
(
"ExitBootServicesDelay"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Quirks
.
ExitBootServicesDelay
),
OC_SCHEMA_BOOLEAN_IN
(
"ForceOcWriteFlash"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Quirks
.
ForceOcWriteFlash
),
OC_SCHEMA_BOOLEAN_IN
(
"ForceOcWriteFlash"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Quirks
.
ForceOcWriteFlash
),
OC_SCHEMA_BOOLEAN_IN
(
"ForgeUefiSupport"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Quirks
.
ForgeUefiSupport
),
OC_SCHEMA_BOOLEAN_IN
(
"ForgeUefiSupport"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Quirks
.
ForgeUefiSupport
),
...
...
Library/OcCpuLib/OcCpuLib.c
浏览文件 @
9d5fc5f4
...
@@ -1163,6 +1163,34 @@ OcCpuCorrectFlexRatio (
...
@@ -1163,6 +1163,34 @@ OcCpuCorrectFlexRatio (
}
}
}
}
EFI_STATUS
OcCpuEnableVmx
(
VOID
)
{
CPUID_VERSION_INFO_ECX
RegEcx
;
MSR_IA32_FEATURE_CONTROL_REGISTER
Msr
;
AsmCpuid
(
1
,
0
,
0
,
&
RegEcx
.
Uint32
,
0
);
if
(
RegEcx
.
Bits
.
VMX
==
0
)
{
return
EFI_UNSUPPORTED
;
}
Msr
.
Uint64
=
AsmReadMsr64
(
MSR_IA32_FEATURE_CONTROL
);
if
(
Msr
.
Bits
.
Lock
!=
0
)
{
return
EFI_WRITE_PROTECTED
;
}
//
// Unclear if pre-existing valid bits should ever be present if register is unlocked.
//
Msr
.
Bits
.
Lock
=
1
;
Msr
.
Bits
.
EnableVmxOutsideSmx
=
1
;
AsmWriteMsr64
(
MSR_IA32_FEATURE_CONTROL
,
Msr
.
Uint64
);
return
EFI_SUCCESS
;
}
STATIC
STATIC
VOID
VOID
EFIAPI
EFIAPI
...
...
Library/OcMainLib/OpenCoreUefi.c
浏览文件 @
9d5fc5f4
...
@@ -816,6 +816,7 @@ OcLoadUefiSupport (
...
@@ -816,6 +816,7 @@ OcLoadUefiSupport (
IN
UINT8
*
Signature
IN
UINT8
*
Signature
)
)
{
{
EFI_STATUS
Status
;
EFI_HANDLE
*
DriversToConnect
;
EFI_HANDLE
*
DriversToConnect
;
EFI_EVENT
Event
;
EFI_EVENT
Event
;
BOOLEAN
AvxEnabled
;
BOOLEAN
AvxEnabled
;
...
@@ -841,6 +842,11 @@ OcLoadUefiSupport (
...
@@ -841,6 +842,11 @@ OcLoadUefiSupport (
OcCpuCorrectFlexRatio
(
CpuInfo
);
OcCpuCorrectFlexRatio
(
CpuInfo
);
}
}
if
(
Config
->
Uefi
.
Quirks
.
EnableVmx
)
{
Status
=
OcCpuEnableVmx
();
DEBUG
((
EFI_ERROR
(
Status
)
?
DEBUG_WARN
:
DEBUG_INFO
,
"OC: Enable VMX - %r
\n
"
,
Status
));
}
if
(
Config
->
Uefi
.
Quirks
.
TscSyncTimeout
>
0
)
{
if
(
Config
->
Uefi
.
Quirks
.
TscSyncTimeout
>
0
)
{
OcCpuCorrectTscSync
(
CpuInfo
,
Config
->
Uefi
.
Quirks
.
TscSyncTimeout
);
OcCpuCorrectTscSync
(
CpuInfo
,
Config
->
Uefi
.
Quirks
.
TscSyncTimeout
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录