From: timur@codeaurora•org (Timur Tabi)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 3/3] [v2] hvc_dcc: disable user-space access to DCC
Date: Mon, 17 Aug 2015 17:45:31 -0500 [thread overview]
Message-ID: <55D2640B.5090709@codeaurora.org> (raw)
In-Reply-To: <20150810094755.GE1604@arm.com>
On 08/10/2015 04:47 AM, Will Deacon wrote:
>> +static inline void __dcc_initialize(void)
>> +{
>> + u32 val;
>> +
>> + /* Disable user-space access to DCC */
>> + asm volatile ("mrs %0, mdscr_el1\n"
>> + " orr %0, %0, #4096\n" /* Set the TDCC bit */
>
> So this is the same as your "1 << 12" for arch/arm/. Shouldn't we
> #define that someplace common?
Well, I'm not sure. First, there is no common place currently
available. I would need to create a new header file that only has one
line in it.
Secondly, DBGDSCR in ARMv7 and MDSCR_EL1 on ARMv8 don't have that much
in common. Those two registers probably serve the same function, but
only a few bits are the same.
I've documented the code. I can clean it up so that it looks like the same.
>> + __dcc_initialize();
>> +
>> /* Returns -1 if error */
>> ret = hvc_instantiate(0, 0, &hvc_dcc_get_put_ops);
>
> Can this driver be built as a module and unloaded? If so, should we
> re-enable userspace access when the kernel doesn't need it anymore?
Not according to the Kconfig:
config HVC_DCC
bool "ARM JTAG DCC console"
> Finally, have you checked the behaviour on CPU hotplug? It looks like we
> zero mdscr_el1 in the cold boot path. The alternative is to set this bit
> there and never allow userspace access. Do you know of any compelling
> use-cases where userspace accesses the DCC directly?
Maybe KVM?
I have to admit, this is starting to get a little out of my league. All
I really wanted to do was make DCC available on ARM64, the same exact
way it's available on ARM32. I don't want to have to solve every DCC
problem that exists today on every ARM platform. I would rather drop
this patch than have to spend an inordinate amount of time making it
perfect.
We've never disabled user-space DCC support on any ARM platform before.
If there is a problem with user-space DCC, I've never seen it, and I
don't know anyone who has.
--
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
next prev parent reply other threads:[~2015-08-17 22:45 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-08 0:16 [PATCH 1/3] [v2] hvc_dcc: don't ignore errors during initialization Timur Tabi
2015-08-08 0:16 ` [PATCH 2/3] [v4] ARM64: TTY: hvc_dcc: Add support for ARM64 dcc Timur Tabi
2015-08-10 9:40 ` Will Deacon
2015-08-17 23:56 ` Timur Tabi
2015-08-18 8:21 ` Dave Martin
2015-08-18 19:07 ` Timur Tabi
2015-08-19 10:14 ` Dave Martin
2015-08-19 16:16 ` Timur Tabi
2015-08-19 16:37 ` Dave Martin
2015-08-24 23:51 ` sboyd at codeaurora.org
2015-09-02 11:10 ` Dave Martin
2015-08-08 0:16 ` [PATCH 3/3] [v2] hvc_dcc: disable user-space access to DCC Timur Tabi
2015-08-10 9:47 ` Will Deacon
2015-08-17 22:45 ` Timur Tabi [this message]
2015-08-10 9:48 ` [PATCH 1/3] [v2] hvc_dcc: don't ignore errors during initialization Will Deacon
2015-08-19 22:51 ` Timur Tabi
-- strict thread matches above, loose matches on Subject: below --
2015-08-19 23:02 [PATCH 1/3] [v3] " Timur Tabi
2015-08-19 23:02 ` [PATCH 3/3] [v2] hvc_dcc: disable user-space access to DCC Timur Tabi
2015-08-20 10:46 ` Will Deacon
2015-08-20 13:02 ` Catalin Marinas
2015-08-20 15:22 ` Timur Tabi
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=55D2640B.5090709@codeaurora.org \
--to=timur@codeaurora$(echo .)org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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