From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/1] Add Thread Support for the Context ID Register of ARM v6 & v7 Architectures
Date: Mon, 27 Jun 2011 12:37:08 +0100 [thread overview]
Message-ID: <20110627113707.GD16103@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <3a6d2636489958d097cd013cad646fed012421dd.1309163073.git.wolfgang.betz@st.com>
On Mon, Jun 27, 2011 at 01:12:27PM +0200, Wolfgang BETZ wrote:
> The aim of this patch is to enable thread support in the context ID register
> (CONTEXTIDR) as it comes with ARM architectures v6 & v7.
>
> On ARMv6 & v7, we have the following structure in the context ID:
>
> 31 7 0
> +-------------------------+-----------+
> | process ID | ASID |
> +-------------------------+-----------+
> | context ID |
> +-------------------------------------+
>
> - The ASID is used to tag entries in the CPU caches and TLBs.
> - The context ID is used by debuggers and trace logic, and
> should be unique within all running processes.
When I added ARMv6 and v7 support to the kernel, I purposely ignored that
detail because it's silly.
The issue here is that the debuggers and trace logic use both the
process ID and the ASID together, and the ASID does not have a stable
value for any particular process in the system. When we have used
the last ASID (255), the next request for a new ASID causes the ASID
generation to increment, which in turn causes all processes in the
system to have their ASIDs reassigned.
At that point, if you have debugging/trace hardware setup to look for
a process with a particular process ID+ASID, you're no longer going to
get matches for your original process.
This makes the whole concept of debuggers/tracing using the context ID
rather pointless especially in a multiprocessor system.
How are you working around this issue?
next prev parent reply other threads:[~2011-06-27 11:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-27 11:12 [PATCH 0/1] Add Thread Support for the Context ID Register of ARM v6 & v7 Architectures Wolfgang BETZ
2011-06-27 11:12 ` [PATCH 1/1] " Wolfgang BETZ
2011-06-27 11:37 ` Russell King - ARM Linux [this message]
2011-06-28 9:00 ` Will Deacon
2011-06-29 13:05 ` Wolfgang BETZ
[not found] ` <4E097B58.3050301@st.com>
2011-06-28 10:29 ` Russell King - ARM Linux
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=20110627113707.GD16103@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).