Re: [PATCH v6 00/10] mm/memory_hotplug: Shrink zones before removing memory

2020-02-04 Thread David Hildenbrand
>> I can understand this is desirable (yet, I am >> not sure if this makes sense with the current take-and-not-give-back >> review mentality on this list). >> >> Although it will make upstreaming stuff *even harder* and *even slower*, >> maybe we should start to only queue patches that have an ACK/

Re: [PATCH v6 06/10] mm/memory_hotplug: Poison memmap in remove_pfn_range_from_zone()

2020-02-04 Thread Oscar Salvador
On Sun, Oct 06, 2019 at 10:56:42AM +0200, David Hildenbrand wrote: > Let's poison the pages similar to when adding new memory in > sparse_add_section(). Also call remove_pfn_range_from_zone() from > memunmap_pages(), so we can poison the memmap from there as well. > > While at it, calculate the pf

Re: [PATCH v6 07/10] mm/memory_hotplug: We always have a zone in find_(smallest|biggest)_section_pfn

2020-02-04 Thread Oscar Salvador
On Sun, Oct 06, 2019 at 10:56:43AM +0200, David Hildenbrand wrote: > With shrink_pgdat_span() out of the way, we now always have a valid > zone. > > Cc: Andrew Morton > Cc: Oscar Salvador > Cc: David Hildenbrand > Cc: Michal Hocko > Cc: Pavel Tatashin > Cc: Dan Williams > Cc: Wei Yang > Sig

Re: [PATCH 0/3] pseries: Track and expose idle PURR and SPURR ticks

2020-02-04 Thread Kamalesh Babulal
On 12/6/19 2:44 PM, Naveen N. Rao wrote: > Naveen N. Rao wrote: >> Hi Nathan, >> >> Nathan Lynch wrote: >>> Hi Kamalesh, >>> >>> Kamalesh Babulal writes: On 12/5/19 3:54 AM, Nathan Lynch wrote: > "Gautham R. Shenoy" writes: >> >> Tools such as lparstat which are used to compute t

Re: [PATCH v6 08/10] mm/memory_hotplug: Don't check for "all holes" in shrink_zone_span()

2020-02-04 Thread Oscar Salvador
On Sun, Oct 06, 2019 at 10:56:44AM +0200, David Hildenbrand wrote: > If we have holes, the holes will automatically get detected and removed > once we remove the next bigger/smaller section. The extra checks can > go. > > Cc: Andrew Morton > Cc: Oscar Salvador > Cc: Michal Hocko > Cc: David Hil

Re: [PATCH v6 08/10] mm/memory_hotplug: Don't check for "all holes" in shrink_zone_span()

2020-02-04 Thread David Hildenbrand
On 04.02.20 10:13, Oscar Salvador wrote: > On Sun, Oct 06, 2019 at 10:56:44AM +0200, David Hildenbrand wrote: >> If we have holes, the holes will automatically get detected and removed >> once we remove the next bigger/smaller section. The extra checks can >> go. >> >> Cc: Andrew Morton >> Cc: Osc

Re: [PATCH v6 09/10] mm/memory_hotplug: Drop local variables in shrink_zone_span()

2020-02-04 Thread Oscar Salvador
On Sun, Oct 06, 2019 at 10:56:45AM +0200, David Hildenbrand wrote: > Get rid of the unnecessary local variables. > > Cc: Andrew Morton > Cc: Oscar Salvador > Cc: David Hildenbrand > Cc: Michal Hocko > Cc: Pavel Tatashin > Cc: Dan Williams > Cc: Wei Yang > Signed-off-by: David Hildenbrand >

Re: [PATCH v6 09/10] mm/memory_hotplug: Drop local variables in shrink_zone_span()

2020-02-04 Thread David Hildenbrand
On 04.02.20 10:26, Oscar Salvador wrote: > On Sun, Oct 06, 2019 at 10:56:45AM +0200, David Hildenbrand wrote: >> Get rid of the unnecessary local variables. >> >> Cc: Andrew Morton >> Cc: Oscar Salvador >> Cc: David Hildenbrand >> Cc: Michal Hocko >> Cc: Pavel Tatashin >> Cc: Dan Williams >>

