• Babu Moger's avatar
    x86/cpufeatures: Add Slow Memory Bandwidth Allocation feature flag · f334f723
    Babu Moger authored
    Add the new AMD feature X86_FEATURE_SMBA. With it, the QOS enforcement policies
    can be applied to external slow memory connected to the host. QOS enforcement is
    accomplished by assigning a Class Of Service (COS) to a processor and specifying
    allocations or limits for that COS for each resource to be allocated.
    
    This feature is identified by the CPUID function 0x8000_0020_EBX_x0[2]:
    L3SBE - L3 external slow memory bandwidth enforcement.
    
    CXL.memory is the only supported "slow" memory device. With SMBA, the hardware
    enables bandwidth allocation on the slow memory devices.  If there are multiple
    slow memory devices in the system, then the throttling logic groups all the slow
    sources together and applies the limit on them as a whole.
    
    The presence of the SMBA feature (with CXL.memory) is independent of whether
    slow memory device is actually present in the system. If there is no slow memory
    in the system, then setting a SMBA limit will have no impact on the performance
    of the system.
    
    Presence of CXL memory can be identified by the numactl command:
    
      $numactl -H
      available: 2 nodes (0-1)
      node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
      node 0 size: 63678 MB node 0 free: 59542 MB
      node 1 cpus:
      node 1 size: 16122 MB
      node 1 free: 15627 MB
      node distances:
      node   0   1
         0:  10  50
         1:  50  10
    
    CPU list for CXL memory will be empty. The cpu-cxl node distance is greater than
    cpu-to-cpu distances. Node 1 has the CXL memory in this case. CXL memory can
    also be identified using ACPI SRAT table and memory maps.
    
    Feature description is available in the specification, "AMD64 Technology
    Platform Quality of Service Extensions, Revision: 1.03 Publication # 56375
    Revision: 1.03 Issue Date: February 2022" at
    https://bugzilla.kernel.org/attachment.cgi?id=301365
    
    See also https://www.amd.com/en/support/tech-docs/amd64-technology-platform-quality-service-extensionsSigned-off-by: default avatarBabu Moger <babu.moger@amd.com>
    Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
    Reviewed-by: default avatarReinette Chatre <reinette.chatre@intel.com>
    Link: https://lore.kernel.org/r/20230113152039.770054-3-babu.moger@amd.com
    f334f723
scattered.c 2.44 KB