[PATCH] x86/mm: Fix copy&paste error in comments

2021-04-19 Thread Cao jin
Direct page mapping in bottom-up way will allocate memory from low address for page structures in a range, which is the *bottom*, not the *end*. Signed-off-by: Cao jin --- arch/x86/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/mm/init.c b/arch/x86/mm

[tip: x86/cleanups] x86/setup: Remove unused RESERVE_BRK_ARRAY()

2021-03-11 Thread tip-bot2 for Cao jin
The following commit has been merged into the x86/cleanups branch of tip: Commit-ID: 81519f778830d1ab02274eeaaeab6797fdc4ec52 Gitweb: https://git.kernel.org/tip/81519f778830d1ab02274eeaaeab6797fdc4ec52 Author:Cao jin AuthorDate:Thu, 11 Mar 2021 16:39:19 +08:00 Committer

[PATCH] bootconfig: Update prototype of setup_boot_config()

2021-03-11 Thread Cao jin
Parameter "cmdline" has no use, drop it. Signed-off-by: Cao jin --- init/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init/main.c b/init/main.c index c68d784376ca..621a11ed18fb 100644 --- a/init/main.c +++ b/init/main.c @@ -404,7 +404,7 @@ static

[PATCH] x86/brk: Drop RESERVE_BRK_ARRAY()

2021-03-11 Thread Cao jin
Since a13f2ef168cb ("x86/xen: remove 32-bit Xen PV guest support"), RESERVE_BRK_ARRAY() has no user anymore, let's drop it. Update related comments too. Signed-off-by: Cao jin --- arch/x86/include/asm/setup.h | 5 - arch/x86/kernel/setup.c | 6 +++--- 2 files change

[PATCH] Documentation/x86/boot.rst: Correct the example of SETUP_INDIRECT

2021-01-27 Thread Cao jin
struct setup_data.len is the length of data field. In case of SETUP_INDIRECT, it should be sizeof(setup_indirect). Signed-off-by: Cao jin --- Documentation/x86/boot.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/x86/boot.rst b/Documentation/x86/boot.rst

[RFC PATCH] Documentation/x86/boot.rst: minor languge improvement

2020-09-22 Thread Cao jin
Suggested-by: H. Peter Anvin Signed-off-by: Cao jin --- for 64-bit protocol, setup data still needs to be mapped, as there is operation on it in extract_kernel(), like: sanitize_boot_params(boot_params); initrd doesn't need to be mapped, which is also what KASLR does i

Re: [PATCH] Documentation/x86/boot.rst: minor improvement

2020-08-31 Thread Cao jin
On 9/1/20 1:35 PM, H. Peter Anvin wrote: > If you are going to fix the language... > > On 2020-08-31 22:25, Cao jin wrote: >> Sorry, I mis-copied 2 addresses. make sure they are CCed. >> >> On 9/1/20 11:41 AM, Cao jin wrote: >>> Typo fix & file name update

Re: [PATCH] Documentation/x86/boot.rst: minor improvement

2020-08-31 Thread Cao jin
Sorry, I mis-copied 2 addresses. make sure they are CCed. On 9/1/20 11:41 AM, Cao jin wrote: > Typo fix & file name update > > Signed-off-by: Cao jin > --- > Documentation/x86/boot.rst | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/

[PATCH] Documentation/x86/boot.rst: minor improvement

2020-08-31 Thread Cao jin
Typo fix & file name update Signed-off-by: Cao jin --- Documentation/x86/boot.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/x86/boot.rst b/Documentation/x86/boot.rst index 7fafc7ac00d7..c04afec90486 100644 --- a/Documentation/x86/boot.rst +

Re: [PATCH v2] perf: fix compilation failure on i386

2020-05-07 Thread Cao jin
BTW, this is reported by kernel test robot , so please help to add: Reported-by: kernel test robot when it got merged. -- Sincerely, Cao jin On 5/1/20 4:25 PM, Cao jin wrote: > Compilation on i386 complains as following: > > util/session.c: In

[PATCH v2] perf: fix compilation failure on i386

2020-05-01 Thread Cao jin
aka unsigned int}' [-Werror=format=] pr_err("failed to decompress (B): %ld -> %ld, dst_size %ld : %s\n", ^ Fix them by pairing "%zd" to size_t. Also revert an unnecessary conversion: "(long)src_size" to plain "src_size" with conversion spec

Re: [PATCH] perf: fix compilation failure on i386

2020-05-01 Thread Cao jin
Sorry, the commit message isn't accurate. v2 coming. -- Sincerely, Cao jin On 5/1/20 4:15 PM, Cao jin wrote: > Compilation on i386 complains as following: > > util/session.c: In function 'perf_session__process_compressed_event': > util/session.c:91:11: error: forma

[PATCH] perf: fix compilation failure on i386

