* Re: [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h
2015-12-15 14:15 [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h Chen Gang
@ 2015-12-15 14:20 ` Chen Gang
2015-12-15 15:34 ` kbuild test robot
` (3 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Chen Gang @ 2015-12-15 14:20 UTC (permalink / raw)
To: Arnd Bergmann, trivial
Cc: Linux-Arch, linux-kernel@vger.kernel.org, Andrew Morton
After this patch, I finish 'scanning' mm related headers in
"include/asm-genric/*".
Next I shall continue 'scanning' mm related headers in
"include/linux/*" to know about the common sense information.
Thanks.
On 12/15/15 22:15, Chen Gang wrote:
>
> It is a trivial patch.
>
> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
> ---
> include/asm-generic/pgtable-nopmd.h | 3 ++-
> include/asm-generic/pgtable-nopud.h | 3 ++-
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h
> index 725612b..7a81185 100644
> --- a/include/asm-generic/pgtable-nopmd.h
> +++ b/include/asm-generic/pgtable-nopmd.h
> @@ -38,7 +38,8 @@ static inline void pud_clear(pud_t *pud) { }
> * (pmds are folded into puds so this doesn't get actually called,
> * but the define is needed for a generic inline function.)
> */
> -#define set_pud(pudptr, pudval) set_pmd((pmd_t *)(pudptr), (pmd_t) { pudval })
> +#define set_pud(pudptr, pudval) (set_pmd((pmd_t *)(pudptr), \
> + (pmd_t) { pudval }))
>
> static inline pmd_t * pmd_offset(pud_t * pud, unsigned long address)
> {
> diff --git a/include/asm-generic/pgtable-nopud.h b/include/asm-generic/pgtable-nopud.h
> index 810431d..bc78818 100644
> --- a/include/asm-generic/pgtable-nopud.h
> +++ b/include/asm-generic/pgtable-nopud.h
> @@ -33,7 +33,8 @@ static inline void pgd_clear(pgd_t *pgd) { }
> * (puds are folded into pgds so this doesn't get actually called,
> * but the define is needed for a generic inline function.)
> */
> -#define set_pgd(pgdptr, pgdval) set_pud((pud_t *)(pgdptr), (pud_t) { pgdval })
> +#define set_pgd(pgdptr, pgdval) (set_pud((pud_t *)(pgdptr), \
> + (pud_t) { pgdval }))
>
> static inline pud_t * pud_offset(pgd_t * pgd, unsigned long address)
> {
>
--
Chen Gang (陈刚)
Open, share, and attitude like air, water, and life which God blessed
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h
2015-12-15 14:15 [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h Chen Gang
2015-12-15 14:20 ` Chen Gang
@ 2015-12-15 15:34 ` kbuild test robot
2015-12-15 15:47 ` kbuild test robot
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: kbuild test robot @ 2015-12-15 15:34 UTC (permalink / raw)
To: Chen Gang
Cc: kbuild-all, Arnd Bergmann, trivial, Linux-Arch,
linux-kernel@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 2753 bytes --]
Hi Chen,
[auto build test ERROR on v4.4-rc5]
[also build test ERROR on next-20151215]
url: https://github.com/0day-ci/linux/commits/Chen-Gang/include-asm-generic-Notice-about-80-columns-in-pgtable-no-h/20151215-221607
config: mips-xway_defconfig (attached as .config)
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=mips
All error/warnings (new ones prefixed by >>):
In file included from include/linux/mm.h:55:0,
from include/linux/pid_namespace.h:6,
from include/linux/ptrace.h:8,
from arch/mips/mm/fault.c:16:
arch/mips/mm/fault.c: In function '__do_page_fault':
>> arch/mips/include/asm/pgtable.h:241:33: error: expected expression before 'do'
#define set_pmd(pmdptr, pmdval) do { *(pmdptr) = (pmdval); } while(0)
^
>> include/asm-generic/pgtable-nopmd.h:41:36: note: in expansion of macro 'set_pmd'
#define set_pud(pudptr, pudval) (set_pmd((pmd_t *)(pudptr), \
^
>> include/asm-generic/pgtable-nopud.h:36:36: note: in expansion of macro 'set_pud'
#define set_pgd(pgdptr, pgdval) (set_pud((pud_t *)(pgdptr), \
^
>> arch/mips/mm/fault.c:314:3: note: in expansion of macro 'set_pgd'
set_pgd(pgd, *pgd_k);
^
vim +/set_pmd +41 include/asm-generic/pgtable-nopmd.h
25 * The "pud_xxx()" functions here are trivial for a folded two-level
26 * setup: the pmd is never bad, and a pmd always exists (as it's folded
27 * into the pud entry)
28 */
29 static inline int pud_none(pud_t pud) { return 0; }
30 static inline int pud_bad(pud_t pud) { return 0; }
31 static inline int pud_present(pud_t pud) { return 1; }
32 static inline void pud_clear(pud_t *pud) { }
33 #define pmd_ERROR(pmd) (pud_ERROR((pmd).pud))
34
35 #define pud_populate(mm, pmd, pte) do { } while (0)
36
37 /*
38 * (pmds are folded into puds so this doesn't get actually called,
39 * but the define is needed for a generic inline function.)
40 */
> 41 #define set_pud(pudptr, pudval) (set_pmd((pmd_t *)(pudptr), \
42 (pmd_t) { pudval }))
43
44 static inline pmd_t * pmd_offset(pud_t * pud, unsigned long address)
45 {
46 return (pmd_t *)pud;
47 }
48
49 #define pmd_val(x) (pud_val((x).pud))
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 13370 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h
2015-12-15 14:15 [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h Chen Gang
2015-12-15 14:20 ` Chen Gang
2015-12-15 15:34 ` kbuild test robot
@ 2015-12-15 15:47 ` kbuild test robot
2015-12-15 15:50 ` Arnd Bergmann
2015-12-15 20:26 ` Joe Perches
2015-12-15 20:29 ` kbuild test robot
4 siblings, 1 reply; 9+ messages in thread
From: kbuild test robot @ 2015-12-15 15:47 UTC (permalink / raw)
To: Chen Gang
Cc: kbuild-all, Arnd Bergmann, trivial, Linux-Arch,
linux-kernel@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 3172 bytes --]
Hi Chen,
[auto build test ERROR on v4.4-rc5]
[also build test ERROR on next-20151215]
url: https://github.com/0day-ci/linux/commits/Chen-Gang/include-asm-generic-Notice-about-80-columns-in-pgtable-no-h/20151215-221607
config: arm-shannon_defconfig (attached as .config)
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm
All error/warnings (new ones prefixed by >>):
In file included from arch/arm/include/asm/pgtable.h:33:0,
from include/linux/mm.h:55,
from arch/arm/mm/fault.c:13:
arch/arm/mm/fault.c: In function 'do_translation_fault':
>> arch/arm/include/asm/pgtable-2level.h:187:27: error: expected expression before 'do'
#define set_pud(pud,pudp) do { } while (0)
^
include/asm-generic/pgtable-nopud.h:36:36: note: in expansion of macro 'set_pud'
#define set_pgd(pgdptr, pgdval) (set_pud((pud_t *)(pgdptr), \
^
>> arch/arm/mm/fault.c:444:3: note: in expansion of macro 'set_pgd'
set_pgd(pgd, *pgd_k);
^
vim +/set_pgd +444 arch/arm/mm/fault.c
^1da177e Linus Torvalds 2005-04-16 428 pmd_t *pmd, *pmd_k;
^1da177e Linus Torvalds 2005-04-16 429
^1da177e Linus Torvalds 2005-04-16 430 if (addr < TASK_SIZE)
^1da177e Linus Torvalds 2005-04-16 431 return do_page_fault(addr, fsr, regs);
^1da177e Linus Torvalds 2005-04-16 432
5e27fb78 Anfei 2010-06-08 433 if (user_mode(regs))
5e27fb78 Anfei 2010-06-08 434 goto bad_area;
5e27fb78 Anfei 2010-06-08 435
^1da177e Linus Torvalds 2005-04-16 436 index = pgd_index(addr);
^1da177e Linus Torvalds 2005-04-16 437
^1da177e Linus Torvalds 2005-04-16 438 pgd = cpu_get_pgd() + index;
^1da177e Linus Torvalds 2005-04-16 439 pgd_k = init_mm.pgd + index;
^1da177e Linus Torvalds 2005-04-16 440
^1da177e Linus Torvalds 2005-04-16 441 if (pgd_none(*pgd_k))
^1da177e Linus Torvalds 2005-04-16 442 goto bad_area;
^1da177e Linus Torvalds 2005-04-16 443 if (!pgd_present(*pgd))
^1da177e Linus Torvalds 2005-04-16 @444 set_pgd(pgd, *pgd_k);
^1da177e Linus Torvalds 2005-04-16 445
516295e5 Russell King 2010-11-21 446 pud = pud_offset(pgd, addr);
516295e5 Russell King 2010-11-21 447 pud_k = pud_offset(pgd_k, addr);
516295e5 Russell King 2010-11-21 448
516295e5 Russell King 2010-11-21 449 if (pud_none(*pud_k))
516295e5 Russell King 2010-11-21 450 goto bad_area;
516295e5 Russell King 2010-11-21 451 if (!pud_present(*pud))
516295e5 Russell King 2010-11-21 452 set_pud(pud, *pud_k);
:::::: The code at line 444 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 11564 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h
2015-12-15 15:47 ` kbuild test robot
@ 2015-12-15 15:50 ` Arnd Bergmann
2015-12-15 21:57 ` Chen Gang
0 siblings, 1 reply; 9+ messages in thread
From: Arnd Bergmann @ 2015-12-15 15:50 UTC (permalink / raw)
To: kbuild test robot
Cc: Chen Gang, kbuild-all, trivial, Linux-Arch,
linux-kernel@vger.kernel.org
On Tuesday 15 December 2015 23:47:28 kbuild test robot wrote:
> from include/linux/mm.h:55,
> from arch/arm/mm/fault.c:13:
> arch/arm/mm/fault.c: In function 'do_translation_fault':
> >> arch/arm/include/asm/pgtable-2level.h:187:27: error: expected expression before 'do'
> #define set_pud(pud,pudp) do { } while (0)
> ^
> include/asm-generic/pgtable-nopud.h:36:36: note: in expansion of macro 'set_pud'
> #define set_pgd(pgdptr, pgdval) (set_pud((pud_t *)(pgdptr), \
>
This is a result of the added braces, please redo the patch.
Arnd
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h
2015-12-15 15:50 ` Arnd Bergmann
@ 2015-12-15 21:57 ` Chen Gang
0 siblings, 0 replies; 9+ messages in thread
From: Chen Gang @ 2015-12-15 21:57 UTC (permalink / raw)
To: Arnd Bergmann, kbuild test robot
Cc: kbuild-all, trivial, Linux-Arch, linux-kernel@vger.kernel.org
On 12/15/15 23:50, Arnd Bergmann wrote:
> On Tuesday 15 December 2015 23:47:28 kbuild test robot wrote:
>> from include/linux/mm.h:55,
>> from arch/arm/mm/fault.c:13:
>> arch/arm/mm/fault.c: In function 'do_translation_fault':
>>>> arch/arm/include/asm/pgtable-2level.h:187:27: error: expected expression before 'do'
>> #define set_pud(pud,pudp) do { } while (0)
>> ^
>> include/asm-generic/pgtable-nopud.h:36:36: note: in expansion of macro 'set_pud'
>> #define set_pgd(pgdptr, pgdval) (set_pud((pud_t *)(pgdptr), \
>>
>
> This is a result of the added braces, please redo the patch.
>
OK, thanks.
--
Chen Gang (陈刚)
Open, share, and attitude like air, water, and life which God blessed
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h
2015-12-15 14:15 [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h Chen Gang
` (2 preceding siblings ...)
2015-12-15 15:47 ` kbuild test robot
@ 2015-12-15 20:26 ` Joe Perches
2015-12-15 22:06 ` Chen Gang
2015-12-15 20:29 ` kbuild test robot
4 siblings, 1 reply; 9+ messages in thread
From: Joe Perches @ 2015-12-15 20:26 UTC (permalink / raw)
To: Chen Gang, Arnd Bergmann, trivial
Cc: Linux-Arch, linux-kernel@vger.kernel.org
On Tue, 2015-12-15 at 22:15 +0800, Chen Gang wrote:
> It is a trivial patch.
[]
> diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h
[]
> @@ -38,7 +38,8 @@ static inline void pud_clear(pud_t *pud) { }
> * (pmds are folded into puds so this doesn't get actually called,
> * but the define is needed for a generic inline function.)
> */
> -#define set_pud(pudptr, pudval) set_pmd((pmd_t *)(pudptr), (pmd_t) { pudval })
> +#define set_pud(pudptr, pudval) (set_pmd((pmd_t *)(pudptr), \
> + (pmd_t) { pudval }))
Not quite so trivial.
If you _really_ want to break this up for 80 columns,
and I don't think it's necessary, it might be better
to use something like:
#define set_pud(pudptr, pudval) \
set_pmd((pmd_t *)(pudptr), (pmd_t) { pudval })
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h
2015-12-15 20:26 ` Joe Perches
@ 2015-12-15 22:06 ` Chen Gang
0 siblings, 0 replies; 9+ messages in thread
From: Chen Gang @ 2015-12-15 22:06 UTC (permalink / raw)
To: Joe Perches, Arnd Bergmann, trivial
Cc: Linux-Arch, linux-kernel@vger.kernel.org
On 12/16/15 04:26, Joe Perches wrote:
> On Tue, 2015-12-15 at 22:15 +0800, Chen Gang wrote:
>> It is a trivial patch.
> []
>> diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h
> []
>> @@ -38,7 +38,8 @@ static inline void pud_clear(pud_t *pud) { }
>> * (pmds are folded into puds so this doesn't get actually called,
>> * but the define is needed for a generic inline function.)
>> */
>> -#define set_pud(pudptr, pudval) set_pmd((pmd_t *)(pudptr), (pmd_t) { pudval })
>> +#define set_pud(pudptr, pudval) (set_pmd((pmd_t *)(pudptr), \
>> + (pmd_t) { pudval }))
>
> Not quite so trivial.
>
> If you _really_ want to break this up for 80 columns,
> and I don't think it's necessary, it might be better
> to use something like:
>
> #define set_pud(pudptr, pudval) \
> set_pmd((pmd_t *)(pudptr), (pmd_t) { pudval })
>
OK, thanks. For me, it is better.
--
Chen Gang (陈刚)
Open, share, and attitude like air, water, and life which God blessed
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h
2015-12-15 14:15 [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h Chen Gang
` (3 preceding siblings ...)
2015-12-15 20:26 ` Joe Perches
@ 2015-12-15 20:29 ` kbuild test robot
4 siblings, 0 replies; 9+ messages in thread
From: kbuild test robot @ 2015-12-15 20:29 UTC (permalink / raw)
To: Chen Gang
Cc: kbuild-all, Arnd Bergmann, trivial, Linux-Arch,
linux-kernel@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 3388 bytes --]
Hi Chen,
[auto build test ERROR on v4.4-rc5]
[also build test ERROR on next-20151215]
url: https://github.com/0day-ci/linux/commits/Chen-Gang/include-asm-generic-Notice-about-80-columns-in-pgtable-no-h/20151215-221607
config: arm-axm55xx_defconfig (attached as .config)
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm
All errors (new ones prefixed by >>):
In file included from arch/arm/include/asm/pgtable.h:31:0,
from include/linux/mm.h:55,
from arch/arm/mm/fault.c:13:
arch/arm/mm/fault.c: In function 'do_translation_fault':
>> arch/arm/include/asm/pgtable-3level.h:158:2: error: expected expression before 'do'
do { \
^
include/asm-generic/pgtable-nopud.h:36:36: note: in expansion of macro 'set_pud'
#define set_pgd(pgdptr, pgdval) (set_pud((pud_t *)(pgdptr), \
^
arch/arm/mm/fault.c:444:3: note: in expansion of macro 'set_pgd'
set_pgd(pgd, *pgd_k);
^
vim +/do +158 arch/arm/include/asm/pgtable-3level.h
da028779 Catalin Marinas 2011-11-22 142 #define pud_none(pud) (!pud_val(pud))
da028779 Catalin Marinas 2011-11-22 143 #define pud_bad(pud) (!(pud_val(pud) & 2))
da028779 Catalin Marinas 2011-11-22 144 #define pud_present(pud) (pud_val(pud))
cc577c26 Christoffer Dall 2013-01-20 145 #define pmd_table(pmd) ((pmd_val(pmd) & PMD_TYPE_MASK) == \
cc577c26 Christoffer Dall 2013-01-20 146 PMD_TYPE_TABLE)
cc577c26 Christoffer Dall 2013-01-20 147 #define pmd_sect(pmd) ((pmd_val(pmd) & PMD_TYPE_MASK) == \
cc577c26 Christoffer Dall 2013-01-20 148 PMD_TYPE_SECT)
1fd15b87 Russell King 2013-10-23 149 #define pmd_large(pmd) pmd_sect(pmd)
da028779 Catalin Marinas 2011-11-22 150
da028779 Catalin Marinas 2011-11-22 151 #define pud_clear(pudp) \
da028779 Catalin Marinas 2011-11-22 152 do { \
da028779 Catalin Marinas 2011-11-22 153 *pudp = __pud(0); \
da028779 Catalin Marinas 2011-11-22 154 clean_pmd_entry(pudp); \
da028779 Catalin Marinas 2011-11-22 155 } while (0)
da028779 Catalin Marinas 2011-11-22 156
da028779 Catalin Marinas 2011-11-22 157 #define set_pud(pudp, pud) \
da028779 Catalin Marinas 2011-11-22 @158 do { \
da028779 Catalin Marinas 2011-11-22 159 *pudp = pud; \
da028779 Catalin Marinas 2011-11-22 160 flush_pmd_entry(pudp); \
da028779 Catalin Marinas 2011-11-22 161 } while (0)
da028779 Catalin Marinas 2011-11-22 162
da028779 Catalin Marinas 2011-11-22 163 static inline pmd_t *pud_page_vaddr(pud_t pud)
da028779 Catalin Marinas 2011-11-22 164 {
da028779 Catalin Marinas 2011-11-22 165 return __va(pud_val(pud) & PHYS_MASK & (s32)PAGE_MASK);
da028779 Catalin Marinas 2011-11-22 166 }
:::::: The code at line 158 was first introduced by commit
:::::: da02877987e6e173ebba137d4e1e155e1f1151cd ARM: LPAE: Page table maintenance for the 3-level format
:::::: TO: Catalin Marinas <catalin.marinas@arm.com>
:::::: CC: Catalin Marinas <catalin.marinas@arm.com>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 18491 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread