Re: [PATCH v3 09/14] powerpc/xmon: Add initial support for prefixed instructions

2020-02-26 Thread Christophe Leroy
Le 27/02/2020 à 01:11, Jordan Niethe a écrit : On Wed, Feb 26, 2020 at 6:10 PM Nicholas Piggin wrote: Jordan Niethe's on February 26, 2020 2:07 pm: A prefixed instruction is composed of a word prefix and a word suffix. It does not make sense to be able to have a breakpoint on the suffix of

Re: [PATCH] powerpc: fix emulate_step std test

2020-02-26 Thread Ravi Bangoria
On 2/26/20 11:23 AM, Nicholas Piggin wrote: Signed-off-by: Nicholas Piggin Reviewed-by: Ravi Bangoria --- arch/powerpc/lib/test_emulate_step.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/lib/test_emulate_step.c b/arch/powerpc/lib/test_emulate_step

[RFC PATCH 21/21] powerpc/mm/book3s64: Avoid sending IPI on clearing PMD

2020-02-26 Thread Aneesh Kumar K.V
Now that all the lockless page table walk is careful w.r.t the PTE address returned, we can now revert commit: 13bd817bb884 ("powerpc/thp: Serialize pmd clear against a linux page table walk.") This speeds up Qemu termination with large guest RAM value. We also drop the equivalent IPI from other

[RFC PATCH 20/21] powerpc/kvm/book3s: Use pte_present instead of opencoding _PAGE_PRESENT check

2020-02-26 Thread Aneesh Kumar K.V
This adds _PAGE_PTE check and makes sure we validate the pte value returned via find_kvm_host_pte. NOTE: this also considers _PAGE_INVALID to the software valid bit. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/kvm_book3s_64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-

[RFC PATCH 19/21] powerpc/kvm/book3s: Use find_kvm_host_pte in kvmppc_get_hpa

2020-02-26 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 32 ++--- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c b/arch/powerpc/kvm/book3s_hv_rm_mmu.c index 83e987fecf97..3b168c69d503 100644 --- a/arch

[RFC PATCH 18/21] powerpc/kvm/book3s: use find_kvm_host_pte in kvmppc_book3s_instantiate_page

2020-02-26 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/kvm/book3s_64_mmu_radix.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kvm/book3s_64_mmu_radix.c b/arch/powerpc/kvm/book3s_64_mmu_radix.c index f0b021052e33..fae89e3dbee0 100644 --- a/arch/powerpc/kvm

[RFC PATCH 17/21] powerpc/kvm/book3s: Avoid using rmap to protect parallel page table update.

2020-02-26 Thread Aneesh Kumar K.V
We now depend on kvm->mmu_lock Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/kvm/book3s_64_vio_hv.c | 38 +++-- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/arch/powerpc/kvm/book3s_64_vio_hv.c b/arch/powerpc/kvm/book3s_64_vio_hv.c index 8a6bf12d2e88.

[RFC PATCH 16/21] powerpc/kvm/book3s: use find_kvm_host_pte in pute_tce functions

2020-02-26 Thread Aneesh Kumar K.V
Current code just hold rmap lock to ensure parallel page table update is prevented. That is not sufficient. The kernel should also check whether a mmu_notifer callback was running in parallel. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/kvm/book3s_64_vio_hv.c | 30 +++---

[RFC PATCH 15/21] powerpc/kvm/book3s: Use find_kvm_host_pte in h_enter

2020-02-26 Thread Aneesh Kumar K.V
Since kvmppc_do_h_enter can get called in realmode use low level arch_spin_lock which is safe to be called in realmode. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/kvm/book3s_64_mmu_hv.c | 5 ++--- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 22 ++ 2 files changed, 8 insertio

[RFC PATCH 14/21] powerpc/kvm/book3s: Use find_kvm_host_pte in page fault handler

2020-02-26 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/kvm/book3s_64_mmu_hv.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c index 6c372f5c61b6..fbabdcf24c86 100644 --- a/arch/powerpc/kvm/book3s_64_mm

[RFC PATCH 13/21] powerpc/kvm/book3s: Add helper for host page table walk

2020-02-26 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/kvm_book3s_64.h | 16 1 file changed, 16 insertions(+) diff --git a/arch/powerpc/include/asm/kvm_book3s_64.h b/arch/powerpc/include/asm/kvm_book3s_64.h index 2860521992b6..1ca1f6495012 100644 --- a/arch/powerpc/includ

[RFC PATCH 12/21] powerpc/kvm/book3s: Use kvm helpers to walk shadow or secondary table

2020-02-26 Thread Aneesh Kumar K.V
update kvmppc_hv_handle_set_rc to use find_kvm_nested_guest_pte and find_kvm_secondary_pte Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/kvm_book3s.h| 2 +- arch/powerpc/include/asm/kvm_book3s_64.h | 3 +++ arch/powerpc/kvm/book3s_64_mmu_radix.c | 18 +- ar

[RFC PATCH 11/21] powerpc/kvm/nested: Add helper to walk nested shadow linux page table.

2020-02-26 Thread Aneesh Kumar K.V
The locking rules for walking nested shadow linux page table is different from process scoped table. Hence add a helper for nested page table walk and also add check whether we are holding the right locks. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/kvm/book3s_hv_nested.c | 28

[RFC PATCH 10/21] powerpc/kvm/book3s: Add helper to walk partition scoped linux page table.

