注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

路雷米的博客

人生最难的就是在热爱和生计之间做选择, 愿每个人这一生 既对得起梦想又担得责任

 
 
 

日志

 
 

OvmfPkg: QuarkPort/CpuS3DataDxe: handle IDT, GDT and MCE in ACPI_CPU_DATA  

2015-12-01 18:28:58|  分类: UEFI技术 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
In this patch we incorporate code from
Quark_EDKII_v1.1.0/IA32FamilyCpuBasePkg/CpuMpDxe that populates the
following fields in ACPI_CPU_DATA for PiSmmCpuDxeSmm:

- ACPI_CPU_DATA.GdtrProfile
- ACPI_CPU_DATA.IdtrProfile
- ACPI_CPU_DATA.ApMachineCheckHandlerBase
- ACPI_CPU_DATA.ApMachineCheckHandlerSize

The patch performs the following steps:
(1) In the entry point call stack of the driver, allocate an AcpiNVS
    block, and copy the BSP's GDT and IDT into it.

(2) Additionally, tack on a small Machine Check Exception handler routine
    that we provide in assembly. Hook this handler into the copied IDT
    mentined in (1) as well.

(3) In the EFI_SMM_CONFIGURATION_PROTOCOL installation callback, GDTR and
    IDTR fields of the MP_CPU_SAVED_DATA AcpiNVS object that embeds
    ACPI_CPU_DATA are pointed to the copied GDT and IDT mentioned in (1).

(4) In the same callback, the latter two fields of the ACPI_CPU_DATA
    object are pointed to the MCE handler described in (2). The former two
    fields (which are doubly indirect pointers) are pointed to the
    MP_CPU_SAVED_DATA pointer fields described in (3).

The PiSmmCpuDxeSmm driver acts upon the data as follows:
(5) In the SmmReadyToLockEventNotify() function, during normal boot,
    PiSmmCpuDxeSmm loads these data from AcpiNVS memory, and stashes them
    all in SMRAM.

(6) When the S3 resume PEIM transfers control to SmmRestoreCpu(), on the
    resume path, the GDT, IDT and MCE handler are restored from SMRAM to
    the AcpiNVS block allocated in (1).

(7) IDTR and GDTR values saved in (3) and then stashed in (5) are written
    to the AP startup routine parameter / communication block. (See
    "mExchangeInfo" in PrepareApStartupVector() in
    "UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c".)

(8) The startup vector in "UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/MpFuncs.S" loads
    these values (identically for all APs) with the LGDT and LIDT
    instructions.
  评论这张
 
阅读(78)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018