Re: [PATCH v6 10/10] mm/memory_hotplug: Cleanup __remove_pages()

2020-02-04 Thread Oscar Salvador
On Sun, Oct 06, 2019 at 10:56:46AM +0200, David Hildenbrand wrote: > Let's drop the basically unused section stuff and simplify. > > Also, let's use a shorter variant to calculate the number of pages to > the next section boundary. > > Cc: Andrew Morton > Cc: Oscar Salvador > Cc: Michal Hocko

Re: [PATCH v6 00/10] mm/memory_hotplug: Shrink zones before removing memory

2020-02-04 Thread Oscar Salvador
On Tue, Feb 04, 2020 at 09:45:24AM +0100, David Hildenbrand wrote: > I really hope we'll find more reviewers in general - I'm also not happy > if my patches go upstream with little/no review. However, patches > shouldn't be stuck for multiple merge windows in linux-next IMHO > (excluding exceptions

Re: [DOC][PATCH v2] powerpc: Provide initial documentation for PAPR hcalls

2020-02-04 Thread Michael Ellerman
On Wed, 2019-08-28 at 08:27:29 UTC, Vaibhav Jain wrote: > This doc patch provides an initial description of the hcall op-codes > that are used by Linux kernel running as a guest (LPAR) on top of > PowerVM or any other sPAPR compliant hyper-visor (e.g qemu). > > Apart from documenting the hcalls th

Re: [PATCH v2] powerpc: Do not consider weak unresolved symbol relocations as bad

2020-02-04 Thread Michael Ellerman
On Sat, 2020-01-18 at 17:03:35 UTC, Alexandre Ghiti wrote: > Commit 8580ac9404f6 ("bpf: Process in-kernel BTF") introduced two weak > symbols that may be unresolved at link time which result in an absolute > relocation to 0. relocs_check.sh emits the following warning: > > "WARNING: 2 bad relocati

Re: [PATCH v2 01/10] powerpc/configs: Drop CONFIG_QLGE which moved to staging

2020-02-04 Thread Michael Ellerman
On Tue, 2020-01-21 at 04:29:51 UTC, Michael Ellerman wrote: > The QLGE driver moved to staging in commit 955315b0dc8c ("qlge: Move > drivers/net/ethernet/qlogic/qlge/ to drivers/staging/qlge/"), meaning > our defconfigs that enable it have no effect as we don't enable > CONFIG_STAGING. > > It soun

Re: [PATCH] powerpc/32s: Fix CPU wake-up from sleep mode

2020-02-04 Thread Michael Ellerman
On Mon, 2020-01-27 at 10:42:04 UTC, Christophe Leroy wrote: > Commit f7354ccac844 ("powerpc/32: Remove CURRENT_THREAD_INFO and > rename TI_CPU") broke the CPU wake-up from sleep mode (i.e. when > _TLF_SLEEPING is set) by delaying the tovirt(r2, r2). > > This is because r2 is not restored by fast_e

Re: [PATCH RESEND] powerpc: indent to improve Kconfig readability

2020-02-04 Thread Michael Ellerman
On Wed, 2020-01-29 at 02:22:25 UTC, Randy Dunlap wrote: > From: Randy Dunlap > > Indent a Kconfig continuation line to improve readability. > > Signed-off-by: Randy Dunlap > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Michael Ellerman > Cc: linuxppc-dev@lists.ozlabs.org Applied to

Re: [PATCH] powerpc/32s: Fix kasan_early_hash_table() for CONFIG_VMAP_STACK

2020-02-04 Thread Michael Ellerman
On Wed, 2020-01-29 at 12:34:36 UTC, Christophe Leroy wrote: > On book3s/32 CPUs that are handling MMU through a hash table, > MMU_init_hw() function was adapted for VMAP_STACK in order to > handle virtual addresses instead of physical addresses in the > low level hash functions. > > When using KAS