2020-05-01 Thread Cao jin
x27;, but argument 4 has type 'long int' [-Werror=format=] pr_err("failed to compress %zd bytes: %s\n", ^ Fix them by pairing "%zd" to size_t. Signed-off-by: Cao jin --- tools/perf/util/session.c | 2 +- tools/perf/util/zstd.c| 6 +++--- 2 files ch

Re: [RFC PATCH] x86/doc/boot_protocol: Correct the description of "reloc"

2019-09-26 Thread Cao jin
On 9/26/19 2:01 PM, Ingo Molnar wrote: > * Cao jin wrote: > >> The fields marked with (reloc) actually are not dedicated for writing, >> but communicating info for relocatable kernel with boot loaders. For >> example: >> >>

[PATCH] mm/memblock: cleanup doc

2019-09-12 Thread Cao jin
fix typos for: elaboarte -> elaborate architecure -> architecture compltes -> completes And, convert the markup :c:func:`foo` to foo() as kernel documentation toolchain can recognize foo() as a function. Suggested-by: Mike Rapoport Signed-off-by: Cao jin --- mm/memblo

Re: [PATCH] mm/memblock: fix typo in memblock doc

2019-09-12 Thread Cao jin
On 9/12/19 6:35 PM, Mike Rapoport wrote: > On Thu, Sep 12, 2019 at 10:54:09AM +0800, Cao jin wrote: >> On 9/11/19 10:42 PM, Mike Rapoport wrote: >> >> Sure. BTW, do you want convert all the markups too? >> >> :c:type:`foo` -> struct foo >> %FOO

Re: [PATCH] mm/memblock: fix typo in memblock doc

2019-09-11 Thread Cao jin
On 9/11/19 10:42 PM, Mike Rapoport wrote: > On Wed, Sep 11, 2019 at 11:08:56AM +0800, Cao jin wrote: >> elaboarte -> elaborate >> architecure -> architecture >> compltes -> completes >> >> Signed-off-by: Cao jin >> --- >> mm/memblock.c | 6 +

[PATCH] mm/memblock: fix typo in memblock doc

2019-09-10 Thread Cao jin
elaboarte -> elaborate architecure -> architecture compltes -> completes Signed-off-by: Cao jin --- mm/memblock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/memblock.c b/mm/memblock.c index 7d4f61ae666a..0d0f92003d18 100644 --- a/mm/memblock.c

Re: [PATCH] x86/cpufeature: explicit comments for duplicate macro

2019-08-28 Thread Cao jin
On 8/28/19 2:42 PM, Borislav Petkov wrote: > On Wed, Aug 28, 2019 at 02:11:00PM +0800, Cao jin wrote: > > For the future: > >> Subject: Re: [PATCH] x86/cpufeature: explicit comments for duplicate macro > > your subject needs to have a verb and start with a capital lett

[tip: x86/cleanups] x86/cpufeature: Explain the macro duplication

2019-08-27 Thread tip-bot2 for Cao Jin
The following commit has been merged into the x86/cleanups branch of tip: Commit-ID: cbb1133b563a63901cf778220eb17e3ff1425aed Gitweb: https://git.kernel.org/tip/cbb1133b563a63901cf778220eb17e3ff1425aed Author:Cao Jin AuthorDate:Wed, 28 Aug 2019 14:11:00 +08:00 Committer

[PATCH] x86/cpufeature: explicit comments for duplicate macro

2019-08-27 Thread Cao jin
Help people to understand the author's intent of apparent duplication of BUILD_BUG_ON_ZERO(NCAPINTS != n), which is hard to detect by eyes. CC: Dave Hansen Suggested-by: Borislav Petkov Signed-off-by: Cao jin --- Tried my best to describe it accurately, in case of any inaccuracy, feel fr

Re: [PATCH] x86/cpufeature: drop *_MASK_CEHCK

2019-08-27 Thread Cao jin
bugs from missing a case. > So, Cao, I wouldn't mind having the gist of that above somewhere around > there in a comment explicitly. > A subtle issue hard to detect by eyes. Sure, on the way. -- Sincerely, Cao jin

[PATCH] x86/cpufeature: drop *_MASK_CEHCK

2019-08-27 Thread Cao jin
They are wrappers of BUILD_BUG_ON_ZERO(NCAPINTS != n), which is already present in corresponding *_MASK_BIT_SET. And fill the missing period in head comments by the way. Signed-off-by: Cao jin --- arch/x86/include/asm/cpufeature.h| 2 -- arch/x86/include/asm/disabled-features.h | 1

[tip: x86/mm] x86/fixmap: Cleanup outdated comments

2019-08-22 Thread tip-bot2 for Cao jin
The following commit has been merged into the x86/mm branch of tip: Commit-ID: c84b82dd3e593db217f23c60f7edae02c76a3c4c Gitweb: https://git.kernel.org/tip/c84b82dd3e593db217f23c60f7edae02c76a3c4c Author:Cao jin AuthorDate:Fri, 09 Aug 2019 19:46:12 +08:00 Committer

Re: [PATCH] x86/fixmap: update stale comments

2019-08-14 Thread Cao jin
Hi, Wish to know whether the patch make sense. On 8/9/19 7:46 PM, Cao jin wrote: > Signed-off-by: Cao jin > --- > arch/x86/include/asm/fixmap.h | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/as

[PATCH] x86/fixmap: update stale comments

2019-08-09 Thread Cao jin
Signed-off-by: Cao jin --- arch/x86/include/asm/fixmap.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h index 9da8cccdf3fb..0c47aa82e2e2 100644 --- a/arch/x86/include/asm/fixmap.h +++ b/arch/x86/include/asm

Re: [PATCH] x86/irq/64: fix the missing update on comment

2019-07-22 Thread Cao jin
On 7/22/19 4:53 PM, Thomas Gleixner wrote: > Cao, > > On Fri, 19 Jul 2019, Cao jin wrote: > >> Commit e6401c130931 ("x86/irq/64: Split the IRQ stack into its own pages") >> missed to update one piece of comment as it did to its peer in Xen, which >> wi

[tip:x86/urgent] x86/irq/64: Update stale comment

2019-07-22 Thread tip-bot for Cao jin
Commit-ID: 385065734cd417b9d7739b2ebb62c960aeb3ccb5 Gitweb: https://git.kernel.org/tip/385065734cd417b9d7739b2ebb62c960aeb3ccb5 Author: Cao jin AuthorDate: Fri, 19 Jul 2019 16:16:35 +0800 Committer: Thomas Gleixner CommitDate: Mon, 22 Jul 2019 10:54:27 +0200 x86/irq/64: Update stale

[PATCH] x86/irq/64: fix the missing update on comment

2019-07-19 Thread Cao jin
Commit e6401c130931 ("x86/irq/64: Split the IRQ stack into its own pages") missed to update one piece of comment as it did to its peer in Xen, which will confuse people who still need to read comment. A bonus fix to identation in ZO's linker script: spaces -> tab. Sign

[RFC PATCH] fcntl header: drop duplicate O_NDELAY

2019-04-02 Thread Cao jin
drop it from VALID_OPEN_FLAGS. Signed-off-by: Cao jin --- include/linux/fcntl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h index d019df946cb2..8a2ca434be6d 100644 --- a/include/linux/fcntl.h +++ b/include/linux/fcntl.h

Re: [PATCH] x86/boot: minor improvement in kaslr

2019-02-12 Thread Cao jin
On 2/1/19 4:20 PM, Kees Cook wrote: > On Fri, Feb 1, 2019 at 6:51 PM Cao jin wrote: >> >> comments fix: input_size is ZO image size which just don't count .bss >> in, but has .text, .data, etc; >> drop unecessary alignment: minimum is either 512M or output, b

Re: [PATCH] x86/boot: comments cleanup & indentation fix

2019-02-12 Thread Cao jin
On 1/4/19 8:04 PM, Cao jin wrote: > No real code modification, just cleanup: > 1. remove redundant comments which have already appeared above > 2. comments improvement: > "aligned to a 2M boundary" > --> > "aligned up to CONFIG_PHYSICAL_ALIGN

Re: [PATCH] x86/boot: minor improvement in kaslr

2019-02-01 Thread Cao jin
On 2/1/19 4:20 PM, Kees Cook wrote: > On Fri, Feb 1, 2019 at 6:51 PM Cao jin wrote: >> >> comments fix: input_size is ZO image size which just don't count .bss >> in, but has .text, .data, etc; >> drop unecessary alignment: minimum is either 512M or output, b

[PATCH] x86/boot: minor improvement in kaslr

2019-01-31 Thread Cao jin
comments fix: input_size is ZO image size which just don't count .bss in, but has .text, .data, etc; drop unecessary alignment: minimum is either 512M or output, both are CONFIG_PHYSICAL_ALIGN aligned(output is aligned in head_32/64.S). But mention it in earlier comments. Signed-off-by: Ca

Re: [PATCH] x86/boot: comments cleanup & indentation fix

2019-01-29 Thread Cao jin
Hi, Is the patch not right? -- Sincerely, Cao jin On 1/4/19 8:04 PM, Cao jin wrote: > No real code modification, just cleanup: > 1. remove redundant comments which have already appeared above > 2. comments improvement: > "aligned to a 2M boundary" > -

[tip:x86/cleanups] x86/boot: Save several bytes in decompressor

2019-01-29 Thread tip-bot for Cao jin
Commit-ID: 0a278662f53159354a0391a17741a20db736256a Gitweb: https://git.kernel.org/tip/0a278662f53159354a0391a17741a20db736256a Author: Cao jin AuthorDate: Wed, 23 Jan 2019 18:00:14 +0800 Committer: Thomas Gleixner CommitDate: Tue, 29 Jan 2019 22:09:12 +0100 x86/boot: Save several

[PATCH] x86/boot: save several bytes in decompressor

2019-01-23 Thread Cao jin
gdt64 represents the content of GDTR under x86-64, which actually needs 10 bytes only, ".long" & ".word" is superfluous. Signed-off-by: Cao jin --- arch/x86/boot/compressed/head_64.S | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/x86/boot/compressed/he

minimal version requirement for ld

2019-01-23 Thread Cao jin
to make target 'include/config/auto.conf', needed by 'include/config/kernel.release'. Stop. Any idea on this problem? Or anyone has ever tried ld 2.20 successfully? -- Sincerely, Cao jin

Re: question about head_64.S

2019-01-22 Thread Cao jin
On 1/22/19 9:08 PM, Kirill A. Shutemov wrote: > On Tue, Jan 22, 2019 at 03:31:25PM +0800, Cao jin wrote: >> Hi, Kirll, >> >>> 2. >>> Why gdt64 has following definition?: >>> >>> gdt64: >>> .word gdt_end - gdt >>> .

Re: question about head_64.S

2019-01-21 Thread Cao jin
Hi, Kirll, On 1/15/19 7:45 PM, Cao jin wrote: > Hi, > I have been digging into this file for a while, and I still have 2 > questions unclear, hope to get your help. > > > 2. > Why gdt64 has following definition?: > > gdt64: > .word gdt_end - gdt >

Re: question about head_64.S

2019-01-16 Thread Cao jin
On 1/15/19 11:55 PM, Thomas Gleixner wrote: > On Tue, 15 Jan 2019, Cao jin wrote: > >> Hi, >> I have been digging into this file for a while, and I still have 2 >> questions unclear, hope to get your help. >> >> 1. >> At the entry of startup_64,

question about head_64.S

2019-01-15 Thread Cao jin
.word gdt_end - gdt .quad 0 With above modification, it can boot. -- Sincerely, Cao jin

Re: [PATCH] x86/boot: drop memset from copy.S

2019-01-10 Thread Cao jin
On 1/8/19 4:46 PM, Cao jin wrote: > One more question: in compressed/, for mem*(), it seems we both use the > macros of boot/string.h, and the functions of compressed/string.c. Is > that what we want? > > compressed/ is compiled with -O2, so it cannot be told by objdump -d, >

Re: [PATCH] x86/boot: drop memset from copy.S

2019-01-10 Thread Cao jin
Hello HPA, On 1/8/19 4:38 PM, h...@zytor.com wrote: > On January 7, 2019 12:52:57 AM PST, Cao jin wrote: >> Hi, >> >> On 1/7/19 3:59 PM, h...@zytor.com wrote: >>> On January 6, 2019 11:40:56 PM PST, Cao jin >> wrote: >>>> According to objdump

Re: [PATCH] x86/boot: drop memset from copy.S

2019-01-08 Thread Cao jin
ciate it someone can leave a hint. -- Sincerely, Cao jin On 1/7/19 3:40 PM, Cao jin wrote: > According to objdump output of setup, function memset is not used in > setup code. Currently, all usage of memset in setup come from macro > definition of string.h. > > Signed-off-by: Cao j

Re: [PATCH] x86/boot: drop memset from copy.S

2019-01-07 Thread Cao jin
Hi, On 1/7/19 3:59 PM, h...@zytor.com wrote: > On January 6, 2019 11:40:56 PM PST, Cao jin wrote: >> According to objdump output of setup, function memset is not used in >> setup code. Currently, all usage of memset in setup come from macro >> definition of string.h. >>

[PATCH] x86/boot: drop memset from copy.S

2019-01-06 Thread Cao jin
According to objdump output of setup, function memset is not used in setup code. Currently, all usage of memset in setup come from macro definition of string.h. Signed-off-by: Cao jin --- Compiled and booted under x86_64; compiled under i386. Questions: now there is 2 definition of memcpy, one

[PATCH] x86/boot: comments cleanup & indentation fix

2019-01-04 Thread Cao jin
indentation fix in linker script: spaces -> tab Signed-off-by: Cao jin --- arch/x86/boot/compressed/head_64.S | 13 + arch/x86/boot/compressed/vmlinux.lds.S | 4 ++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/arch/x86/boot/compressed/head_64.S b/arch/

question about reserve_bios_regions

2019-01-03 Thread Cao jin
21216a8: ("x86/boot: Reorganize and clean up the BIOS area reservation code"), still no clue. -- Sincerely, Cao jin

Re: [PATCH] x86/mkpiggy: Drop endianness transforming

2018-11-10 Thread Cao jin
On 11/9/18 9:00 PM, Thomas Gleixner wrote: > Cao, > > On Fri, 9 Nov 2018, Cao jin wrote: > >> gzip file has 4-byte little-endian file size encoded at the end of file, >> while all the other compressed kernel file has size_append operation in >> the Makefile which

[PATCH] x86/mkpiggy: Drop endianness transforming

2018-11-09 Thread Cao jin
gzip file has 4-byte little-endian file size encoded at the end of file, while all the other compressed kernel file has size_append operation in the Makefile which also append the 4-byte little-endian file size. There is no need to do endianness transforming by mkpiggy. Signed-off-by: Cao jin

Re: kconfig usage in automatic kernel test

2018-07-10 Thread Cao jin
On 07/08/2018 10:15 AM, Masahiro Yamada wrote: > 2018-07-06 17:49 GMT+09:00 Cao jin : >> Masahiro-san, >> >> I am writing some utility for internal kdump test with latest kernel, >> my purpose is to test the new introduced kernel feature. For automatical >>

Re: [PATCH] kbuild: document the KBUILD_KCONFIG env. variable

2018-07-06 Thread Cao jin
e in kbuild, so, Acked-by: Cao jin -- Sincerely, Cao jin > --- > Documentation/kbuild/kbuild.txt |5 + > 1 file changed, 5 insertions(+) > > --- lnx-418-rc3.orig/Documentation/kbuild/kbuild.txt > +++ lnx-418-rc3/Documentation/kbuild/kbuild.txt &g

kconfig usage in automatic kernel test

2018-07-06 Thread Cao jin
be used in olddefconfig. All these things let me have 2 questions: 1. What would you suggest for my purpose? 2. allyesconfig, allmodconfig, randconfig seems useful for test kbuild, but what's the purpose of allnoconfig, alldefconfig? In others words, when people would need allnoconfig, alldefconfig? -- Sincerely, Cao jin

Re: [PATCH] x86/tools/relocs: comments cleanup

2018-04-15 Thread Cao jin
ping? On 03/05/2018 03:15 PM, Cao jin wrote: > 1. typo fix: there -> their > 2. remove superfluous "by" > > Signed-off-by: Cao jin > --- > arch/x86/tools/relocs.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/

[tip:x86/build] x86/build: Don't pass in -D__KERNEL__ multiple times

2018-03-31 Thread tip-bot for Cao jin
Commit-ID: d6289f36aa7d5893d091a7a0c67eee7798719f03 Gitweb: https://git.kernel.org/tip/d6289f36aa7d5893d091a7a0c67eee7798719f03 Author: Cao jin AuthorDate: Fri, 16 Mar 2018 16:49:44 +0800 Committer: Ingo Molnar CommitDate: Sat, 31 Mar 2018 08:02:07 +0200 x86/build: Don't pa

Re: [PATCH] x86/build: drop a superfluous macro

2018-03-28 Thread Cao jin
ping? On 03/16/2018 04:49 PM, Cao jin wrote: > Some ..cmd files under arch/x86 report -D__KERNEL__ appears two > times in the command line, like arch/x86/boot, arch/x86/realmode/rm. > It is already defined in KBUILD_CPPFLAGS from top Makefile. so it can be > dropped saftely from the

Re: questions about header.S

2018-03-21 Thread Cao jin
Thanks very much for you hint! On 03/21/2018 05:57 PM, Thomas Gleixner wrote: > On Wed, 21 Mar 2018, Cao jin wrote: >> On 03/17/2018 06:01 PM, Cao jin wrote: >>>   I find two small questions which confuse me a little. >>> >>> 1. >>> # Check signature a

Re: questions about header.S

2018-03-21 Thread Cao jin
Dear Maintainers,   Could you help to give a hint?   Thanks in advance. -- Sincerely, Cao jin On 03/17/2018 06:01 PM, Cao jin wrote: > Hi, > >   I find two small questions which confuse me a little. > > 1. > # Check signature at end of setup >cmpl$

questions about header.S

2018-03-17 Thread Cao jin
n my test, replace the 2nd line with: movw$_end, %cx or: movw$__bss_end+3, %cx are both fine. -- Sincerely, Cao jin

[PATCH] x86/build: drop a superfluous macro

2018-03-16 Thread Cao jin
Some ..cmd files under arch/x86 report -D__KERNEL__ appears two times in the command line, like arch/x86/boot, arch/x86/realmode/rm. It is already defined in KBUILD_CPPFLAGS from top Makefile. so it can be dropped saftely from these Makefiles. Signed-off-by: Cao jin --- arch/x86/Makefile

Re: [PATCH 0/5] kbuild: always define KBUILD_MODNAME, and clean-up/fix modname

2018-03-08 Thread Cao jin
The series build successfully on upstream in my: make allyesconfig and allmodconfig, so, Tested-by: Cao jin -- Sincerely, Cao jin On 03/08/2018 09:04 AM, Masahiro Yamada wrote: > > 3/5 takes into account '-m' case for multi-used-m. > > 2/5 is necessary beforehand bec

Re: [PATCH 5/5] kbuild: move modname and modname-multi close to modname_flags

2018-03-08 Thread Cao jin
On 03/08/2018 09:05 AM, Masahiro Yamada wrote: > Just a cosmetic change to put related code close together. > > Signed-off-by: Masahiro Yamada Reviewed-by: Cao jin -- Sincerely, Cao jin

Re: [PATCH 4/5] kbuild: simplify modname calculation

2018-03-08 Thread Cao jin
$(multi-objs-y)) > -multi-objs-m := $(addprefix $(obj)/,$(multi-objs-m)) > subdir-ym:= $(addprefix $(obj)/,$(subdir-ym)) > > # These flags are needed for modversions and compiling, so we define them > here > multi-objs-y/m seems only exist for rules above with target-specific variable assignment. A great simplification, So Reviewed-by: Cao jin -- Sincerely, Cao jin

