[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: [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. > >

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 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

[PATCH v2 0/4] arm: support get_user_pages_fast

2020-10-23 Thread Miles Chen
EV_NONSHARED 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

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

2020-10-23 Thread Miles Chen
ve Capper Cc: Simon 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(-) di

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

2020-10-23 Thread Miles Chen
Baghdasaryan 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/i

[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
;) [-Werror,-Wincompatible-pointer-types] 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

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

[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 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 reading in

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 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

[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 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 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 "---"

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

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

[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

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 v2] arm64: mm: make CONFIG_ZONE_DMA32 configurable

2019-05-28 Thread Miles Chen
2. remove 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..20c552b13

[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

Re: [PATCH v4] dma-debug: fix incorrect pfn calculation

2017-11-16 Thread Miles Chen
On Thu, 2017-11-16 at 16:13 -0800, Andrew Morton wrote: > On Fri, 17 Nov 2017 06:56:12 +0800 wrote: > > > From: Miles Chen > > > > dma-debug reports the following warning: > > > > [name:panic&]WARNING: CPU: 3 PID: 298 at kernel-4.4/lib/dma-debug.c:60

Re: [PATCH] dma-debug: use virt_addr_valid() to check linear addresses

2017-11-23 Thread Miles Chen
On Thu, 2017-11-23 at 09:58 +0100, Christoph Hellwig wrote: > Can you just resend the original patch with the fixes? > No problem. I'll resend the original patch with this fix.

[PATCH] checkpatch: support function pointers for unnamed function definition arguments

2017-09-13 Thread Miles Chen
Signed-off-by: Miles Chen --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index dd2c262..dc6da15 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5957,7 +5957,7 @@ sub process { #

Re: [PATCH] checkpatch: support function pointers for unnamed function definition arguments

2017-09-14 Thread Miles Chen
On Wed, 2017-09-13 at 22:33 -0700, Joe Perches wrote: > On Thu, 2017-09-14 at 11:01 +0800, Miles Chen wrote: > > Current unnamed function definition argument does not include function > > pointer cases and it reports warnings like: > > > > WARNING: function definition

[PATCH v2] checkpatch: support function pointers for unnamed function definition arguments

2017-09-14 Thread Miles Chen
Signed-off-by: Miles Chen --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index dd2c262..03eb255 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5957,7 +5957,7 @@ sub process { #

[RFC/PATCH v3] arm64: define MODULES_VADDR by module_alloc_base

2017-08-30 Thread Miles Chen
-0xff9008576000 4K PTE RW NX SHD AF 0xff900858-0xff900859 64K PTE RW NX SHD AF 0xff9008591000-0xff90085d1000 256K PTE RW NX SHD AF ... Signed-off-by: Miles Chen --- arch/arm64/include/asm/memory.h | 12 +++-- arch/arm64

Re: [PATCH v3] dma-debug: fix incorrect pfn calculation

2017-10-02 Thread Miles Chen
On Sun, 2017-10-01 at 10:04 +0200, Christoph Hellwig wrote: > On Wed, Sep 27, 2017 at 11:23:52AM +0100, Robin Murphy wrote: > > > I found that debug_dma_alloc_coherent() and debug_dma_free_coherent() > > > assume that dma_alloc_coherent() always returns a linear address. > > > However it's possible

Re: [PATCH] dma-debug: fix incorrect pfn calculation

2017-09-26 Thread Miles Chen
On Tue, 2017-09-26 at 15:53 +0100, Robin Murphy wrote: > On 26/09/17 14:24, miles.c...@mediatek.com wrote: > > From: Miles Chen > > > > dma-debug report the following warning: > > > > [name:panic&]WARNING: CPU: 3 PID: 298 at kernel-4.4/lib/dma-debug.c:604 &

[PATCH] arm64: correct modules range of kernel virtual memory layout

2017-08-07 Thread Miles Chen
ory layout: modules : 0xffa7df637000 - 0xffa7e7637000 ( 128 MB) Signed-off-by: Miles Chen --- arch/arm64/mm/init.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 5960bef..57a11d5 100644 --- a/arch/arm64/mm/init.c

Re: [PATCH] arm64: correct modules range of kernel virtual memory layout

2017-08-07 Thread Miles Chen
On Mon, 2017-08-07 at 14:18 +0100, Ard Biesheuvel wrote: > On 7 August 2017 at 14:16, Will Deacon wrote: > > On Mon, Aug 07, 2017 at 07:04:46PM +0800, Miles Chen wrote: > >> The commit f80fb3a3d508 ("arm64: add support for kernel ASLR") > >> moved module virtu

Re: [PATCH] arm64: correct modules range of kernel virtual memory layout

2017-08-07 Thread Miles Chen
On Mon, 2017-08-07 at 15:01 +0100, Will Deacon wrote: > On Mon, Aug 07, 2017 at 02:18:00PM +0100, Ard Biesheuvel wrote: > > On 7 August 2017 at 14:16, Will Deacon wrote: > > > On Mon, Aug 07, 2017 at 07:04:46PM +0800, Miles Chen wrote: > > >> The commit f80fb3a

Re: [PATCH] arm64: correct modules range of kernel virtual memory layout

2017-08-07 Thread Miles Chen
On Tue, 2017-08-08 at 12:44 +0800, Miles Chen wrote: > On Mon, 2017-08-07 at 15:01 +0100, Will Deacon wrote: > > On Mon, Aug 07, 2017 at 02:18:00PM +0100, Ard Biesheuvel wrote: > > > On 7 August 2017 at 14:16, Will Deacon wrote: > > > > On Mon, Aug 07, 2017 at 07:0

[RFC/PATCH v2] arm64: define MODULES_VADDR by module_alloc_base

2017-08-15 Thread Miles Chen
0xffc88200-0xffc8c000 992M PMD RW NX SHD AF 0xffc8c000-0xffc9 1G PGD RW NX SHD AF Signed-off-by: Miles Chen --- arch/arm64/include/asm/memory.h | 12 +++-- arch/arm64/include/asm/module.h | 6 - arch/arm64/include/asm/pgtable.h | 4

Re: [PATCH] slub: Fix sysfs duplicate filename creation when slub_debug=O

2017-11-09 Thread Miles Chen
On Wed, 2017-11-08 at 09:05 -0600, Christopher Lameter wrote: > On Wed, 8 Nov 2017, Miles Chen wrote: > > > > Ok then the aliasing failed for some reason. The creation of the unique id > > > and the alias detection needs to be in sync otherwise duplicate filenames > &

Re: [PATCH] slub: Fix sysfs duplicate filename creation when slub_debug=O

2017-11-09 Thread Miles Chen
On Thu, 2017-11-09 at 09:49 -0600, Christopher Lameter wrote: > On Thu, 9 Nov 2017, Miles Chen wrote: > > > In this fix patch, it disables slab merging if SLUB_DEBUG=O and > > CONFIG_SLUB_DEBUG_ON=y but the debug features are disabled by the > > disable_higher_order_debu

Re: [PATCH] slub: Fix sysfs duplicate filename creation when slub_debug=O

2017-11-07 Thread Miles Chen
On Tue, 2017-11-07 at 09:22 -0600, Christopher Lameter wrote: > On Tue, 7 Nov 2017, miles.c...@mediatek.com wrote: > > > When slub_debug=O is set. It is possible to clear debug flags > > for an "unmergeable" slab cache in kmem_cache_open(). > > It makes the "unmergeable" cache became "mergeable" i

[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

[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

<    1   2