Intel is preparing Linux for ChkTag by adapting Linear Address Masking to use 4-bit tags, aligning with industry standards for memory safety.
Intel is making significant changes to how Linux handles memory tagging in preparation for the upcoming ChkTag feature. The company's Linux engineers are working to adapt Linear Address Masking (LAM) to better align with ChkTag's specifications, which will bring enhanced memory safety capabilities to x86 processors.

LAM is a feature already present in recent Intel CPUs that allows metadata like tags to be stored in the upper bits of 64-bit pointers. These upper bits are typically unused in standard 64-bit addressing, making them available for storing additional information. LAM has proven useful for various applications including garbage collectors, memory sanitizers, and security checks.
The preparation work comes in the wake of last year's announcement by AMD and Intel through the x86 Ecosystem Advisory Group about ChkTag. This new feature will introduce x86 instructions specifically designed to detect memory safety violations and provide flexible controls for addressing memory-related security issues.
Intel engineer Maciej Wieczor-Retman has been leading the effort to create a stable x86 LAM user interface that anticipates ChkTag's requirements. The key change involves standardizing LAM to use 4-bit tags rather than the 6-bit tags that x86's LAM currently supports.
This alignment makes strategic sense given that ChkTag will utilize 4-bit tags and that other industry implementations, such as Arm's Memory Tagging Extension (MTE), are also converging on 4-bit tag widths. By standardizing on 4 bits, Intel aims to create a more generalized interface that can be utilized across different memory tagging technologies.
The decision to default LAM to 4 bits, despite x86's capability to support 6-bit tags, reflects the expectation that ChkTag will become the primary user of this interface. This standardization should simplify future integration and reduce complexity when ChkTag becomes available in processors.
For scenarios that might require the full 6-bit tag width, Intel plans to make this available as a debug feature that can be enabled through debugfs. This approach maintains flexibility for specialized use cases while providing a stable, standardized interface for the majority of applications.
The patchset also includes cleanup of comments that referenced LAM_U48, a feature that was never implemented in the Linux kernel. These comments have been removed to avoid implying that LAM_U48 can be enabled, improving the clarity and accuracy of the kernel documentation.
These changes are currently undergoing review for inclusion in future Linux kernel versions. While ChkTag itself hasn't yet seen compiler or kernel patches emerge, the preparation work on LAM suggests that broader support for memory tagging features is actively being developed.
The convergence of different memory tagging approaches around a common 4-bit standard represents an important step toward more unified memory safety mechanisms across the industry. As processors continue to evolve with enhanced security features, having standardized interfaces in the operating system will be crucial for developers to take advantage of these capabilities without dealing with platform-specific complexities.

Comments
Please log in or register to join the discussion