Re: [PATCH 2/5] kbuild: define KBUILD_MODNAME even if multiple modules share objects

2018-03-08 Thread Cao jin
Masahiro-san On 03/08/2018 06:21 PM, Masahiro Yamada wrote: > 2018-03-08 19:11 GMT+09:00 Cao jin : >> >> >> On 03/08/2018 09:05 AM, Masahiro Yamada wrote: >>> Currently, KBUILD_MODNAME is defined only when $(modname) contains >>> just one word. If an

Re: [PATCH 1/5] kbuild: remove unnecessary $(subst $(obj)/,,...) in modname-multi

2018-03-08 Thread Cao jin
dependency of composite objects > # Usage: > A subtle catch! And in my test, a debug line     $(info $@ = $*) in rule:     $(obj)/%.o: $(src)/%.c xxx does tell me it is correct. So, Reviewed-by: Cao jin -- Sincerely, Cao jin

Re: [PATCH 2/5] kbuild: define KBUILD_MODNAME even if multiple modules share objects

2018-03-08 Thread Cao jin
eed to be modified above this code hunk: Note: Files that end up in two or more modules are compiled without the    KBUILD_MODNAME definition. The reason is that any made-up name       would differ in different configs. -- Sincerely, Cao jin

[PATCH] x86/tools/relocs: comments cleanup

2018-03-04 Thread Cao jin
1. typo fix: there -> their 2. remove superfluous "by" Signed-off-by: Cao jin --- arch/x86/tools/relocs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c index 5d73c443e778..fcf3fad01b08 100644 --- a/a

[PATCH] kbuild/kallsyms: trivial typo fix

2018-02-27 Thread Cao jin
Signed-off-by: Cao jin --- I guess this belongs to kbuild though get_maintainer.pl doesn't tell me that. scripts/kallsyms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index 9ee9bf7fd1a2..65792650c630 100644 --- a/sc

[PATCH RFC] kbuild: drop superfluous GCC_PLUGINS_CFLAGS assignment

2018-02-20 Thread Cao jin
GCC_PLUGINS_CFLAGS is already in the environment, so it is superfluous to add it in commanline of final build of init/ Signed-off-by: Cao jin --- This is only tested with Randomizing Structure Layout plugin. The test method is not so grace but I think it can prove the correctness of this patch

Re: why scripts/link-vmlinux.sh has a final build of init/

2018-02-20 Thread Cao jin
Sorry for late. On 02/14/2018 07:31 PM, Masahiro Yamada wrote: > 2018-02-13 16:08 GMT+09:00 Cao jin : > >> BTW, I still have 2 questions. >> >> 1. In final build, why need >> >>GCC_PLUGINS_CFLAGS="${GCC_PLUGINS_CFLAGS}" >> >> D