2020-02-26 Thread Aneesh Kumar K.V
The locking rules for walking partition scoped table is different from process scoped table. Hence add a helper for secondary linux page table walk and also add check whether we are holding the right locks. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/kvm_book3s_64.h | 13 +++

[RFC PATCH 09/21] powerpc/kvm/book3s: switch from raw_spin_*lock to arch_spin_lock.

2020-02-26 Thread Aneesh Kumar K.V
These functions can get called in realmode. Hence use low level arch_spin_lock which is safe to be called in realmode. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kvm/book3s_hv_rm

[RFC PATCH 08/21] powerpc/perf/callchain: Use __get_user_pages_fast in read_user_stack_slow

2020-02-26 Thread Aneesh Kumar K.V
read_user_stack_slow is called with interrupts soft disabled and it copies contents from the page which we find mapped to a specific address. To convert userspace address to pfn, the kernel now uses lockless page table walk. The kernel needs to make sure the pfn value read remains stable and is n

[RFC PATCH 07/21] powerpc/mce: Don't reload pte val in addr_to_pfn

2020-02-26 Thread Aneesh Kumar K.V
A lockless page table walk should be safe against parallel THP collapse, THP split and madvise(MADV_DONTNEED)/parallel fault. This patch makes sure kernel won't reload the pteval when checking for different conditions. The patch also added a check for pte_present to make sure the kernel is indeed

[RFC PATCH 06/21] powerpc/book3s/hash64/devmap: Use H_PAGE_THP_HUGE when setting up level huge devmap pte entries

2020-02-26 Thread Aneesh Kumar K.V
H_PAGE_THP_HUGE is used to differentiate between a THP hugepage and hugetlb hugepage entries. The difference is w.r.t how we handle hash fault on these address. THP address enables MPSS in segments. We want to manage devmap hugepage entries similar to THP pt entries. Hence use H_PAGE_THP_HUGE for d

[RFC PATCH 05/21] powerpc/book3s64/hash: Use the pte_t address from the caller

2020-02-26 Thread Aneesh Kumar K.V
Don't fetch the pte value using lockless page table walk. Instead use the value from the caller. hash_preload is called with ptl lock held. So it is safe to use the pte_t address directly. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/hash_utils.c | 27 +--

[RFC PATCH 04/21] powerpc/hash64: Restrict page table lookup using init_mm with __flush_hash_table_range

2020-02-26 Thread Aneesh Kumar K.V
This is only used with init_mm currently. Walking init_mm is much simpler because we don't need to handle concurrent page table like other mm_context Signed-off-by: Aneesh Kumar K.V --- .../include/asm/book3s/64/tlbflush-hash.h| 3 +-- arch/powerpc/kernel/pci_64.c |

[RFC PATCH 03/21] powerpc/mm/hash64: use _PAGE_PTE when checking for pte_present

2020-02-26 Thread Aneesh Kumar K.V
This makes the pte_present check stricter by checking for additional _PAGE_PTE bit. A level 1 pte pointer (THP pte) can be switched to a pointer to level 0 pte page table page by following two operations. 1) THP split. 2) madvise(MADV_DONTNEED) in parallel to page fault. A lockless page table wal

[RFC PATCH 02/21] powerpc/pkeys: Check vma before returning key fault error to the user

