On Wed, Dec 08, 2021 at 12:08:47PM +0530, Sai Prakash Ranjan wrote:
From: Shanker Donthineni <shankerd@xxxxxxxxxxxxxx>But your code will break on systems when cpu 0 goes away, so this isn't
Some debuggers, such as Trace32 from Lauterbach GmbH, do not handle
reads/writes from/to DCC on secondary cores. Each core has its
own DCC device registers, so when a core reads or writes from/to DCC,
it only accesses its own DCC device. Since kernel code can run on
any core, every time the kernel wants to write to the console, it
might write to a different DCC.
In SMP mode, Trace32 creates multiple windows, and each window shows
the DCC output only from that core's DCC. The result is that console
output is either lost or scattered across windows.
Selecting this option will enable code that serializes all console
input and output to core 0. The DCC driver will create input and
output FIFOs that all cores will use. Reads and writes from/to DCC
are handled by a workqueue that runs only core 0.
Link: https://lore.kernel.org/lkml/1435344756-20901-1-git-send-email-timur@xxxxxxxxxxxxxx/
Signed-off-by: Shanker Donthineni <shankerd@xxxxxxxxxxxxxx>
Acked-by: Adam Wallis <awallis@xxxxxxxxxxxxxx>
Signed-off-by: Timur Tabi <timur@xxxxxxxxxxxxxx>
Signed-off-by: Elliot Berman <eberman@xxxxxxxxxxxxxx>
Signed-off-by: Sai Prakash Ranjan <quic_saipraka@xxxxxxxxxxx>
---
Resending this v2 since earlier one had a typo in the variable type.
Changes in v2:
* Checkpatch warning fixes.
* Use of IS_ENABLED macros instead of ifdefs.
I also thought of making it depends on !HOTPLUG_CPU since it is broken
in case core0 is hotplugged off, but apparently HOTPLUG_CPU kconfig
has weird dependency issues, i.e., gets selected by CONFIG_PM and others.
So it will be almost like this feature won't be selectable at all if
I add !HOTPLUG_CPU kconfig dependency. Also HVC_DCC is a debug feature
where we need Trace32 like tools to access DCC windows in which case
these shortcomings can be expected since manual intervention is required
anyways for attaching a core to Trace32, so it won't matter much.
going to work well at all. Please make this work for any cpu or handle
the case when the cpu it is running on goes away.
Also, this REALLY looks like you are trying to fix the kernel for a
crazy userspace program. Why not fix the userspace program instead?
Isn't that easier and then that way it will work for any kernel version?