Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Quick links: redhat.com, Customer Portal, Red Hat's developer site, Red Hat's partner site.

  • You are here

    Red Hat

    Learn about our open source products, services, and company.

  • You are here

    Red Hat Customer Portal

    Get product support and knowledge from the open source experts.

  • You are here

    Red Hat Developer

    Read developer tutorials and download Red Hat software for cloud application development.

  • You are here

    Red Hat Partner Connect

    Get training, subscriptions, certifications, and more for partners to build, sell, and support customer solutions.

Products & tools

  • Ansible.com

    Learn about and try our IT automation product.
  • Red Hat Ecosystem Catalog

    Find hardware, software, and cloud providers―and download container images―certified to perform with Red Hat technologies.

Try, buy, & sell

  • Red Hat Hybrid Cloud Console

    Access technical how-tos, tutorials, and learning paths focused on Red Hat’s hybrid cloud managed services.
  • Red Hat Store

    Buy select Red Hat products and services online.
  • Red Hat Marketplace

    Try, buy, sell, and manage certified enterprise software for container-based environments.

Events

  • Red Hat Summit and AnsibleFest

    Register for and learn about our annual open source IT industry event.

Building Red Hat Enterprise Linux 9 for the x86-64-v2 microarchitecture level

 

January 5, 2021
Florian Weimer
Related topics:
C, C#, C++LinuxOpen source
Related products:
Red Hat Enterprise Linux

Share:

Share on twitter Share on facebook Share on linkedin Share with email
  • Background of the x86-64 microarchitecture levels
  • Architectural considerations for RHEL 9
  • Recommendations for RHEL 9
  • Support for other architectures
  • Conclusion

One of the most important early decisions when building a Linux distribution is the scope of supported hardware. The distribution's default compiler flags are significant for hardware-platform compatibility. Programs that use newer CPU instructions might not run on older CPUs. In this article, I discuss a new approach to building the x86-64 variant of Red Hat Enterprise Linux (RHEL) 9 and share Red Hat's recommendation for that build.

Background of the x86-64 microarchitecture levels

Background of the x86-64 microarchitecture levels

The GNU C Library (glibc) offers a way to load optimized libraries that use additional hardware features that might not be present on all systems. Originally, this mechanism was designed to support perhaps one or two alternative library implementations, in addition to the default (fallback) implementation that is usually installed in the /usr/lib64 directory. However, the power-set construction involved in the library lookup mechanism poorly matches current platforms with a long list of optional CPU features. We see this especially on the x86 architecture, where many optional features have been added over the years (see the Wikipedia article for the CPUID instruction for a list). The plethora of choices poses a problem not only for the dynamic linker but also for programmers. Until recently, there has been little guidance on what CPU features to assume in optimized libraries. GCC and glibc disagree on the definition of feature sets, and the glibc selection mechanism is vendor-specific.

In the summer of 2020, AMD, Intel, Red Hat, and SUSE collaborated to define three x86-64 microarchitecture levels on top of the x86-64 baseline. The three microarchitectures group together CPU features roughly based on hardware release dates:

  • x86-64-v2 brings support (among other things) for vector instructions up to Streaming SIMD Extensions 4.2 (SSE4.2)  and Supplemental Streaming SIMD Extensions 3 (SSSE3), the POPCNT instruction (useful for data analysis and bit-fiddling in some data structures), and CMPXCHG16B (a two-word compare-and-swap instruction useful for concurrent algorithms).
  • x86-64-v3 adds vector instructions up to AVX2, MOVBE (for big-endian data access), and additional bit-manipulation instructions.
  • x86-64-v4 includes vector instructions from some of the AVX-512 variants.

We've documented the three levels in detail in the x86-64 psABI supplement. The upcoming GCC version 11 and LLVM version 12 releases will support them in -march= arguments. Patches to augment the glibc dynamic loader with a new mechanism (without the power-set construction) have been incorporated into glibc under the glibc-hwcaps moniker. These changes are expected to be part of the upcoming 2.33 release of glibc.

Architectural considerations for RHEL 9

Architectural considerations for RHEL 9

