assembly - x86-64 规范地址?

标签 assembly x86-64 intel memory-address virtual-address-space

在阅读英特尔手册时,我遇到了以下问题:

On processors that support Intel 64 architecture, the IA32_SYSENTER_ESP field and the IA32_SYSENTER_EIP field must each contain a canonical address.



什么是“规范地址”?

最佳答案

建议您下载full software developer's manual .该文档以单独的卷提供,但该链接在一个庞大的 PDF 中为您提供了所有七卷,这样可以更轻松地搜索内容。

答案在第 3.3.7.1 节。该部分的第一行说明

In 64-bit mode, an address is considered to be in canonical form if address bits 63 through to the most-significant implemented bit by the microarchitecture are set to either all ones or all zeros.



它从那里继续......

您可以使用 cpuid查询该 CPU 上支持的虚拟地址宽度。 (即“由微体系结构实现”。)或者您通常可以假设 48 位。

IE。规范虚拟地址是 48 位正确符号扩展为 64。如果高位不匹配,则它是非规范的,如果您尝试取消引用它,则会出错。

(或者使用 Intel 即将推出的 5 级页表扩展,将 57 位符号扩展为 64)。

关于assembly - x86-64 规范地址?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25852367/

相关文章:

c - 实现用户级线程库启动一个新线程[作业]

c - 从程序集(x64)翻译成 C

c++ - 汇编器 push rdi, pop rdi around function call

c++ - 英特尔 TBB 性能

c++ - 在单独分配的堆栈上运行函数

组装正确使用字/字节/字 ptr

optimization - 优化的汇编代码 (BLAS)

feenableexcept 会损害程序性能吗?

windows - 全局描述符表

c - #pragma pack 与 Intel C 的 -fpack-struct