2020-02-26 Thread Aneesh Kumar K.V
If multiple threads in userspace keep changing the protection keys mapping a range, there can be a scenario where kernel takes a key fault but the pkey value found in the siginfo struct is a permissive one. This can confuse the userspace as shown in the below test case. /* use this to control the

[RFC PATCH 01/21] powerpc/pkeys: Avoid using lockless page table walk

2020-02-26 Thread Aneesh Kumar K.V
Fetch pkey from vma instead of linux page table. Also document the fact that in some cases the pkey returned in siginfo won't be the same as the one we took keyfault on. Even with linux page table walk, we can end up in a similar scenario. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/includ

[RFC PATCH 00/21] Avoid IPI while updating page table entries.

2020-02-26 Thread Aneesh Kumar K.V
Problem Summary: Slow termination of KVM guest with large guest RAM config due to a large number of IPIs that were caused by clearing level 1 PTE entries (THP) entries. This is shown in the stack trace below. - qemu-system-ppc [kernel.vmlinux][k] smp_call_function_many - smp_call_

Re: [PATCH 2/2] powerpc/vmlinux.lds: Discard .interp section

2020-02-26 Thread Alan Modra
On Thu, Feb 27, 2020 at 03:59:33PM +1100, Michael Ellerman wrote: > The .interp section specifies which "interpreter", ie. dynamic loader, > the kernel requests. But that doesn't make any sense, the kernel is > not a regular binary that is run with an interpreter. > > The content seems to be some

Re: [PATCH 1/2] powerpc/vmlinux.lds: Explicitly retain .gnu.hash

2020-02-26 Thread Alan Modra
On Thu, Feb 27, 2020 at 03:59:32PM +1100, Michael Ellerman wrote: > Relocatable kernel builds produce a warning about .gnu.hash being an > orphan section: > > ld: warning: orphan section `.gnu.hash' from `linker stubs' being placed in > section `.gnu.hash' > > If we try to discard it the build

[PATCH V2 2/3] mm/vma: Make vma_is_foreign() available for general use

2020-02-26 Thread Anshuman Khandual
Idea of a foreign VMA with respect to the present context is very generic. But currently there are two identical definitions for this in powerpc and x86 platforms. Lets consolidate those redundant definitions while making vma_is_foreign() available for general use later. This should not cause any f

[PATCH V2 0/3] mm/vma: some more minor changes

2020-02-26 Thread Anshuman Khandual
The motivation here is to consolidate VMA flags and helpers in generic memory header and reduce code duplication when ever applicable. If there are other possible similar instances which might be missing here, please do let me me know. I will be happy to incorporate them. This series is based on v

Re: [PATCH v3 12/27] powerpc/powernv/pmem: Add register addresses & status values to the header

2020-02-26 Thread Alastair D'Silva
On Thu, 2020-02-27 at 16:08 +1100, Andrew Donnellan wrote: > On 21/2/20 2:27 pm, Alastair D'Silva wrote: > > From: Alastair D'Silva > > > > These values have been taken from the device specifications. > > > > Signed-off-by: Alastair D'Silva > > I've compared these values against the internal v

Re: [PATCH v3 1/4] ASoC: fsl_asrc: Change asrc_width to asrc_format

2020-02-26 Thread Shengjiu Wang
On Thu, Feb 27, 2020 at 11:43 AM Nicolin Chen wrote: > > On Thu, Feb 27, 2020 at 10:41:55AM +0800, Shengjiu Wang wrote: > > asrc_format is more inteligent variable, which is align > > with the alsa definition snd_pcm_format_t. > > > > Signed-off-by: Shengjiu Wang > > --- > > sound/soc/fsl/fsl_as

Re: [PATCH v3 12/27] powerpc/powernv/pmem: Add register addresses & status values to the header

2020-02-26 Thread Andrew Donnellan
On 21/2/20 2:27 pm, Alastair D'Silva wrote: From: Alastair D'Silva These values have been taken from the device specifications. Signed-off-by: Alastair D'Silva I've compared these values against the internal version of the device specifications that I have access to, and they appear to mat

[PATCH 2/2] powerpc/vmlinux.lds: Discard .interp section

2020-02-26 Thread Michael Ellerman
The .interp section specifies which "interpreter", ie. dynamic loader, the kernel requests. But that doesn't make any sense, the kernel is not a regular binary that is run with an interpreter. The content seems to be some default value, this file doesn't even exist on my system: 2f 75

[PATCH 1/2] powerpc/vmlinux.lds: Explicitly retain .gnu.hash

2020-02-26 Thread Michael Ellerman
Relocatable kernel builds produce a warning about .gnu.hash being an orphan section: ld: warning: orphan section `.gnu.hash' from `linker stubs' being placed in section `.gnu.hash' If we try to discard it the build fails: ld -EL -m elf64lppc -pie --orphan-handling=warn --build-id -o .tm

Re: [PATCH V14] mm/debug: Add tests validating architecture page table helpers

2020-02-26 Thread Anshuman Khandual
es check for linear address with __is_lm_address() >> and >> switch accordingly if it is a kernel text symbol. Nevertheless, its much >> better >> to use __pa_symbol() here rather than __pa(). >> >> Rather than respining the patch once more, will just send a

Re: [PATCH V14] mm/debug: Add tests validating architecture page table helpers

2020-02-26 Thread Andrew Morton
> better > to use __pa_symbol() here rather than __pa(). > > Rather than respining the patch once more, will just send a fix replacing this > helper __pa() with __pa_symbol() for Andrew to pick up as this patch is > already > part of linux-next (next-20200226). But can defini

Re: [PATCH v3 13/27] powerpc/powernv/pmem: Read the capability registers & wait for device ready

2020-02-26 Thread Alastair D'Silva
On Thu, 2020-02-27 at 14:54 +1100, Andrew Donnellan wrote: > On 21/2/20 2:27 pm, Alastair D'Silva wrote: > > +/** > > + * read_device_metadata() - Retrieve config information from the > > AFU and save it for future use > > + * @ocxlpmem: the device metadata > > + * Return: 0 on success, negative on

Re: [PATCH v3 13/27] powerpc/powernv/pmem: Read the capability registers & wait for device ready

2020-02-26 Thread Andrew Donnellan
On 21/2/20 2:27 pm, Alastair D'Silva wrote: +/** + * read_device_metadata() - Retrieve config information from the AFU and save it for future use + * @ocxlpmem: the device metadata + * Return: 0 on success, negative on failure + */ +static int read_device_metadata(struct ocxlpmem *ocxlpmem) +{ +

Re: [PATCH v3 1/4] ASoC: fsl_asrc: Change asrc_width to asrc_format

2020-02-26 Thread Nicolin Chen
On Thu, Feb 27, 2020 at 10:41:55AM +0800, Shengjiu Wang wrote: > asrc_format is more inteligent variable, which is align > with the alsa definition snd_pcm_format_t. > > Signed-off-by: Shengjiu Wang > --- > sound/soc/fsl/fsl_asrc.c | 23 +++ > sound/soc/fsl/fsl_asrc.h

[PATCH v3 4/4] ASoC: fsl_easrc: Add EASRC ASoC CPU DAI and platform drivers

2020-02-26 Thread Shengjiu Wang
EASRC (Enhanced Asynchronous Sample Rate Converter) is a new IP module found on i.MX8MN. It is different with old ASRC module. The primary features for the EASRC are as follows: - 4 Contexts - groups of channels with an independent time base - Fully independent and concurrent context control - Sim

[PATCH v3 2/4] ASoC: fsl_asrc: Move common definition to fsl_asrc_common

2020-02-26 Thread Shengjiu Wang
There is a new ASRC included in i.MX serial platform, there are some common definition can be shared with each other. So move the common definition to a separate header file. And add fsl_asrc_pair_internal and fsl_asrc_internal for the variable specific for the module, which can be used internally

[PATCH v3 1/4] ASoC: fsl_asrc: Change asrc_width to asrc_format

2020-02-26 Thread Shengjiu Wang
asrc_format is more inteligent variable, which is align with the alsa definition snd_pcm_format_t. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_asrc.c | 23 +++ sound/soc/fsl/fsl_asrc.h | 4 ++-- sound/soc/fsl/fsl_asrc_dma.c | 2 +- 3 files changed, 14 inserti

[PATCH v3 3/4] ASoC: dt-bindings: fsl_easrc: Add document for EASRC

2020-02-26 Thread Shengjiu Wang
EASRC (Enhanced Asynchronous Sample Rate Converter) is a new IP module found on i.MX8MN. Signed-off-by: Shengjiu Wang --- .../devicetree/bindings/sound/fsl,easrc.yaml | 96 +++ 1 file changed, 96 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/fsl,easrc

[PATCH v3 0/4] ASoC: Add new module driver for new ASRC

2020-02-26 Thread Shengjiu Wang
Add new module driver for new ASRC in i.MX8MN Shengjiu Wang (4): ASoC: fsl_asrc: Change asrc_width to asrc_format ASoC: fsl_asrc: Move common definition to fsl_asrc_common ASoC: dt-bindings: fsl_easrc: Add document for EASRC ASoC: fsl_easrc: Add EASRC ASoC CPU DAI and platform drivers cha

Re: [PATCH V14] mm/debug: Add tests validating architecture page table helpers

2020-02-26 Thread Anshuman Khandual
Rather than respining the patch once more, will just send a fix replacing this helper __pa() with __pa_symbol() for Andrew to pick up as this patch is already part of linux-next (next-20200226). But can definitely respin if that will be preferred. Thanks Qian for catching this. > > Christophe >

Re: [PATCH v3 0/6] implement KASLR for powerpc/fsl_booke/64

2020-02-26 Thread Jason Yan
在 2020/2/26 19:41, Daniel Axtens 写道: I suspect that you will find it easier to convince people to accept a change to %pK than removal:) BTW, I have a T4240RDB so I might be able to test this series at some point - do I need an updated bootloader to pass in a random seed, or is the kernel able

