On Tue, Jul 6, 2021 at 6:18 AM Huacai Chen <chenhuacai@xxxxxxxxxxx> wrote: > 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. > --- /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. > 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