* [PATCH v2 0/6] mm: Stop alaising VM_FAULT_HINDEX_MASK in arch code
@ 2023-03-15 3:03 Palmer Dabbelt
2023-03-15 3:03 ` [PATCH v2 1/6] riscv/mm/fault: simplify code for do_page_fault() Palmer Dabbelt
` (5 more replies)
0 siblings, 6 replies; 10+ messages in thread
From: Palmer Dabbelt @ 2023-03-15 3:03 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-riscv, linux-s390, linux-arm-kernel
When reviewing
<https://lore.kernel.org/r/20221029084715.3669204-1-tongtiangen@huawei.com>
I noticed that the arch-specific VM_FAULT flags used by arm and s390
alias with VM_FAULT_HINDEX_MASK. I'm not sure if it's possible to
manifest this as a bug, but it certainly seems fragile.
I'm including that original patch this time in the hope that makes it
easier for folks to review. There were some boring conflicts so I
figured I'd rebase rather than pinging again.
Changes since v1 <20221203030356.3917-1-palmer@rivosinc.com>:
* Add the original patch, and reorder the RISC-V stuff first.
* Rebased on v6.3-rc2
* Moved the comment about VM_FAULT_ARCH_* to the patch that adds those,
rather than the patch that adds 0s.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 1/6] riscv/mm/fault: simplify code for do_page_fault()
2023-03-15 3:03 [PATCH v2 0/6] mm: Stop alaising VM_FAULT_HINDEX_MASK in arch code Palmer Dabbelt
@ 2023-03-15 3:03 ` Palmer Dabbelt
2023-03-15 5:02 ` Matthew Wilcox
2023-03-15 3:03 ` [PATCH v2 2/6] mm: Add a leading 0 to the VM_FAULT_* types Palmer Dabbelt
` (4 subsequent siblings)
5 siblings, 1 reply; 10+ messages in thread
From: Palmer Dabbelt @ 2023-03-15 3:03 UTC (permalink / raw)
To: akpm
Cc: linux-mm, linux-riscv, linux-s390, linux-arm-kernel,
Tong Tiangen, Palmer Dabbelt
From: Tong Tiangen <tongtiangen@huawei.com>
To make the code more hierarchical and readable, we fold vma related
judgments into __do_page_fault(). And to simplify the code, move the
tsk->thread.bad_cause's setting into bad_area(). No functional change
intended.
Signed-off-by: Tong Tiangen <tongtiangen@huawei.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
---
arch/riscv/mm/fault.c | 77 +++++++++++++++++++++++--------------------
1 file changed, 41 insertions(+), 36 deletions(-)
diff --git a/arch/riscv/mm/fault.c b/arch/riscv/mm/fault.c
index 460f785f6e09..0a8c9afeee22 100644
--- a/arch/riscv/mm/fault.c
+++ b/arch/riscv/mm/fault.c
@@ -85,6 +85,8 @@ static inline void mm_fault_error(struct pt_regs *regs, unsigned long addr, vm_f
static inline void bad_area(struct pt_regs *regs, struct mm_struct *mm, int code, unsigned long addr)
{
+ current->thread.bad_cause = regs->cause;
+
/*
* Something tried to access memory that isn't in our memory map.
* Fix it, but check if it's kernel or user first.
@@ -200,6 +202,38 @@ static inline bool access_error(unsigned long cause, struct vm_area_struct *vma)
return false;
}
+#define VM_FAULT_BADMAP ((__force vm_fault_t)0x010000)
+#define VM_FAULT_BADACCESS ((__force vm_fault_t)0x020000)
+
+static vm_fault_t __do_page_fault(struct mm_struct *mm, unsigned long addr,
+ unsigned int mm_flags, struct pt_regs *regs)
+{
+ struct vm_area_struct *vma = find_vma(mm, addr);
+
+ if (unlikely(!vma))
+ return VM_FAULT_BADMAP;
+
+ if (unlikely(vma->vm_start > addr)) {
+ if (unlikely(!(vma->vm_flags & VM_GROWSDOWN) ||
+ expand_stack(vma, addr)))
+ return VM_FAULT_BADMAP;
+ }
+
+ /*
+ * Ok, we have a good vm_area for this memory access, so
+ * we can handle it.
+ */
+ if (unlikely(access_error(regs->cause, vma)))
+ return VM_FAULT_BADACCESS;
+
+ /*
+ * If for any reason at all we could not handle the fault,
+ * make sure we exit gracefully rather than endlessly redo
+ * the fault.
+ */
+ return handle_mm_fault(vma, addr, mm_flags, regs);
+}
+
/*
* This routine handles page faults. It determines the address and the
* problem, and then passes it off to one of the appropriate routines.
@@ -207,7 +241,6 @@ static inline bool access_error(unsigned long cause, struct vm_area_struct *vma)
asmlinkage void do_page_fault(struct pt_regs *regs)
{
struct task_struct *tsk;
- struct vm_area_struct *vma;
struct mm_struct *mm;
unsigned long addr, cause;
unsigned int flags = FAULT_FLAG_DEFAULT;
@@ -282,44 +315,16 @@ asmlinkage void do_page_fault(struct pt_regs *regs)
flags |= FAULT_FLAG_INSTRUCTION;
retry:
mmap_read_lock(mm);
- vma = find_vma(mm, addr);
- if (unlikely(!vma)) {
- tsk->thread.bad_cause = cause;
- bad_area(regs, mm, code, addr);
- return;
- }
- if (likely(vma->vm_start <= addr))
- goto good_area;
- if (unlikely(!(vma->vm_flags & VM_GROWSDOWN))) {
- tsk->thread.bad_cause = cause;
- bad_area(regs, mm, code, addr);
- return;
- }
- if (unlikely(expand_stack(vma, addr))) {
- tsk->thread.bad_cause = cause;
- bad_area(regs, mm, code, addr);
- return;
- }
- /*
- * Ok, we have a good vm_area for this memory access, so
- * we can handle it.
- */
-good_area:
- code = SEGV_ACCERR;
+ fault = __do_page_fault(mm, addr, flags, regs);
- if (unlikely(access_error(cause, vma))) {
- tsk->thread.bad_cause = cause;
- bad_area(regs, mm, code, addr);
- return;
- }
+ if (unlikely(fault & VM_FAULT_BADMAP))
+ return bad_area(regs, mm, code, addr);
- /*
- * If for any reason at all we could not handle the fault,
- * make sure we exit gracefully rather than endlessly redo
- * the fault.
- */
- fault = handle_mm_fault(vma, addr, flags, regs);
+ if (unlikely(fault & VM_FAULT_BADACCESS)) {
+ code = SEGV_ACCERR;
+ return bad_area(regs, mm, code, addr);
+ }
/*
* If we need to retry but a fatal signal is pending, handle the
--
2.39.2
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 2/6] mm: Add a leading 0 to the VM_FAULT_* types
2023-03-15 3:03 [PATCH v2 0/6] mm: Stop alaising VM_FAULT_HINDEX_MASK in arch code Palmer Dabbelt
2023-03-15 3:03 ` [PATCH v2 1/6] riscv/mm/fault: simplify code for do_page_fault() Palmer Dabbelt
@ 2023-03-15 3:03 ` Palmer Dabbelt
2023-03-15 3:03 ` [PATCH v2 3/6] mm: Add VM_FAULT_ARCH_* codes Palmer Dabbelt
` (3 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Palmer Dabbelt @ 2023-03-15 3:03 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-riscv, linux-s390, linux-arm-kernel, Palmer Dabbelt
The next patch will add enough codes to need another character, this
adds the 0 to all the existing codes to keep alignment.
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
---
include/linux/mm_types.h | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 0722859c3647..fd9b863869b4 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -941,20 +941,20 @@ typedef __bitwise unsigned int vm_fault_t;
*
*/
enum vm_fault_reason {
- VM_FAULT_OOM = (__force vm_fault_t)0x000001,
- VM_FAULT_SIGBUS = (__force vm_fault_t)0x000002,
- VM_FAULT_MAJOR = (__force vm_fault_t)0x000004,
- VM_FAULT_HWPOISON = (__force vm_fault_t)0x000010,
- VM_FAULT_HWPOISON_LARGE = (__force vm_fault_t)0x000020,
- VM_FAULT_SIGSEGV = (__force vm_fault_t)0x000040,
- VM_FAULT_NOPAGE = (__force vm_fault_t)0x000100,
- VM_FAULT_LOCKED = (__force vm_fault_t)0x000200,
- VM_FAULT_RETRY = (__force vm_fault_t)0x000400,
- VM_FAULT_FALLBACK = (__force vm_fault_t)0x000800,
- VM_FAULT_DONE_COW = (__force vm_fault_t)0x001000,
- VM_FAULT_NEEDDSYNC = (__force vm_fault_t)0x002000,
- VM_FAULT_COMPLETED = (__force vm_fault_t)0x004000,
- VM_FAULT_HINDEX_MASK = (__force vm_fault_t)0x0f0000,
+ VM_FAULT_OOM = (__force vm_fault_t)0x0000001,
+ VM_FAULT_SIGBUS = (__force vm_fault_t)0x0000002,
+ VM_FAULT_MAJOR = (__force vm_fault_t)0x0000004,
+ VM_FAULT_HWPOISON = (__force vm_fault_t)0x0000010,
+ VM_FAULT_HWPOISON_LARGE = (__force vm_fault_t)0x0000020,
+ VM_FAULT_SIGSEGV = (__force vm_fault_t)0x0000040,
+ VM_FAULT_NOPAGE = (__force vm_fault_t)0x0000100,
+ VM_FAULT_LOCKED = (__force vm_fault_t)0x0000200,
+ VM_FAULT_RETRY = (__force vm_fault_t)0x0000400,
+ VM_FAULT_FALLBACK = (__force vm_fault_t)0x0000800,
+ VM_FAULT_DONE_COW = (__force vm_fault_t)0x0001000,
+ VM_FAULT_NEEDDSYNC = (__force vm_fault_t)0x0002000,
+ VM_FAULT_COMPLETED = (__force vm_fault_t)0x0004000,
+ VM_FAULT_HINDEX_MASK = (__force vm_fault_t)0x00f0000,
};
/* Encode hstate index for a hwpoisoned large page */
--
2.39.2
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 3/6] mm: Add VM_FAULT_ARCH_* codes
2023-03-15 3:03 [PATCH v2 0/6] mm: Stop alaising VM_FAULT_HINDEX_MASK in arch code Palmer Dabbelt
2023-03-15 3:03 ` [PATCH v2 1/6] riscv/mm/fault: simplify code for do_page_fault() Palmer Dabbelt
2023-03-15 3:03 ` [PATCH v2 2/6] mm: Add a leading 0 to the VM_FAULT_* types Palmer Dabbelt
@ 2023-03-15 3:03 ` Palmer Dabbelt
2023-03-16 9:32 ` kernel test robot
2023-03-15 3:03 ` [PATCH v2 4/6] RISC-V: fault: Convert to " Palmer Dabbelt
` (2 subsequent siblings)
5 siblings, 1 reply; 10+ messages in thread
From: Palmer Dabbelt @ 2023-03-15 3:03 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-riscv, linux-s390, linux-arm-kernel, Palmer Dabbelt
A handful of architectures (arm, s390, and soon RISC-V) define their
own internal fault codes, so instead dedicate a few standard codes as
being architecture-specific to avoid conflicts.
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
---
include/linux/mm_types.h | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index fd9b863869b4..47f36a2fdaac 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -938,6 +938,7 @@ typedef __bitwise unsigned int vm_fault_t;
* in DAX)
* @VM_FAULT_COMPLETED: ->fault completed, meanwhile mmap lock released
* @VM_FAULT_HINDEX_MASK: mask HINDEX value
+ * @VM_FAULT_ARCH_* Architecture-specific VM fault codes.
*
*/
enum vm_fault_reason {
@@ -955,6 +956,11 @@ enum vm_fault_reason {
VM_FAULT_NEEDDSYNC = (__force vm_fault_t)0x0002000,
VM_FAULT_COMPLETED = (__force vm_fault_t)0x0004000,
VM_FAULT_HINDEX_MASK = (__force vm_fault_t)0x00f0000,
+ VM_FAULT_ARCH_0 = (__force vm_fault_t)0x0100000,
+ VM_FAULT_ARCH_1 = (__force vm_fault_t)0x0200000,
+ VM_FAULT_ARCH_2 = (__force vm_fault_t)0x0400000,
+ VM_FAULT_ARCH_3 = (__force vm_fault_t)0x0800000,
+ VM_FAULT_ARCH_4 = (__force vm_fault_t)0x1000000,
};
/* Encode hstate index for a hwpoisoned large page */
@@ -977,7 +983,12 @@ enum vm_fault_reason {
{ VM_FAULT_RETRY, "RETRY" }, \
{ VM_FAULT_FALLBACK, "FALLBACK" }, \
{ VM_FAULT_DONE_COW, "DONE_COW" }, \
- { VM_FAULT_NEEDDSYNC, "NEEDDSYNC" }
+ { VM_FAULT_NEEDDSYNC, "NEEDDSYNC" }, \
+ { VM_FAULT_ARCH_0, "ARCH_0" }, \
+ { VM_FAULT_ARCH_1, "ARCH_1" }, \
+ { VM_FAULT_ARCH_2, "ARCH_2" }, \
+ { VM_FAULT_ARCH_3, "ARCH_3" }, \
+ { VM_FAULT_ARCH_4, "ARCH_4" }, \
struct vm_special_mapping {
const char *name; /* The name, e.g. "[vdso]". */
--
2.39.2
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 4/6] RISC-V: fault: Convert to VM_FAULT_ARCH_* codes
2023-03-15 3:03 [PATCH v2 0/6] mm: Stop alaising VM_FAULT_HINDEX_MASK in arch code Palmer Dabbelt
` (2 preceding siblings ...)
2023-03-15 3:03 ` [PATCH v2 3/6] mm: Add VM_FAULT_ARCH_* codes Palmer Dabbelt
@ 2023-03-15 3:03 ` Palmer Dabbelt
2023-03-15 3:03 ` [PATCH v2 5/6] arm: " Palmer Dabbelt
2023-03-15 3:03 ` [PATCH v2 6/6] s390: " Palmer Dabbelt
5 siblings, 0 replies; 10+ messages in thread
From: Palmer Dabbelt @ 2023-03-15 3:03 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-riscv, linux-s390, linux-arm-kernel, Palmer Dabbelt
These conflict with VM_FAULT_HINDEX_MASK, so move to some designated
arch-specific values.
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
---
arch/riscv/mm/fault.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/riscv/mm/fault.c b/arch/riscv/mm/fault.c
index 0a8c9afeee22..5b035c0ae782 100644
--- a/arch/riscv/mm/fault.c
+++ b/arch/riscv/mm/fault.c
@@ -202,8 +202,8 @@ static inline bool access_error(unsigned long cause, struct vm_area_struct *vma)
return false;
}
-#define VM_FAULT_BADMAP ((__force vm_fault_t)0x010000)
-#define VM_FAULT_BADACCESS ((__force vm_fault_t)0x020000)
+#define VM_FAULT_BADMAP VM_FAULT_ARCH_0
+#define VM_FAULT_BADACCESS VM_FAULT_ARCH_1
static vm_fault_t __do_page_fault(struct mm_struct *mm, unsigned long addr,
unsigned int mm_flags, struct pt_regs *regs)
--
2.39.2
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 5/6] arm: fault: Convert to VM_FAULT_ARCH_* codes
2023-03-15 3:03 [PATCH v2 0/6] mm: Stop alaising VM_FAULT_HINDEX_MASK in arch code Palmer Dabbelt
` (3 preceding siblings ...)
2023-03-15 3:03 ` [PATCH v2 4/6] RISC-V: fault: Convert to " Palmer Dabbelt
@ 2023-03-15 3:03 ` Palmer Dabbelt
2023-03-15 3:03 ` [PATCH v2 6/6] s390: " Palmer Dabbelt
5 siblings, 0 replies; 10+ messages in thread
From: Palmer Dabbelt @ 2023-03-15 3:03 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-riscv, linux-s390, linux-arm-kernel, Palmer Dabbelt
These conflict with VM_FAULT_HINDEX_MASK, so move to some designated
arch-specific values.
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
---
arch/arm/mm/fault.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index 2418f1efabd8..c57ea332ca97 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -216,8 +216,8 @@ void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
}
#ifdef CONFIG_MMU
-#define VM_FAULT_BADMAP ((__force vm_fault_t)0x010000)
-#define VM_FAULT_BADACCESS ((__force vm_fault_t)0x020000)
+#define VM_FAULT_BADMAP VM_FAULT_ARCH_0
+#define VM_FAULT_BADACCESS VM_FAULT_ARCH_1
static inline bool is_permission_fault(unsigned int fsr)
{
--
2.39.2
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 6/6] s390: fault: Convert to VM_FAULT_ARCH_* codes
2023-03-15 3:03 [PATCH v2 0/6] mm: Stop alaising VM_FAULT_HINDEX_MASK in arch code Palmer Dabbelt
` (4 preceding siblings ...)
2023-03-15 3:03 ` [PATCH v2 5/6] arm: " Palmer Dabbelt
@ 2023-03-15 3:03 ` Palmer Dabbelt
5 siblings, 0 replies; 10+ messages in thread
From: Palmer Dabbelt @ 2023-03-15 3:03 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-riscv, linux-s390, linux-arm-kernel, Palmer Dabbelt
These conflict with VM_FAULT_HINDEX_MASK, so move to some designated
arch-specific values.
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
---
arch/s390/mm/fault.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index a2632fd97d00..f1a186a4c465 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -50,11 +50,11 @@
* Allocate private vm_fault_reason from top. Please make sure it won't
* collide with vm_fault_reason.
*/
-#define VM_FAULT_BADCONTEXT ((__force vm_fault_t)0x80000000)
-#define VM_FAULT_BADMAP ((__force vm_fault_t)0x40000000)
-#define VM_FAULT_BADACCESS ((__force vm_fault_t)0x20000000)
-#define VM_FAULT_SIGNAL ((__force vm_fault_t)0x10000000)
-#define VM_FAULT_PFAULT ((__force vm_fault_t)0x8000000)
+#define VM_FAULT_BADCONTEXT VM_FAULT_ARCH_0
+#define VM_FAULT_BADMAP VM_FAULT_ARCH_1
+#define VM_FAULT_BADACCESS VM_FAULT_ARCH_2
+#define VM_FAULT_SIGNAL VM_FAULT_ARCH_3
+#define VM_FAULT_PFAULT VM_FAULT_ARCH_4
enum fault_type {
KERNEL_FAULT,
--
2.39.2
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/6] riscv/mm/fault: simplify code for do_page_fault()
2023-03-15 3:03 ` [PATCH v2 1/6] riscv/mm/fault: simplify code for do_page_fault() Palmer Dabbelt
@ 2023-03-15 5:02 ` Matthew Wilcox
2023-03-15 5:09 ` Palmer Dabbelt
0 siblings, 1 reply; 10+ messages in thread
From: Matthew Wilcox @ 2023-03-15 5:02 UTC (permalink / raw)
To: Palmer Dabbelt
Cc: akpm, linux-mm, linux-riscv, linux-s390, linux-arm-kernel, Tong Tiangen
On Tue, Mar 14, 2023 at 08:03:54PM -0700, Palmer Dabbelt wrote:
> To make the code more hierarchical and readable, we fold vma related
> judgments into __do_page_fault(). And to simplify the code, move the
> tsk->thread.bad_cause's setting into bad_area(). No functional change
> intended.
I think this is exaactly the wrong thing to be doing. Please _stop_
using custom internal VM_FAULT flags, not adding new uses!
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/6] riscv/mm/fault: simplify code for do_page_fault()
2023-03-15 5:02 ` Matthew Wilcox
@ 2023-03-15 5:09 ` Palmer Dabbelt
0 siblings, 0 replies; 10+ messages in thread
From: Palmer Dabbelt @ 2023-03-15 5:09 UTC (permalink / raw)
To: willy
Cc: akpm, linux-mm, linux-riscv, linux-s390, linux-arm-kernel, tongtiangen
On Tue, 14 Mar 2023 22:02:37 PDT (-0700), willy@infradead.org wrote:
> On Tue, Mar 14, 2023 at 08:03:54PM -0700, Palmer Dabbelt wrote:
>> To make the code more hierarchical and readable, we fold vma related
>> judgments into __do_page_fault(). And to simplify the code, move the
>> tsk->thread.bad_cause's setting into bad_area(). No functional change
>> intended.
>
> I think this is exaactly the wrong thing to be doing. Please _stop_
> using custom internal VM_FAULT flags, not adding new uses!
I'm fine with that. The rest of the patch set was to chunk out a few to
avoid them stepping on generic stuff, but we don't really need that in
RISC-V land (aside from this, which is sort of a mixed bag WRT whether
this is simpler or not). That's sort of why I held off on merging this
in the first place.
That said, the follow-on patches do clean up some mixing between generic
and arch codes for other ports. I'm not sure if those can manifest as a
real bug or not.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 3/6] mm: Add VM_FAULT_ARCH_* codes
2023-03-15 3:03 ` [PATCH v2 3/6] mm: Add VM_FAULT_ARCH_* codes Palmer Dabbelt
@ 2023-03-16 9:32 ` kernel test robot
0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2023-03-16 9:32 UTC (permalink / raw)
To: Palmer Dabbelt, akpm
Cc: oe-kbuild-all, linux-mm, linux-riscv, linux-s390,
linux-arm-kernel, Palmer Dabbelt
Hi Palmer,
I love your patch! Yet something to improve:
[auto build test ERROR on akpm-mm/mm-everything]
url: https://github.com/intel-lab-lkp/linux/commits/Palmer-Dabbelt/riscv-mm-fault-simplify-code-for-do_page_fault/20230315-111507
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/r/20230315030359.14162-4-palmer%40rivosinc.com
patch subject: [PATCH v2 3/6] mm: Add VM_FAULT_ARCH_* codes
config: s390-randconfig-r044-20230312 (https://download.01.org/0day-ci/archive/20230316/202303161725.tJspbzJz-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/d25cdd69b804d954e31ad8835750a8707e11af32
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Palmer-Dabbelt/riscv-mm-fault-simplify-code-for-do_page_fault/20230315-111507
git checkout d25cdd69b804d954e31ad8835750a8707e11af32
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=s390 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303161725.tJspbzJz-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from include/trace/define_trace.h:102,
from include/trace/events/fs_dax.h:286,
from fs/dax.c:31:
include/trace/events/fs_dax.h: In function 'trace_raw_output_dax_pmd_fault_class':
>> include/trace/stages/stage3_trace_output.h:70:37: error: expected expression before ',' token
70 | { flag_array, { -1, NULL }}; \
| ^
include/trace/trace_events.h:203:34: note: in definition of macro 'DECLARE_EVENT_CLASS'
203 | trace_event_printf(iter, print); \
| ^~~~~
include/trace/events/fs_dax.h:38:9: note: in expansion of macro 'TP_printk'
38 | TP_printk("dev %d:%d ino %#lx %s %s address %#lx vm_start "
| ^~~~~~~~~
include/trace/events/fs_dax.h:50:17: note: in expansion of macro '__print_flags'
50 | __print_flags(__entry->result, "|", VM_FAULT_RESULT_TRACE)
| ^~~~~~~~~~~~~
include/trace/events/fs_dax.h: In function 'trace_raw_output_dax_pte_fault_class':
>> include/trace/stages/stage3_trace_output.h:70:37: error: expected expression before ',' token
70 | { flag_array, { -1, NULL }}; \
| ^
include/trace/trace_events.h:203:34: note: in definition of macro 'DECLARE_EVENT_CLASS'
203 | trace_event_printf(iter, print); \
| ^~~~~
include/trace/events/fs_dax.h:174:9: note: in expansion of macro 'TP_printk'
174 | TP_printk("dev %d:%d ino %#lx %s %s address %#lx pgoff %#lx %s",
| ^~~~~~~~~
include/trace/events/fs_dax.h:182:17: note: in expansion of macro '__print_flags'
182 | __print_flags(__entry->result, "|", VM_FAULT_RESULT_TRACE)
| ^~~~~~~~~~~~~
vim +70 include/trace/stages/stage3_trace_output.h
1bc191051dca28 include/trace/stages/stage3_defines.h Linus Torvalds 2022-03-23 65
af6b9668e85ffd include/trace/stages/stage3_defines.h Steven Rostedt (Google 2022-03-03 66) #undef __print_flags
af6b9668e85ffd include/trace/stages/stage3_defines.h Steven Rostedt (Google 2022-03-03 67) #define __print_flags(flag, delim, flag_array...) \
af6b9668e85ffd include/trace/stages/stage3_defines.h Steven Rostedt (Google 2022-03-03 68) ({ \
af6b9668e85ffd include/trace/stages/stage3_defines.h Steven Rostedt (Google 2022-03-03 69) static const struct trace_print_flags __flags[] = \
af6b9668e85ffd include/trace/stages/stage3_defines.h Steven Rostedt (Google 2022-03-03 @70) { flag_array, { -1, NULL }}; \
af6b9668e85ffd include/trace/stages/stage3_defines.h Steven Rostedt (Google 2022-03-03 71) trace_print_flags_seq(p, delim, flag, __flags); \
af6b9668e85ffd include/trace/stages/stage3_defines.h Steven Rostedt (Google 2022-03-03 72) })
af6b9668e85ffd include/trace/stages/stage3_defines.h Steven Rostedt (Google 2022-03-03 73)
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2023-03-16 9:33 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-15 3:03 [PATCH v2 0/6] mm: Stop alaising VM_FAULT_HINDEX_MASK in arch code Palmer Dabbelt
2023-03-15 3:03 ` [PATCH v2 1/6] riscv/mm/fault: simplify code for do_page_fault() Palmer Dabbelt
2023-03-15 5:02 ` Matthew Wilcox
2023-03-15 5:09 ` Palmer Dabbelt
2023-03-15 3:03 ` [PATCH v2 2/6] mm: Add a leading 0 to the VM_FAULT_* types Palmer Dabbelt
2023-03-15 3:03 ` [PATCH v2 3/6] mm: Add VM_FAULT_ARCH_* codes Palmer Dabbelt
2023-03-16 9:32 ` kernel test robot
2023-03-15 3:03 ` [PATCH v2 4/6] RISC-V: fault: Convert to " Palmer Dabbelt
2023-03-15 3:03 ` [PATCH v2 5/6] arm: " Palmer Dabbelt
2023-03-15 3:03 ` [PATCH v2 6/6] s390: " Palmer Dabbelt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox