x86-64 canonical address?

I suggest that you download the full software developer’s manual. The documentation is available in separate volumes, but that link gives you all seven volumes in a single massive PDF, which makes it easier to search for things.

The answer is in section 3.3.7.1. The first line of that section states

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.

It goes on from there…

You can use cpuid to query the supported virtual address width on that CPU. (i.e. “implemented by the microarchitecture”.) Or you can normally just assume 48-bit.


I.e. a canonical virtual address is 48 bits correctly sign-extended to 64. If the high bits don’t match, it’s non-canonical and will fault if you attempt to dereference it.

(Or with Intel’s upcoming 5-level page table extension, 57 bits sign-extended to 64).

Leave a Comment