Re: [PATCH 06/19] LoongArch: Add exception/interrupt handling

From
Arnd Bergmann <arnd@arndb.de>
Date
2021-07-06 10:16:54
Reply to
Huacai Chen, 2021-07-06
On Tue, Jul 6, 2021 at 6:18 AM Huacai Chen [off-list ref] wrote:
quoted hunk ↗ jump to hunk
diff --git a/arch/loongarch/include/asm/break.h b/arch/loongarch/include/asm/break.h
new file mode 100644
index 000000000000..109d0c85c582
--- /dev/null
+++ b/arch/loongarch/include/asm/break.h
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020-2021 Loongson Technology Corporation Limited
+ */
+#ifndef __ASM_BREAK_H
+#define __ASM_BREAK_H
+
+#include <uapi/asm/break.h>
+
+#endif /* __ASM_BREAK_H */
The file can be removed.
quoted hunk ↗ jump to hunk
--- /dev/null
+++ b/arch/loongarch/include/asm/debug.h
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020-2021 Loongson Technology Corporation Limited
+ */
+
+#ifndef __LOONGARCH_ASM_DEBUG_H__
+#define __LOONGARCH_ASM_DEBUG_H__
+
+#include <linux/dcache.h>
+
+/*
+ * loongarch_debugfs_dir corresponds to the "loongarch" directory at the top
+ * level of the DebugFS hierarchy. LoongArch-specific DebugFS entries should
+ * be placed beneath this directory.
+ */
+extern struct dentry *loongarch_debugfs_dir;
I see this one is used for the alignment trap handling, which on other
architectures
is part of sysctl. Try to see what the most common implementation is
across architectures
and use that instead.

I think there also needs to be a discussion about how to handle alignment traps
in general, so maybe split out all alignment handling into a separate patch.
quoted hunk ↗ jump to hunk
diff --git a/arch/loongarch/kernel/unaligned.c b/arch/loongarch/kernel/unaligned.c
new file mode 100644
index 000000000000..d66e453297da
--- /dev/null
+++ b/arch/loongarch/kernel/unaligned.c
@@ -0,0 +1,461 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Handle unaligned accesses by emulation.
Can you explain in this comment what the CPU can or cannot do? Are all
memory accesses assumed to be naturally aligned? Is any of the CPU
implementation dependent?

        Arnd
Thread (110 messages) 110 messages, 12 authors, last reply 2021-08-27
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help