Re: [PATCH 1/2] cpufreq/powernv: Fix use-after-free

2020-02-26 Thread Michael Ellerman
Andrew Donnellan writes: > On 6/2/20 5:26 pm, Oliver O'Halloran wrote: >> The cpufreq driver has a use-after-free that we can hit if: >> >> a) There's an OCC message pending when the notifier is registered, and >> b) The cpufreq driver fails to register with the core. >> >> When a) occurs the no

Re: [PATCH] macintosh: therm_windtunnel: fix regression when instantiating devices

2020-02-26 Thread Michael Ellerman
Wolfram Sang writes: > Removing attach_adapter from this driver caused a regression for at > least some machines. Those machines had the sensors described in their > DT, too, so they didn't need manual creation of the sensor devices. The > old code worked, though, because manual creation came firs

Re: [PATCH v3 11/14] powerpc/kprobes: Support kprobes on prefixed instructions

2020-02-26 Thread Jordan Niethe
On Wed, Feb 26, 2020 at 6:18 PM Nicholas Piggin wrote: > > Jordan Niethe's on February 26, 2020 2:07 pm: > > @@ -136,11 +148,14 @@ int arch_prepare_kprobe(struct kprobe *p) > > } > > > > if (!ret) { > > - patch_instruction(p->ainsn.insn, *p->addr); > > + patch_i

Re: [PATCH v3 09/14] powerpc/xmon: Add initial support for prefixed instructions

2020-02-26 Thread Jordan Niethe
On Wed, Feb 26, 2020 at 6:10 PM Nicholas Piggin wrote: > > Jordan Niethe's on February 26, 2020 2:07 pm: > > A prefixed instruction is composed of a word prefix and a word suffix. > > It does not make sense to be able to have a breakpoint on the suffix of > > a prefixed instruction, so make this i

Re: [PATCH v3 08/14] powerpc/xmon: Remove store_inst() for patch_instruction()

2020-02-26 Thread Jordan Niethe
On Wed, Feb 26, 2020 at 6:04 PM Nicholas Piggin wrote: > > Jordan Niethe's on February 26, 2020 2:07 pm: > > For modifying instructions in xmon, patch_instruction() can serve the > > same role that store_inst() is performing with the advantage of not > > being specific to xmon. In some places patc

Re: [PATCH v3 07/14] powerpc/traps: Check for prefixed instructions in facility_unavailable_exception()

2020-02-26 Thread Jordan Niethe
On Wed, Feb 26, 2020 at 5:53 PM Nicholas Piggin wrote: > > Jordan Niethe's on February 26, 2020 2:07 pm: > > If prefixed instructions are made unavailable by the [H]FSCR, attempting > > to use them will cause a facility unavailable exception. Add "PREFIX" to > > the facility_strings[]. > > > > Cur

Re: [PATCH v2 0/3] Fix some incompatibilites between KASAN and FORTIFY_SOURCE

