All of lore.kernel.org
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6] arm64: cpuinfo: Expose MIDR_EL1 and REVIDR_EL1 to sysfs
Date: Tue, 28 Jun 2016 17:27:56 +0100	[thread overview]
Message-ID: <20160628162755.GR31744@leverpostej> (raw)
In-Reply-To: <20160628153346.GF4585@e104818-lin.cambridge.arm.com>

On Tue, Jun 28, 2016 at 04:33:46PM +0100, 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?

Per Documentation/filesystems/sysfs.txt, attributes should be ASCII text
files, with one value per file. I think they should stay as they are.

Thanks,
Mark.

WARNING: multiple messages have this Message-ID (diff)
From: Mark Rutland <mark.rutland@arm.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>,
	will.deacon@arm.com, steve.capper@linaro.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v6] arm64: cpuinfo: Expose MIDR_EL1 and REVIDR_EL1 to sysfs
Date: Tue, 28 Jun 2016 17:27:56 +0100	[thread overview]
Message-ID: <20160628162755.GR31744@leverpostej> (raw)
In-Reply-To: <20160628153346.GF4585@e104818-lin.cambridge.arm.com>

On Tue, Jun 28, 2016 at 04:33:46PM +0100, 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?

Per Documentation/filesystems/sysfs.txt, attributes should be ASCII text
files, with one value per file. I think they should stay as they are.

Thanks,
Mark.

  parent reply	other threads:[~2016-06-28 16:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-21 11:12 [PATCH v6] arm64: cpuinfo: Expose MIDR_EL1 and REVIDR_EL1 to sysfs Suzuki K Poulose
2016-06-21 11:12 ` Suzuki K Poulose
2016-06-28 11:06 ` Will Deacon
2016-06-28 11:06   ` Will Deacon
2016-06-28 14:17   ` Catalin Marinas
2016-06-28 14:17     ` Catalin Marinas
2016-06-28 15:33 ` Catalin Marinas
2016-06-28 15:33   ` Catalin Marinas
2016-06-28 16:14   ` Suzuki K Poulose
2016-06-28 16:14     ` Suzuki K Poulose
2016-06-28 16:27   ` Mark Rutland [this message]
2016-06-28 16:27     ` Mark Rutland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160628162755.GR31744@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.