[PATCH v3] proc: use untagged_addr() for pagemap_read addresses

2020-12-03 Thread Miles Chen
rc/os.cc#L158 Cc: Andrew Morton Cc: Alexey Dobriyan Cc: Andrey Konovalov Cc: Alexander Potapenko Cc: Vincenzo Frascino Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Marco Elver Cc: Will Deacon Cc: Eric W. Biederman Cc: Song Bao Hua (Barry Song) Cc: sta...@vger.kernel.org

Re: [PATCH v2] proc: use untagged_addr() for pagemap_read addresses

2020-12-03 Thread Miles Chen
On Thu, 2020-12-03 at 11:30 +, Catalin Marinas wrote: > On Fri, Nov 27, 2020 at 01:07:38PM +0800, Miles Chen wrote: > > Cc: Will Deacon > > That should be w...@kernel.org. ok, I will fix it and submit v3 > > > diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.

Re: [PATCH v2] proc: use untagged_addr() for pagemap_read addresses

2020-12-03 Thread Miles Chen
On Thu, 2020-12-03 at 11:45 +, Vincenzo Frascino wrote: > Hi Miles, > > On 11/27/20 5:07 AM, Miles Chen wrote: > > When we try to visit the pagemap of a tagged userspace pointer, we find > > that the start_vaddr is not correct because of the tag. > > To fix it, w

[PATCH v2] proc: use untagged_addr() for pagemap_read addresses

2020-11-26 Thread Miles Chen
os.cc#L158 Cc: Andrew Morton Cc: Alexey Dobriyan Cc: Andrey Konovalov Cc: Alexander Potapenko Cc: Vincenzo Frascino Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Marco Elver Cc: Will Deacon Cc: Eric W. Biederman Cc: Song Bao Hua (Barry Song) Cc: sta...@vger.kernel.org #

Re: [RESEND PATCH v1] proc: use untagged_addr() for pagemap_read addresses

2020-11-26 Thread Miles Chen
On Thu, 2020-11-26 at 11:10 +, Catalin Marinas wrote: > Hi Miles, > > Could you please cc me and Andrey Konovalov on future versions of this > patch (if any)? > > On Mon, 23 Nov 2020 at 08:47, Miles Chen wrote: > > When we try to visit the pagemap of a tagged us

Re: [RESEND PATCH v1] proc: use untagged_addr() for pagemap_read addresses

2020-11-26 Thread Miles Chen
On Tue, 2020-11-24 at 12:32 -0600, Eric W. Biederman wrote: > Miles Chen writes: > > > When we try to visit the pagemap of a tagged userspace pointer, we find > > that the start_vaddr is not correct because of the tag. > > To fix it, we should untag the usespace

RE: [RESEND PATCH v1] proc: use untagged_addr() for pagemap_read addresses

2020-11-25 Thread Miles Chen
On Thu, 2020-11-26 at 07:16 +, Song Bao Hua (Barry Song) wrote: > > > -Original Message- > > From: Miles Chen [mailto:miles.c...@mediatek.com] > > Sent: Monday, November 23, 2020 7:39 PM > > To: Alexey Dobriyan ; Andrew Morton > > > > Cc: l

[RESEND PATCH v1] proc: use untagged_addr() for pagemap_read addresses

2020-11-22 Thread Miles Chen
int len; unsigned long end; ... } ... } [1] https://github.com/stressapptest/stressapptest/blob/master/src/os.cc#L158 Signed-off-by: Miles Chen --- fs/proc/task_mmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/proc/task_m

Re: [PATCH v2 3/4] arm: mm: introduce L_PTE_SPECIAL

2020-11-01 Thread Miles Chen
On Tue, 2020-10-27 at 09:11 +, Russell King - ARM Linux admin wrote: > On Tue, Oct 27, 2020 at 03:45:12PM +0800, Miles Chen wrote: > > On Fri, 2020-10-23 at 11:08 +0100, Russell King - ARM Linux admin wrote: > > > On Fri, Oct 23, 2020 at 05:14:36PM +0800, Miles Chen w

Re: [PATCH v2 2/4] arm: mm: reordering memory type table

2020-10-27 Thread Miles Chen
On Fri, 2020-10-23 at 11:16 +0100, Russell King - ARM Linux admin wrote: > On Fri, Oct 23, 2020 at 05:14:35PM +0800, Miles Chen wrote: > > From: Minchan Kim > > > > To use bit 5 in page table as L_PTE_SPECIAL, we need a room for that. > > It seems we don't need

Re: [PATCH v2 3/4] arm: mm: introduce L_PTE_SPECIAL

2020-10-27 Thread Miles Chen
On Fri, 2020-10-23 at 11:08 +0100, Russell King - ARM Linux admin wrote: > On Fri, Oct 23, 2020 at 05:14:36PM +0800, Miles Chen wrote: > > From: Minchan Kim > > > > This patch introduces L_PTE_SPECIAL and pte functions for supporting > > get_user_pages_fast. > &

Re: [PATCH v2 4/4] arm: replace vector mem type with read-only type

2020-10-27 Thread Miles Chen
On Fri, 2020-10-23 at 11:12 +0100, Russell King - ARM Linux admin wrote: > On Fri, Oct 23, 2020 at 05:14:37PM +0800, Miles Chen wrote: > > Since kernel no longer writes to the vector, try to replace > > the vector mem type with read-only type and remove L_PTE_MT_VECTORS. > &

[PATCH v2 0/4] arm: support get_user_pages_fast