2020-02-26 Thread Daniel Axtens
Daniel Axtens writes: > 3 KASAN self-tests fail on a kernel with both KASAN and FORTIFY_SOURCE: > memchr, memcmp and strlen. I have observed this on x86 and powerpc. > > When FORTIFY_SOURCE is on, a number of functions are replaced with > fortified versions, which attempt to check the sizes of th

Re: [5.6.0-rc2-next-20200218/powerpc] Boot failure on POWER9

2020-02-26 Thread Vlastimil Babka
On 2/26/20 10:45 PM, Vlastimil Babka wrote: > > > if (node == NUMA_NO_NODE) > page = alloc_pages(flags, order); > else > page = __alloc_pages_node(node, flags, order); > > So yeah looks like SLUB's kmalloc_node() is supposed to behave like the > page allocator's __alloc_pages_node() and

Re: [PATCH v5 3/8] powerpc/mm/ptdump: debugfs handler for W+X checks at runtime

2020-02-26 Thread Kees Cook
On Wed, Feb 26, 2020 at 05:35:46PM +1100, Russell Currey wrote: > Very rudimentary, just > > echo 1 > [debugfs]/check_wx_pages > > and check the kernel log. Useful for testing strict module RWX. > > Updated the Kconfig entry to reflect this. Oh, I like this! This would be handy to have o

Re: [5.6.0-rc2-next-20200218/powerpc] Boot failure on POWER9

2020-02-26 Thread Vlastimil Babka
On 2/26/20 7:41 PM, Michal Hocko wrote: > On Wed 26-02-20 18:25:28, Cristopher Lameter wrote: >> On Mon, 24 Feb 2020, Michal Hocko wrote: >> >>> Hmm, nasty. Is there any reason why kmalloc_node behaves differently >>> from the page allocator? >> >> The page allocator will do the same thing if you p

[Bug 206525] BUG: KASAN: stack-out-of-bounds in test_bit+0x30/0x44 (kernel 5.6-rc1)

2020-02-26 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=206525 Erhard F. (erhar...@mailbox.org) changed: What|Removed |Added Status|NEW |RESOLVED Resol

Re: [5.6.0-rc2-next-20200218/powerpc] Boot failure on POWER9

2020-02-26 Thread Michal Hocko
On Wed 26-02-20 12:31:56, David Rientjes wrote: > On Wed, 26 Feb 2020, Michal Hocko wrote: > > > On Wed 26-02-20 18:44:13, Cristopher Lameter wrote: > > > On Wed, 26 Feb 2020, Michal Hocko wrote: > > > > > > > Besides that kmalloc_node shouldn't really have an implicit GFP_THISNODE > > > > semant

Re: [PATCH] ima: add a new CONFIG for loading arch-specific policies

2020-02-26 Thread Mimi Zohar
On Wed, 2020-02-26 at 11:21 -0800, Lakshmi Ramasubramanian wrote: > Hi Nayna, > > > + > > +config IMA_SECURE_AND_OR_TRUSTED_BOOT > > + bool > > + depends on IMA > > + depends on IMA_ARCH_POLICY > > + default n > > + help > > + This option is selected by architectures to enable secur

[PATCH] ima: add a new CONFIG for loading arch-specific policies

2020-02-26 Thread Nayna Jain
Every time a new architecture defines the IMA architecture specific functions - arch_ima_get_secureboot() and arch_ima_get_policy(), the IMA include file needs to be updated. To avoid this "noise", this patch defines a new IMA Kconfig IMA_SECURE_AND_OR_TRUSTED_BOOT option, allowing the different ar

Re: [PATCH] ima: add a new CONFIG for loading arch-specific policies

2020-02-26 Thread Lakshmi Ramasubramanian
Hi Nayna, + +config IMA_SECURE_AND_OR_TRUSTED_BOOT + bool + depends on IMA + depends on IMA_ARCH_POLICY + default n + help + This option is selected by architectures to enable secure and/or + trusted boot based on IMA runtime policies. Why is th

Re: [PATCH v3 10/13] powerpc/ptrace: split out ADV_DEBUG_REGS related functions.

2020-02-26 Thread kbuild test robot
Hi Christophe, Thank you for the patch! Yet something to improve: [auto build test ERROR on powerpc/next] [also build test ERROR on v5.6-rc3 next-20200226] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '-

Re: [PATCH v3 04/27] ocxl: Remove unnecessary externs

2020-02-26 Thread Greg Kurz
On Wed, 26 Feb 2020 22:15:23 +0800 'Baoquan He' wrote: > On 02/26/20 at 10:01am, Greg Kurz wrote: > > On Wed, 26 Feb 2020 19:26:34 +1100 > > "Alastair D'Silva" wrote: > > > > > > -Original Message- > > > > From: Baoquan He > > > > Sent: Wednesday, 26 February 2020 7:15 PM > > > > To: A

Re: [5.6.0-rc2-next-20200218/powerpc] Boot failure on POWER9

2020-02-26 Thread Michal Hocko
On Wed 26-02-20 18:44:13, Cristopher Lameter wrote: > On Wed, 26 Feb 2020, Michal Hocko wrote: > > > Besides that kmalloc_node shouldn't really have an implicit GFP_THISNODE > > semantic right? At least I do not see anything like that documented > > anywhere. > > Kmalloc_node does not support mem

Re: [5.6.0-rc2-next-20200218/powerpc] Boot failure on POWER9

