From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752552AbcF1QPJ (ORCPT ); Tue, 28 Jun 2016 12:15:09 -0400 Received: from foss.arm.com ([217.140.101.70]:48659 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752209AbcF1QPH (ORCPT ); Tue, 28 Jun 2016 12:15:07 -0400 Subject: Re: [PATCH v6] arm64: cpuinfo: Expose MIDR_EL1 and REVIDR_EL1 to sysfs To: Catalin Marinas References: <1466507556-9027-1-git-send-email-suzuki.poulose@arm.com> <20160628153346.GF4585@e104818-lin.cambridge.arm.com> Cc: will.deacon@arm.com, mark.rutland@arm.com, steve.capper@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, "edward.nevill@linaro.org" From: Suzuki K Poulose Message-ID: <5772A263.2050503@arm.com> Date: Tue, 28 Jun 2016 17:14:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <20160628153346.GF4585@e104818-lin.cambridge.arm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/06/16 16:33, Catalin Marinas wrote: > On Tue, Jun 21, 2016 at 12:12:36PM +0100, Suzuki K. Poulose wrote: >> +#define CPUINFO_ATTR_RO(_name) \ >> + static ssize_t show_##_name(struct device *dev, \ >> + struct device_attribute *attr, char *buf) \ >> + { \ >> + struct cpuinfo_arm64 *info = &per_cpu(cpu_data, dev->id); \ >> + \ >> + if (info->reg_midr) \ >> + return sprintf(buf, "0x%016x\n", info->reg_##_name); \ >> + else \ >> + return 0; \ >> + } \ >> + static DEVICE_ATTR(_name, 0444, show_##_name, NULL) >> + >> +CPUINFO_ATTR_RO(midr); >> +CPUINFO_ATTR_RO(revidr); > > Since exposing these values is aimed at JIT code (and not human > readable), wouldn't it make more sense to present the binary value > instead of the ascii transformation? I am fine with either. Edward, Do you have any preference ? Suzuki