• Sudeep Holla's avatar
    x86/cacheinfo: Move cacheinfo sysfs code to generic infrastructure · 0d55ba46
    Sudeep Holla authored
    This patch removes the redundant sysfs cacheinfo code by reusing
    the newly introduced generic cacheinfo infrastructure through the
    commit
    
      246246cb ("drivers: base: support cpu cache information
    		 interface to userspace via sysfs")
    
    The private pointer provided by the cacheinfo is used to implement
    the AMD L3 cache-specific attributes.
    
    Note that with v4.0-rc1, commit
    
      513e3d2d ("cpumask: always use nr_cpu_ids in formatting and parsing
    		 functions")
    
    in particular changes from long format to shorter one for all cpumasks
    sysfs entries. As the consequence of the same, even the shared_cpu_map
    in the cacheinfo sysfs was also changed.
    
    This patch neither alters any existing sysfs entries nor their
    formating, however since the generic cacheinfo has switched to use the
    device attributes instead of the traditional raw kobjects, a directory
    named "power" along with its standard attributes are added similar to
    any other device.
    Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Andre Przywara <andre.przywara@arm.com>
    Link: http://lkml.kernel.org/r/1425470416-20691-1-git-send-email-sudeep.holla@arm.com
    [ Add a check for uninitialized this_cpu_ci for the cpu_has_topoext case too
      in __cache_amd_cpumap_setup() ]
    Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
    0d55ba46
intel_cacheinfo.c 25.7 KB