Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp926200ybl; Fri, 6 Dec 2019 08:25:20 -0800 (PST) X-Google-Smtp-Source: APXvYqzFL7tRaHa8c3JfHog1cbcv1iXylh5S4oxB92Vh2hc5hPehS4OWcgKu6nTjTwgoyPVjvRuA X-Received: by 2002:aca:fc07:: with SMTP id a7mr13366868oii.28.1575649520154; Fri, 06 Dec 2019 08:25:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575649520; cv=none; d=google.com; s=arc-20160816; b=sKxpD32cuxL9KjInfr93Uh8Ax9913IzUZMxwy3LVMHMqZkiAzYCFtp+2YAKGTYhHF+ y/x+z5CAjG+qo1aXEY/m5U6VAKnOjvPQKiZSBCNxYNslupaj5V3mR33RnpIMTFaDQkON mem/FHsuBuyLIJHv8vYTT3F9kTgWvtoQht5NY4OzqVmUuqbeYM43FWCF1GhEoipgQLTX IfziRccPS3QAfzrN2bIi1qGIefRUSiztxKMNzGlE16TWs5q7wqU9aYQqote+tBk/d9VO QKjomZYeoPAV/64qCRkm0Hvb7iTAkKX/jYuRSNzAlYo+RodLX6uwL4AhVrtlGoVZi+Wb nSOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=QSq76k0TqT59AhBig1Kbka7g+E26L+qoMMhTyQQ7ut0=; b=CV8EJomrYVLz+TToSYIrKIY4w2RFYXTm8HsqiaeBgBQaPN4Au9BQdUQkzkG35CTFSh BlQHN3BF18c4SrTnBu1IWnByEh+0pp1bNkeRA8BAlnNDAVaCVxDqGzkuaVs4MW1SVw7G x+svzbbKq500y3uh9nbPcK9b/cNd+vLEWMc62AoPvY5tERaNrUmWssQFtf4erEfBQiRf 1abQE2nA2egaGPLYAd7GyCb+uQD/LlxMmz28cb0UNd27m6vw8jJLpCp0/gb8yXiE4QRW i8hqI09w9ytB8svIezEZXZhejp6KbrWsOamk4J1SUpk9w+iRQoeJ303cPjByQgMoGYgE gWng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d199si7042904oib.226.2019.12.06.08.25.07; Fri, 06 Dec 2019 08:25:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726460AbfLFQYi (ORCPT + 99 others); Fri, 6 Dec 2019 11:24:38 -0500 Received: from mx2.suse.de ([195.135.220.15]:41970 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726258AbfLFQYh (ORCPT ); Fri, 6 Dec 2019 11:24:37 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 9D64CB190; Fri, 6 Dec 2019 16:24:35 +0000 (UTC) From: Thomas Renninger To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, Thomas Renninger , linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk, will.deacon@arm.com, x86@kernel.org, fschnitzlein@suse.de Subject: [PATCH v5 0/3] sysfs: add sysfs based cpuinfo Date: Fri, 6 Dec 2019 17:24:18 +0100 Message-Id: <20191206162421.15050-1-trenn@suse.de> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I picked up Felix Schnizlein's work from 2017. It was already reviewed by Greg-KH at this time and even pushed into linux-next tree, when it came out that the mails never reached lkml, even the list was added to CC. ARM people then correctly complained that this needs more review by ARCH people. It got reverted, Felix had no time anymore and this nice patcheset was hanging around nowhere... Changes (by trenn) since v4: - Do not separate bug and flag list via comma, but by space - Adjust renamed cpu_data(c).x86_mask to cpu_data(c).x86_stepping due to commit b399151cb48db30ad1e0 - Introduce config CPUINFO_SYSFS and use config HAVE_CPUINFO_SYSFS as a pre-set helper only - Set CPUINFO_SYSFS def_bool y ============================================= Tested on x86_64 and aarch64 (see below). Tested on x86_64 (virtual machine): ------------------------------------------------------------ /sys/devices/system/cpu/cpu1/info/:[0]# ls bogomips bugs cpu_family flags model model_name stepping vendor_id for file in *;do echo $file; cat $file;echo;done bogomips 5187.72 bugs cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit cpu_family 6 flags fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm cpuid_fault invpcid_single pti ssbd ibrs ibpb fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt arat umip model 60 model_name Intel Core Processor (Haswell, no TSX, IBRS) stepping 1 vendor_id GenuineIntel ============================================= Tested on aarch64: /sys/devices/system/cpu/cpu1/info/:[0]# ls architecture bogomips flags implementer part revision variant ------------------------------------------------------------ for file in *;do echo $file; cat $file;echo;done architecture 8 bogomips 40.00 flags fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid asimdrdm implementer 0x51 part 0xc00 revision 1 variant 0x0 Felix Schnizlein (3): cpuinfo: add sysfs based arch independent cpuinfo framework x86 cpuinfo: implement sysfs nodes for x86 arm64 cpuinfo: implement sysfs nodes for arm64 Documentation/ABI/testing/sysfs-devices-system-cpu | 52 ++++++++++++ arch/Kconfig | 11 +++ arch/arm64/Kconfig | 1 + arch/arm64/kernel/cpuinfo.c | 55 ++++++++++++ arch/x86/Kconfig | 1 + arch/x86/kernel/Makefile | 2 + arch/x86/kernel/cpuinfo.c | 99 ++++++++++++++++++++++ drivers/base/Makefile | 1 + drivers/base/cpuinfo.c | 48 +++++++++++ include/linux/cpuhotplug.h | 1 + include/linux/cpuinfo.h | 43 ++++++++++ 11 files changed, 314 insertions(+) create mode 100644 arch/x86/kernel/cpuinfo.c create mode 100644 drivers/base/cpuinfo.c create mode 100644 include/linux/cpuinfo.h -- 2.16.4