2020-10-23 Thread Miles Chen
to SHARED - Catalin * https://lkml.kernel.org/r/20180910165011.zcighyuabshsm...@armageddon.cambridge.arm.com Miles Chen (2): arm: mm: use strict p[gum]d types arm: replace vector mem type with read-only type Minchan Kim (2): arm: mm: reordering memory type table arm: mm: introduce

[PATCH v2 2/4] arm: mm: reordering memory type table

2020-10-23 Thread Miles Chen
Horman Cc: Minchan Kim Cc: Suren Baghdasaryan Signed-off-by: Minchan Kim Signed-off-by: Miles Chen --- arch/arm/include/asm/pgtable-2level.h | 21 + arch/arm/mm/proc-macros.S | 4 ++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/arch/arm/

[PATCH v2 3/4] arm: mm: introduce L_PTE_SPECIAL

2020-10-23 Thread Miles Chen
From: Minchan Kim This patch introduces L_PTE_SPECIAL and pte functions for supporting get_user_pages_fast. Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon Cc: Steve Capper Cc: Minchan Kim Cc: Suren Baghdasaryan Signed-off-by: Minchan Kim Signed-off-by: Miles Chen --- arch/arm

[PATCH v2 1/4] arm: mm: use strict p[gum]d types

2020-10-23 Thread Miles Chen
] mm/gup.c:2616:9: error: array initializer must be an initializer list Fix some types errors in fixmap.h after using strict types. Cc: Russell King Cc: Catalin Marinas Cc: Minchan Kim Cc: Suren Baghdasaryan Signed-off-by: Miles Chen --- arch/arm/include/asm/fixmap.h | 6

[PATCH v2 4/4] arm: replace vector mem type with read-only type

2020-10-23 Thread Miles Chen
ghdasaryan Signed-off-by: Miles Chen --- arch/arm/include/asm/pgtable-2level.h | 1 - arch/arm/mm/mmu.c | 7 +++ arch/arm/mm/proc-macros.S | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/arm/include/asm/pgtable-2level.h b/arch/arm/includ

[RESEND PATCHv1] proc: use untagged_addr() for pagemap_read addresses

2020-09-15 Thread Miles Chen
When we try to visit the pagemap of a tagged userspace pointer, we find that the start_vaddr is not correct because of the tag. To fix it, we should untag the usespace pointers in pagemap_read(). Signed-off-by: Miles Chen --- fs/proc/task_mmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[RESEND PATCHv5] iommu/mediatek: check 4GB mode by reading infracfg

2020-09-04 Thread Miles Chen
: Christoph Hellwig Cc: Rob Herring Cc: Matthias Brugger Cc: Joerg Roedel Reviewed-by: Matthias Brugger Signed-off-by: Miles Chen --- Change since v4 - remove unnecessary data->enable_4GB = false, since it is kzalloc()ed. Change since v3 - use lore.kernel.org links - move "change since..

Re: [PATCH v5] iommu/mediatek: check 4GB mode by reading infracfg

2020-09-04 Thread Miles Chen
On Fri, 2020-09-04 at 11:42 +0200, Joerg Roedel wrote: > On Mon, Aug 31, 2020 at 06:56:39PM +0800, Miles Chen wrote: > > In previous discussion [1] and [2], we found that it is risky to > > use max_pfn or totalram_pages to tell if 4GB mode is enabled. > > > > Check 4

[PATCH v5] iommu/mediatek: check 4GB mode by reading infracfg

2020-08-31 Thread Miles Chen
: Christoph Hellwig Cc: Rob Herring Cc: Matthias Brugger Signed-off-by: Miles Chen --- Change since v4 - remove unnecessary data->enable_4GB = false, since it is kzalloc()ed. Change since v3 - use lore.kernel.org links - move "change since..." after "---" Change since v2:

Re: [RESEND PATCH v4] iommu/mediatek: check 4GB mode by reading infracfg

2020-08-29 Thread Miles Chen
On Thu, 2020-08-27 at 20:27 +0100, Robin Murphy wrote: > On 2020-08-27 06:31, Yong Wu wrote: > > On Wed, 2020-08-26 at 16:56 +0800, Miles Chen wrote: > >> In previous discussion [1] and [2], we found that it is risky to > >> use max_pfn or totalram_pages to

[RESEND PATCH v4] iommu/mediatek: check 4GB mode by reading infracfg

2020-08-26 Thread Miles Chen
: Christoph Hellwig Cc: Rob Herring Cc: Matthias Brugger Signed-off-by: Miles Chen --- Change since v3 - use lore.kernel.org links - move "change since..." after "---" Change since v2: - determine compatible string by m4u_plat - rebase to next-20200720 - add "---&qu

Re: [PATCH] net: untag pointer in sockptr_is_kernel

2020-08-12 Thread Miles Chen
et: optimize the sockptr_t for unified kernel/user address spaces") has been reverted, so I will not sent patch v2 for this build error. Miles > url: > https://github.com/0day-ci/linux/commits/Miles-Chen/net-untag-pointer-in-sockptr_is_kernel/20200811-18303 > base: https

RE: [PATCH] net: untag pointer in sockptr_is_kernel

2020-08-12 Thread Miles Chen
On Tue, 2020-08-11 at 11:44 +, David Laight wrote: > > On Tue, Aug 11, 2020 at 06:27:04PM +0800, Miles Chen wrote: > > > From: Miles Chen > > > > > > sockptr_is_kernel() uses (sockptr.kernel >= TASK_SIZE) to tell > > > if the pointer is ker

[PATCH] net: untag pointer in sockptr_is_kernel