[tip:x86/build] x86/build: Drop superfluous ALIGN from the linker script

2018-02-13 Thread tip-bot for Cao jin
Commit-ID: a06cc94f3f8dfab74fe7fac3a6e9f15d77566d00 Gitweb: https://git.kernel.org/tip/a06cc94f3f8dfab74fe7fac3a6e9f15d77566d00 Author: Cao jin AuthorDate: Thu, 8 Feb 2018 14:38:57 +0800 Committer: Ingo Molnar CommitDate: Tue, 13 Feb 2018 13:08:46 +0100 x86/build: Drop superfluous

Re: why scripts/link-vmlinux.sh has a final build of init/

2018-02-12 Thread Cao jin
On 02/12/2018 10:48 PM, Masahiro Yamada wrote: > 2018-02-12 13:22 GMT+09:00 Cao jin : >> Hi Masahiro-san, >> >> As I remember, init/ is already built during recursive make, and I did >> a clean build(make mrproper, make localmodconfig) with all plugins >>

why scripts/link-vmlinux.sh has a final build of init/

2018-02-11 Thread Cao jin
uot;${srctree}/scripts/Makefile.build" obj=init GCC_PLUGINS_CFLAGS="${GCC_PLUGINS_CFLAGS}" - archive_builtin #link vmlinux.o -- Sincerely, Cao jin