2020-02-26 Thread Christopher Lameter
On Wed, 26 Feb 2020, Michal Hocko wrote: > Besides that kmalloc_node shouldn't really have an implicit GFP_THISNODE > semantic right? At least I do not see anything like that documented > anywhere. Kmalloc_node does not support memory policies etc. Only kmalloc does. kmalloc_node is mostly used b

Re: [5.6.0-rc2-next-20200218/powerpc] Boot failure on POWER9

2020-02-26 Thread Michal Hocko
On Wed 26-02-20 18:25:28, Cristopher Lameter wrote: > On Mon, 24 Feb 2020, Michal Hocko wrote: > > > Hmm, nasty. Is there any reason why kmalloc_node behaves differently > > from the page allocator? > > The page allocator will do the same thing if you pass GFP_THISNODE and > insist on allocating

Re: [5.6.0-rc2-next-20200218/powerpc] Boot failure on POWER9

2020-02-26 Thread Christopher Lameter
On Mon, 24 Feb 2020, Michal Hocko wrote: > Hmm, nasty. Is there any reason why kmalloc_node behaves differently > from the page allocator? The page allocator will do the same thing if you pass GFP_THISNODE and insist on allocating memory from a node that does not exist. > > > A short summary. k

Re: [PATCH V2 3/4] mm/vma: Replace all remaining open encodings with is_vm_hugetlb_page()

2020-02-26 Thread Vlastimil Babka
On 2/24/20 6:03 AM, Anshuman Khandual wrote: > This replaces all remaining open encodings with is_vm_hugetlb_page(). > > Cc: Paul Mackerras > Cc: Benjamin Herrenschmidt > Cc: Michael Ellerman > Cc: Alexander Viro > Cc: Will Deacon > Cc: "Aneesh Kumar K.V" > Cc: Andrew Morton > Cc: Nick Pigg

Re: [PATCH V2 2/4] mm/vma: Make vma_is_accessible() available for general use

2020-02-26 Thread Vlastimil Babka
On 2/24/20 6:03 AM, Anshuman Khandual wrote: > Lets move vma_is_accessible() helper to include/linux/mm.h which makes it > available for general use. While here, this replaces all remaining open > encodings for VMA access check with vma_is_accessible(). > > Cc: Guo Ren > Cc: Geert Uytterhoeven >

[Bug 205283] BUG: KASAN: global-out-of-bounds in _copy_to_iter+0x3d4/0x5a8

2020-02-26 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205283 Erhard F. (erhar...@mailbox.org) changed: What|Removed |Added Status|NEW |RESOLVED Resol

[Bug 205099] KASAN hit at raid6_pq: BUG: Unable to handle kernel data access at 0x00f0fd0d

2020-02-26 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205099 Erhard F. (erhar...@mailbox.org) changed: What|Removed |Added Attachment #286395|0 |1 is obsolete|

[Bug 205099] KASAN hit at raid6_pq: BUG: Unable to handle kernel data access at 0x00f0fd0d

2020-02-26 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205099 Erhard F. (erhar...@mailbox.org) changed: What|Removed |Added Attachment #286249|0 |1 is obsolete|

Re: [PATCH V14] mm/debug: Add tests validating architecture page table helpers

2020-02-26 Thread Qian Cai
On Wed, 2020-02-26 at 15:45 +0100, Christophe Leroy wrote: > > Le 26/02/2020 à 15:09, Qian Cai a écrit : > > On Mon, 2020-02-17 at 08:47 +0530, Anshuman Khandual wrote: > > > This adds tests which will validate architecture page table helpers and > > > other accessors in their compliance with expe

[Bug 205099] KASAN hit at raid6_pq: BUG: Unable to handle kernel data access at 0x00f0fd0d

2020-02-26 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205099 Erhard F. (erhar...@mailbox.org) changed: What|Removed |Added Attachment #286251|0 |1 is obsolete|

Re: [PATCH v6 2/3] arm64: dts: ls1028a: Add PCIe controller DT nodes

2020-02-26 Thread Michael Walle
Am 2020-02-24 10:22, schrieb Z.q. Hou: Hi Michael and Shawn, I'll update the patch with iommu-map property. friendly ping :) -michael Thanks, Zhiqiang -Original Message- From: Michael Walle Sent: 2020年2月24日 16:54 To: Shawn Guo Cc: Xiaowei Bao ; Z.q. Hou ; bhelg...@google.com; d

