Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1176643
| From | Timur Tabi <timur@codeaurora.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 4/4] hvc_dcc: disable user-space access to DCC |
| Date | 2015-07-03 17:00 +0200 |
| Message-ID | <pIaBA-1kt-13@gated-at.bofh.it> (permalink) |
| References | <pHbgm-5xn-7@gated-at.bofh.it> <pHbgm-5xn-5@gated-at.bofh.it> <pHAeJ-3Ll-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Jul 1, 2015, at 8:00 PM, Stephen Boyd wrote:
>>
>> #include <asm/barrier.h>
>> +#include <asm/hardware/cp14.h>
>
> That's new.
And no one else is using it either.
>>
>> +
>> +static inline void __dcc_initialize(void)
>> +{
>> + u32 val;
>> +
>> + /* Disable user-space access to DCC */
>> + val = MRC14(0, c0, c1, 0);
>> + val |= 1 << 12; /* DSCR[Comms] */
>> + MCR14(val, 0, c0, c1, 0);
>> +}
>
> Nitpick: We do raw cp14 accesses for other functions in this file, so it
> would be nice to be consistent throughout.
I agree, but I didn't want to expand the scope of this patch beyond what it's supposed to do.
>>
>> +static inline void __dcc_initialize(void)
>> +{
>> + u32 val;
>> +
>> + /* Disable user-space access to DCC */
>> + asm ("mrs %0, mdscr_el1\n"
>
> shouldn't this be volatile?
Well, I figured it wasn't important exactly why these instructions are executed, since it just disables user-space. I usually get chewed out by someone if I add volatile where it's not needed, so I didn't add it this time.
>
>> + " orr %0, %0, #4096\n" /* Set the TDCC bit */
>
> arm64 has some #defines in debug-monitors.h which we should probably
> extend to have this bit as a #define too.
Hmmm, the only thing I see in debug_monitors.h that seems applicable are the mdscr_write() and mdscr_read() functions, which seem to overlap cp14.h.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 4/4] hvc_dcc: disable user-space access to DCC Timur Tabi <timur@codeaurora.org> - 2015-06-30 23:30 +0200
Re: [PATCH 4/4] hvc_dcc: disable user-space access to DCC Stephen Boyd <sboyd@codeaurora.org> - 2015-07-02 02:10 +0200
Re: [PATCH 4/4] hvc_dcc: disable user-space access to DCC Timur Tabi <timur@codeaurora.org> - 2015-07-03 17:00 +0200
csiph-web