Historically, the x86_64 Red Hat Enterprise Linux userspace has been built to match the original AMD K8 baseline minus the AMD-specific 3Dnow! parts. That decision has held up to and including the latest version of Red Hat Enterprise Linux 8. However, due to kernel-driver removals, old hardware (such as systems with first-generation Opteron CPUs) are unlikely to run Red Hat Enterprise Linux in any useful fashion. There are also significant power requirements when running older hardware.

So far, we've been able to utilize new CPU features via mechanisms like IFUNCs, function multi-versioning, or loading alternative implementations via dlopen, which could be automated with the ongoing glibc-hwcaps work. Each of these approaches applies only to specifically designated blocks of code. The remainder of the distribution still does not employ additional CPU features, so those parts of the CPU are essentially dormant.

As a welcome side-effect of defining the x86-64 microarchitecture levels, we now have a convenient language for discussing the architectural baseline for Linux distributions: We can stay the course and use the original K8 baseline or we can apply one of the three later levels.

Recommendations for RHEL 9

Recommendations for RHEL 9

We believe that x86-64-v2 is the appropriate choice for Red Hat Enterprise Linux 9. Our recommendation is based on the following observations:

  • Virtual machine models that artificially mask x86-64-v2 CPU features despite host support are comparatively easy to adjust.
  • The next level, x86-64-v3, is not available because we intend to build one unified distribution for the x86-64 architecture.
  • The new server-class CPUs released in 2020 do not implement the AVX instruction set.
  • AVX instructions are also unavailable in certain software implementations (although the valgrind tool supports them). The lack of emulation support could constrain developers targeting Red Hat Enterprise Linux 9.

As in previous Red Hat Enterprise Linux versions, we will continue to support other CPU features (beyond x86-64-v2) via IFUNCs and function multi-versioning. We might also use the glibc-hwcaps mechanism to load optimized versions of libraries. As usual, these plans could change at any time before the release of Red Hat Enterprise Linux 9.

Currently, the changes do not apply to Fedora outside of Fedora ELN.

Support for other architectures

Support for other architectures

Together with its hardware partners, Red Hat regularly reviews the architectural baselines for all architectures. For IBM POWER and IBM Z, we have historically updated the baseline for every major release. For example, Red Hat Enterprise Linux 8 requires POWER little-endian (ppc64le) and—for the s390x architecture—a z13 or later CPU.

Conclusion

Conclusion

This article described the criteria guiding Red Hat’s approach to choosing an x86-64 microarchitecture level for Red Hat Enterprise Linux 9. Our recommendation, x86-64-v2, will support additional vector instructions (up to SSE4.2 and SSSE 3), the POPCNT instruction for data analysis, and the CMPXCHG16B instruction for concurrency algorithms.

Last updated: February 5, 2024

Recent Posts

  • More Essential AI tutorials for Node.js Developers

  • How to run a fraud detection AI model on RHEL CVMs

  • How we use software provenance at Red Hat

  • Alternatives to creating bootc images from scratch

  • How to update OpenStack Services on OpenShift

Red Hat Developers logo LinkedIn YouTube Twitter Facebook

Products

  • Red Hat Enterprise Linux
  • Red Hat OpenShift
  • Red Hat Ansible Automation Platform

Build

  • Developer Sandbox
  • Developer Tools
  • Interactive Tutorials
  • API Catalog

Quicklinks

  • Learning Resources
  • E-books
  • Cheat Sheets
  • Blog
  • Events
  • Newsletter

Communicate

  • About us
  • Contact sales
  • Find a partner
  • Report a website issue
  • Site Status Dashboard
  • Report a security problem

RED HAT DEVELOPER

Build here. Go anywhere.

We serve the builders. The problem solvers who create careers with code.

Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

Sign me up

Red Hat legal and privacy links

  • About Red Hat
  • Jobs
  • Events
  • Locations
  • Contact Red Hat
  • Red Hat Blog
  • Inclusion at Red Hat
  • Cool Stuff Store
  • Red Hat Summit

Red Hat legal and privacy links

  • Privacy statement
  • Terms of use
  • All policies and guidelines
  • Digital accessibility

Report a website issue