Well, it's up to you to figure out the details, but I'd start by adding
some static inlines to the arch-specific header files for enabling/disabling
userspace access.
From there, I think I'd get the architecture init code to reset the thing
to "disabled" (so it's disabled regardless of whether we build the hvc_dcc
driver) and then if you wanted to go all-out, we could have a sysfs entry
provided by the driver to toggle it on and off.
>static int __init hvc_dcc_console_init(void)Yeah, that's super ugly.
>{
>#ifdef CONFIG_ARM64
> u32 val;
>
> asm("msr mdscr_el1, %0 "
> "orr %0, %0, #4096 " /* TDCC */
> "msr %0, mdscr_el1 "
> : "=r" (val));
>#endif
>
>But this seems clunky.
>I am concerned about KVM, though. There appears to be code in KVM inThat's a bug imo.
>hyp.s and sys_regs.c that touches and/or emulates MDSCR_EL1.
>
>On a side note, it does not appear that ARM32 blocks userspace DCC. I
>don't see where DBGDSCR.UDCCdis is set.