Saturday, May 25, 2013

"Process Identifier" Support in x86-64/x64 CPUs TLB

Recent x86-64 CPUs--at least from Intel--supports a sort of process identifier in the Translation Look-aside Buffer (TLB). This is important for multiprocessing in user mode, i.e. supporting more than one process running in user mode and switching between them without invalidating and flushing the TLB.

In ARMv6 architecture and above, there is an Application Space IDentifier (ASID) hardware that identifies the process which owns an entry in the TLB. This kind of support in x86/x86-64 CPUs is long overdue. Very probably because of the need to preserve compatibility with older OS running on the platform.

However, in newer x86-64 CPUs, there is a new "field" in the CR4 control register called Process-Context IDentifier Enable (PCIDE). This field controls whether Process-Context IDentifier (PCID) is enabled in the TLB or not. The value of the PCID for the "current" process is stored in CR3 register, in bits 0 to 11 (12-bits in total). This implies that the TLB can store up-to 4KB unique PCIDs.

You can read Intel64 Software Developer Manual Volume 3, section 4.10.1 Process-Context Identifiers (PCIDs) for the details. These two articles are also helpful:

PS: Thanks to Johan over at linkedin for the links ;-)

Monday, May 6, 2013

Dr. Dobbs Article on Buffer Overflow Prevention with GCC

This article: is very helpful for *NIX developer working with GCC compiler(s), especially those targeting x86_64 CPU architecture.

The article goes to great length explaining how the buffer overflow protection is built into GCC. The protection is known as GCC Stack Smashing Protector (SSP).

Saturday, May 4, 2013

Alternative Way to Store Information -- Quipu

Chinese, Japanese or Korean "writings" are exotic but all of them are still writings as we know it.
How about this:

Quipu is entirely different. What makes me really amazed is that it proved that you don't need the "writing system as we know it" to store information. Thus, to build complex stuffs or develop complex system. Well, Quipu is a "sort of" writing but it's far more different than what other cultures have developed over the last several millenia. It's an original idea, an out-of-the box solution to store and presumably transmit information.