2020-08-11 Thread Miles Chen
From: Miles Chen sockptr_is_kernel() uses (sockptr.kernel >= TASK_SIZE) to tell if the pointer is kernel space or user space. When user space uses the "top byte ignored" feature such as HWAsan, we must untag the pointer before checking against TASK_SIZE. sockptr_is_kernel() will

[PATCH] proc: use untagged_addr() for pagemap_read addresses

2020-08-03 Thread Miles Chen
When we try to visit the pagemap of a tagged userspace pointer, we find that the start_vaddr is not correct because of the tag. To fix it, we should untag the usespace pointers in pagemap_read(). Signed-off-by: Miles Chen --- fs/proc/task_mmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH v4] iommu/mediatek: check 4GB mode by reading infracfg

2020-07-22 Thread Miles Chen
: Christoph Hellwig Cc: Rob Herring Cc: Matthias Brugger Signed-off-by: Miles Chen --- Change since v3 - use lore.kernel.org links - move "change since..." after "---" Change since v2: - determine compatible string by m4u_plat - rebase to next-20200720 - add "---&qu

Re: [PATCH v3] iommu/mediatek: check 4GB mode by reading infracfg

2020-07-22 Thread Miles Chen
On Wed, 2020-07-22 at 17:19 +0200, Matthias Brugger wrote: > > On 22/07/2020 16:19, Miles Chen wrote: > > In previous discussion [1] and [2], we found that it is risky to > > use max_pfn or totalram_pages to tell if 4GB mode is enabled. > > > > Check 4GB mode by rea

[PATCH v3] iommu/mediatek: check 4GB mode by reading infracfg

2020-07-22 Thread Miles Chen
e_4GB only when has_4gb_mode [1] https://lkml.org/lkml/2020/6/3/733 [2] https://lkml.org/lkml/2020/6/4/136 [3] https://lkml.org/lkml/2020/7/15/1147 Cc: Mike Rapoport Cc: David Hildenbrand Cc: Yong Wu Cc: Yingjoe Chen Cc: Christoph Hellwig Cc: Rob Herring Cc: Matthias Brugger Signed-off-by:

Re: [PATCH v2] iommu/mediatek: check 4GB mode by reading infracfg

2020-07-22 Thread Miles Chen
On Wed, 2020-07-22 at 15:17 +0800, Miles Chen wrote: > On Tue, 2020-07-21 at 23:19 +0200, Matthias Brugger wrote: > > > > On 21/07/2020 13:24, Yong Wu wrote: > > > On Tue, 2020-07-21 at 11:40 +0200, Matthias Brugger wrote: > > >> > > >> On 21/07/2

Re: [PATCH v2] iommu/mediatek: check 4GB mode by reading infracfg

2020-07-22 Thread Miles Chen
On Tue, 2020-07-21 at 23:19 +0200, Matthias Brugger wrote: > > On 21/07/2020 13:24, Yong Wu wrote: > > On Tue, 2020-07-21 at 11:40 +0200, Matthias Brugger wrote: > >> > >> On 21/07/2020 04:16, Miles Chen wrote: > >>> In previous discussion [1] and [

Re: [PATCH v2] iommu/mediatek: check 4GB mode by reading infracfg

2020-07-22 Thread Miles Chen
On Tue, 2020-07-21 at 11:10 +0200, David Hildenbrand wrote: > On 21.07.20 04:16, Miles Chen wrote: > > In previous discussion [1] and [2], we found that it is risky to > > use max_pfn or totalram_pages to tell if 4GB mode is enabled. > > > > Check 4GB mode by readin

[PATCH v2] iommu/mediatek: check 4GB mode by reading infracfg

2020-07-20 Thread Miles Chen
] https://lkml.org/lkml/2020/7/15/1147 Cc: Mike Rapoport Cc: David Hildenbrand Cc: Yong Wu Cc: Yingjoe Chen Cc: Christoph Hellwig Cc: Yong Wu Cc: Chao Hao Cc: Rob Herring Cc: Matthias Brugger Signed-off-by: Miles Chen --- drivers/iommu/mtk_iommu.c | 26

Re: [PATCH 4/4] iommu/mediatek: check 4GB mode by reading infracfg

2020-07-17 Thread Miles Chen
On Wed, 2020-07-15 at 23:05 +0200, Matthias Brugger wrote: > > On 02/07/2020 11:37, Miles Chen wrote: > > In previous disscusion [1] and [2], we found that it is risky to > > use max_pfn or totalram_pages to tell if 4GB mode is enabled. > > > > Check 4GB mode by rea

Re: [PATCH 1/4] dt-bindings: mediatek: add mediatek,infracfg phandle

2020-07-17 Thread Miles Chen
On Wed, 2020-07-15 at 14:51 -0600, Rob Herring wrote: > On Thu, Jul 02, 2020 at 05:37:17PM +0800, Miles Chen wrote: > > Add a description for mediatek,infracfg. We can check if 4GB mode > > is enable by reading it instead of checking the unexported > > symbol "max_pfn

[PATCH 2/4] arm64: dts: mt2712: add mediatek,infracfg to iommu

2020-07-02 Thread Miles Chen
Add mediatek,infracfg to iommu node. Signed-off-by: Miles Chen --- arch/arm64/boot/dts/mediatek/mt2712e.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/mediatek/mt2712e.dtsi b/arch/arm64/boot/dts/mediatek/mt2712e.dtsi index db17d0a4ed57..0749b0f4834c 100644

[PATCH 4/4] iommu/mediatek: check 4GB mode by reading infracfg

2020-07-02 Thread Miles Chen
/136 Cc: Mike Rapoport Cc: David Hildenbrand Cc: Yong Wu Cc: Yingjoe Chen Cc: Christoph Hellwig Signed-off-by: Miles Chen --- drivers/iommu/mtk_iommu.c | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu

[PATCH 1/4] dt-bindings: mediatek: add mediatek,infracfg phandle

2020-07-02 Thread Miles Chen
Add a description for mediatek,infracfg. We can check if 4GB mode is enable by reading it instead of checking the unexported symbol "max_pfn". This is a step towards building mtk_iommu as a kernel module. Cc: Yong Wu Signed-off-by: Miles Chen --- Documentation/devicetree/bind

[PATCH 3/4] arm64: dts: mt8173: add mediatek,infracfg to iommu

2020-07-02 Thread Miles Chen
Add mediatek,infracfg to iommu node. Signed-off-by: Miles Chen --- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi index 70b1ffcab7f0..a6f14f68ef7e 100644 --- a/arch

Re: [PATCH] Fix unwind_frame for clang-built kernels

2020-06-18 Thread Miles Chen
n if we had to change LLVM. Just providing additional > context for folks on the thread. > > This should also have a reported by tag from Miles, in v2. > > Reported-by: Miles Chen > > Miles mentioned to me that he tested it, but maybe Miles can confirm > that publicly on-list

Re: [PATCH] iommu/mediatek: Use totalram_pages to setup enable_4GB

2020-06-04 Thread Miles Chen
On Thu, 2020-06-04 at 10:25 +0200, David Hildenbrand wrote: > On 04.06.20 10:01, Miles Chen wrote: > > To build this driver as a kernel module, we cannot use > > the unexported symbol "max_pfn" to setup enable_4GB. > > > > Use totalram_pages() instead to

[PATCH] iommu/mediatek: Use totalram_pages to setup enable_4GB

2020-06-04 Thread Miles Chen
To build this driver as a kernel module, we cannot use the unexported symbol "max_pfn" to setup enable_4GB. Use totalram_pages() instead to setup enable_4GB. Suggested-by: Mike Rapoport Signed-off-by: Miles Chen Cc: David Hildenbrand Cc: Yong Wu Cc: Chao Hao --- drivers/iommu/m

Re: [PATCH] mm/memblock: export max_pfn for kernel modules

2020-06-03 Thread Miles Chen
On Wed, 2020-06-03 at 18:16 +0200, David Hildenbrand wrote: > On 03.06.20 18:11, Miles Chen wrote: > > max_pfn is uesd to get the highest pfn in the system. Drivers like > > drivers/iommu/mtk_iommu.c checks max_pfn to see if it should enable > > its "4GB mode&quo

Re: [PATCH] mm/memblock: export max_pfn for kernel modules

2020-06-03 Thread Miles Chen
On Wed, 2020-06-03 at 20:06 +0300, Mike Rapoport wrote: > On Thu, Jun 04, 2020 at 12:11:32AM +0800, Miles Chen wrote: > > max_pfn is uesd to get the highest pfn in the system. Drivers like > > drivers/iommu/mtk_iommu.c checks max_pfn to see if it should enable &g

[PATCH] mm/memblock: export max_pfn for kernel modules

2020-06-03 Thread Miles Chen
max_pfn is uesd to get the highest pfn in the system. Drivers like drivers/iommu/mtk_iommu.c checks max_pfn to see if it should enable its "4GB mode". This patch exports the max_pfn symbol, so we can build the driver as a kernel module. Signed-off-by: Miles Chen --- mm/memblock.c | 1

[PATCH] dm: replace strncpy() with strscpy()

2020-05-15 Thread Miles Chen
Replace strncpy() with strscpy() to guarantee a NULL-terminated string. Detected by Coverity. Signed-off-by: Miles Chen --- drivers/md/dm-ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index ac83f5002ce5..4dc3658e3351

[PATCH] mm: fix outdated comment in page_get_anon_vma()

2019-10-17 Thread Miles Chen
Replace DESTROY_BY_RCU with SLAB_TYPESAFE_BY_RCU because SLAB_DESTROY_BY_RCU has been renamed to SLAB_TYPESAFE_BY_RCU by commit 5f0d5a3ae7cf ("mm: Rename SLAB_DESTROY_BY_RCU to SLAB_TYPESAFE_BY_RCU") Signed-off-by: Miles Chen --- mm/rmap.c | 7 --- 1 file changed, 4 insert

Re: [PATCH] mm/page_owner: fix incorrect looping in __set_page_owner_handle()

2019-10-04 Thread Miles Chen
On Fri, 2019-10-04 at 09:57 +0200, Vlastimil Babka wrote: > On 10/4/19 9:37 AM, Miles Chen wrote: > > In __set_page_owner_handle(), we should loop over page > > [0...(1 << order) - 1] and setup their page_owner structures. > > > > Currently, __set_page_owner_ha

[PATCH] mm/page_owner: fix incorrect looping in __set_page_owner_handle()

2019-10-04 Thread Miles Chen
0) } Cc: Andrew Morton Cc: Vlastimil Babka Cc: Michal Hocko Signed-off-by: Miles Chen Fixes: 7e2f2a0cd17c ("mm, page_owner: record page owner for each subpage") --- mm/page_owner.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/page_owner.c b/mm/page_owner.c in

[PATCH v2] mm: slub: print the offset of fault addresses