[Bug 206501] Kernel 5.6-rc1 fails to boot on a PowerMac G4 3,6 with CONFIG_VMAP_STACK=y: Oops! Machine check, sig: 7 [#1]

2020-02-26 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=206501 Erhard F. (erhar...@mailbox.org) changed: What|Removed |Added Status|NEW |RESOLVED Resol

[Bug 206527] Kernel 5.6-rc1 w. CONFIG_VMAP_STACK=y + CONFIG_KASAN=y fails to boot on a PowerMac G4 3,6

2020-02-26 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=206527 Erhard F. (erhar...@mailbox.org) changed: What|Removed |Added Status|NEW |RESOLVED Resol

Re: [PATCH v3 04/27] ocxl: Remove unnecessary externs

2020-02-26 Thread 'Baoquan He'
On 02/26/20 at 03:20pm, Greg Kurz wrote: > On Wed, 26 Feb 2020 22:15:23 +0800 > 'Baoquan He' wrote: > > > On 02/26/20 at 10:01am, Greg Kurz wrote: > > > On Wed, 26 Feb 2020 19:26:34 +1100 > > > "Alastair D'Silva" wrote: > > > > > > > > -Original Message- > > > > > From: Baoquan He > >

Re: [PATCH V14] mm/debug: Add tests validating architecture page table helpers

2020-02-26 Thread Christophe Leroy
Le 26/02/2020 à 15:09, Qian Cai a écrit : On Mon, 2020-02-17 at 08:47 +0530, Anshuman Khandual wrote: This adds tests which will validate architecture page table helpers and other accessors in their compliance with expected generic MM semantics. This will help various architectures in validat

Re: [PATCH V14] mm/debug: Add tests validating architecture page table helpers

2020-02-26 Thread Christophe Leroy
Le 26/02/2020 à 15:12, Qian Cai a écrit : On Wed, 2020-02-26 at 09:09 -0500, Qian Cai wrote: On Mon, 2020-02-17 at 08:47 +0530, Anshuman Khandual wrote: How useful is this that straightly crash the powerpc? And then generate warnings on arm64, [  146.634626][T1] debug_vm_pgtable: debu

Re: [PATCH v3 04/27] ocxl: Remove unnecessary externs

2020-02-26 Thread 'Baoquan He'
On 02/26/20 at 10:01am, Greg Kurz wrote: > On Wed, 26 Feb 2020 19:26:34 +1100 > "Alastair D'Silva" wrote: > > > > -Original Message- > > > From: Baoquan He > > > Sent: Wednesday, 26 February 2020 7:15 PM > > > To: Alastair D'Silva > > > Cc: alast...@d-silva.org; Aneesh Kumar K . V > > >

Re: [PATCH V14] mm/debug: Add tests validating architecture page table helpers

2020-02-26 Thread Qian Cai
lpers [  146.643995][T1] [ cut here ] [  146.649350][T1] virt_to_phys used for non-linear address: (ptrval) (start_kernel+0x0/0x580) [  146.658840][T1] WARNING: CPU: 165 PID: 1 at arch/arm64/mm/physaddr.c:15 __virt_to_phys+0x98/0xe0 [  146.66

Re: [PATCH V14] mm/debug: Add tests validating architecture page table helpers

2020-02-26 Thread Qian Cai
R_CPUS=256 DEBUG_PAGEALLOC NUMA PowerNV [   23.263731][T1] Modules linked in: [   23.263752][T1] CPU: 4 PID: 1 Comm: swapper/0 Not tainted 5.6.0-rc3-next- 20200226 #1 [   23.263776][T1] NIP:  c007308c LR: c103dbd8 CTR: 0000 [   23.263810][T1] REGS: c

Re: [PATCH 2/3] mm/vma: Make vma_is_foreign() available for general use

2020-02-26 Thread Vlastimil Babka
On 2/26/20 5:50 AM, Anshuman Khandual wrote: > Idea of a foreign VMA with respect to the present context is very generic. > But currently there are two identical definitions for this in powerpc and > x86 platforms. Lets consolidate those redundant definitions while making > vma_is_foreign() availab

Re: [PATCH v2 2/3] ASoC: dt-bindings: fsl_easrc: Add document for EASRC

2020-02-26 Thread Shengjiu Wang
Hi On Thu, Feb 20, 2020 at 4:38 AM Rob Herring wrote: > > On Tue, Feb 18, 2020 at 02:39:36PM +0800, Shengjiu Wang wrote: > > EASRC (Enhanced Asynchronous Sample Rate Converter) is a new > > IP module found on i.MX8MN. > > > > Signed-off-by: Shengjiu Wang > > --- > > .../devicetree/bindings/soun

Re: [RFC PATCH v2 02/12] powerpc/ptrace: drop unnecessary #ifdefs CONFIG_PPC64

2020-02-26 Thread Christophe Leroy
Le 24/02/2020 à 11:48, Michael Ellerman a écrit : Christophe Leroy writes: Drop a bunch of #ifdefs CONFIG_PPC64 that are not vital. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ptrace.h | 9 - arch/powerpc/include/uapi/asm/ptrace.h | 12 arch/

Re: [RFC PATCH v2 04/12] powerpc/ptrace: split out VSX related functions.

2020-02-26 Thread Christophe Leroy
Le 24/02/2020 à 11:51, Michael Ellerman a écrit : Christophe Leroy writes: diff --git a/arch/powerpc/kernel/ptrace/ptrace-novsx.c b/arch/powerpc/kernel/ptrace/ptrace-novsx.c new file mode 100644 index ..55fbbb4aa9d7 --- /dev/null +++ b/arch/powerpc/kernel/ptrace/ptrace-novsx.c @

Re: [RFC PATCH v2 00/12] Reduce ifdef mess in ptrace

2020-02-26 Thread Christophe Leroy
Le 24/02/2020 à 11:54, Michael Ellerman a écrit : Christophe Leroy writes: Le 24/02/2020 à 03:15, Michael Neuling a écrit : Christophe, Le 28/06/2019 à 17:47, Christophe Leroy a écrit : The purpose of this series is to reduce the amount of #ifdefs in ptrace.c Any feedback on this series

[Bug 206669] Little-endian kernel crashing on POWER8 on heavy big-endian PowerKVM load

2020-02-26 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=206669 --- Comment #6 from John Paul Adrian Glaubitz (glaub...@physik.fu-berlin.de) --- (In reply to npiggin from comment #5) > I thought it might only be going down that path if you have already done > some tracing. Perhaps ensure /sys/kernel/debug/trac

[PATCH v3 13/13] powerpc/ptrace: move ptrace_triggered() into hw_breakpoint.c

2020-02-26 Thread Christophe Leroy
ptrace_triggered() is declared in asm/hw_breakpoint.h and only needed when CONFIG_HW_BREAKPOINT is set, so move it into hw_breakpoint.c Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/hw_breakpoint.c | 16 arch/powerpc/kernel/ptrace/ptrace.c | 18 -- 2 fi

[PATCH v3 09/13] powerpc/ptrace: move register viewing functions out of ptrace.c

2020-02-26 Thread Christophe Leroy
Create a dedicated ptrace-view.c file. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/ptrace/Makefile | 4 +- arch/powerpc/kernel/ptrace/ptrace-decl.h | 43 + arch/powerpc/kernel/ptrace/ptrace-view.c | 904 + arch/powerpc/kernel/ptrace/ptrace.c | 966 ---

[PATCH v3 10/13] powerpc/ptrace: split out ADV_DEBUG_REGS related functions.

2020-02-26 Thread Christophe Leroy
Move ADV_DEBUG_REGS functions out of ptrace.c, into ptrace-adv.c and ptrace-noadv.c Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/ptrace/Makefile | 4 + arch/powerpc/kernel/ptrace/ptrace-adv.c | 468 arch/powerpc/kernel/ptrace/ptrace-decl.h | 5 + arch/pow

[PATCH v3 12/13] powerpc/ptrace: create ppc_gethwdinfo()

2020-02-26 Thread Christophe Leroy
Create ippc_gethwdinfo() to handle PPC_PTRACE_GETHWDBGINFO and reduce ifdef mess Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/ptrace/ptrace-adv.c | 15 +++ arch/powerpc/kernel/ptrace/ptrace-decl.h | 1 + arch/powerpc/kernel/ptrace/ptrace-noadv.c | 20 ++ arch/p

[PATCH v3 11/13] powerpc/ptrace: create ptrace_get_debugreg()

2020-02-26 Thread Christophe Leroy
Create ptrace_get_debugreg() to handle PTRACE_GET_DEBUGREG and reduce ifdef mess Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/ptrace/ptrace-adv.c | 9 + arch/powerpc/kernel/ptrace/ptrace-decl.h | 2 ++ arch/powerpc/kernel/ptrace/ptrace-noadv.c | 13 + arch/pow

[PATCH v3 08/13] powerpc/ptrace: split out TRANSACTIONAL_MEM related functions.

2020-02-26 Thread Christophe Leroy
Move TRANSACTIONAL_MEM functions out of ptrace.c, into ptrace-tm.c Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/ptrace/Makefile | 1 + arch/powerpc/kernel/ptrace/ptrace-decl.h | 89 +++ arch/powerpc/kernel/ptrace/ptrace-tm.c | 851 + arch/powerpc/kernel/p

[PATCH v3 06/13] powerpc/ptrace: split out ALTIVEC related functions.

2020-02-26 Thread Christophe Leroy
Move CONFIG_ALTIVEC functions out of ptrace.c, into ptrace-altivec.c Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/ptrace/Makefile | 1 + arch/powerpc/kernel/ptrace/ptrace-altivec.c | 126 arch/powerpc/kernel/ptrace/ptrace-decl.h| 9 ++ arch/powerpc

[PATCH v3 07/13] powerpc/ptrace: split out SPE related functions.

2020-02-26 Thread Christophe Leroy
Move CONFIG_SPE functions out of ptrace.c, into ptrace-spe.c Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/ptrace/Makefile | 1 + arch/powerpc/kernel/ptrace/ptrace-decl.h | 9 arch/powerpc/kernel/ptrace/ptrace-spe.c | 66 arch/powerpc/kernel/ptrace

[PATCH v3 05/13] powerpc/ptrace: split out VSX related functions.

2020-02-26 Thread Christophe Leroy
Move CONFIG_VSX functions out of ptrace.c, into ptrace-vsx.c and ptrace-novsx.c Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/ptrace/Makefile | 4 + arch/powerpc/kernel/ptrace/ptrace-decl.h | 26 arch/powerpc/kernel/ptrace/ptrace-novsx.c | 57 +++ arch/powerpc/kerne

[PATCH v3 04/13] powerpc/ptrace: drop PARAMETER_SAVE_AREA_OFFSET

2020-02-26 Thread Christophe Leroy
PARAMETER_SAVE_AREA_OFFSET is not used, drop it. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/ptrace/ptrace.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/arch/powerpc/kernel/ptrace/ptrace.c b/arch/powerpc/kernel/ptrace/ptrace.c index 3dd94c296ac7..22826c942eae 1006

[PATCH v3 01/13] powerpc: move ptrace into a subdirectory.

2020-02-26 Thread Christophe Leroy
In order to allow splitting of ptrace depending on the different CONFIG_ options, create a subdirectory dedicated to ptrace and move ptrace.c and ptrace32.c into it. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/Makefile| 7 +++ arch/powerpc/kernel/ptrace/Makefile

[PATCH v3 03/13] powerpc/ptrace: drop unnecessary #ifdefs CONFIG_PPC64

2020-02-26 Thread Christophe Leroy
Drop a bunch of #ifdefs CONFIG_PPC64 that are not vital. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ptrace.h | 2 ++ arch/powerpc/kernel/ptrace/ptrace.c | 18 +++--- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/arch/powerpc/include/asm/ptrace.h

  1   2   >