[PATCH] x86/linker script: drop superfluous ALIGN

2018-02-07 Thread Cao jin
ALIGN(8) is superfluous since macro TEXT_TEXT already has one. bonus: indentation fix, spaces -> tab. Signed-off-by: Cao jin --- arch/x86/kernel/vmlinux.lds.S | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.ld

[PATCH] trivial: typofix in vmlinux.lds.h

2018-01-31 Thread Cao jin
aling --> aligned Signed-off-by: Cao jin --- include/asm-generic/vmlinux.lds.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index ee8b707d9fa9..470c41d2e272 100644 --- a/include/asm-gene

[PATCH] kbuild/gcc-plugin: drop randomize_layout_hash.h from targets

2018-01-30 Thread Cao jin
randomize_layout_hash.h is not used in plugin compilation, but locates in include/generated/ Signed-off-by: Cao jin --- scripts/gcc-plugins/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gcc-plugins/Makefile b/scripts/gcc-plugins/Makefile index e2ff425f4c7e

A problem met when using crash with randomized kernel

2018-01-26 Thread Cao jin
gcc maintainer[*] that it is a problem of the plugin, not gcc [*]https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84052 So, could you confirm it is plugin bug or not? -- Sincerely, Cao jin

Re: [PATCH] Document: typo fix in mm.txt