2019-09-25 Thread Miles Chen
are useful 2. print the offset of the fault address Cc: Christoph Lameter Cc: Matthew Wilcox Cc: David Rientjes Signed-off-by: Miles Chen --- mm/slub.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 42c1b3af3c98..21d26cd3e3bc 100644 --- a/mm/sl

Re: [PATCH] mm: slub: print_hex_dump() with DUMP_PREFIX_OFFSET

2019-09-22 Thread Miles Chen
On Sat, 2019-09-21 at 09:00 -0700, Matthew Wilcox wrote: > On Sat, Sep 21, 2019 at 02:08:59AM -0700, David Rientjes wrote: > > On Fri, 20 Sep 2019, Miles Chen wrote: > > > > > Since commit ad67b74d2469d9b8 ("printk: hash addresses printed with %p"), > &

Re: [PATCH] mm: slub: print_hex_dump() with DUMP_PREFIX_OFFSET

2019-09-22 Thread Miles Chen
On Sat, 2019-09-21 at 02:08 -0700, David Rientjes wrote: > On Fri, 20 Sep 2019, Miles Chen wrote: > > > Since commit ad67b74d2469d9b8 ("printk: hash addresses printed with %p"), > > The use DUMP_PREFIX_OFFSET instead of DUMP_PREFIX_ADDRESS with > > print_h

[PATCH] mm: slub: print_hex_dump() with DUMP_PREFIX_OFFSET

2019-09-20 Thread Miles Chen
nux kernel. $ git grep 'DUMP_PREFIX_ADDRESS' | cut -f1 -d"/" | sort | uniq -c 3 arch 140 drivers 12 fs 1 include 5 lib 2 mm Signed-off-by: Miles Chen --- mm/slub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/slub.c b/mm/slub.c index 8834563cdb4b..89d91c1eb33d 10

[tip: sched/core] sched/psi: Correct overly pessimistic size calculation

2019-09-13 Thread tip-bot2 for Miles Chen
The following commit has been merged into the sched/core branch of tip: Commit-ID: 4adcdcea717cb2d8436bef00dd689aa5bc76f11b Gitweb: https://git.kernel.org/tip/4adcdcea717cb2d8436bef00dd689aa5bc76f11b Author:Miles Chen AuthorDate:Thu, 12 Sep 2019 18:34:52 +08:00 Committer

[PATCH] psi: put NULL char correctly in psi_write()

2019-09-12 Thread Miles Chen
9|123456789|123456789|1 (print 31 chars) %sh: write error: Invalid argument Signed-off-by: Miles Chen --- kernel/sched/psi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c index 6e52b67b420e..517e3719027e 100644 --- a/kernel/sched/ps

[RESEND PATCH v4] checkpatch: add several Kconfig default value tests

2019-08-27 Thread Miles Chen
ange since v1: discourage default n$ discourage default "[ynm]" discourage default \!?EXPERT Change since v2: (Joe has provided the whole patch and I just post it) test Kconfig in a single block print precise message such as 'default "m"', not 'default "[ynm]"' provide --fix

[tip:core/stacktrace] lib/stackdepot: Fix outdated comments

2019-08-19 Thread tip-bot for Miles Chen
Commit-ID: ee050dc83bc326ad5ef8ee93bca344819371e7a5 Gitweb: https://git.kernel.org/tip/ee050dc83bc326ad5ef8ee93bca344819371e7a5 Author: Miles Chen AuthorDate: Thu, 15 Aug 2019 19:32:46 +0800 Committer: Thomas Gleixner CommitDate: Mon, 19 Aug 2019 12:57:28 +0200 lib/stackdepot: Fix

[PATCH] shmem: fix obsolete comment in shmem_getpage_gfp()

2019-08-16 Thread Miles Chen
ype sgp, gfp_t gfp, struct vm_area_struct *vma, struct vm_fault *vmf, vm_fault_t *fault_type); Signed-off-by: Miles Chen --- mm/shmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/shmem.c b/mm/shmem.c index 2bed4761f279..fed9ebea316c 10

[PATCH] lib/stackdepot: fix obsolete comments

2019-08-15 Thread Miles Chen
e_stack() is removed in commit 56d8f079c51a ("lib/stackdepot: Remove obsolete functions") Cc: Thomas Gleixner Cc: Alexander Potapenko Cc: Josh Poimboeuf Cc: Greg Kroah-Hartman Cc: Kate Stewart Signed-off-by: Miles Chen --- lib/stackdepot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 delet

Re: [RFC PATCH v2] mm: slub: print kernel addresses in slub debug messages

2019-08-12 Thread Miles Chen
On Fri, 2019-08-09 at 07:26 -0700, Matthew Wilcox wrote: > On Fri, Aug 09, 2019 at 10:11:58PM +0800, Miles Chen wrote: > > On Thu, 2019-08-08 at 19:46 -0700, Matthew Wilcox wrote: > > > On Fri, Aug 09, 2019 at 09:08:37AM +0800, miles.c...@mediatek.com wrote: > > > >

Re: [RFC PATCH v2] mm: slub: print kernel addresses in slub debug messages

2019-08-09 Thread Miles Chen
On Thu, 2019-08-08 at 19:46 -0700, Matthew Wilcox wrote: > On Fri, Aug 09, 2019 at 09:08:37AM +0800, miles.c...@mediatek.com wrote: > > Possible approaches are: > > 1. stop printing kernel addresses > > 2. print with %pK, > > 3. print with %px. > > No. The point of obscuring kernel addresses is