Re: [PATCH] powerpc: configs: Cleanup old Kconfig options

2020-02-04 Thread Michael Ellerman
On Thu, 2020-01-30 at 19:52:23 UTC, Krzysztof Kozlowski wrote: > CONFIG_ENABLE_WARN_DEPRECATED is gone since > commit 771c035372a0 ("deprecate the '__deprecated' attribute warnings > entirely and for good"). > > CONFIG_IOSCHED_DEADLINE and CONFIG_IOSCHED_CFQ are gone since > commit f382fb0bcef4 ("

Re: [PATCH v4 2/7] powerpc/32s: Fix bad_kuap_fault()

2020-02-04 Thread Michael Ellerman
On Fri, 2020-01-24 at 11:54:40 UTC, Christophe Leroy wrote: > At the moment, bad_kuap_fault() reports a fault only if a bad access > to userspace occurred while access to userspace was not granted. > > But if a fault occurs for a write outside the allowed userspace > segment(s) that have been unlo

[GIT PULL] Please pull powerpc/linux.git powerpc-5.6-1 tag

2020-02-04 Thread Michael Ellerman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi Linus, Please pull powerpc updates for 5.6. A pretty small batch for us, and apologies for it being a bit late, I wanted to sneak Christophe's user_access_begin() series in. No conflicts or other issues I'm aware of. cheers The following cha

Re: [PATCH v6 10/10] mm/memory_hotplug: Cleanup __remove_pages()

2020-02-04 Thread David Hildenbrand
On 04.02.20 10:46, Oscar Salvador wrote: > On Sun, Oct 06, 2019 at 10:56:46AM +0200, David Hildenbrand wrote: >> Let's drop the basically unused section stuff and simplify. >> >> Also, let's use a shorter variant to calculate the number of pages to >> the next section boundary. >> >> Cc: Andrew Mor

Re: [PATCH v6 10/10] mm/memory_hotplug: Cleanup __remove_pages()

2020-02-04 Thread Segher Boessenkool
On Tue, Feb 04, 2020 at 01:41:06PM +0100, David Hildenbrand wrote: > On 04.02.20 10:46, Oscar Salvador wrote: > > I have to confess that it took me while to wrap around my head > > with the new min() change, but looks ok: > > It's a pattern commonly used in compilers and emulators to calculate the

Re: [GIT PULL] Please pull powerpc/linux.git powerpc-5.6-1 tag

2020-02-04 Thread pr-tracker-bot
The pull request you sent on Tue, 04 Feb 2020 23:10:55 +1100: > https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git > tags/powerpc-5.6-1 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/71c3a888cbcaf453aecf8d2f8fb003271d28073f Thank you! -- Deet-doot-do

Re: [PATCH v6 10/10] mm/memory_hotplug: Cleanup __remove_pages()

2020-02-04 Thread David Hildenbrand
On 04.02.20 14:13, Segher Boessenkool wrote: > On Tue, Feb 04, 2020 at 01:41:06PM +0100, David Hildenbrand wrote: >> On 04.02.20 10:46, Oscar Salvador wrote: >>> I have to confess that it took me while to wrap around my head >>> with the new min() change, but looks ok: >> >> It's a pattern commonly

Re: [PATCH v6 08/10] mm/memory_hotplug: Don't check for "all holes" in shrink_zone_span()

2020-02-04 Thread David Hildenbrand
On 04.02.20 15:25, Baoquan He wrote: > On 10/06/19 at 10:56am, David Hildenbrand wrote: >> If we have holes, the holes will automatically get detected and removed >> once we remove the next bigger/smaller section. The extra checks can >> go. >> >> Cc: Andrew Morton >> Cc: Oscar Salvador >> Cc: Mi

Re: [PATCH] libnvdimm/of_pmem: Fix leaking bus_desc.provider_name in some paths

2020-02-04 Thread Aneesh Kumar K.V
Vaibhav Jain writes: > String 'bus_desc.provider_name' allocated inside > of_pmem_region_probe() will leak in case call to nvdimm_bus_register() > fails or when of_pmem_region_remove() is called. > > This minor patch ensures that 'bus_desc.provider_name' is freed in > error path for of_pmem_regio

Re: [PATCH] powerpc/drmem: cache LMBs in xarray to accelerate lookup

2020-02-04 Thread Scott Cheloha
On Tue, Jan 28, 2020 at 05:56:55PM -0600, Nathan Lynch wrote: > Scott Cheloha writes: > > LMB lookup is currently an O(n) linear search. This scales poorly when > > there are many LMBs. > > > > If we cache each LMB by both its base address and its DRC index > > in an xarray we can cut lookups to

Re: [PATCH v6 08/10] mm/memory_hotplug: Don't check for "all holes" in shrink_zone_span()

2020-02-04 Thread Baoquan He
On 10/06/19 at 10:56am, David Hildenbrand wrote: > If we have holes, the holes will automatically get detected and removed > once we remove the next bigger/smaller section. The extra checks can > go. > > Cc: Andrew Morton > Cc: Oscar Salvador > Cc: Michal Hocko > Cc: David Hildenbrand > Cc: Pa

Re: [RFC] per-CPU usage in perf core-book3s

2020-02-04 Thread maddy
On 1/27/20 8:36 PM, Sebastian Andrzej Siewior wrote: I've been looking at usage of per-CPU variable cpu_hw_events in arch/powerpc/perf/core-book3s.c. power_pmu_enable() and power_pmu_disable() (pmu::pmu_enable() and pmu::pmu_disable()) are accessing the variable and the callbacks are invoked

Re: [PATCH 2/5] mm/memremap_pages: Introduce memremap_compat_align()

2020-02-04 Thread Michael Ellerman
Dan Williams writes: > The "sub-section memory hotplug" facility allows memremap_pages() users > like libnvdimm to compensate for hardware platforms like x86 that have a > section size larger than their hardware memory mapping granularity. The > compensation that sub-section support affords is be

[PATCH v2 4/6] powerpc/fsl_booke/64: do not clear the BSS for the second pass

2020-02-04 Thread Jason Yan
The BSS section has already cleared out in the first pass. No need to clear it again. This can save some time when booting with KASLR enabled. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc

[PATCH v2 0/6] implement KASLR for powerpc/fsl_booke/64

2020-02-04 Thread Jason Yan
This is a try to implement KASLR for Freescale BookE64 which is based on my earlier implementation for Freescale BookE32: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=131718 The implementation for Freescale BookE64 is similar as BookE32. One difference is that Freescale BookE64 s

[PATCH v2 3/6] powerpc/fsl_booke/64: implement KASLR for fsl_booke64

2020-02-04 Thread Jason Yan
The implementation for Freescale BookE64 is similar as BookE32. One difference is that Freescale BookE64 set up a TLB mapping of 1G during booting. Another difference is that ppc64 needs the kernel to be 64K-aligned. So we can randomize the kernel in this 1G mapping and make it 64K-aligned. This ca

[PATCH v2 2/6] powerpc/fsl_booke/64: introduce reloc_kernel_entry() helper

2020-02-04 Thread Jason Yan
Like the 32bit code, we introduce reloc_kernel_entry() helper to prepare for the KASLR 64bit version. And move the C declaration of this function out of CONFIG_PPC32 and use long instead of int for the parameter 'addr'. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Eller

[PATCH v2 5/6] powerpc/fsl_booke/64: clear the original kernel if randomized

2020-02-04 Thread Jason Yan
The original kernel still exists in the memory, clear it now. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook --- arch/powerpc/mm/nohash/kaslr_booke.c | 4 +

[PATCH v2 6/6] powerpc/fsl_booke/kaslr: rename kaslr-booke32.rst to kaslr-booke.rst and add 64bit part

2020-02-04 Thread Jason Yan
Now we support both 32 and 64 bit KASLR for fsl booke. Add document for 64 bit part and rename kaslr-booke32.rst to kaslr-booke.rst. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas

[PATCH v2 1/6] powerpc/fsl_booke/kaslr: refactor kaslr_legal_offset() and kaslr_early_init()

2020-02-04 Thread Jason Yan
Some code refactor in kaslr_legal_offset() and kaslr_early_init(). No functional change. This is a preparation for KASLR fsl_booke64. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nichola

Re: [PATCH 2/3] powerpc/sysfs: Show idle_purr and idle_spurr for every CPU

2020-02-04 Thread Gautham R Shenoy
Hi Naveen, On Tue, Feb 04, 2020 at 01:22:19PM +0530, Naveen N. Rao wrote: > Gautham R Shenoy wrote: > >Hi Naveen, > > > >On Thu, Dec 05, 2019 at 10:23:58PM +0530, Naveen N. Rao wrote: > >>>diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c > >>>index 80a676d..42ade55 100644 > >

Re: [PATCH v2 1/3] powerpc/tm: Clear the current thread's MSR[TS] after treclaim

2020-02-04 Thread Michael Neuling
Other than the minor things below that I think you need, the patch good with me. Acked-by: Michael Neuling > Subject: Re: [PATCH v2 1/3] powerpc/tm: Clear the current thread's MSR[TS] > after treclaim The subject should mention "signals". On Mon, 2020-02-03 at 13:09 -0300, Gustavo Luiz Duarte

Re: [PATCH v2 3/6] powerpc/fsl_booke/64: implement KASLR for fsl_booke64

2020-02-04 Thread kbuild test robot
Hi Jason, Thank you for the patch! Yet something to improve: [auto build test ERROR on powerpc/next] [also build test ERROR on v5.5 next-20200204] [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 '--base'

[PATCH v2] libnvdimm: Update persistence domain value for of_pmem and papr_scm device

2020-02-04 Thread Aneesh Kumar K.V
Currently, kernel shows the below values "persistence_domain":"cpu_cache" "persistence_domain":"memory_controller" "persistence_domain":"unknown" "cpu_cache" indicates no extra instructions is needed to ensure the persistence of data in the pmem media on power failure. "me

Re: [PATCH v2 2/3] selftests/powerpc: Add tm-signal-pagefault test

2020-02-04 Thread Michael Ellerman
Gustavo Luiz Duarte writes: > This test triggers a TM Bad Thing by raising a signal in transactional state > and forcing a pagefault to happen in kernelspace when the kernel signal > handling code first touches the user signal stack. > > This is inspired by the test tm-signal-context-force-tm but

Re: [PATCH] powerpc/vdso32: mark __kernel_datapage_offset as STV_PROTECTED

2020-02-04 Thread Christophe Leroy
Le 05/02/2020 à 01:50, Fangrui Song a écrit : A PC-relative relocation (R_PPC_REL16_LO in this case) referencing a preemptible symbol in a -shared link is not allowed. GNU ld's powerpc port is permissive and allows it [1], but lld will report an error after https://git.kernel.org/pub/scm/linu

Re: [PATCH 2/3] powerpc/sysfs: Show idle_purr and idle_spurr for every CPU

2020-02-04 Thread Naveen N. Rao
Gautham R Shenoy wrote: With repect to lparstat, the read interval is user-specified and just gets passed onto sleep(). Ok. So I guess currently you will be sending smp_call_function every time you read a PURR and SPURR. That number will now increase by 2 times when we read idle_purr and idle

Re: [PATCH 2/3] powerpc/sysfs: Show idle_purr and idle_spurr for every CPU

2020-02-04 Thread Christophe Leroy
Le 27/11/2019 à 13:01, Gautham R. Shenoy a écrit : From: "Gautham R. Shenoy" On Pseries LPARs, to calculate utilization, we need to know the [S]PURR ticks when the CPUs were busy or idle. The total PURR and SPURR ticks are already exposed via the per-cpu sysfs files /sys/devices/system/cpu/