2018-01-14 Thread Cao jin
Finally know why I have this wrong understanding according to private discussion. Sorry for the noise -- Sincerely, Cao jin On 01/15/2018 11:36 AM, Cao jin wrote: > Signed-off-by: Cao jin > --- > Documentation/x86/x86_64/mm.txt | 2 +- > 1 file changed, 1 insertion(+)

[PATCH] Document: typo fix in mm.txt

2018-01-14 Thread Cao jin
Signed-off-by: Cao jin --- Documentation/x86/x86_64/mm.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/x86/x86_64/mm.txt b/Documentation/x86/x86_64/mm.txt index ea91cb61a602..8d09b6e5eb3f 100644 --- a/Documentation/x86/x86_64/mm.txt +++ b/Documentation/x86

Re: [PATCH RFC] kbuild: improvement in Makefile.modbuiltin

2017-11-20 Thread Cao jin
On 11/18/2017 07:23 PM, Cao jin wrote: > Drop unnecessary "__subdir-Y" and `cat /dev/null` > > Signed-off-by: Cao jin > --- > Don't know why they exist, but a simple build is fine without them > in my test > > scripts/Makefile.modbuiltin | 5 ++--

[PATCH RFC] kbuild: improvement in Makefile.modbuiltin

2017-11-18 Thread Cao jin
Drop unnecessary "__subdir-Y" and `cat /dev/null` Signed-off-by: Cao jin --- Don't know why they exist, but a simple build is fine without them in my test scripts/Makefile.modbuiltin | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/Makefile.modbu

Re: [PATCH] kbuild: define KBUILD_MODNAME even if multiple modules share objects

2017-11-16 Thread Cao jin
name)),$(basetarget),$(modname))) > > orig_c_flags = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \ > $(ccflags-y) $(CFLAGS_$(basetarget).o) > I like this style of the refactor, because it is a bit more readable according to human mind,  and it also behave the same as before in the case drivers/net/ethernet/cavium/liquidio/Makefile: modname = $(basetarget). So: Tested-by: Cao jin Reviewed-by: Cao jin -- Sincerely, Cao jin

Re: [PATCH v2] kbuild: comments correction & update on Makefile.host

2017-11-14 Thread Cao jin
Masahiro-san, On 11/14/2017 06:31 PM, Masahiro Yamada wrote: > Hi Cao, > > 2017-11-01 10:43 GMT+09:00 Cao jin : >> >> # C code >> -# Executables compiled from a single .c file >> +# C Executables compiled from a single .c file > > > Is anything w

Re: [PATCH v2] kbuild: comments correction & update on Makefile.host

2017-11-13 Thread Cao jin
I guess maybe this trivial one is forgot:) So, a friendly ping. On 11/01/2017 09:43 AM, Cao jin wrote: > host-cmulti means the composite host program that is compiled/linked > from several .c file, not .o file, because .o file could also be > compiled from .cpp file. > > Bonus: u

[PATCH] kbuild: fixes in Makefile.lib

2017-11-13 Thread Cao jin
Commit cf4f21938e13 ("kbuild: Allow to specify composite modules with modname-m") added modname-m support, but missed to update the corresponding multi-objs-m & modname-multi definition. Signed-off-by: Cao jin --- Addressed the all comments of Masahiro-san from RFC version,

Re: [PATCH RFC] kbuild: fixes in Makefile.lib