Re: [PATCH v2] arm64: mm: print hexadecimal EC value in mem_abort_decode()

2019-08-08 Thread Miles Chen
On Thu, 2019-08-08 at 11:51 +0530, Anshuman Khandual wrote: > > On 08/08/2019 11:31 AM, Miles Chen wrote: > > On Thu, 2019-08-08 at 11:19 +0530, Anshuman Khandual wrote: > >> > >> On 08/07/2019 06:03 AM, Miles Chen wrote: > >>> This change prints th

[PATCH v3] arm64: mm: print hexadecimal EC value in mem_abort_decode()

2019-08-08 Thread Miles Chen
ed the suggestion in v1 add reviewed-by tag from Anshuman in v2 Acked-by: Mark Rutland Reviewed-by: Anshuman Khandual Cc: Mark Rutland Cc: Anshuman Khandual Cc: James Morse Signed-off-by: Miles Chen --- arch/arm64/mm/fault.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --g

Re: [PATCH v2] arm64: mm: print hexadecimal EC value in mem_abort_decode()

2019-08-08 Thread Miles Chen
On Thu, 2019-08-08 at 11:19 +0530, Anshuman Khandual wrote: > > On 08/07/2019 06:03 AM, Miles Chen wrote: > > This change prints the hexadecimal EC value in mem_abort_decode(), > > which makes it easier to lookup the corresponding EC in > > the ARM Archi

[PATCH v2] arm64: mm: print hexadecimal EC value in mem_abort_decode()

