From: sudeep.holla@arm.com (Sudeep Holla)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 8/9] ARM: kernel: add support for cpu cache information
Date: Thu, 26 Jun 2014 12:33:14 +0100 [thread overview]
Message-ID: <53AC04FA.4060303@arm.com> (raw)
In-Reply-To: <20140625223302.GL32514@n2100.arm.linux.org.uk>
Hi Russell,
Thanks for the reviews.
On 25/06/14 23:33, Russell King - ARM Linux wrote:
> On Wed, Jun 25, 2014 at 06:30:43PM +0100, Sudeep Holla wrote:
[...]
>> +
>> +#include <linux/bitops.h>
>> +#include <linux/cacheinfo.h>
>> +#include <linux/cpu.h>
>> +#include <linux/compiler.h>
>> +#include <linux/of.h>
>> +
>> +#include <asm/cputype.h>
>> +#include <asm/processor.h>
>> +
>> +#if __LINUX_ARM_ARCH__ < 7 /* pre ARMv7 */
>
> __LINUX_ARM_ARCH__ defines the minimum architecture version we are building
> for - we may support later versions than the architecture version denoted
> by this symbol. It does not define which CPUs we are building for. Are
> you sure that this is correct here? What if we build a kernel supporting
> both v6 + v7, as the OMAP guys do?
>
You are right, I have not considered v6 + v7, I will use cpu_architecture and
make it runtime.
>> +
>> +#define MAX_CACHE_LEVEL 1 /* Only 1 level supported */
>> +#define CTR_CTYPE_SHIFT 24
>> +#define CTR_CTYPE_MASK (1 << CTR_CTYPE_SHIFT)
>> +
>> +struct ctr_info {
>> + unsigned int cpuid_id;
>> + unsigned int ctr;
>> +};
>> +
>> +static struct ctr_info cache_ctr_list[] = {
>> +};
>
> This list needs to be populated. Early CPUs (such as StrongARM) do not
> have the CTR register.
>
Right, since I didn't have the list left it empty. I will compile the list
soon but I need your help. The list of StrongARM I can come up is:
1. SA-110
2. SA-1100
3. SA-1110
4. SA-1500 (grep didn't show this in kernel, not sure if it's supported)
I also have to find all other ARMv4 implementations not having CTR.
>> +static int get_unimplemented_ctr(unsigned int *ctr)
>> +{
>> + int i, cpuid_id = read_cpuid_id();
>> +
>> + for (i = 0; i < ARRAY_SIZE(cache_ctr_list); i++)
>> + if (cache_ctr_list[i].cpuid_id == cpuid_id) {
>> + *ctr = cache_ctr_list[i].ctr;
>> + return 0;
>> + }
>> + return -ENOENT;
>> +}
>> +
>> +static unsigned int get_ctr(void)
>> +{
>> + unsigned int ctr;
>> +
>> + if (get_unimplemented_ctr(&ctr))
>> + asm volatile ("mrc p15, 0, %0, c0, c0, 1" : "=r" (ctr));
>
> read_cpuid_cachetype() ?
>
Ah, I missed to see that, will use it.
Regards,
Sudeep
WARNING: multiple messages have this Message-ID (diff)
From: Sudeep Holla <sudeep.holla@arm.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Lorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>,
Will Deacon <Will.Deacon@arm.com>,
Nicolas Pitre <nicolas.pitre@linaro.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 8/9] ARM: kernel: add support for cpu cache information
Date: Thu, 26 Jun 2014 12:33:14 +0100 [thread overview]
Message-ID: <53AC04FA.4060303@arm.com> (raw)
In-Reply-To: <20140625223302.GL32514@n2100.arm.linux.org.uk>
Hi Russell,
Thanks for the reviews.
On 25/06/14 23:33, Russell King - ARM Linux wrote:
> On Wed, Jun 25, 2014 at 06:30:43PM +0100, Sudeep Holla wrote:
[...]
>> +
>> +#include <linux/bitops.h>
>> +#include <linux/cacheinfo.h>
>> +#include <linux/cpu.h>
>> +#include <linux/compiler.h>
>> +#include <linux/of.h>
>> +
>> +#include <asm/cputype.h>
>> +#include <asm/processor.h>
>> +
>> +#if __LINUX_ARM_ARCH__ < 7 /* pre ARMv7 */
>
> __LINUX_ARM_ARCH__ defines the minimum architecture version we are building
> for - we may support later versions than the architecture version denoted
> by this symbol. It does not define which CPUs we are building for. Are
> you sure that this is correct here? What if we build a kernel supporting
> both v6 + v7, as the OMAP guys do?
>
You are right, I have not considered v6 + v7, I will use cpu_architecture and
make it runtime.
>> +
>> +#define MAX_CACHE_LEVEL 1 /* Only 1 level supported */
>> +#define CTR_CTYPE_SHIFT 24
>> +#define CTR_CTYPE_MASK (1 << CTR_CTYPE_SHIFT)
>> +
>> +struct ctr_info {
>> + unsigned int cpuid_id;
>> + unsigned int ctr;
>> +};
>> +
>> +static struct ctr_info cache_ctr_list[] = {
>> +};
>
> This list needs to be populated. Early CPUs (such as StrongARM) do not
> have the CTR register.
>
Right, since I didn't have the list left it empty. I will compile the list
soon but I need your help. The list of StrongARM I can come up is:
1. SA-110
2. SA-1100
3. SA-1110
4. SA-1500 (grep didn't show this in kernel, not sure if it's supported)
I also have to find all other ARMv4 implementations not having CTR.
>> +static int get_unimplemented_ctr(unsigned int *ctr)
>> +{
>> + int i, cpuid_id = read_cpuid_id();
>> +
>> + for (i = 0; i < ARRAY_SIZE(cache_ctr_list); i++)
>> + if (cache_ctr_list[i].cpuid_id == cpuid_id) {
>> + *ctr = cache_ctr_list[i].ctr;
>> + return 0;
>> + }
>> + return -ENOENT;
>> +}
>> +
>> +static unsigned int get_ctr(void)
>> +{
>> + unsigned int ctr;
>> +
>> + if (get_unimplemented_ctr(&ctr))
>> + asm volatile ("mrc p15, 0, %0, c0, c0, 1" : "=r" (ctr));
>
> read_cpuid_cachetype() ?
>
Ah, I missed to see that, will use it.
Regards,
Sudeep
next prev parent reply other threads:[~2014-06-26 11:33 UTC|newest]
Thread overview: 126+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-25 17:30 [PATCH 0/9] drivers: cacheinfo support Sudeep Holla
2014-06-25 17:30 ` Sudeep Holla
2014-06-25 17:30 ` Sudeep Holla
2014-06-25 17:30 ` Sudeep Holla
2014-06-25 17:30 ` [PATCH 1/9] drivers: base: add new class "cpu" to group cpu devices Sudeep Holla
2014-06-25 17:30 ` [PATCH 2/9] drivers: base: support cpu cache information interface to userspace via sysfs Sudeep Holla
2014-06-25 17:30 ` Sudeep Holla
2014-06-25 17:30 ` Sudeep Holla
2014-06-25 17:30 ` Sudeep Holla
2014-06-25 22:23 ` Russell King - ARM Linux
2014-06-25 22:23 ` Russell King - ARM Linux
2014-06-25 22:23 ` Russell King - ARM Linux
2014-06-25 22:23 ` Russell King - ARM Linux
2014-06-26 18:41 ` Sudeep Holla
2014-06-26 18:41 ` Sudeep Holla
2014-06-26 18:41 ` Sudeep Holla
2014-06-26 18:41 ` Sudeep Holla
2014-06-26 18:50 ` Russell King - ARM Linux
2014-06-26 18:50 ` Russell King - ARM Linux
2014-06-26 18:50 ` Russell King - ARM Linux
2014-06-26 18:50 ` Russell King - ARM Linux
2014-06-26 19:03 ` Sudeep Holla
2014-06-26 19:03 ` Sudeep Holla
2014-06-26 19:03 ` Sudeep Holla
2014-06-26 19:03 ` Sudeep Holla
2014-07-10 0:09 ` Greg Kroah-Hartman
2014-07-10 0:09 ` Greg Kroah-Hartman
2014-07-10 0:09 ` Greg Kroah-Hartman
2014-07-10 0:09 ` Greg Kroah-Hartman
2014-07-10 13:37 ` Sudeep Holla
2014-07-10 13:37 ` Sudeep Holla
2014-07-10 13:37 ` Sudeep Holla
2014-07-10 13:37 ` Sudeep Holla
2014-06-25 17:30 ` [PATCH 3/9] ia64: move cacheinfo sysfs to generic cacheinfo infrastructure Sudeep Holla
2014-06-25 17:30 ` Sudeep Holla
2014-06-25 17:30 ` [PATCH 4/9] s390: " Sudeep Holla
2014-06-25 17:30 ` [PATCH 5/9] x86: " Sudeep Holla
2014-06-25 17:30 ` [PATCH 6/9] powerpc: " Sudeep Holla
2014-06-25 17:30 ` Sudeep Holla
2014-06-25 17:30 ` [PATCH 7/9] ARM64: kernel: add support for cpu cache information Sudeep Holla
2014-06-25 17:30 ` Sudeep Holla
2014-06-27 10:36 ` Mark Rutland
2014-06-27 10:36 ` Mark Rutland
2014-06-27 11:22 ` Sudeep Holla
2014-06-27 11:22 ` Sudeep Holla
2014-06-27 11:34 ` Mark Rutland
2014-06-27 11:34 ` Mark Rutland
2014-06-25 17:30 ` [PATCH 8/9] ARM: " Sudeep Holla
2014-06-25 17:30 ` Sudeep Holla
2014-06-25 22:33 ` Russell King - ARM Linux
2014-06-25 22:33 ` Russell King - ARM Linux
2014-06-26 11:33 ` Sudeep Holla [this message]
2014-06-26 11:33 ` Sudeep Holla
2014-06-26 0:19 ` Stephen Boyd
2014-06-26 0:19 ` Stephen Boyd
2014-06-26 11:36 ` Sudeep Holla
2014-06-26 11:36 ` Sudeep Holla
2014-06-26 18:45 ` Stephen Boyd
2014-06-26 18:45 ` Stephen Boyd
2014-06-27 9:38 ` Sudeep Holla
2014-06-27 9:38 ` Sudeep Holla
2014-06-25 17:30 ` [PATCH 9/9] ARM: kernel: add outer cache support for cacheinfo implementation Sudeep Holla
2014-06-25 17:30 ` Sudeep Holla
2014-06-25 22:37 ` Russell King - ARM Linux
2014-06-25 22:37 ` Russell King - ARM Linux
2014-06-26 13:02 ` Sudeep Holla
2014-06-26 13:02 ` Sudeep Holla
2014-07-25 16:44 ` [PATCH v2 0/9] drivers: cacheinfo support Sudeep Holla
2014-07-25 16:44 ` Sudeep Holla
2014-07-25 16:44 ` Sudeep Holla
2014-07-25 16:44 ` [PATCH v2 1/9] drivers: base: add new class "cpu" to group cpu devices Sudeep Holla
2014-07-25 19:09 ` Stephen Boyd
2014-07-28 13:37 ` Sudeep Holla
2014-07-25 16:44 ` [PATCH v2 2/9] drivers: base: support cpu cache information interface to userspace via sysfs Sudeep Holla
2014-07-29 23:09 ` Stephen Boyd
2014-07-30 16:23 ` Sudeep Holla
2014-07-31 19:46 ` Stephen Boyd
2014-08-05 18:15 ` Sudeep Holla
2014-07-25 16:44 ` [PATCH v2 3/9] ia64: move cacheinfo sysfs to generic cacheinfo infrastructure Sudeep Holla
2014-07-25 16:44 ` Sudeep Holla
2014-07-25 16:44 ` [PATCH v2 4/9] s390: " Sudeep Holla
2014-07-25 16:44 ` [PATCH v2 5/9] x86: " Sudeep Holla
2014-07-25 16:44 ` [PATCH v2 6/9] powerpc: " Sudeep Holla
2014-07-25 16:44 ` Sudeep Holla
2014-07-25 16:44 ` [PATCH v2 7/9] ARM64: kernel: add support for cpu cache information Sudeep Holla
2014-07-25 16:44 ` Sudeep Holla
2014-07-25 16:44 ` [PATCH v2 8/9] ARM: " Sudeep Holla
2014-07-25 16:44 ` Sudeep Holla
2014-07-25 16:44 ` [PATCH v2 9/9] ARM: kernel: add outer cache support for cacheinfo implementation Sudeep Holla
2014-07-25 16:44 ` Sudeep Holla
2014-08-21 10:59 ` [PATCH v3 00/11] drivers: cacheinfo support Sudeep Holla
2014-08-21 10:59 ` Sudeep Holla
2014-08-21 10:59 ` Sudeep Holla
2014-08-21 10:59 ` Sudeep Holla
2014-08-21 10:59 ` [PATCH v3 01/11] cpumask: factor out show_cpumap into separate helper function Sudeep Holla
2014-08-21 10:59 ` [PATCH v3 02/11] topology: replace custom attribute macros with standard DEVICE_ATTR* Sudeep Holla
2014-08-21 10:59 ` [PATCH v3 03/11] drivers: base: add new class "cpu" to group cpu devices Sudeep Holla
2014-08-21 11:20 ` David Herrmann
2014-08-21 12:30 ` Sudeep Holla
2014-08-21 12:37 ` David Herrmann
2014-08-21 14:54 ` Sudeep Holla
2014-08-22 9:12 ` Kay Sievers
2014-08-22 11:29 ` [PATCH] drivers: base: add cpu_device_create to support per-cpu devices Sudeep Holla
2014-08-22 11:37 ` David Herrmann
2014-08-22 11:41 ` David Herrmann
2014-08-22 12:33 ` Sudeep Holla
2014-08-26 16:54 ` Sudeep Holla
2014-08-26 17:08 ` David Herrmann
2014-08-22 12:17 ` Sudeep Holla
2014-09-02 17:22 ` Sudeep Holla
2014-09-02 17:26 ` Greg Kroah-Hartman
2014-09-02 17:40 ` Sudeep Holla
2014-09-02 17:55 ` Greg Kroah-Hartman
2014-08-21 10:59 ` [PATCH v3 04/11] drivers: base: support cpu cache information interface to userspace via sysfs Sudeep Holla
2014-08-21 10:59 ` [PATCH v3 05/11] ia64: move cacheinfo sysfs to generic cacheinfo infrastructure Sudeep Holla
2014-08-21 10:59 ` Sudeep Holla
2014-08-21 10:59 ` [PATCH v3 06/11] s390: " Sudeep Holla
2014-08-21 10:59 ` [PATCH v3 07/11] x86: " Sudeep Holla
2014-08-21 10:59 ` [PATCH v3 08/11] powerpc: " Sudeep Holla
2014-08-21 10:59 ` Sudeep Holla
2014-08-21 10:59 ` [PATCH v3 09/11] ARM64: kernel: add support for cpu cache information Sudeep Holla
2014-08-21 10:59 ` Sudeep Holla
2014-08-21 10:59 ` [PATCH v3 10/11] ARM: " Sudeep Holla
2014-08-21 10:59 ` Sudeep Holla
2014-08-21 10:59 ` [PATCH v3 11/11] ARM: kernel: add outer cache support for cacheinfo implementation Sudeep Holla
2014-08-21 10:59 ` Sudeep Holla
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=53AC04FA.4060303@arm.com \
--to=sudeep.holla@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.