2017-11-13 Thread Cao jin
ion 'foreach': > missing ')'. Stop. > > > Please test your patch before submitting. > Sorry for my mistake,I missed to test the patch this time incredibly:( > Assuming the build error will be fixed, this change is correct. > > > > > Also, modname-multi should be fixed. > > modname-multi = $(sort $(foreach m,$(multi-used),\ > $(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) > $($(m:.o=-y)) $($(m:.o=-m))),$(m:.o= > Yes, I also noticed here, but fail to remember it:( Thanks very much, Masahiro-san! -- Sincerely, Cao jin

Re: [PATCH 4/4] kbuild: optimize object directory creation for incremental build

2017-11-10 Thread Cao jin
-out . $(exist-dirs), $(obj-dirs))) First I am not sure if the dot "." here is necessary, because I guess kbuild always descend into subdir do recursive make, so, very $(cmd_files) should have at least 1 level dir. Second, Assuming that "." probably exists, would it be "

Re: [PATCH 3/4] kbuild: create object directories simpler and faster

2017-11-10 Thread Cao jin
irs := $(sort $(obj) $(patsubst %/,%, $(dir $(targets > +$(shell mkdir -p $(obj-dirs)) > +endif > + I just take a quick glance: is "$(obj)" here necessary? I think all $(targets) are under directory $(obj) when we descend into $(obj) to recursive make, if I don't miss

[PATCH RFC] kbuild: fixes in Makefile.lib

2017-11-09 Thread Cao jin
ept that the subdirs are totally identical between obj-y and obj-m, or else I think it will miss something. But until now, no one has complaining about it, so I guess it just no one has triggerred it. Signed-off-by: Cao jin --- I found these 2 points which I think might be wrong during code inspe

[PATCH v2] kbuild: comments correction & update on Makefile.host

2017-10-31 Thread Cao jin
host-cmulti means the composite host program that is compiled/linked from several .c file, not .o file, because .o file could also be compiled from .cpp file. Bonus: update the stale comment. Signed-off-by: Cao jin --- scripts/Makefile.host | 6 +++--- 1 file changed, 3 insertions(+), 3

Re: [PATCH] kbuild: comments correction & update

2017-10-31 Thread Cao jin
On 11/01/2017 09:31 AM, Cao jin wrote: > host-cmulti means the composite host program that is compiled/linked > from several .c file, not .o file, because .o file could also be > compiled from .cpp file. > > Bonus: update the stale comment. > Signed-off-by: Cao jin

[PATCH] kbuild: comments correction & update

2017-10-31 Thread Cao jin
host-cmulti means the composite host program that is compiled/linked from several .c file, not .o file, because .o file could also be compiled from .cpp file. Bonus: update the stale comment. Signed-off-by: Cao jin --- scripts/Makefile.host | 6 +++--- 1 file changed, 3 insertions(+), 3

[PATCH] kbuild doc: a bundle of fixes on makefiles.txt

2017-10-18 Thread Cao jin
It does several fixes: 1. move the displaced ld example to its reasonale place. 2. add new example for command gzip. 3. fix 2 number errors. 4. fix format of chapter 7.x, make it looks the same as other chapters. Signed-off-by: Cao jin --- Documentation/kbuild/makefiles.txt | 31

Re: [PATCH] kbuild: remove KBUILD_SUBDIR_ASFLAGS and KBUILD_SUBDIR_CCFLAGS

2017-10-11 Thread Cao jin
$(basetarget).o) > _a_flags = $(filter-out $(AFLAGS_REMOVE_$(basetarget).o), > $(orig_a_flags)) > _cpp_flags = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F)) > I also think the KBUILD_SUBDIR_{AS,CC}FLAGS is unnecessary when I came to this part. So FWIW: Reviewed-by: Cao jin -- Sincerely, Cao jin

[PATCH 3/3] hexagon/kbuild: replace CFLAGS_MODULE with KBUILD_CFLAGS_MODULE

2017-10-09 Thread Cao jin
As kbuild document & commit 6588169d51 says: KBUILD_CFLAGS_MODULE is used to add arch-specific options for $(CC). From commandline, CFLAGS_MODULE shall be used. Doesn't have any functional change, but just follow kbuild rules. Signed-off-by: Cao jin CC: Richard Kuo CC: l

[PATCH 1/3] arm/kbuild: replace {C,LD}FLAGS_MODULE with KBUILD_{C,LD}FLAGS_MODULE

2017-10-09 Thread Cao jin
As kbuild document & commit 6588169d51 says: KBUILD_{C,LD}FLAGS_MODULE are used to add arch-specific options for $(CC) and $(LD). From commandline, {C,LD}FLAGS_MODULE shall be used. Doesn't have any functional change, but just follow kbuild rules. Signed-off-by: Cao jin CC: Russell

[PATCH 2/3] c6x/kbuild: replace CFLAGS_MODULE with KBUILD_CFLAGS_MODULE

2017-10-09 Thread Cao jin
As kbuild document & commit 6588169d51 says: KBUILD_CFLAGS_MODULE is used to add arch-specific options for $(CC). From commandline, CFLAGS_MODULE shall be used. Doesn't have any functional change, but just follow kbuild rules. Signed-off-by: Cao jin CC: Mark Salter CC: Aurelien Jac

[PATCH v2] kbuild: comments cleanup in Makefile.lib

2017-10-08 Thread Cao jin
It has: 1. Move comments close to what it want to comment. 2. Comments cleanup & improvement. Signed-off-by: Cao jin --- scripts/Makefile.lib | 21 +++-- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 5e9

Re: [PATCH] kbuild: comments cleanup in Makefile.lib

2017-10-08 Thread Cao jin
Masahiro-san, On 10/04/2017 12:58 PM, Masahiro Yamada wrote: > Hi Cao, > > > 2017-09-19 20:36 GMT+09:00 Cao jin : >> It has: >> 1. Move comments close to what it want to comment. >> 2. Comments cleanup & improvement. >> >> Signed-off-by: Cao jin

  1   2   3   >