2019-08-06 Thread Miles Chen
T (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 Data abort info: ISV = 0, ISS = 0x0046 CM = 0, WnR = 1 Change since v1: print "EC" instead of "Exception class" print EC in fixwidth Cc: Mark Rutland Cc: Anshuman Khandual Cc: James Morse Signed-

Re: [PATCH] arm64: mm: print hexadecimal EC value in mem_abort_decode()

2019-08-06 Thread Miles Chen
On Tue, 2019-08-06 at 13:34 +0100, Mark Rutland wrote: > On Tue, Aug 06, 2019 at 07:29:48PM +0800, Miles Chen wrote: > > This change prints the hexadecimal EC value in mem_abort_decode(), > > which makes it easier to lookup the corresponding EC in > > the ARM Architec

[PATCH] arm64: mm: print hexadecimal EC value in mem_abort_decode()

2019-08-06 Thread Miles Chen
eption class = DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 Data abort info: ISV = 0, ISS = 0x0046 CM = 0, WnR = 1 Cc: Mark Rutland Cc: Anshuman Khandual Cc: James Morse Signed-off-by: Miles Chen --- arch/arm64/mm/fault.c | 4 ++-- 1 file changed, 2 inser

Re: linux-next: build warning after merge of the akpm-current tree

2019-08-01 Thread Miles Chen
On Thu, 2019-08-01 at 16:39 +1000, Stephen Rothwell wrote: > Hi Miles, > > On Thu, 1 Aug 2019 14:30:03 +0800 Miles Chen wrote: > > > > It's the first time that I receive a build warning after the patch has > > been merged to -mm tree. The build warning had been fixed

Re: linux-next: build warning after merge of the akpm-current tree

2019-08-01 Thread Miles Chen
On Thu, 2019-08-01 at 08:15 +0200, Michal Hocko wrote: > On Thu 01-08-19 15:51:30, Stephen Rothwell wrote: > > Hi Miles, > > > > On Wed, 31 Jul 2019 14:28:04 +0800 Miles Chen > > wrote: > > > > > > On Wed, 2019-07-31 at 16:11 +1000, Stephen R

[PATCH v3] checkpatch: add several Kconfig default value tests

2019-07-31 Thread Miles Chen
o change default EXPERT => no change Change since v1: discourage default n$ discourage default "[ynm]" discourage default \!?EXPERT Change since v2: test Kconfig in a single block print precise message such as 'default "m"', not 'default "[ynm]"' provide --fix capa

Re: linux-next: build warning after merge of the akpm-current tree

2019-07-31 Thread Miles Chen
On Wed, 2019-07-31 at 16:11 +1000, Stephen Rothwell wrote: > Hi all, > > After merging the akpm-current tree, today's linux-next build (powerpc > ppc64_defconfig) produced this warning: > > mm/memcontrol.c: In function 'invalidate_reclaim_iterators': > mm/memcontrol.c:1160:11: warning: suggest

[PATCH v4] mm: memcontrol: fix use after free in mem_cgroup_iter()

2019-07-29 Thread Miles Chen
m iterator to simple css refcounting") Cc: Johannes Weiner Cc: Michal Hocko Signed-off-by: Miles Chen --- mm/memcontrol.c | 39 +-- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index cdbb7a84cb6e..8a

Re: [PATCH v2] mm: memcontrol: fix use after free in mem_cgroup_iter()

2019-07-29 Thread Miles Chen
On Mon, 2019-07-29 at 12:06 -0400, Johannes Weiner wrote: > On Fri, Jul 26, 2019 at 10:12:47AM +0800, Miles Chen wrote: > > This patch is sent to report an use after free in mem_cgroup_iter() > > after merging commit: be2657752e9e "mm: memcg: fix use after free in

Re: [PATCH v2] mm: memcontrol: fix use after free in mem_cgroup_iter()

2019-07-27 Thread Miles Chen
On Sat, 2019-07-27 at 07:47 +0800, Miles Chen wrote: > On Fri, 2019-07-26 at 14:55 +0200, Michal Hocko wrote: > > On Fri 26-07-19 14:49:33, Michal Hocko wrote: > > > On Fri 26-07-19 10:12:47, Miles Chen wrote: > > > > This patch is sent to report an use

[PATCH v3] mm: memcontrol: fix use after free in mem_cgroup_iter()

2019-07-26 Thread Miles Chen
since v1: Add a comment to explain why we need to handle root_mem_cgroup separately. Rename invalid_root to invalidate_root. Change since v2: add fix tag Fixes: 5ac8fb31ad2e ("mm: memcontrol: convert reclaim iterator to simple css refcounting") Cc: Johannes Weiner Cc: Michal H

Re: [PATCH v2] mm: memcontrol: fix use after free in mem_cgroup_iter()

2019-07-26 Thread Miles Chen
On Fri, 2019-07-26 at 14:55 +0200, Michal Hocko wrote: > On Fri 26-07-19 14:49:33, Michal Hocko wrote: > > On Fri 26-07-19 10:12:47, Miles Chen wrote: > > > This patch is sent to report an use after free in mem_cgroup_iter() > > > after merging commit: be2657752e9e &qu

Re: [PATCH v2] mm: memcontrol: fix use after free in mem_cgroup_iter()

2019-07-26 Thread Miles Chen
Hi Johannes, I post patch v2 with proper comment you mentioned. (I am not sure if I can copy your acked-by to patch v2 directly) Miles On Fri, 2019-07-26 at 10:12 +0800, Miles Chen wrote: > This patch is sent to report an use after free in mem_cgroup_iter() > after merging commit: be2657

[PATCH v2] mm: memcontrol: fix use after free in mem_cgroup_iter()

2019-07-25 Thread Miles Chen
since v1: Add a comment to explain why we need to handle root_mem_cgroup separately. Rename invalid_root to invalidate_root. Cc: Johannes Weiner Signed-off-by: Miles Chen --- mm/memcontrol.c | 38 -- 1 file changed, 28 insertions(+), 10 deletions(-) diff --

Re: [PATCH v3] checkpatch: add several Kconfig default value tests

2019-07-19 Thread Miles Chen
On Fri, 2019-07-05 at 11:16 +0800, Miles Chen wrote: > This change adds 3 Kconfig default value tests. Hi Joe, I was wondering if this patch looks good to you? Miles > > 1. discourage default n cases: > e.g., > default n > > 2. discourage default "[ynm]" cases:

[PATCH v3] checkpatch: add several Kconfig default value tests

2019-07-04 Thread Miles Chen
ange since v1: discourage default n$ discourage default "[ynm]" discourage default \!?EXPERT Change since v2: (Joe has provided the whole patch and I just post it) test Kconfig in a single block print precise message such as 'default "m"', not 'default "[ynm]"' prov

Re: [PATCH v2] checkpatch: add several Kconfig default value tests

2019-07-04 Thread Miles Chen
On Thu, 2019-07-04 at 11:49 -0700, Joe Perches wrote: > On Thu, 2019-07-04 at 17:40 +0800, Miles Chen wrote: > > This change adds 3 Kconfig default value tests: > [] > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > [] > > @@ -300

[PATCH v2] checkpatch: add several Kconfig default value tests

2019-07-04 Thread Miles Chen
ault "[ynm]" + default "y" if PPC_POWERNV Change since v1: discourage default n$ discourage default "[ynm]" discourage default \!?EXPERT Cc: Joe Perches Cc: Yingjoe Chen Signed-off-by: Miles Chen --- scripts/checkpatch.pl | 21 + 1 file

Re: [PATCH] checkpatch: avoid default n

2019-07-03 Thread Miles Chen
On Wed, 2019-07-03 at 08:37 -0700, Joe Perches wrote: > On Wed, 2019-07-03 at 17:03 +0800, Yingjoe Chen wrote: > > On Wed, 2019-07-03 at 01:42 -0700, Joe Perches wrote: > > > On Wed, 2019-07-03 at 16:30 +0800, Miles Chen wrote: > > > > This change reports a wa

Re: [PATCH] checkpatch: avoid default n

2019-07-03 Thread Miles Chen
On Wed, 2019-07-03 at 01:42 -0700, Joe Perches wrote: > On Wed, 2019-07-03 at 16:30 +0800, Miles Chen wrote: > > This change reports a warning when "default n" is used. > > > > I have seen several "remove default n" patches, so I think > > it

[PATCH] checkpatch: avoid default n

2019-07-03 Thread Miles Chen
This change reports a warning when "default n" is used. I have seen several "remove default n" patches, so I think it might be helpful to add this test in checkpatch. tested: WARNING: 'default n' is the default value, no need to write it explicitly. + default n Signe

[PATCH v2] arm64: mm: make CONFIG_ZONE_DMA32 configurable

2019-05-28 Thread Miles Chen
redundant IS_ENABLED(CONFIG_ZONE_DMA32) Cc: Robin Murphy Signed-off-by: Miles Chen --- arch/arm64/Kconfig | 3 ++- arch/arm64/mm/init.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 76f6e4765f49..20c552b1302c 100644

Re: [PATCH] arm64: mm: make CONFIG_ZONE_DMA32 configurable

2019-05-28 Thread Miles Chen
On Tue, 2019-05-28 at 11:43 +0100, Robin Murphy wrote: > On 27/05/2019 17:08, Miles Chen wrote: > > This change makes CONFIG_ZONE_DMA32 defuly y and allows users > > to overwrite it. > > > > For the SoCs that do not need CONFIG_ZONE_DMA32, this is the > > first st

[PATCH] arm64: mm: make CONFIG_ZONE_DMA32 configurable

2019-05-27 Thread Miles Chen
CONFIG_NUMA=y and CONFIG_ZONE_DMA32=n. arch/arm64/mm/init.c:195:17: error: use of undeclared identifier 'ZONE_DMA32' max_zone_pfns[ZONE_DMA32] = PFN_DOWN(max_zone_dma_phys()); Signed-off-by: Miles Chen --- arch/arm64/Kconfig | 3 ++- arch/arm64/mm/init.c | 2 ++ 2 files changed

[PATCH] arm64: mm: check virtual addr in virt_to_page() if CONFIG_DEBUG_VIRTUAL=y

2019-04-15 Thread Miles Chen
ss in __pa()/__virt_to_phys(). A simple solution is to use the original virt_to_page() (the one with__pa()) if CONFIG_DEBUG_VIRTUAL=y. Signed-off-by: Miles Chen Cc: Ard Biesheuvel --- arch/arm64/include/asm/memory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/as

[PATCH] arm64: setup min_low_pfn

2019-03-20 Thread Miles Chen
/0x1068 __alloc_pages_nodemask+0xd4/0xcb8 shmem_alloc_page+0x7c/0xa0 shmem_alloc_and_acct_page+0x124/0x1e8 shmem_getpage_gfp.isra.7+0x118/0x878 shmem_write_begin+0x38/0x68 Signed-off-by: Miles Chen --- arch/arm64/mm/init.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/mm/init.c b/arch

Re: [PATCH v2] mm/slub: introduce SLAB_WARN_ON_ERROR

2019-01-29 Thread Miles Chen
On Tue, 2019-01-29 at 19:46 +, Christopher Lameter wrote: > On Tue, 29 Jan 2019, Miles Chen wrote: > > > a) classic slub issue. e.g., use-after-free, redzone overwritten. It's > > more efficient to report a issue as soon as slub detects it. (comparing > > to monitor t

