x86/resctrl: Add a new resource type RDT_RESOURCE_SMBA
authorBabu Moger <babu.moger@amd.com>
Fri, 13 Jan 2023 15:20:29 +0000 (09:20 -0600)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 23 Jan 2023 16:38:22 +0000 (17:38 +0100)
Add a new resource type RDT_RESOURCE_SMBA to handle the QoS enforcement
policies on the external slow memory.

Mostly initialization of the essentials. Setting fflags to RFTYPE_RES_MB
configures the SMBA resource to have the same resctrl files as the
existing MBA resource. The SMBA resource has identical properties to
the existing MBA resource. These properties will be enumerated in an
upcoming change and exposed via resctrl because of this flag.

Signed-off-by: Babu Moger <babu.moger@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Link: https://lore.kernel.org/r/20230113152039.770054-4-babu.moger@amd.com
arch/x86/kernel/cpu/resctrl/core.c
arch/x86/kernel/cpu/resctrl/internal.h

index c98e52ff5f206267c2a097eef4c443b47b3c6272..f6af3ac1ef20ed063bc7ca3638c3c0b54d98a1bc 100644 (file)
@@ -100,6 +100,18 @@ struct rdt_hw_resource rdt_resources_all[] = {
                        .fflags                 = RFTYPE_RES_MB,
                },
        },
+       [RDT_RESOURCE_SMBA] =
+       {
+               .r_resctrl = {
+                       .rid                    = RDT_RESOURCE_SMBA,
+                       .name                   = "SMBA",
+                       .cache_level            = 3,
+                       .domains                = domain_init(RDT_RESOURCE_SMBA),
+                       .parse_ctrlval          = parse_bw,
+                       .format_str             = "%d=%*u",
+                       .fflags                 = RFTYPE_RES_MB,
+               },
+       },
 };
 
 /*
index 5ebd28e6aa0cae5553f02f8092bf0463f08712f1..fdbbf66312ec892baf91a5078b699c0302919d46 100644 (file)
@@ -409,6 +409,7 @@ enum resctrl_res_level {
        RDT_RESOURCE_L3,
        RDT_RESOURCE_L2,
        RDT_RESOURCE_MBA,
+       RDT_RESOURCE_SMBA,
 
        /* Must be the last */
        RDT_NUM_RESOURCES,