Re: [PATCH v2] mm/slub: introduce SLAB_WARN_ON_ERROR

2019-01-28 Thread Miles Chen
On Tue, 2019-01-29 at 05:46 +, Christopher Lameter wrote: > On Mon, 28 Jan 2019, Andrew Morton wrote: > > > > When debugging slab errors in slub.c, sometimes we have to trigger > > > a panic in order to get the coredump file. Add a debug option > > > SLAB_WARN_ON_ERROR to toggle WARN_ON()

Re: [PATCH v2] mm/slub: introduce SLAB_WARN_ON_ERROR

2019-01-28 Thread Miles Chen
On Mon, 2019-01-28 at 17:41 -0800, David Rientjes wrote: > On Thu, 24 Jan 2019, miles.c...@mediatek.com wrote: > > > From: Miles Chen > > > > When debugging slab errors in slub.c, sometimes we have to trigger > > a panic in order to get the cor

Re: [PATCH] mm/slub: use WARN_ON() for some slab errors

2019-01-21 Thread Miles Chen
On Mon, 2019-01-21 at 22:02 +, Christopher Lameter wrote: > On Mon, 21 Jan 2019, miles.c...@mediatek.com wrote: > > > From: Miles Chen > > > > When debugging with slub.c, sometimes we have to trigger a panic in > > order to get the coredump file. To do

Re: [PATCH] arm64: trap illegal translations in __virt_to_phys()

2019-01-08 Thread Miles Chen
On Tue, 2019-01-08 at 12:14 +, Mark Rutland wrote: > On Tue, Jan 08, 2019 at 11:24:43AM +0800, Miles Chen wrote: > > On Mon, 2019-01-07 at 15:00 +, Mark Rutland wrote: > > > On Mon, Jan 07, 2019 at 07:21:20PM +0800, Miles Chen wrote: > > > > Current __vir

Re: [PATCH] arm64: trap illegal translations in __virt_to_phys()

2019-01-07 Thread Miles Chen
On Mon, 2019-01-07 at 15:00 +, Mark Rutland wrote: > On Mon, Jan 07, 2019 at 07:21:20PM +0800, Miles Chen wrote: > > Current __virt_to_phys() only print warning messages for non-linear > > addresses. It's hard to catch all warnings by those messages. > > Why? Are you

[PATCH] arm64: trap illegal translations in __virt_to_phys()

2019-01-07 Thread Miles Chen
: stack addresses: kernel BUG() symbol addresses: kernel warning message Maybe we should trap all non-linear address translations in the future. Signed-off-by: Miles Chen --- arch/arm64/mm/physaddr.c | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/arm64/mm/physaddr.c b/arch/arm64

[PATCH] tools/vm/page_owner: use page_owner_sort in the use example

2019-01-03 Thread Miles Chen
The example in comment does not useable because the output binary is named "page_owner_sort", not "sort". Also add a reference to Documentation/vm/page_owner.rst Signed-off-by: Miles Chen --- tools/vm/page_owner_sort.c | 4 +++- 1 file changed, 3 insertions(+), 1 del

Re: [PATCH] arm64: kaslr: print PHYS_OFFSET in dump_kernel_offset()

2018-12-13 Thread Miles Chen
On Thu, 2018-12-13 at 19:15 +0100, Ard Biesheuvel wrote: > On Thu, 13 Dec 2018 at 19:12, Will Deacon wrote: > > > > [+Ard because I'll basically go with his preference on this one] > > > > On Wed, Dec 12, 2018 at 06:56:49PM +0800, Miles Chen wrote: > > > Wh

  1   2   >